diff --git a/build/generate-flow-typed-style-spec.js b/build/generate-flow-typed-style-spec.js index f483d316c91..56047f79d46 100644 --- a/build/generate-flow-typed-style-spec.js +++ b/build/generate-flow-typed-style-spec.js @@ -44,6 +44,8 @@ function flowType(property) { return `DataDrivenPropertyValueSpecification<${baseType}>`; } else if (property['zoom-function']) { return `PropertyValueSpecification<${baseType}>`; + } else if (property.function) { + return `ExpressionSpecification`; } else { return baseType; } diff --git a/flow-typed/style-spec.js b/flow-typed/style-spec.js index cb141ffd005..89c3030aafc 100644 --- a/flow-typed/style-spec.js +++ b/flow-typed/style-spec.js @@ -215,7 +215,7 @@ declare type SymbolLayerSpecification = {| "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">, "text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">, "text-field"?: DataDrivenPropertyValueSpecification, - "text-font"?: PropertyValueSpecification>, + "text-font"?: DataDrivenPropertyValueSpecification>, "text-size"?: DataDrivenPropertyValueSpecification, "text-max-width"?: DataDrivenPropertyValueSpecification, "text-line-height"?: PropertyValueSpecification, @@ -294,7 +294,7 @@ declare type HeatmapLayerSpecification = {| "heatmap-radius"?: PropertyValueSpecification, "heatmap-weight"?: DataDrivenPropertyValueSpecification, "heatmap-intensity"?: PropertyValueSpecification, - "heatmap-color"?: PropertyValueSpecification, + "heatmap-color"?: ExpressionSpecification, "heatmap-opacity"?: PropertyValueSpecification |} |} diff --git a/package.json b/package.json index 25580ef9c6a..1d0e714db53 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,7 @@ "test-render": "node --max-old-space-size=2048 test/render.test.js", "test-query": "node test/query.test.js", "test-expressions": "node test/expression.test.js", - "test-flow": "flow .", + "test-flow": "node build/generate-flow-typed-style-spec && flow .", "test-flow-cov": "flow-coverage-report -i 'src/**/*.js' -t html", "test-cov": "nyc --require=flow-remove-types/register --reporter=text-summary --reporter=lcov --cache run-s test-unit test-expressions test-query test-render", "prepublish": "in-publish && run-s build-dev build-min || not-in-publish"