fix missing types (#2259)

This commit is contained in:
Noam Lin 2023-08-20 22:08:49 +03:00 committed by Xiaoji Chen
parent bfcc893b4e
commit c09485ed5d

View File

@ -40,7 +40,7 @@ export default function createRef<
StyleT extends MapStyle,
CallbacksT extends Callbacks,
MapT extends MapInstance
>(mapInstance: Mapbox<StyleT, CallbacksT, MapT>): MapRef<MapT> {
>(mapInstance: Mapbox<StyleT, CallbacksT, MapT>): MapRef<MapT> | null {
if (!mapInstance) {
return null;
}
@ -90,7 +90,7 @@ export default function createRef<
return result;
}
function getMethodNames(obj) {
function getMethodNames(obj: Object) {
const result = new Set<string>();
let proto = obj;