mmr-gl-react
Version:
React components for MMR GL JS-compatible libraries
21 lines (20 loc) • 703 B
TypeScript
import * as React from 'react';
import { MapRef } from '../mmr/create-ref';
import { MapInstance } from '../types';
type MountedMapsContextValue = {
maps: {
[id: string]: MapRef<MapInstance>;
};
onMapMount: (map: MapRef<MapInstance>, id: string) => void;
onMapUnmount: (id: string) => void;
};
export declare const MountedMapsContext: React.Context<MountedMapsContextValue>;
export declare const MapProvider: React.FC<{
children?: React.ReactNode;
}>;
export type MapCollection<MapT extends MapInstance> = {
[id: string]: MapRef<MapT> | undefined;
current?: MapRef<MapT>;
};
export declare function useMap<MapT extends MapInstance>(): MapCollection<MapT>;
export {};