diff --git a/src/components/use-map.tsx b/src/components/use-map.tsx index 4569525c..e7f8b64b 100644 --- a/src/components/use-map.tsx +++ b/src/components/use-map.tsx @@ -52,10 +52,12 @@ export const MapProvider: React.FC<{children?: React.ReactNode}> = props => { ); }; -export function useMap(): { +export type MapCollection = { [id: string]: MapRef | undefined; current?: MapRef; -} { +}; + +export function useMap(): MapCollection { const maps = useContext(MountedMapsContext)?.maps; const currentMap = useContext(MapContext); @@ -63,5 +65,5 @@ export function useMap(): { return {...maps, current: currentMap?.map}; }, [maps, currentMap]); - return mapsWithCurrent as {current?: MapRef; [id: string]: MapRef | undefined}; + return mapsWithCurrent as MapCollection; }