@goongmaps/goong-map-react
Version:
A fork of react-map-gl. React components for Goong JS
49 lines (47 loc) • 1.19 kB
Flow
/**
* Flowtype definitions for draggable-control
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.21.0
*/
import { MjolnirEvent } from "../utils/map-controller";
import { MapControlProps, MapControlRef } from "./use-map-control";
declare type Coordinate = [number, number];
declare type Offset = [number, number];
declare type CallbackEvent = {
...MjolnirEvent,
...{
lngLat: Coordinate,
...
},
};
export type DraggableControlProps = {
...MapControlProps,
...{
draggable?: boolean,
onDrag?: (evt: CallbackEvent) => void,
onDragEnd?: (evt: CallbackEvent) => void,
onDragStart?: (evt: CallbackEvent) => void,
offsetLeft?: number,
offsetTop?: number,
...
},
};
declare type State = {
dragPos?: Coordinate,
dragOffset?: Offset,
...
};
declare export var draggableControlPropTypes: any;
declare export var draggableControlDefaultProps: DraggableControlProps;
export type DraggableControlRef = {
...MapControlRef,
...{
props: DraggableControlProps,
state: State,
...
},
};
declare export default function useDraggableControl(
props: DraggableControlProps,
callbacks: any
): DraggableControlRef;