Skip to content

Commit

Permalink
Improve typing (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Sep 7, 2021
1 parent 2ab9d0f commit a47d0ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/static-map.d.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,11 +21,7 @@ export type StaticMapProps = MapboxProps & Partial<{
children: any,

onResize: (dimensions: { width: number; height: number }) => void;
}>;

export interface MapRef {
getMap(): any;
queryRenderedFeatures(geometry: [number,number] | [[number,number],[number,number]], options?: any): Array<any>;
}

ref: React.Ref<MapRef>
}>;
export default function StaticMap(props: StaticMapProps) : ReactElement;
8 changes: 8 additions & 0 deletions src/components/use-map-control.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}>;

Expand Down

0 comments on commit a47d0ef

Please sign in to comment.