Skip to content

Commit

Permalink
Generate flow types from recent style-spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick authored Oct 13, 2017
1 parent 04f3b56 commit 477edc6
Showing 1 changed file with 26 additions and 4 deletions.
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

0 comments on commit 477edc6

Please sign in to comment.