Skip to content

Commit

Permalink
Improve filter and LayerBaseProps TypeScript typings (#473)
Browse files Browse the repository at this point in the history
- It is currently not supported to set a filter with nested arrays e.g. `filter={['!', ['has', 'point_count']]}`.
- `getVisibleBounds()` returns bounds/region so it should have the same type as `visibleRegion` in `RegionPayload`
  • Loading branch information
anfriis authored and kristfal committed Nov 7, 2019
1 parent 5363970 commit c8a9d71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ declare namespace MapboxGL {
class MapView extends Component<MapViewProps> {
getPointInView(coordinate: GeoJSON.Position): Promise<GeoJSON.Position>;
getCoordinateFromView(point: GeoJSON.Position): Promise<GeoJSON.Position>;
getVisibleBounds(): Promise<void>;
getVisibleBounds(): Promise<GeoJSON.Position[]>;
queryRenderedFeaturesAtPoint(
coordinate: GeoJSON.Position,
filter?: Array<any>,
filter?: Expression,
layerIds?: Array<string>,
): Promise<GeoJSON.FeatureCollection?>;
queryRenderedFeaturesInRect(
coordinate: GeoJSON.Position,
filter?: Array<any>,
filter?: Expression,
layerIds?: Array<string>,
): Promise<GeoJSON.FeatureCollection?>;
takeSnap(writeToDisk?: boolean): Promise<string>;
Expand Down Expand Up @@ -687,7 +687,7 @@ export interface LayerBaseProps<T = {}> extends Omit<ViewProps, 'style'> {
aboveLayerID?: string;
belowLayerID?: string;
layerIndex?: number;
filter?: Array<any>;
filter?: Expression;
minZoomLevel?: number;
maxZoomLevel?: number;
}
Expand Down

0 comments on commit c8a9d71

Please sign in to comment.