UNPKG

mapbox-gl

Version:
54 lines (44 loc) 2.17 kB
// This file is generated. Edit build/generate-style-code.js, then run `yarn run codegen`. // @flow /* eslint-disable */ import styleSpec from '../../style-spec/reference/latest'; import { Properties, DataConstantProperty, DataDrivenProperty, CrossFadedDataDrivenProperty, CrossFadedProperty, ColorRampProperty } from '../properties'; import type Color from '../../style-spec/util/color'; import type Formatted from '../../style-spec/expression/types/formatted'; export type LayoutProps = {| "fill-sort-key": DataDrivenProperty<number>, |}; const layout: Properties<LayoutProps> = new Properties({ "fill-sort-key": new DataDrivenProperty(styleSpec["layout_fill"]["fill-sort-key"]), }); export type PaintProps = {| "fill-antialias": DataConstantProperty<boolean>, "fill-opacity": DataDrivenProperty<number>, "fill-color": DataDrivenProperty<Color>, "fill-outline-color": DataDrivenProperty<Color>, "fill-translate": DataConstantProperty<[number, number]>, "fill-translate-anchor": DataConstantProperty<"map" | "viewport">, "fill-pattern": CrossFadedDataDrivenProperty<string>, |}; const paint: Properties<PaintProps> = new Properties({ "fill-antialias": new DataConstantProperty(styleSpec["paint_fill"]["fill-antialias"]), "fill-opacity": new DataDrivenProperty(styleSpec["paint_fill"]["fill-opacity"]), "fill-color": new DataDrivenProperty(styleSpec["paint_fill"]["fill-color"]), "fill-outline-color": new DataDrivenProperty(styleSpec["paint_fill"]["fill-outline-color"]), "fill-translate": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate"]), "fill-translate-anchor": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate-anchor"]), "fill-pattern": new CrossFadedDataDrivenProperty(styleSpec["paint_fill"]["fill-pattern"]), }); // Note: without adding the explicit type annotation, Flow infers weaker types // for these objects from their use in the constructor to StyleLayer, as // {layout?: Properties<...>, paint: Properties<...>} export default ({ paint, layout }: $Exact<{ paint: Properties<PaintProps>, layout: Properties<LayoutProps> }>);