import React from 'react'; import { LatLng, LatLngTuple, LeafletMouseEvent } from 'leaflet'; import { useMap } from 'react-leaflet'; import { Coordinate } from 'types'; interface MapSnapshot { reframe: boolean; size: string; } export interface Props { /** * activePolygonIndex is the index of the polygon that is currently available for editing */ activePolygonIndex: number; highlightedPolygonIndex?: number; polygonCoordinates: Coordinate[][]; boundaryPolygonCoordinates: Coordinate[]; selection: Set; editable: boolean; initialCenter: LatLngTuple; initialZoom: number; isPolygonClosed: boolean; onClick?: (index: number) => void; onMouseEnter?: (index: number) => void; onMouseLeave?: (index: number) => void; addPoint: (coord: Coordinate) => void; addPointToEdge: (coordinate: Coordinate, index: number) => void; deselectAllPoints: () => void; removePointFromSelection: (index: number) => void; addPointsToSelection: (indices: number[]) => void; selectPoints: (indices: number[]) => void; moveSelectedPoints: (newPosition: Coordinate) => void; deletePolygonPoints: () => void; selectAllPoints: () => void; setPolygon: (polygon: Coordinate[]) => void; onUndo: () => void; onRedo: () => void; } type MapType = ReturnType; export interface State { isMovedPointInBoundary: boolean; isShiftPressed: boolean; isMoveActive: boolean; rectangleSelection: { startPosition: Coordinate; endPosition: Coordinate; startTime: number; } | null; previousMouseMovePosition?: Coordinate; isPenToolActive: boolean; newPointPosition: Coordinate | null; showExportPolygonModal: boolean; showImportPolygonModal: boolean; } export declare class BaseMap extends React.Component { private map; state: State; static getDerivedStateFromProps(props: Props, state: State): State; componentDidMount(): void; componentWillUnmount(): void; getSnapshotBeforeUpdate(prevProps: Props, prevState: State): MapSnapshot; componentDidUpdate(prevProps: Readonly, prevState: Readonly, { reframe, size }: MapSnapshot): void; setMap: (map: MapType) => void; reframe: () => void; reframeOnPolygon: (polygonCoordinates: Coordinate[] | Coordinate[][]) => void; toggleVectorMode: () => void; getSize: (map: MapType | null) => string; handleOnFocusClicked: () => void; handleExportPolygon: (serialized: string) => void; handleExportPolygonActionClicked: () => void; handleExportPolygonModalClosed: () => void; handleImportPolygon: (coordinates: Coordinate[]) => void; handleImportPolygonActionClicked: () => void; handleImportPolygonModalClosed: () => void; handleMapClick: (event: LeafletMouseEvent) => void; handleMouseDownOnMap: (event: LeafletMouseEvent) => void; handleMouseUpOnMap: () => void; handleMouseMoveOnMap: (event: LeafletMouseEvent) => void; handleMouseOutOfMap: () => void; onPolygonVertexClick: (index: number) => void; startVertexMove: (latLng: LatLng) => void; onPolygonVertexDragStart: (latLng: LatLng, index: number) => void; updateVertexPosition: (latLng: LatLng) => void; endVertexMove: () => void; handleKeyDown: (e: KeyboardEvent) => void; handleKeyUp: (e: KeyboardEvent) => void; renderPolygonVertex: (coordinate: Coordinate, index: number) => JSX.Element; renderActivePolygonPoints: () => JSX.Element[]; renderVertexEdge: (coordinate: Coordinate, index: number) => JSX.Element; renderPolygonEdges: () => JSX.Element[]; renderInactivePolygons: () => (JSX.Element | null)[]; renderActivePolygon: () => JSX.Element; renderPolyline: () => JSX.Element | null; renderSelectionRectangle: () => JSX.Element | null; render(): JSX.Element; } declare const _default: React.MemoExoticComponent; export default _default;