Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate flow types from recent style-spec changes #5454

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions flow-typed/style-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ declare type TileSourceSpecification = {
"type": "vector" | "raster",
"url"?: string,
"tiles"?: Array<string>,
"bounds"?: [number, number, number, number],
"minzoom"?: number,
"maxzoom"?: number,
"tileSize"?: number,
"bounds"?: [number, number, number, number]
"tileSize"?: number
}

declare type GeojsonSourceSpecification = {|
Expand Down Expand Up @@ -111,8 +111,7 @@ declare type CanvasSourceSpecification = {|
"type": "canvas",
"coordinates": [[number, number], [number, number], [number, number], [number, number]],
"animate"?: boolean,
"canvas": string,
"contextType": "2d" | "webgl" | "experimental-webgl" | "webgl2"
"canvas": string
|}

declare type SourceSpecification =
Expand Down Expand Up @@ -216,6 +215,7 @@ declare type SymbolLayerSpecification = {|
"icon-padding"?: PropertyValueSpecification<number>,
"icon-keep-upright"?: PropertyValueSpecification<boolean>,
"icon-offset"?: DataDrivenPropertyValueSpecification<[number, number]>,
"icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">,
"icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
"text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
"text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
Expand Down Expand Up @@ -267,6 +267,27 @@ declare type CircleLayerSpecification = {|
|}
|}

declare type HeatmapLayerSpecification = {|
"id": string,
"type": "heatmap",
"metadata"?: mixed,
"source": string,
"source-layer"?: string,
"minzoom"?: number,
"maxzoom"?: number,
"filter"?: FilterSpecification,
"layout"?: {|
"heatmap-radius"?: PropertyValueSpecification<number>,
"heatmap-weight"?: DataDrivenPropertyValueSpecification<number>,
"heatmap-intensity"?: PropertyValueSpecification<number>,
"heatmap-color"?: PropertyValueSpecification<ColorSpecification>,
"heatmap-opacity"?: PropertyValueSpecification<number>
|},
"paint"?: {|
"visibility"?: "visible" | "none"
|}
|}

declare type FillExtrusionLayerSpecification = {|
"id": string,
"type": "fill-extrusion",
Expand Down Expand Up @@ -334,6 +355,7 @@ declare type LayerSpecification =
| LineLayerSpecification
| SymbolLayerSpecification
| CircleLayerSpecification
| HeatmapLayerSpecification
| FillExtrusionLayerSpecification
| RasterLayerSpecification
| BackgroundLayerSpecification;
Expand Down