Improve typing (#1568)

This commit is contained in:
Xiaoji Chen 2021-09-07 09:45:20 -07:00 committed by Xiaoji Chen
parent 2ab9d0f5e5
commit a47d0ef8a9
2 changed files with 16 additions and 6 deletions

View File

@ -1,6 +1,12 @@
import * as React from 'react';
import {ReactElement} from 'react';
import type {MapboxProps} from '../mapbox/mapbox';
export interface MapRef {
getMap(): any;
queryRenderedFeatures(geometry: [number,number] | [[number,number],[number,number]], options?: any): Array<any>;
}
export type StaticMapProps = MapboxProps & Partial<{
className: string,
style: any,
@ -15,11 +21,7 @@ export type StaticMapProps = MapboxProps & Partial<{
children: any,
onResize: (dimensions: { width: number; height: number }) => void;
ref: React.Ref<MapRef>
}>;
export interface MapRef {
getMap(): any;
queryRenderedFeatures(geometry: [number,number] | [[number,number],[number,number]], options?: any): Array<any>;
}
export default function StaticMap(props: StaticMapProps) : ReactElement;

View File

@ -7,6 +7,14 @@ export type MapControlProps = Partial<{
captureClick: boolean,
captureDoubleClick: boolean,
capturePointerMove: boolean,
onScroll: Function,
onDragStart: Function,
onClick: Function,
onNativeClick: Function,
onDoubleClick: Function,
onPointerMove: Function,
children: any
}>;