From a47d0ef8a9bc0f6be968ac2f4ebd79da1a122d1d Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Tue, 7 Sep 2021 09:45:20 -0700 Subject: [PATCH] Improve typing (#1568) --- src/components/static-map.d.ts | 14 ++++++++------ src/components/use-map-control.d.ts | 8 ++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/components/static-map.d.ts b/src/components/static-map.d.ts index 0211c342..2c859aca 100644 --- a/src/components/static-map.d.ts +++ b/src/components/static-map.d.ts @@ -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; +} + 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 }>; - -export interface MapRef { - getMap(): any; - queryRenderedFeatures(geometry: [number,number] | [[number,number],[number,number]], options?: any): Array; -} - export default function StaticMap(props: StaticMapProps) : ReactElement; diff --git a/src/components/use-map-control.d.ts b/src/components/use-map-control.d.ts index 243ae956..0ae9940e 100644 --- a/src/components/use-map-control.d.ts +++ b/src/components/use-map-control.d.ts @@ -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 }>;