Skip to content

Commit

Permalink
Improve Flow typings (internal-1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin authored and mourner committed May 22, 2024
1 parent 1229b73 commit 0f5ba1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/style-spec/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export type LineLayerSpecification = {|
"filter"?: FilterSpecification,
"layout"?: {|
"line-cap"?: DataDrivenPropertyValueSpecification<"butt" | "round" | "square">,
"line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">,
"line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter" | "none">,
"line-miter-limit"?: PropertyValueSpecification<number>,
"line-round-limit"?: PropertyValueSpecification<number>,
"line-sort-key"?: DataDrivenPropertyValueSpecification<number>,
Expand Down Expand Up @@ -633,7 +633,8 @@ export type ModelLayerSpecification = {|
"model-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
"model-roughness"?: DataDrivenPropertyValueSpecification<number>,
"model-height-based-emissive-strength-multiplier"?: DataDrivenPropertyValueSpecification<[number, number, number, number, number]>,
"model-cutoff-fade-range"?: ExpressionSpecification
"model-cutoff-fade-range"?: ExpressionSpecification,
"model-front-cutoff"?: PropertyValueSpecification<[number, number, number]>
|}
|}

Expand Down
2 changes: 1 addition & 1 deletion src/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,7 @@ class Style extends Evented {
return (this._flattenAndSortRenderedFeatures(sourceResults): any);
}

querySourceFeatures(sourceID: string, params: ?{sourceLayer: ?string, filter: ?Array<any>, validate?: boolean}): Array<QueryFeature> {
querySourceFeatures(sourceID: string, params: ?{sourceLayer: ?string, filter?: ?Array<any>, validate?: boolean}): Array<QueryFeature> {
if (params && params.filter) {
this._validate(validateFilter, 'querySourceFeatures.filter', params.filter, null, params);
}
Expand Down
10 changes: 7 additions & 3 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export type MapOptions = {
maxPitch?: ?number,
boxZoom?: boolean,
dragRotate?: boolean,
dragPan?: DragPanOptions,
dragPan?: boolean | DragPanOptions,
keyboard?: boolean,
doubleClickZoom?: boolean,
touchZoomRotate?: boolean,
Expand All @@ -172,7 +172,11 @@ export type MapOptions = {
respectPrefersReducedMotion?: boolean,
contextCreateOptions?: ContextOptions,
devtools?: boolean,
repaint?: boolean
repaint?: boolean,
fadeDuration?: number,
localFontFamily?: string,
localIdeographFontFamily?: string,
performanceMetricsCollection?: boolean,
};

const defaultMinZoom = -2;
Expand Down Expand Up @@ -1957,7 +1961,7 @@ export class Map extends Camera {
*
* @see [Example: Highlight features containing similar data](https://www.mapbox.com/mapbox-gl-js/example/query-similar-features/)
*/
querySourceFeatures(sourceId: string, parameters: ?{sourceLayer: ?string, filter: ?Array<any>, validate?: boolean}): Array<QueryFeature> {
querySourceFeatures(sourceId: string, parameters: ?{sourceLayer: ?string, filter?: ?Array<any>, validate?: boolean}): Array<QueryFeature> {
if (!this._isValidId(sourceId)) {
return [];
}
Expand Down

0 comments on commit 0f5ba1c

Please sign in to comment.