urbi-exhibitions
Version:
30 lines (29 loc) • 879 B
TypeScript
import { Map } from '@2gis/mapgl/types';
import { Dispatch, ReactNode, SetStateAction, FC } from 'react';
import { GltfPlugin } from '@2gis/mapgl-gltf';
import { FloorLevel } from '@2gis/mapgl/types/types/events';
interface MapState {
zoom: number;
isDragging: boolean;
floorLevels: FloorLevel[];
floorLevelIndex?: number;
floorLevelName?: string;
floorPlanId?: string;
}
interface MapContextState {
map?: {
instance: Map;
gltfPlugin: GltfPlugin;
state: MapState;
};
}
export interface MapContext extends MapContextState {
setMapContext: Dispatch<SetStateAction<MapContextState | undefined>>;
updateMapState: (value: Partial<MapState>) => void;
}
export declare function useMap(): MapContext;
type MapProviderProps = {
children?: ReactNode;
};
export declare const MapProvider: FC<MapProviderProps>;
export {};