mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Improve typing (#1568)
This commit is contained in:
parent
2ab9d0f5e5
commit
a47d0ef8a9
14
src/components/static-map.d.ts
vendored
14
src/components/static-map.d.ts
vendored
@ -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;
|
||||
|
||||
8
src/components/use-map-control.d.ts
vendored
8
src/components/use-map-control.d.ts
vendored
@ -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
|
||||
}>;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user