@mapbox/mapbox-gl-style-spec 14.4.0-beta.1 → 14.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/bin/gl-style-composite.js +0 -5
  2. package/bin/gl-style-format.js +0 -5
  3. package/bin/gl-style-migrate.js +0 -5
  4. package/bin/gl-style-validate.js +0 -5
  5. package/{composite.js → composite.ts} +1 -1
  6. package/data/{extent.js → extent.ts} +0 -2
  7. package/{deref.js → deref.ts} +7 -9
  8. package/{diff.js → diff.ts} +44 -21
  9. package/dist/index.cjs +800 -1357
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.ts +1726 -0
  12. package/dist/index.es.js +800 -1357
  13. package/dist/index.es.js.map +1 -1
  14. package/{empty.js → empty.ts} +1 -2
  15. package/error/{parsing_error.js → parsing_error.ts} +0 -2
  16. package/error/{validation_error.js → validation_error.ts} +5 -5
  17. package/expression/{compound_expression.js → compound_expression.ts} +29 -19
  18. package/expression/definitions/{assertion.js → assertion.ts} +16 -13
  19. package/expression/definitions/{at.js → at.ts} +12 -13
  20. package/expression/definitions/{case.js → case.ts} +12 -11
  21. package/expression/definitions/{coalesce.js → coalesce.ts} +11 -11
  22. package/expression/definitions/{coercion.js → coercion.ts} +21 -20
  23. package/expression/definitions/{collator.js → collator.ts} +11 -11
  24. package/expression/definitions/{comparison.js → comparison.ts} +30 -24
  25. package/expression/definitions/{config.js → config.ts} +16 -16
  26. package/expression/definitions/{distance.js → distance.ts} +60 -52
  27. package/expression/definitions/{format.js → format.ts} +26 -15
  28. package/expression/definitions/{image.js → image.ts} +12 -12
  29. package/expression/definitions/{in.js → in.ts} +22 -13
  30. package/expression/definitions/{index.js → index.ts} +70 -83
  31. package/expression/definitions/{index_of.js → index_of.ts} +24 -15
  32. package/expression/definitions/{interpolate.js → interpolate.ts} +44 -25
  33. package/expression/definitions/{length.js → length.ts} +11 -10
  34. package/expression/definitions/{let.js → let.ts} +10 -7
  35. package/expression/definitions/{literal.js → literal.ts} +11 -12
  36. package/expression/definitions/{match.js → match.ts} +25 -15
  37. package/expression/definitions/{number_format.js → number_format.ts} +10 -10
  38. package/expression/definitions/{slice.js → slice.ts} +23 -15
  39. package/expression/definitions/{step.js → step.ts} +14 -12
  40. package/expression/definitions/{var.js → var.ts} +5 -7
  41. package/expression/definitions/{within.js → within.ts} +41 -29
  42. package/expression/{evaluation_context.js → evaluation_context.ts} +26 -23
  43. package/expression/expression.ts +29 -0
  44. package/expression/{index.js → index.ts} +208 -110
  45. package/expression/{is_constant.js → is_constant.ts} +5 -7
  46. package/expression/{parsing_context.js → parsing_context.ts} +47 -34
  47. package/expression/{parsing_error.js → parsing_error.ts} +0 -2
  48. package/expression/{runtime_error.js → runtime_error.ts} +0 -2
  49. package/expression/{scope.js → scope.ts} +5 -5
  50. package/expression/{stops.js → stops.ts} +2 -4
  51. package/expression/types/{collator.js → collator.ts} +1 -3
  52. package/expression/types/{formatted.js → formatted.ts} +8 -7
  53. package/expression/types/{resolved_image.js → resolved_image.ts} +5 -7
  54. package/expression/{types.js → types.ts} +53 -45
  55. package/expression/{values.js → values.ts} +12 -12
  56. package/feature_filter/{convert.js → convert.ts} +19 -18
  57. package/feature_filter/{index.js → index.ts} +33 -18
  58. package/{format.js → format.ts} +3 -3
  59. package/function/{convert.js → convert.ts} +36 -25
  60. package/function/{index.js → index.ts} +12 -12
  61. package/{group_by_layout.js → group_by_layout.ts} +11 -8
  62. package/migrate/{expressions.js → expressions.ts} +8 -14
  63. package/migrate/{v8.js → v8.ts} +2 -2
  64. package/migrate/{v9.js → v9.ts} +2 -2
  65. package/{migrate.js → migrate.ts} +3 -3
  66. package/package.json +20 -18
  67. package/{read_style.js → read_style.ts} +5 -4
  68. package/reference/latest.ts +5 -0
  69. package/reference/v8.json +224 -1
  70. package/rollup.config.js +6 -23
  71. package/{style-spec.js → style-spec.ts} +28 -30
  72. package/test.js +3 -2
  73. package/types/config_options.ts +13 -0
  74. package/types/lut.ts +7 -0
  75. package/types/tile_id.ts +5 -0
  76. package/{types.js → types.ts} +636 -183
  77. package/util/{color.js → color.ts} +89 -3
  78. package/util/{color_spaces.js → color_spaces.ts} +12 -14
  79. package/util/{deep_equal.js → deep_equal.ts} +1 -3
  80. package/util/{extend.js → extend.ts} +1 -3
  81. package/util/{geometry_util.js → geometry_util.ts} +23 -11
  82. package/util/{get_type.js → get_type.ts} +1 -3
  83. package/util/{interpolate.js → interpolate.ts} +1 -3
  84. package/util/{properties.js → properties.ts} +5 -4
  85. package/util/{random.js → random.ts} +0 -2
  86. package/util/{ref_properties.js → ref_properties.ts} +0 -1
  87. package/util/{result.js → result.ts} +7 -5
  88. package/util/{unbundle_jsonlint.js → unbundle_jsonlint.ts} +5 -5
  89. package/validate/{validate.js → validate.ts} +33 -35
  90. package/validate/{validate_array.js → validate_array.ts} +5 -7
  91. package/validate/{validate_boolean.js → validate_boolean.ts} +3 -5
  92. package/validate/{validate_color.js → validate_color.ts} +3 -5
  93. package/validate/{validate_enum.js → validate_enum.ts} +4 -5
  94. package/validate/{validate_expression.js → validate_expression.ts} +7 -9
  95. package/validate/{validate_filter.js → validate_filter.ts} +16 -12
  96. package/validate/{validate_fog.js → validate_fog.ts} +4 -6
  97. package/validate/validate_formatted.ts +13 -0
  98. package/validate/{validate_function.js → validate_function.ts} +14 -16
  99. package/validate/{validate_glyphs_url.js → validate_glyphs_url.ts} +3 -5
  100. package/validate/validate_image.ts +13 -0
  101. package/validate/{validate_import.js → validate_import.ts} +6 -8
  102. package/validate/{validate_layer.js → validate_layer.ts} +17 -15
  103. package/validate/{validate_layout_property.js → validate_layout_property.ts} +3 -5
  104. package/validate/{validate_light.js → validate_light.ts} +4 -6
  105. package/validate/{validate_lights.js → validate_lights.ts} +7 -9
  106. package/validate/{validate_model.js → validate_model.ts} +4 -6
  107. package/validate/{validate_number.js → validate_number.ts} +4 -6
  108. package/validate/{validate_object.js → validate_object.ts} +5 -8
  109. package/validate/{validate_paint_property.js → validate_paint_property.ts} +3 -5
  110. package/validate/{validate_projection.js → validate_projection.ts} +4 -6
  111. package/validate/{validate_property.js → validate_property.ts} +15 -15
  112. package/validate/{validate_source.js → validate_source.ts} +16 -13
  113. package/validate/validate_string.ts +16 -0
  114. package/validate/validate_style.ts +33 -0
  115. package/validate/{validate_terrain.js → validate_terrain.ts} +5 -7
  116. package/{validate_mapbox_api_supported.js → validate_mapbox_api_supported.ts} +22 -18
  117. package/{validate_style.min.js → validate_style.min.ts} +20 -21
  118. package/{validate_style.js → validate_style.ts} +9 -9
  119. package/{visit.js → visit.ts} +22 -17
  120. package/.eslintrc +0 -10
  121. package/expression/expression.js +0 -28
  122. package/flow-typed/cheap-ruler.js +0 -25
  123. package/flow-typed/geojson.js +0 -44
  124. package/flow-typed/gl-matrix.js +0 -119
  125. package/flow-typed/gl.js +0 -5
  126. package/flow-typed/intl.js +0 -58
  127. package/flow-typed/kdbush.js +0 -9
  128. package/flow-typed/mapbox-gl-supported.js +0 -16
  129. package/flow-typed/mapbox-unitbezier.js +0 -14
  130. package/flow-typed/offscreen-canvas.js +0 -9
  131. package/flow-typed/pbf.js +0 -26
  132. package/flow-typed/point-geometry.js +0 -46
  133. package/flow-typed/potpack.js +0 -13
  134. package/flow-typed/tiny-sdf.js +0 -31
  135. package/flow-typed/tracked_parameters_proxy.js +0 -82
  136. package/flow-typed/vector-tile.js +0 -49
  137. package/flow-typed/webgl2.js +0 -41
  138. package/reference/latest.js +0 -7
  139. package/validate/validate_formatted.js +0 -15
  140. package/validate/validate_image.js +0 -15
  141. package/validate/validate_string.js +0 -18
  142. package/validate/validate_style.js +0 -29
@@ -0,0 +1,1726 @@
1
+ import Point from '@mapbox/point-geometry';
2
+
3
+ type StyleReference = Record<any, any>;
4
+ declare const _default: StyleReference;
5
+ /**
6
+ * Format a Mapbox GL Style. Returns a stringified style with its keys
7
+ * sorted in the same order as the reference style.
8
+ *
9
+ * The optional `space` argument is passed to
10
+ * [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
11
+ * to generate formatted output.
12
+ *
13
+ * If `space` is unspecified, a default of `2` spaces will be used.
14
+ *
15
+ * @private
16
+ * @param {Object} style a Mapbox GL Style
17
+ * @param {number} [space] space argument to pass to `JSON.stringify`
18
+ * @returns {string} stringified formatted JSON
19
+ * @example
20
+ * var fs = require('fs');
21
+ * var format = require('mapbox-gl-style-spec').format;
22
+ * var style = fs.readFileSync('./source.json', 'utf8');
23
+ * fs.writeFileSync('./dest.json', format(style));
24
+ * fs.writeFileSync('./dest.min.json', format(style, 0));
25
+ */
26
+ export declare function format(style: any, space?: number): string;
27
+ /**
28
+ * Migrate a Mapbox GL Style to the latest version.
29
+ *
30
+ * @private
31
+ * @alias migrate
32
+ * @param {object} style a Mapbox GL Style
33
+ * @returns {Object} a migrated style
34
+ * @example
35
+ * var fs = require('fs');
36
+ * var migrate = require('mapbox-gl-style-spec').migrate;
37
+ * var style = fs.readFileSync('./style.json', 'utf8');
38
+ * fs.writeFileSync('./style.json', JSON.stringify(migrate(style)));
39
+ */
40
+ declare function _default$1(style: any): any;
41
+ declare function _default$2(style: any): any;
42
+ type ColorSpecification = string;
43
+ type FormattedSpecification = string;
44
+ type ResolvedImageSpecification = string;
45
+ type PromoteIdSpecification = {
46
+ [_: string]: string;
47
+ } | string;
48
+ type FilterSpecification = [
49
+ "has",
50
+ string
51
+ ] | [
52
+ "!has",
53
+ string
54
+ ] | [
55
+ "==",
56
+ string,
57
+ string | number | boolean
58
+ ] | [
59
+ "!=",
60
+ string,
61
+ string | number | boolean
62
+ ] | [
63
+ ">",
64
+ string,
65
+ string | number | boolean
66
+ ] | [
67
+ ">=",
68
+ string,
69
+ string | number | boolean
70
+ ] | [
71
+ "<",
72
+ string,
73
+ string | number | boolean
74
+ ] | [
75
+ "<=",
76
+ string,
77
+ string | number | boolean
78
+ ] | Array<string | FilterSpecification>;
79
+ type TransitionSpecification = {
80
+ duration?: number;
81
+ delay?: number;
82
+ };
83
+ type CameraFunctionSpecification<T> = {
84
+ type: "exponential";
85
+ stops: Array<[
86
+ number,
87
+ T
88
+ ]>;
89
+ } | {
90
+ type: "interval";
91
+ stops: Array<[
92
+ number,
93
+ T
94
+ ]>;
95
+ };
96
+ type SourceFunctionSpecification<T> = {
97
+ type: "exponential";
98
+ stops: Array<[
99
+ number,
100
+ T
101
+ ]>;
102
+ property: string;
103
+ default?: T;
104
+ } | {
105
+ type: "interval";
106
+ stops: Array<[
107
+ number,
108
+ T
109
+ ]>;
110
+ property: string;
111
+ default?: T;
112
+ } | {
113
+ type: "categorical";
114
+ stops: Array<[
115
+ string | number | boolean,
116
+ T
117
+ ]>;
118
+ property: string;
119
+ default?: T;
120
+ } | {
121
+ type: "identity";
122
+ property: string;
123
+ default?: T;
124
+ };
125
+ type CompositeFunctionSpecification<T> = {
126
+ type: "exponential";
127
+ stops: Array<[
128
+ {
129
+ zoom: number;
130
+ value: number;
131
+ },
132
+ T
133
+ ]>;
134
+ property: string;
135
+ default?: T;
136
+ } | {
137
+ type: "interval";
138
+ stops: Array<[
139
+ {
140
+ zoom: number;
141
+ value: number;
142
+ },
143
+ T
144
+ ]>;
145
+ property: string;
146
+ default?: T;
147
+ } | {
148
+ type: "categorical";
149
+ stops: Array<[
150
+ {
151
+ zoom: number;
152
+ value: string | number | boolean;
153
+ },
154
+ T
155
+ ]>;
156
+ property: string;
157
+ default?: T;
158
+ };
159
+ type ExpressionSpecification = [
160
+ string,
161
+ ...any[]
162
+ ];
163
+ type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
164
+ type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification;
165
+ type StyleSpecification = {
166
+ "version": 8;
167
+ "fragment"?: boolean;
168
+ "name"?: string;
169
+ "metadata"?: unknown;
170
+ "center"?: Array<number>;
171
+ "zoom"?: number;
172
+ "bearing"?: number;
173
+ "pitch"?: number;
174
+ "light"?: LightSpecification;
175
+ "lights"?: Array<LightsSpecification>;
176
+ "terrain"?: TerrainSpecification | null | undefined;
177
+ "fog"?: FogSpecification;
178
+ "camera"?: CameraSpecification;
179
+ "color-theme"?: ColorThemeSpecification;
180
+ "imports"?: Array<ImportSpecification>;
181
+ "schema"?: SchemaSpecification;
182
+ "sources": SourcesSpecification;
183
+ "sprite"?: string;
184
+ "glyphs"?: string;
185
+ "transition"?: TransitionSpecification;
186
+ "projection"?: ProjectionSpecification;
187
+ "layers": Array<LayerSpecification>;
188
+ "models"?: ModelsSpecification;
189
+ };
190
+ type SourcesSpecification = {
191
+ [_: string]: SourceSpecification;
192
+ };
193
+ type ModelsSpecification = {
194
+ [_: string]: ModelSpecification;
195
+ };
196
+ type LightSpecification = {
197
+ "anchor"?: PropertyValueSpecification<"map" | "viewport">;
198
+ "position"?: PropertyValueSpecification<[
199
+ number,
200
+ number,
201
+ number
202
+ ]>;
203
+ "position-transition"?: TransitionSpecification;
204
+ "color"?: PropertyValueSpecification<ColorSpecification>;
205
+ "color-transition"?: TransitionSpecification;
206
+ "intensity"?: PropertyValueSpecification<number>;
207
+ "intensity-transition"?: TransitionSpecification;
208
+ };
209
+ type TerrainSpecification = {
210
+ "source": string;
211
+ "exaggeration"?: PropertyValueSpecification<number>;
212
+ "exaggeration-transition"?: TransitionSpecification;
213
+ };
214
+ type FogSpecification = {
215
+ "range"?: PropertyValueSpecification<[
216
+ number,
217
+ number
218
+ ]>;
219
+ "range-transition"?: TransitionSpecification;
220
+ "color"?: PropertyValueSpecification<ColorSpecification>;
221
+ "color-transition"?: TransitionSpecification;
222
+ "high-color"?: PropertyValueSpecification<ColorSpecification>;
223
+ "high-color-transition"?: TransitionSpecification;
224
+ "space-color"?: PropertyValueSpecification<ColorSpecification>;
225
+ "space-color-transition"?: TransitionSpecification;
226
+ "horizon-blend"?: PropertyValueSpecification<number>;
227
+ "horizon-blend-transition"?: TransitionSpecification;
228
+ "star-intensity"?: PropertyValueSpecification<number>;
229
+ "star-intensity-transition"?: TransitionSpecification;
230
+ "vertical-range"?: PropertyValueSpecification<[
231
+ number,
232
+ number
233
+ ]>;
234
+ "vertical-range-transition"?: TransitionSpecification;
235
+ };
236
+ type CameraSpecification = {
237
+ "camera-projection"?: PropertyValueSpecification<"perspective" | "orthographic">;
238
+ "camera-projection-transition"?: TransitionSpecification;
239
+ };
240
+ type ColorThemeSpecification = {
241
+ "data"?: ExpressionSpecification;
242
+ };
243
+ type ProjectionSpecification = {
244
+ "name": "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel" | "globe";
245
+ "center"?: [
246
+ number,
247
+ number
248
+ ];
249
+ "parallels"?: [
250
+ number,
251
+ number
252
+ ];
253
+ };
254
+ type ImportSpecification = {
255
+ "id": string;
256
+ "url": string;
257
+ "config"?: ConfigSpecification;
258
+ "data"?: StyleSpecification;
259
+ };
260
+ type ConfigSpecification = {
261
+ [_: string]: unknown;
262
+ };
263
+ type SchemaSpecification = {
264
+ [_: string]: OptionSpecification;
265
+ };
266
+ type OptionSpecification = {
267
+ "default": ExpressionSpecification;
268
+ "type"?: "string" | "number" | "boolean" | "color";
269
+ "array"?: boolean;
270
+ "minValue"?: number;
271
+ "maxValue"?: number;
272
+ "stepValue"?: number;
273
+ "values"?: Array<unknown>;
274
+ "metadata"?: unknown;
275
+ };
276
+ type VectorSourceSpecification = {
277
+ "type": "vector";
278
+ "url"?: string;
279
+ "tiles"?: Array<string>;
280
+ "bounds"?: [
281
+ number,
282
+ number,
283
+ number,
284
+ number
285
+ ];
286
+ "scheme"?: "xyz" | "tms";
287
+ "minzoom"?: number;
288
+ "maxzoom"?: number;
289
+ "attribution"?: string;
290
+ "promoteId"?: PromoteIdSpecification;
291
+ "volatile"?: boolean;
292
+ [_: string]: unknown;
293
+ };
294
+ type RasterSourceSpecification = {
295
+ "type": "raster";
296
+ "url"?: string;
297
+ "tiles"?: Array<string>;
298
+ "bounds"?: [
299
+ number,
300
+ number,
301
+ number,
302
+ number
303
+ ];
304
+ "minzoom"?: number;
305
+ "maxzoom"?: number;
306
+ "tileSize"?: number;
307
+ "scheme"?: "xyz" | "tms";
308
+ "attribution"?: string;
309
+ "volatile"?: boolean;
310
+ [_: string]: unknown;
311
+ };
312
+ type RasterDEMSourceSpecification = {
313
+ "type": "raster-dem";
314
+ "url"?: string;
315
+ "tiles"?: Array<string>;
316
+ "bounds"?: [
317
+ number,
318
+ number,
319
+ number,
320
+ number
321
+ ];
322
+ "minzoom"?: number;
323
+ "maxzoom"?: number;
324
+ "tileSize"?: number;
325
+ "attribution"?: string;
326
+ "encoding"?: "terrarium" | "mapbox";
327
+ "volatile"?: boolean;
328
+ [_: string]: unknown;
329
+ };
330
+ type RasterArraySourceSpecification = {
331
+ "type": "raster-array";
332
+ "url"?: string;
333
+ "tiles"?: Array<string>;
334
+ "bounds"?: [
335
+ number,
336
+ number,
337
+ number,
338
+ number
339
+ ];
340
+ "minzoom"?: number;
341
+ "maxzoom"?: number;
342
+ "tileSize"?: number;
343
+ "attribution"?: string;
344
+ "rasterLayers"?: unknown;
345
+ "volatile"?: boolean;
346
+ [_: string]: unknown;
347
+ };
348
+ type GeoJSONSourceSpecification = {
349
+ "type": "geojson";
350
+ "data"?: GeoJSON.GeoJSON | string;
351
+ "maxzoom"?: number;
352
+ "minzoom"?: number;
353
+ "attribution"?: string;
354
+ "buffer"?: number;
355
+ "filter"?: unknown;
356
+ "tolerance"?: number;
357
+ "cluster"?: boolean;
358
+ "clusterRadius"?: number;
359
+ "clusterMaxZoom"?: number;
360
+ "clusterMinPoints"?: number;
361
+ "clusterProperties"?: unknown;
362
+ "lineMetrics"?: boolean;
363
+ "generateId"?: boolean;
364
+ "promoteId"?: PromoteIdSpecification;
365
+ "dynamic"?: boolean;
366
+ };
367
+ type VideoSourceSpecification = {
368
+ "type": "video";
369
+ "urls": Array<string>;
370
+ "coordinates": [
371
+ [
372
+ number,
373
+ number
374
+ ],
375
+ [
376
+ number,
377
+ number
378
+ ],
379
+ [
380
+ number,
381
+ number
382
+ ],
383
+ [
384
+ number,
385
+ number
386
+ ]
387
+ ];
388
+ };
389
+ type ImageSourceSpecification = {
390
+ "type": "image";
391
+ "url"?: string;
392
+ "coordinates": [
393
+ [
394
+ number,
395
+ number
396
+ ],
397
+ [
398
+ number,
399
+ number
400
+ ],
401
+ [
402
+ number,
403
+ number
404
+ ],
405
+ [
406
+ number,
407
+ number
408
+ ]
409
+ ];
410
+ };
411
+ type ModelSourceSpecification = {
412
+ "type": "model" | "batched-model";
413
+ "maxzoom"?: number;
414
+ "minzoom"?: number;
415
+ "tiles"?: Array<string>;
416
+ };
417
+ type SourceSpecification = VectorSourceSpecification | RasterSourceSpecification | RasterDEMSourceSpecification | RasterArraySourceSpecification | GeoJSONSourceSpecification | VideoSourceSpecification | ImageSourceSpecification | ModelSourceSpecification;
418
+ type ModelSpecification = string;
419
+ type AmbientLightSpecification = {
420
+ "id": string;
421
+ "properties"?: {
422
+ "color"?: PropertyValueSpecification<ColorSpecification>;
423
+ "color-transition"?: TransitionSpecification;
424
+ "intensity"?: PropertyValueSpecification<number>;
425
+ "intensity-transition"?: TransitionSpecification;
426
+ };
427
+ "type": "ambient";
428
+ };
429
+ type DirectionalLightSpecification = {
430
+ "id": string;
431
+ "properties"?: {
432
+ "direction"?: PropertyValueSpecification<[
433
+ number,
434
+ number
435
+ ]>;
436
+ "direction-transition"?: TransitionSpecification;
437
+ "color"?: PropertyValueSpecification<ColorSpecification>;
438
+ "color-transition"?: TransitionSpecification;
439
+ "intensity"?: PropertyValueSpecification<number>;
440
+ "intensity-transition"?: TransitionSpecification;
441
+ "cast-shadows"?: ExpressionSpecification;
442
+ "shadow-intensity"?: PropertyValueSpecification<number>;
443
+ "shadow-intensity-transition"?: TransitionSpecification;
444
+ };
445
+ "type": "directional";
446
+ };
447
+ type FlatLightSpecification = {
448
+ "id": string;
449
+ "properties"?: {
450
+ "anchor"?: PropertyValueSpecification<"map" | "viewport">;
451
+ "position"?: PropertyValueSpecification<[
452
+ number,
453
+ number,
454
+ number
455
+ ]>;
456
+ "position-transition"?: TransitionSpecification;
457
+ "color"?: PropertyValueSpecification<ColorSpecification>;
458
+ "color-transition"?: TransitionSpecification;
459
+ "intensity"?: PropertyValueSpecification<number>;
460
+ "intensity-transition"?: TransitionSpecification;
461
+ };
462
+ "type": "flat";
463
+ };
464
+ type LightsSpecification = AmbientLightSpecification | DirectionalLightSpecification | FlatLightSpecification;
465
+ type FillLayerSpecification = {
466
+ "id": string;
467
+ "type": "fill";
468
+ "metadata"?: unknown;
469
+ "source": string;
470
+ "source-layer"?: string;
471
+ "slot"?: string;
472
+ "minzoom"?: number;
473
+ "maxzoom"?: number;
474
+ "filter"?: FilterSpecification;
475
+ "layout"?: {
476
+ "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
477
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
478
+ };
479
+ "paint"?: {
480
+ "fill-antialias"?: PropertyValueSpecification<boolean>;
481
+ "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
482
+ "fill-opacity-transition"?: TransitionSpecification;
483
+ "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
484
+ "fill-color-transition"?: TransitionSpecification;
485
+ "fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
486
+ "fill-outline-color-transition"?: TransitionSpecification;
487
+ "fill-translate"?: PropertyValueSpecification<[
488
+ number,
489
+ number
490
+ ]>;
491
+ "fill-translate-transition"?: TransitionSpecification;
492
+ "fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
493
+ "fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
494
+ "fill-emissive-strength"?: PropertyValueSpecification<number>;
495
+ "fill-emissive-strength-transition"?: TransitionSpecification;
496
+ };
497
+ };
498
+ type LineLayerSpecification = {
499
+ "id": string;
500
+ "type": "line";
501
+ "metadata"?: unknown;
502
+ "source": string;
503
+ "source-layer"?: string;
504
+ "slot"?: string;
505
+ "minzoom"?: number;
506
+ "maxzoom"?: number;
507
+ "filter"?: FilterSpecification;
508
+ "layout"?: {
509
+ "line-cap"?: DataDrivenPropertyValueSpecification<"butt" | "round" | "square">;
510
+ "line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter" | "none">;
511
+ "line-miter-limit"?: PropertyValueSpecification<number>;
512
+ "line-round-limit"?: PropertyValueSpecification<number>;
513
+ "line-sort-key"?: DataDrivenPropertyValueSpecification<number>;
514
+ /**
515
+ * @experimental This property is experimental and subject to change in future versions.
516
+ */
517
+ "line-z-offset"?: DataDrivenPropertyValueSpecification<number>;
518
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
519
+ };
520
+ "paint"?: {
521
+ "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
522
+ "line-opacity-transition"?: TransitionSpecification;
523
+ "line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
524
+ "line-color-transition"?: TransitionSpecification;
525
+ "line-translate"?: PropertyValueSpecification<[
526
+ number,
527
+ number
528
+ ]>;
529
+ "line-translate-transition"?: TransitionSpecification;
530
+ "line-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
531
+ "line-width"?: DataDrivenPropertyValueSpecification<number>;
532
+ "line-width-transition"?: TransitionSpecification;
533
+ "line-gap-width"?: DataDrivenPropertyValueSpecification<number>;
534
+ "line-gap-width-transition"?: TransitionSpecification;
535
+ "line-offset"?: DataDrivenPropertyValueSpecification<number>;
536
+ "line-offset-transition"?: TransitionSpecification;
537
+ "line-blur"?: DataDrivenPropertyValueSpecification<number>;
538
+ "line-blur-transition"?: TransitionSpecification;
539
+ "line-dasharray"?: DataDrivenPropertyValueSpecification<Array<number>>;
540
+ "line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
541
+ "line-gradient"?: ExpressionSpecification;
542
+ "line-trim-offset"?: [
543
+ number,
544
+ number
545
+ ];
546
+ "line-emissive-strength"?: PropertyValueSpecification<number>;
547
+ "line-emissive-strength-transition"?: TransitionSpecification;
548
+ "line-border-width"?: DataDrivenPropertyValueSpecification<number>;
549
+ "line-border-width-transition"?: TransitionSpecification;
550
+ "line-border-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
551
+ "line-border-color-transition"?: TransitionSpecification;
552
+ "line-occlusion-opacity"?: PropertyValueSpecification<number>;
553
+ "line-occlusion-opacity-transition"?: TransitionSpecification;
554
+ };
555
+ };
556
+ type SymbolLayerSpecification = {
557
+ "id": string;
558
+ "type": "symbol";
559
+ "metadata"?: unknown;
560
+ "source": string;
561
+ "source-layer"?: string;
562
+ "slot"?: string;
563
+ "minzoom"?: number;
564
+ "maxzoom"?: number;
565
+ "filter"?: FilterSpecification;
566
+ "layout"?: {
567
+ "symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">;
568
+ "symbol-spacing"?: PropertyValueSpecification<number>;
569
+ "symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
570
+ "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
571
+ "symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">;
572
+ "symbol-z-elevate"?: PropertyValueSpecification<boolean>;
573
+ "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
574
+ "icon-ignore-placement"?: PropertyValueSpecification<boolean>;
575
+ "icon-optional"?: PropertyValueSpecification<boolean>;
576
+ "icon-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
577
+ "icon-size"?: DataDrivenPropertyValueSpecification<number>;
578
+ "icon-text-fit"?: DataDrivenPropertyValueSpecification<"none" | "width" | "height" | "both">;
579
+ "icon-text-fit-padding"?: DataDrivenPropertyValueSpecification<[
580
+ number,
581
+ number,
582
+ number,
583
+ number
584
+ ]>;
585
+ "icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
586
+ "icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
587
+ "icon-padding"?: PropertyValueSpecification<number>;
588
+ "icon-keep-upright"?: PropertyValueSpecification<boolean>;
589
+ "icon-offset"?: DataDrivenPropertyValueSpecification<[
590
+ number,
591
+ number
592
+ ]>;
593
+ "icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
594
+ "icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
595
+ "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
596
+ "text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
597
+ "text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>;
598
+ "text-font"?: DataDrivenPropertyValueSpecification<Array<string>>;
599
+ "text-size"?: DataDrivenPropertyValueSpecification<number>;
600
+ "text-max-width"?: DataDrivenPropertyValueSpecification<number>;
601
+ "text-line-height"?: DataDrivenPropertyValueSpecification<number>;
602
+ "text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>;
603
+ "text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
604
+ "text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
605
+ "text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
606
+ "text-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
607
+ "text-max-angle"?: PropertyValueSpecification<number>;
608
+ "text-writing-mode"?: PropertyValueSpecification<Array<"horizontal" | "vertical">>;
609
+ "text-rotate"?: DataDrivenPropertyValueSpecification<number>;
610
+ "text-padding"?: PropertyValueSpecification<number>;
611
+ "text-keep-upright"?: PropertyValueSpecification<boolean>;
612
+ "text-transform"?: DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">;
613
+ "text-offset"?: DataDrivenPropertyValueSpecification<[
614
+ number,
615
+ number
616
+ ]>;
617
+ "text-allow-overlap"?: PropertyValueSpecification<boolean>;
618
+ "text-ignore-placement"?: PropertyValueSpecification<boolean>;
619
+ "text-optional"?: PropertyValueSpecification<boolean>;
620
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
621
+ };
622
+ "paint"?: {
623
+ "icon-opacity"?: DataDrivenPropertyValueSpecification<number>;
624
+ "icon-opacity-transition"?: TransitionSpecification;
625
+ "icon-occlusion-opacity"?: DataDrivenPropertyValueSpecification<number>;
626
+ "icon-occlusion-opacity-transition"?: TransitionSpecification;
627
+ "icon-emissive-strength"?: DataDrivenPropertyValueSpecification<number>;
628
+ "icon-emissive-strength-transition"?: TransitionSpecification;
629
+ "text-emissive-strength"?: DataDrivenPropertyValueSpecification<number>;
630
+ "text-emissive-strength-transition"?: TransitionSpecification;
631
+ "icon-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
632
+ "icon-color-transition"?: TransitionSpecification;
633
+ "icon-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
634
+ "icon-halo-color-transition"?: TransitionSpecification;
635
+ "icon-halo-width"?: DataDrivenPropertyValueSpecification<number>;
636
+ "icon-halo-width-transition"?: TransitionSpecification;
637
+ "icon-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
638
+ "icon-halo-blur-transition"?: TransitionSpecification;
639
+ "icon-translate"?: PropertyValueSpecification<[
640
+ number,
641
+ number
642
+ ]>;
643
+ "icon-translate-transition"?: TransitionSpecification;
644
+ "icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
645
+ "icon-image-cross-fade"?: DataDrivenPropertyValueSpecification<number>;
646
+ "icon-image-cross-fade-transition"?: TransitionSpecification;
647
+ "text-opacity"?: DataDrivenPropertyValueSpecification<number>;
648
+ "text-opacity-transition"?: TransitionSpecification;
649
+ "text-occlusion-opacity"?: DataDrivenPropertyValueSpecification<number>;
650
+ "text-occlusion-opacity-transition"?: TransitionSpecification;
651
+ "text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
652
+ "text-color-transition"?: TransitionSpecification;
653
+ "text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
654
+ "text-halo-color-transition"?: TransitionSpecification;
655
+ "text-halo-width"?: DataDrivenPropertyValueSpecification<number>;
656
+ "text-halo-width-transition"?: TransitionSpecification;
657
+ "text-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
658
+ "text-halo-blur-transition"?: TransitionSpecification;
659
+ "text-translate"?: PropertyValueSpecification<[
660
+ number,
661
+ number
662
+ ]>;
663
+ "text-translate-transition"?: TransitionSpecification;
664
+ "text-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
665
+ "icon-color-saturation"?: ExpressionSpecification;
666
+ "icon-color-contrast"?: ExpressionSpecification;
667
+ "icon-color-brightness-min"?: ExpressionSpecification;
668
+ "icon-color-brightness-max"?: ExpressionSpecification;
669
+ };
670
+ };
671
+ type CircleLayerSpecification = {
672
+ "id": string;
673
+ "type": "circle";
674
+ "metadata"?: unknown;
675
+ "source": string;
676
+ "source-layer"?: string;
677
+ "slot"?: string;
678
+ "minzoom"?: number;
679
+ "maxzoom"?: number;
680
+ "filter"?: FilterSpecification;
681
+ "layout"?: {
682
+ "circle-sort-key"?: DataDrivenPropertyValueSpecification<number>;
683
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
684
+ };
685
+ "paint"?: {
686
+ "circle-radius"?: DataDrivenPropertyValueSpecification<number>;
687
+ "circle-radius-transition"?: TransitionSpecification;
688
+ "circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
689
+ "circle-color-transition"?: TransitionSpecification;
690
+ "circle-blur"?: DataDrivenPropertyValueSpecification<number>;
691
+ "circle-blur-transition"?: TransitionSpecification;
692
+ "circle-opacity"?: DataDrivenPropertyValueSpecification<number>;
693
+ "circle-opacity-transition"?: TransitionSpecification;
694
+ "circle-translate"?: PropertyValueSpecification<[
695
+ number,
696
+ number
697
+ ]>;
698
+ "circle-translate-transition"?: TransitionSpecification;
699
+ "circle-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
700
+ "circle-pitch-scale"?: PropertyValueSpecification<"map" | "viewport">;
701
+ "circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
702
+ "circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
703
+ "circle-stroke-width-transition"?: TransitionSpecification;
704
+ "circle-stroke-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
705
+ "circle-stroke-color-transition"?: TransitionSpecification;
706
+ "circle-stroke-opacity"?: DataDrivenPropertyValueSpecification<number>;
707
+ "circle-stroke-opacity-transition"?: TransitionSpecification;
708
+ "circle-emissive-strength"?: PropertyValueSpecification<number>;
709
+ "circle-emissive-strength-transition"?: TransitionSpecification;
710
+ };
711
+ };
712
+ type HeatmapLayerSpecification = {
713
+ "id": string;
714
+ "type": "heatmap";
715
+ "metadata"?: unknown;
716
+ "source": string;
717
+ "source-layer"?: string;
718
+ "slot"?: string;
719
+ "minzoom"?: number;
720
+ "maxzoom"?: number;
721
+ "filter"?: FilterSpecification;
722
+ "layout"?: {
723
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
724
+ };
725
+ "paint"?: {
726
+ "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
727
+ "heatmap-radius-transition"?: TransitionSpecification;
728
+ "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
729
+ "heatmap-intensity"?: PropertyValueSpecification<number>;
730
+ "heatmap-intensity-transition"?: TransitionSpecification;
731
+ "heatmap-color"?: ExpressionSpecification;
732
+ "heatmap-opacity"?: PropertyValueSpecification<number>;
733
+ "heatmap-opacity-transition"?: TransitionSpecification;
734
+ };
735
+ };
736
+ type FillExtrusionLayerSpecification = {
737
+ "id": string;
738
+ "type": "fill-extrusion";
739
+ "metadata"?: unknown;
740
+ "source": string;
741
+ "source-layer"?: string;
742
+ "slot"?: string;
743
+ "minzoom"?: number;
744
+ "maxzoom"?: number;
745
+ "filter"?: FilterSpecification;
746
+ "layout"?: {
747
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
748
+ /**
749
+ * @experimental This property is experimental and subject to change in future versions.
750
+ */
751
+ "fill-extrusion-edge-radius"?: ExpressionSpecification;
752
+ };
753
+ "paint"?: {
754
+ "fill-extrusion-opacity"?: PropertyValueSpecification<number>;
755
+ "fill-extrusion-opacity-transition"?: TransitionSpecification;
756
+ "fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
757
+ "fill-extrusion-color-transition"?: TransitionSpecification;
758
+ "fill-extrusion-translate"?: PropertyValueSpecification<[
759
+ number,
760
+ number
761
+ ]>;
762
+ "fill-extrusion-translate-transition"?: TransitionSpecification;
763
+ "fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
764
+ "fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
765
+ "fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
766
+ "fill-extrusion-height-transition"?: TransitionSpecification;
767
+ "fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
768
+ "fill-extrusion-base-transition"?: TransitionSpecification;
769
+ "fill-extrusion-vertical-gradient"?: PropertyValueSpecification<boolean>;
770
+ "fill-extrusion-ambient-occlusion-intensity"?: PropertyValueSpecification<number>;
771
+ "fill-extrusion-ambient-occlusion-intensity-transition"?: TransitionSpecification;
772
+ "fill-extrusion-ambient-occlusion-radius"?: PropertyValueSpecification<number>;
773
+ "fill-extrusion-ambient-occlusion-radius-transition"?: TransitionSpecification;
774
+ "fill-extrusion-ambient-occlusion-wall-radius"?: PropertyValueSpecification<number>;
775
+ "fill-extrusion-ambient-occlusion-wall-radius-transition"?: TransitionSpecification;
776
+ "fill-extrusion-ambient-occlusion-ground-radius"?: PropertyValueSpecification<number>;
777
+ "fill-extrusion-ambient-occlusion-ground-radius-transition"?: TransitionSpecification;
778
+ "fill-extrusion-ambient-occlusion-ground-attenuation"?: PropertyValueSpecification<number>;
779
+ "fill-extrusion-ambient-occlusion-ground-attenuation-transition"?: TransitionSpecification;
780
+ "fill-extrusion-flood-light-color"?: PropertyValueSpecification<ColorSpecification>;
781
+ "fill-extrusion-flood-light-color-transition"?: TransitionSpecification;
782
+ "fill-extrusion-flood-light-intensity"?: PropertyValueSpecification<number>;
783
+ "fill-extrusion-flood-light-intensity-transition"?: TransitionSpecification;
784
+ "fill-extrusion-flood-light-wall-radius"?: DataDrivenPropertyValueSpecification<number>;
785
+ "fill-extrusion-flood-light-wall-radius-transition"?: TransitionSpecification;
786
+ "fill-extrusion-flood-light-ground-radius"?: DataDrivenPropertyValueSpecification<number>;
787
+ "fill-extrusion-flood-light-ground-radius-transition"?: TransitionSpecification;
788
+ "fill-extrusion-flood-light-ground-attenuation"?: PropertyValueSpecification<number>;
789
+ "fill-extrusion-flood-light-ground-attenuation-transition"?: TransitionSpecification;
790
+ "fill-extrusion-vertical-scale"?: PropertyValueSpecification<number>;
791
+ "fill-extrusion-vertical-scale-transition"?: TransitionSpecification;
792
+ /**
793
+ * @experimental This property is experimental and subject to change in future versions.
794
+ */
795
+ "fill-extrusion-rounded-roof"?: PropertyValueSpecification<boolean>;
796
+ "fill-extrusion-cutoff-fade-range"?: ExpressionSpecification;
797
+ "fill-extrusion-emissive-strength"?: PropertyValueSpecification<number>;
798
+ "fill-extrusion-emissive-strength-transition"?: TransitionSpecification;
799
+ };
800
+ };
801
+ type RasterLayerSpecification = {
802
+ "id": string;
803
+ "type": "raster";
804
+ "metadata"?: unknown;
805
+ "source": string;
806
+ "source-layer"?: string;
807
+ "slot"?: string;
808
+ "minzoom"?: number;
809
+ "maxzoom"?: number;
810
+ "filter"?: FilterSpecification;
811
+ "layout"?: {
812
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
813
+ };
814
+ "paint"?: {
815
+ "raster-opacity"?: PropertyValueSpecification<number>;
816
+ "raster-opacity-transition"?: TransitionSpecification;
817
+ "raster-color"?: ExpressionSpecification;
818
+ "raster-color-mix"?: PropertyValueSpecification<[
819
+ number,
820
+ number,
821
+ number,
822
+ number
823
+ ]>;
824
+ "raster-color-mix-transition"?: TransitionSpecification;
825
+ "raster-color-range"?: PropertyValueSpecification<[
826
+ number,
827
+ number
828
+ ]>;
829
+ "raster-color-range-transition"?: TransitionSpecification;
830
+ "raster-hue-rotate"?: PropertyValueSpecification<number>;
831
+ "raster-hue-rotate-transition"?: TransitionSpecification;
832
+ "raster-brightness-min"?: PropertyValueSpecification<number>;
833
+ "raster-brightness-min-transition"?: TransitionSpecification;
834
+ "raster-brightness-max"?: PropertyValueSpecification<number>;
835
+ "raster-brightness-max-transition"?: TransitionSpecification;
836
+ "raster-saturation"?: PropertyValueSpecification<number>;
837
+ "raster-saturation-transition"?: TransitionSpecification;
838
+ "raster-contrast"?: PropertyValueSpecification<number>;
839
+ "raster-contrast-transition"?: TransitionSpecification;
840
+ "raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
841
+ "raster-fade-duration"?: PropertyValueSpecification<number>;
842
+ "raster-emissive-strength"?: PropertyValueSpecification<number>;
843
+ "raster-emissive-strength-transition"?: TransitionSpecification;
844
+ /**
845
+ * @experimental This property is experimental and subject to change in future versions.
846
+ */
847
+ "raster-array-band"?: string;
848
+ "raster-elevation"?: PropertyValueSpecification<number>;
849
+ "raster-elevation-transition"?: TransitionSpecification;
850
+ };
851
+ };
852
+ type RasterParticleLayerSpecification = {
853
+ "id": string;
854
+ "type": "raster-particle";
855
+ "metadata"?: unknown;
856
+ "source": string;
857
+ "source-layer"?: string;
858
+ "slot"?: string;
859
+ "minzoom"?: number;
860
+ "maxzoom"?: number;
861
+ "filter"?: FilterSpecification;
862
+ "layout"?: {
863
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
864
+ };
865
+ "paint"?: {
866
+ "raster-particle-array-band"?: string;
867
+ "raster-particle-count"?: number;
868
+ "raster-particle-color"?: ExpressionSpecification;
869
+ "raster-particle-max-speed"?: number;
870
+ "raster-particle-speed-factor"?: PropertyValueSpecification<number>;
871
+ "raster-particle-speed-factor-transition"?: TransitionSpecification;
872
+ "raster-particle-fade-opacity-factor"?: PropertyValueSpecification<number>;
873
+ "raster-particle-fade-opacity-factor-transition"?: TransitionSpecification;
874
+ "raster-particle-reset-rate-factor"?: number;
875
+ };
876
+ };
877
+ type HillshadeLayerSpecification = {
878
+ "id": string;
879
+ "type": "hillshade";
880
+ "metadata"?: unknown;
881
+ "source": string;
882
+ "source-layer"?: string;
883
+ "slot"?: string;
884
+ "minzoom"?: number;
885
+ "maxzoom"?: number;
886
+ "filter"?: FilterSpecification;
887
+ "layout"?: {
888
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
889
+ };
890
+ "paint"?: {
891
+ "hillshade-illumination-direction"?: PropertyValueSpecification<number>;
892
+ "hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">;
893
+ "hillshade-exaggeration"?: PropertyValueSpecification<number>;
894
+ "hillshade-exaggeration-transition"?: TransitionSpecification;
895
+ "hillshade-shadow-color"?: PropertyValueSpecification<ColorSpecification>;
896
+ "hillshade-shadow-color-transition"?: TransitionSpecification;
897
+ "hillshade-highlight-color"?: PropertyValueSpecification<ColorSpecification>;
898
+ "hillshade-highlight-color-transition"?: TransitionSpecification;
899
+ "hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>;
900
+ "hillshade-accent-color-transition"?: TransitionSpecification;
901
+ "hillshade-emissive-strength"?: PropertyValueSpecification<number>;
902
+ "hillshade-emissive-strength-transition"?: TransitionSpecification;
903
+ };
904
+ };
905
+ type ModelLayerSpecification = {
906
+ "id": string;
907
+ "type": "model";
908
+ "metadata"?: unknown;
909
+ "source": string;
910
+ "source-layer"?: string;
911
+ "slot"?: string;
912
+ "minzoom"?: number;
913
+ "maxzoom"?: number;
914
+ "filter"?: FilterSpecification;
915
+ "layout"?: {
916
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
917
+ "model-id"?: DataDrivenPropertyValueSpecification<string>;
918
+ };
919
+ "paint"?: {
920
+ "model-opacity"?: PropertyValueSpecification<number>;
921
+ "model-opacity-transition"?: TransitionSpecification;
922
+ "model-rotation"?: DataDrivenPropertyValueSpecification<[
923
+ number,
924
+ number,
925
+ number
926
+ ]>;
927
+ "model-rotation-transition"?: TransitionSpecification;
928
+ "model-scale"?: DataDrivenPropertyValueSpecification<[
929
+ number,
930
+ number,
931
+ number
932
+ ]>;
933
+ "model-scale-transition"?: TransitionSpecification;
934
+ "model-translation"?: DataDrivenPropertyValueSpecification<[
935
+ number,
936
+ number,
937
+ number
938
+ ]>;
939
+ "model-translation-transition"?: TransitionSpecification;
940
+ "model-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
941
+ "model-color-transition"?: TransitionSpecification;
942
+ "model-color-mix-intensity"?: DataDrivenPropertyValueSpecification<number>;
943
+ "model-color-mix-intensity-transition"?: TransitionSpecification;
944
+ "model-type"?: "common-3d" | "location-indicator";
945
+ "model-cast-shadows"?: ExpressionSpecification;
946
+ "model-receive-shadows"?: ExpressionSpecification;
947
+ "model-ambient-occlusion-intensity"?: PropertyValueSpecification<number>;
948
+ "model-ambient-occlusion-intensity-transition"?: TransitionSpecification;
949
+ "model-emissive-strength"?: DataDrivenPropertyValueSpecification<number>;
950
+ "model-emissive-strength-transition"?: TransitionSpecification;
951
+ "model-roughness"?: DataDrivenPropertyValueSpecification<number>;
952
+ "model-roughness-transition"?: TransitionSpecification;
953
+ "model-height-based-emissive-strength-multiplier"?: DataDrivenPropertyValueSpecification<[
954
+ number,
955
+ number,
956
+ number,
957
+ number,
958
+ number
959
+ ]>;
960
+ "model-height-based-emissive-strength-multiplier-transition"?: TransitionSpecification;
961
+ "model-cutoff-fade-range"?: ExpressionSpecification;
962
+ "model-front-cutoff"?: PropertyValueSpecification<[
963
+ number,
964
+ number,
965
+ number
966
+ ]>;
967
+ };
968
+ };
969
+ type BackgroundLayerSpecification = {
970
+ "id": string;
971
+ "type": "background";
972
+ "metadata"?: unknown;
973
+ "source"?: never;
974
+ "source-layer"?: never;
975
+ "slot"?: string;
976
+ "minzoom"?: number;
977
+ "maxzoom"?: number;
978
+ "filter"?: never;
979
+ "layout"?: {
980
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
981
+ };
982
+ "paint"?: {
983
+ "background-color"?: PropertyValueSpecification<ColorSpecification>;
984
+ "background-color-transition"?: TransitionSpecification;
985
+ "background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>;
986
+ "background-opacity"?: PropertyValueSpecification<number>;
987
+ "background-opacity-transition"?: TransitionSpecification;
988
+ "background-emissive-strength"?: PropertyValueSpecification<number>;
989
+ "background-emissive-strength-transition"?: TransitionSpecification;
990
+ };
991
+ };
992
+ type SkyLayerSpecification = {
993
+ "id": string;
994
+ "type": "sky";
995
+ "metadata"?: unknown;
996
+ "source"?: never;
997
+ "source-layer"?: never;
998
+ "slot"?: string;
999
+ "minzoom"?: number;
1000
+ "maxzoom"?: number;
1001
+ "filter"?: never;
1002
+ "layout"?: {
1003
+ "visibility"?: "visible" | "none" | ExpressionSpecification;
1004
+ };
1005
+ "paint"?: {
1006
+ "sky-type"?: PropertyValueSpecification<"gradient" | "atmosphere">;
1007
+ "sky-atmosphere-sun"?: PropertyValueSpecification<[
1008
+ number,
1009
+ number
1010
+ ]>;
1011
+ "sky-atmosphere-sun-intensity"?: number;
1012
+ "sky-gradient-center"?: PropertyValueSpecification<[
1013
+ number,
1014
+ number
1015
+ ]>;
1016
+ "sky-gradient-radius"?: PropertyValueSpecification<number>;
1017
+ "sky-gradient"?: ExpressionSpecification;
1018
+ "sky-atmosphere-halo-color"?: ColorSpecification;
1019
+ "sky-atmosphere-color"?: ColorSpecification;
1020
+ "sky-opacity"?: PropertyValueSpecification<number>;
1021
+ "sky-opacity-transition"?: TransitionSpecification;
1022
+ };
1023
+ };
1024
+ type SlotLayerSpecification = {
1025
+ "id": string;
1026
+ "type": "slot";
1027
+ "metadata"?: unknown;
1028
+ "source"?: never;
1029
+ "source-layer"?: never;
1030
+ "slot"?: string;
1031
+ "minzoom"?: never;
1032
+ "maxzoom"?: never;
1033
+ "filter"?: never;
1034
+ "layout"?: never;
1035
+ "paint"?: never;
1036
+ };
1037
+ type ClipLayerSpecification = {
1038
+ "id": string;
1039
+ "type": "clip";
1040
+ "metadata"?: unknown;
1041
+ "source": string;
1042
+ "source-layer"?: string;
1043
+ "slot"?: string;
1044
+ "minzoom"?: number;
1045
+ "maxzoom"?: number;
1046
+ "filter"?: FilterSpecification;
1047
+ "layout"?: {
1048
+ /**
1049
+ * @experimental This property is experimental and subject to change in future versions.
1050
+ */
1051
+ "clip-layer-types"?: ExpressionSpecification;
1052
+ };
1053
+ "paint"?: never;
1054
+ };
1055
+ type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | RasterParticleLayerSpecification | HillshadeLayerSpecification | ModelLayerSpecification | BackgroundLayerSpecification | SkyLayerSpecification | SlotLayerSpecification | ClipLayerSpecification;
1056
+ /**
1057
+ * Given an array of layers, some of which may contain `ref` properties
1058
+ * whose value is the `id` of another property, return a new array where
1059
+ * such layers have been augmented with the 'type', 'source', etc. properties
1060
+ * from the parent layer, and the `ref` property has been removed.
1061
+ *
1062
+ * The input is not modified. The output may contain references to portions
1063
+ * of the input.
1064
+ *
1065
+ * @private
1066
+ * @param {Array<Layer>} layers
1067
+ * @returns {Array<Layer>}
1068
+ */
1069
+ export function derefLayers(layers: Array<LayerSpecification>): Array<LayerSpecification>;
1070
+ type Command = {
1071
+ command: string;
1072
+ args: Array<any>;
1073
+ };
1074
+ /**
1075
+ * Diff two stylesheet
1076
+ *
1077
+ * Creates semanticly aware diffs that can easily be applied at runtime.
1078
+ * Operations produced by the diff closely resemble the mapbox-gl-js API. Any
1079
+ * error creating the diff will fall back to the 'setStyle' operation.
1080
+ *
1081
+ * Example diff:
1082
+ * [
1083
+ * { command: 'setConstant', args: ['@water', '#0000FF'] },
1084
+ * { command: 'setPaintProperty', args: ['background', 'background-color', 'black'] }
1085
+ * ]
1086
+ *
1087
+ * @private
1088
+ * @param {*} [before] stylesheet to compare from
1089
+ * @param {*} after stylesheet to compare to
1090
+ * @returns Array list of changes
1091
+ */
1092
+ declare function diffStyles(before: StyleSpecification, after: StyleSpecification): Array<Command>;
1093
+ export declare class ValidationError {
1094
+ message: string;
1095
+ identifier: string | null | undefined;
1096
+ line: number | null | undefined;
1097
+ constructor(key: string | null | undefined, value: {
1098
+ __line__: number;
1099
+ } | null | undefined, message: string, identifier?: string | null);
1100
+ }
1101
+ export declare class ParsingError {
1102
+ message: string;
1103
+ error: Error;
1104
+ line: number;
1105
+ constructor(error: Error);
1106
+ }
1107
+ declare class ParsingError$1 extends Error {
1108
+ key: string;
1109
+ message: string;
1110
+ constructor(key: string, message: string);
1111
+ }
1112
+ type LUT = {
1113
+ image: {
1114
+ width: number;
1115
+ height: number;
1116
+ data: Uint8Array;
1117
+ };
1118
+ };
1119
+ /**
1120
+ * An RGBA color value. Create instances from color strings using the static
1121
+ * method `Color.parse`. The constructor accepts RGB channel values in the range
1122
+ * `[0, 1]`, premultiplied by A.
1123
+ *
1124
+ * @param {number} r The red channel.
1125
+ * @param {number} g The green channel.
1126
+ * @param {number} b The blue channel.
1127
+ * @param {number} a The alpha channel.
1128
+ * @private
1129
+ */
1130
+ export declare class Color {
1131
+ r: number;
1132
+ g: number;
1133
+ b: number;
1134
+ a: number;
1135
+ constructor(r: number, g: number, b: number, a?: number);
1136
+ static black: Color;
1137
+ static white: Color;
1138
+ static transparent: Color;
1139
+ static red: Color;
1140
+ static blue: Color;
1141
+ /**
1142
+ * Parses valid CSS color strings and returns a `Color` instance.
1143
+ * @returns A `Color` instance, or `undefined` if the input is not a valid color string.
1144
+ */
1145
+ static parse(input?: string | Color | null): Color | void;
1146
+ /**
1147
+ * Returns an RGBA string representing the color value.
1148
+ *
1149
+ * @returns An RGBA string.
1150
+ * @example
1151
+ * var purple = new Color.parse('purple');
1152
+ * purple.toString; // = "rgba(128,0,128,1)"
1153
+ * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
1154
+ * translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
1155
+ */
1156
+ toString(): string;
1157
+ toRenderColor(lut: LUT | null): RenderColor;
1158
+ }
1159
+ declare class RenderColor {
1160
+ r: number;
1161
+ g: number;
1162
+ b: number;
1163
+ a: number;
1164
+ constructor(lut: LUT | null, r: number, g: number, b: number, a: number);
1165
+ /**
1166
+ * Returns an RGBA array of values representing the color, unpremultiplied by A.
1167
+ *
1168
+ * @returns An array of RGBA color values in the range [0, 255].
1169
+ */
1170
+ toArray(): [
1171
+ number,
1172
+ number,
1173
+ number,
1174
+ number
1175
+ ];
1176
+ /**
1177
+ * Returns a RGBA array of float values representing the color, unpremultiplied by A.
1178
+ *
1179
+ * @returns An array of RGBA color values in the range [0, 1].
1180
+ */
1181
+ toArray01(): [
1182
+ number,
1183
+ number,
1184
+ number,
1185
+ number
1186
+ ];
1187
+ /**
1188
+ * Returns an RGB array of values representing the color, unpremultiplied by A and multiplied by a scalar.
1189
+ *
1190
+ * @param {number} scale A scale to apply to the unpremultiplied-alpha values.
1191
+ * @returns An array of RGB color values in the range [0, 1].
1192
+ */
1193
+ toArray01Scaled(scale: number): [
1194
+ number,
1195
+ number,
1196
+ number
1197
+ ];
1198
+ /**
1199
+ * Returns an RGBA array of values representing the color, premultiplied by A.
1200
+ *
1201
+ * @returns An array of RGBA color values in the range [0, 1].
1202
+ */
1203
+ toArray01PremultipliedAlpha(): [
1204
+ number,
1205
+ number,
1206
+ number,
1207
+ number
1208
+ ];
1209
+ /**
1210
+ * Returns an RGBA array of values representing the color, unpremultiplied by A, and converted to linear color space.
1211
+ * The color is defined by sRGB primaries, but the sRGB transfer function is reversed to obtain linear energy.
1212
+ *
1213
+ * @returns An array of RGBA color values in the range [0, 1].
1214
+ */
1215
+ toArray01Linear(): [
1216
+ number,
1217
+ number,
1218
+ number,
1219
+ number
1220
+ ];
1221
+ }
1222
+ declare class Collator {
1223
+ locale: string | null;
1224
+ sensitivity: "base" | "accent" | "case" | "variant";
1225
+ collator: Intl.Collator;
1226
+ constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null);
1227
+ compare(lhs: string, rhs: string): number;
1228
+ resolvedLocale(): string;
1229
+ }
1230
+ type ResolvedImageOptions = {
1231
+ namePrimary: string;
1232
+ nameSecondary: string | null | undefined;
1233
+ available: boolean;
1234
+ };
1235
+ declare class ResolvedImage {
1236
+ namePrimary: string;
1237
+ nameSecondary: string | null | undefined;
1238
+ available: boolean;
1239
+ constructor(options: ResolvedImageOptions);
1240
+ toString(): string;
1241
+ static fromString(namePrimary: string, nameSecondary?: string | null): ResolvedImage | null;
1242
+ serialize(): Array<string>;
1243
+ }
1244
+ declare class FormattedSection {
1245
+ text: string;
1246
+ image: ResolvedImage | null;
1247
+ scale: number | null;
1248
+ fontStack: string | null;
1249
+ textColor: Color | null;
1250
+ constructor(text: string, image: ResolvedImage | null, scale: number | null, fontStack: string | null, textColor: Color | null);
1251
+ }
1252
+ declare class Formatted {
1253
+ sections: Array<FormattedSection>;
1254
+ constructor(sections: Array<FormattedSection>);
1255
+ static fromString(unformatted: string): Formatted;
1256
+ isEmpty(): boolean;
1257
+ static factory(text: Formatted | string): Formatted;
1258
+ toString(): string;
1259
+ serialize(): Array<unknown>;
1260
+ }
1261
+ type NullTypeT = {
1262
+ kind: "null";
1263
+ };
1264
+ type NumberTypeT = {
1265
+ kind: "number";
1266
+ };
1267
+ type StringTypeT = {
1268
+ kind: "string";
1269
+ };
1270
+ type BooleanTypeT = {
1271
+ kind: "boolean";
1272
+ };
1273
+ type ColorTypeT = {
1274
+ kind: "color";
1275
+ };
1276
+ type ObjectTypeT = {
1277
+ kind: "object";
1278
+ };
1279
+ type ValueTypeT = {
1280
+ kind: "value";
1281
+ };
1282
+ type ErrorTypeT = {
1283
+ kind: "error";
1284
+ };
1285
+ type CollatorTypeT = {
1286
+ kind: "collator";
1287
+ };
1288
+ type FormattedTypeT = {
1289
+ kind: "formatted";
1290
+ };
1291
+ type ResolvedImageTypeT = {
1292
+ kind: "resolvedImage";
1293
+ };
1294
+ type EvaluationKind = "constant" | "source" | "camera" | "composite";
1295
+ type Type = NullTypeT | NumberTypeT | StringTypeT | BooleanTypeT | ColorTypeT | ObjectTypeT | ValueTypeT | // eslint-disable-line no-use-before-define
1296
+ ArrayType | ErrorTypeT | CollatorTypeT | FormattedTypeT | ResolvedImageTypeT;
1297
+ type ArrayType = {
1298
+ kind: "array";
1299
+ itemType: Type;
1300
+ N: number | null | undefined;
1301
+ };
1302
+ type Value = null | string | boolean | number | Color | Collator | Formatted | ResolvedImage | ReadonlyArray<Value> | {
1303
+ readonly [key: string]: Value;
1304
+ };
1305
+ type CanonicalTileID = {
1306
+ z: number;
1307
+ x: number;
1308
+ y: number;
1309
+ };
1310
+ type FeatureDistanceData = {
1311
+ bearing: [
1312
+ number,
1313
+ number
1314
+ ];
1315
+ center: [
1316
+ number,
1317
+ number
1318
+ ];
1319
+ scale: number;
1320
+ };
1321
+ type FilterExpression = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData) => boolean;
1322
+ type FeatureFilter = {
1323
+ filter: FilterExpression;
1324
+ dynamicFilter?: FilterExpression;
1325
+ needGeometry: boolean;
1326
+ needFeature: boolean;
1327
+ };
1328
+ declare function isExpressionFilter(filter: any): boolean;
1329
+ /**
1330
+ * Given a filter expressed as nested arrays, return a new function
1331
+ * that evaluates whether a given feature (with a .properties or .tags property)
1332
+ * passes its test.
1333
+ *
1334
+ * @private
1335
+ * @param {Array} filter mapbox gl filter
1336
+ * @param {string} layerType the type of the layer this filter will be applied to.
1337
+ * @returns {Function} filter-evaluating function
1338
+ */
1339
+ declare function createFilter(filter: any, layerType?: string): FeatureFilter;
1340
+ type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
1341
+ interface Expression {
1342
+ readonly type: Type;
1343
+ value?: any;
1344
+ evaluate(ctx: EvaluationContext): any;
1345
+ eachChild(fn: (arg1: Expression) => void): void;
1346
+ /**
1347
+ * Statically analyze the expression, attempting to enumerate possible outputs. Returns
1348
+ * false if the complete set of outputs is statically undecidable, otherwise true.
1349
+ */
1350
+ outputDefined(): boolean;
1351
+ serialize(): SerializedExpression;
1352
+ }
1353
+ type ConfigOptionValue = {
1354
+ default: Expression;
1355
+ value?: Expression;
1356
+ values?: Array<unknown>;
1357
+ minValue?: number;
1358
+ maxValue?: number;
1359
+ stepValue?: number;
1360
+ type?: "string" | "number" | "boolean" | "color";
1361
+ };
1362
+ type ConfigOptions = Map<string, ConfigOptionValue>;
1363
+ declare class EvaluationContext {
1364
+ globals: GlobalProperties;
1365
+ feature: Feature | null | undefined;
1366
+ featureState: FeatureState | null | undefined;
1367
+ formattedSection: FormattedSection | null | undefined;
1368
+ availableImages: Array<string> | null | undefined;
1369
+ canonical: null | CanonicalTileID;
1370
+ featureTileCoord: Point | null | undefined;
1371
+ featureDistanceData: FeatureDistanceData | null | undefined;
1372
+ scope: string | null | undefined;
1373
+ options: ConfigOptions | null | undefined;
1374
+ _parseColorCache: {
1375
+ [_: string]: Color | null | undefined;
1376
+ };
1377
+ constructor(scope?: string | null, options?: ConfigOptions | null);
1378
+ id(): number | null;
1379
+ geometryType(): null | string;
1380
+ geometry(): Array<Array<Point>> | null | undefined;
1381
+ canonicalID(): null | CanonicalTileID;
1382
+ properties(): {
1383
+ [key: string]: any;
1384
+ };
1385
+ measureLight(_: string): number;
1386
+ distanceFromCenter(): number;
1387
+ parseColor(input: string): Color | null | undefined;
1388
+ getConfig(id: string): ConfigOptionValue | null | undefined;
1389
+ }
1390
+ type Result<T, E> = {
1391
+ result: "success";
1392
+ value: T;
1393
+ } | {
1394
+ result: "error";
1395
+ value: E;
1396
+ };
1397
+ type InterpolationType = {
1398
+ name: "linear";
1399
+ } | {
1400
+ name: "exponential";
1401
+ base: number;
1402
+ } | {
1403
+ name: "cubic-bezier";
1404
+ controlPoints: [
1405
+ number,
1406
+ number,
1407
+ number,
1408
+ number
1409
+ ];
1410
+ };
1411
+ interface Feature {
1412
+ readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "LineString" | "Polygon";
1413
+ readonly id?: number | null;
1414
+ readonly properties: {
1415
+ [_: string]: any;
1416
+ };
1417
+ readonly patterns?: {
1418
+ [_: string]: string;
1419
+ };
1420
+ readonly geometry?: Array<Array<Point>>;
1421
+ }
1422
+ type FeatureState = {
1423
+ [_: string]: any;
1424
+ };
1425
+ interface GlobalProperties {
1426
+ zoom: number;
1427
+ pitch?: number;
1428
+ heatmapDensity?: number;
1429
+ lineProgress?: number;
1430
+ rasterValue?: number;
1431
+ rasterParticleSpeed?: number;
1432
+ skyRadialProgress?: number;
1433
+ readonly isSupportedScript?: (_: string) => boolean;
1434
+ accumulated?: Value;
1435
+ brightness?: number;
1436
+ }
1437
+ declare class StyleExpression {
1438
+ expression: Expression;
1439
+ _evaluator: EvaluationContext;
1440
+ _defaultValue: Value;
1441
+ _warningHistory: {
1442
+ [key: string]: boolean;
1443
+ };
1444
+ _enumValues?: {
1445
+ [_: string]: unknown;
1446
+ };
1447
+ constructor(expression: Expression, propertySpec?: StylePropertySpecification, scope?: string, options?: ConfigOptions);
1448
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any;
1449
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any;
1450
+ }
1451
+ declare function isExpression(expression: unknown): boolean;
1452
+ declare function createExpression(expression: unknown, propertySpec?: StylePropertySpecification | null, scope?: string | null, options?: ConfigOptions | null): Result<StyleExpression, Array<ParsingError$1>>;
1453
+ declare class ZoomConstantExpression<Kind extends EvaluationKind> {
1454
+ kind: Kind;
1455
+ isStateDependent: boolean;
1456
+ isConfigDependent: boolean;
1457
+ _styleExpression: StyleExpression;
1458
+ isLightConstant: boolean | null | undefined;
1459
+ constructor(kind: Kind, expression: StyleExpression, isLightConstant?: boolean | null);
1460
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1461
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1462
+ }
1463
+ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
1464
+ kind: Kind;
1465
+ zoomStops: Array<number>;
1466
+ isStateDependent: boolean;
1467
+ isLightConstant: boolean | null | undefined;
1468
+ isConfigDependent: boolean;
1469
+ _styleExpression: StyleExpression;
1470
+ interpolationType: InterpolationType | null | undefined;
1471
+ constructor(kind: Kind, expression: StyleExpression, zoomStops: Array<number>, interpolationType?: InterpolationType, isLightConstant?: boolean | null);
1472
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1473
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1474
+ interpolationFactor(input: number, lower: number, upper: number): number;
1475
+ }
1476
+ type ConstantExpression = {
1477
+ kind: "constant";
1478
+ isConfigDependent: boolean;
1479
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1480
+ };
1481
+ type SourceExpression = {
1482
+ kind: "source";
1483
+ isStateDependent: boolean;
1484
+ isLightConstant: boolean | null | undefined;
1485
+ isConfigDependent: boolean;
1486
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1487
+ };
1488
+ type CameraExpression = {
1489
+ kind: "camera";
1490
+ isStateDependent: boolean;
1491
+ isConfigDependent: boolean;
1492
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1493
+ readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1494
+ zoomStops: Array<number>;
1495
+ interpolationType: InterpolationType | null | undefined;
1496
+ };
1497
+ interface CompositeExpression {
1498
+ kind: "composite";
1499
+ isStateDependent: boolean;
1500
+ isLightConstant: boolean | null | undefined;
1501
+ isConfigDependent: boolean;
1502
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1503
+ readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1504
+ zoomStops: Array<number>;
1505
+ interpolationType: InterpolationType | null | undefined;
1506
+ }
1507
+ type StylePropertyExpression = ConstantExpression | SourceExpression | CameraExpression | CompositeExpression;
1508
+ declare function createPropertyExpression(expression: unknown, propertySpec: StylePropertySpecification, scope?: string | null, options?: ConfigOptions | null): Result<StylePropertyExpression, Array<ParsingError$1>>;
1509
+ declare class StylePropertyFunction<T> {
1510
+ _parameters: PropertyValueSpecification<T>;
1511
+ _specification: StylePropertySpecification;
1512
+ kind: EvaluationKind;
1513
+ evaluate: (globals: GlobalProperties, feature?: Feature) => any;
1514
+ interpolationFactor: (input: number, lower: number, upper: number) => number | null | undefined;
1515
+ zoomStops: Array<number> | null | undefined;
1516
+ constructor(parameters: PropertyValueSpecification<T>, specification: StylePropertySpecification);
1517
+ static deserialize<T>(serialized: {
1518
+ _parameters: PropertyValueSpecification<T>;
1519
+ _specification: StylePropertySpecification;
1520
+ }): StylePropertyFunction<T>;
1521
+ static serialize<T>(input: StylePropertyFunction<T>): {
1522
+ _parameters: PropertyValueSpecification<T>;
1523
+ _specification: StylePropertySpecification;
1524
+ };
1525
+ }
1526
+ declare function normalizePropertyExpression<T>(value: PropertyValueSpecification<T>, specification: StylePropertySpecification, scope?: string | null, options?: ConfigOptions | null): StylePropertyExpression;
1527
+ /**
1528
+ * Convert the given legacy filter to (the JSON representation of) an
1529
+ * equivalent expression
1530
+ * @private
1531
+ */
1532
+ export function convertFilter(filter: FilterSpecification): unknown;
1533
+ declare function isFunction(value: any): boolean;
1534
+ declare function createFunction(parameters: any, propertySpec: any): {
1535
+ kind: string;
1536
+ interpolationType: {
1537
+ name: string;
1538
+ };
1539
+ interpolationFactor: any;
1540
+ zoomStops: any[];
1541
+ evaluate({ zoom }: {
1542
+ zoom: any;
1543
+ }, properties: any): any;
1544
+ } | {
1545
+ kind: string;
1546
+ interpolationType: {
1547
+ name: string;
1548
+ base: any;
1549
+ };
1550
+ interpolationFactor: any;
1551
+ zoomStops: any;
1552
+ evaluate: ({ zoom }: {
1553
+ zoom: any;
1554
+ }) => any;
1555
+ } | {
1556
+ kind: string;
1557
+ evaluate(_: any, feature: any): any;
1558
+ interpolationType?: undefined;
1559
+ interpolationFactor?: undefined;
1560
+ zoomStops?: undefined;
1561
+ };
1562
+ type Stop = [
1563
+ {
1564
+ zoom: number;
1565
+ value: string | number | boolean;
1566
+ },
1567
+ unknown
1568
+ ];
1569
+ type FunctionParameters = {
1570
+ stops: Array<Stop>;
1571
+ base: number;
1572
+ property: string;
1573
+ type: "identity" | "exponential" | "interval" | "categorical";
1574
+ colorSpace: "rgb" | "lab" | "hcl";
1575
+ default: unknown;
1576
+ };
1577
+ declare function convertFunction(parameters: FunctionParameters, propertySpec: StylePropertySpecification): ExpressionSpecification;
1578
+ declare function eachSource(style: StyleSpecification, callback: (_: SourceSpecification) => void): void;
1579
+ declare function eachLayer(style: StyleSpecification, callback: (_: LayerSpecification) => void): void;
1580
+ type PropertyCallback = (arg1: {
1581
+ path: [
1582
+ string,
1583
+ "paint" | "layout",
1584
+ string
1585
+ ];
1586
+ key: string;
1587
+ value: PropertyValueSpecification<unknown>;
1588
+ reference: StylePropertySpecification;
1589
+ set: (arg1: PropertyValueSpecification<unknown>) => void;
1590
+ }) => void;
1591
+ declare function eachProperty(style: StyleSpecification, options: {
1592
+ paint?: boolean;
1593
+ layout?: boolean;
1594
+ }, callback: PropertyCallback): void;
1595
+ type ValidationError$1 = {
1596
+ message: string;
1597
+ identifier?: string | null | undefined;
1598
+ line?: number | null | undefined;
1599
+ };
1600
+ type ValidationErrors = ReadonlyArray<ValidationError$1>;
1601
+ /**
1602
+ * Validate a Mapbox GL style against the style specification.
1603
+ *
1604
+ * @private
1605
+ * @alias validate
1606
+ * @param {Object|String|Buffer} style The style to be validated. If a `String`
1607
+ * or `Buffer` is provided, the returned errors will contain line numbers.
1608
+ * @param {Object} [styleSpec] The style specification to validate against.
1609
+ * If omitted, the spec version is inferred from the stylesheet.
1610
+ * @returns {Array<ValidationError|ParsingError>}
1611
+ * @example
1612
+ * var validate = require('mapbox-gl-style-spec').validate;
1613
+ * var style = fs.readFileSync('./style.json', 'utf8');
1614
+ * var errors = validate(style);
1615
+ */
1616
+ declare function validateStyle(style: StyleSpecification | string | Buffer, styleSpec?: any): ValidationErrors;
1617
+ /**
1618
+ * Validate a Mapbox GL style against the style specification and check for
1619
+ * compatibility with the Mapbox Styles API.
1620
+ *
1621
+ * @param {Object} style The style to be validated.
1622
+ * @returns {Array<ValidationError>}
1623
+ * @example
1624
+ * var validateMapboxApiSupported = require('mapbox-gl-style-spec/lib/validate_style_mapbox_api_supported.js');
1625
+ * var errors = validateMapboxApiSupported(style);
1626
+ */
1627
+ export function validateMapboxApiSupported(style: any, styleSpec?: any): ValidationErrors;
1628
+ type ExpressionType = "data-driven" | "color-ramp" | "data-constant" | "constant";
1629
+ type ExpressionParameters = Array<"zoom" | "feature" | "feature-state" | "heatmap-density" | "line-progress" | "raster-value" | "sky-radial-progress" | "pitch" | "distance-from-center" | "measure-light" | "raster-particle-speed">;
1630
+ type ExpressionSpecification$1 = {
1631
+ interpolated: boolean;
1632
+ parameters?: ExpressionParameters;
1633
+ relaxZoomRestriction?: boolean;
1634
+ };
1635
+ export type StylePropertySpecification = {
1636
+ type: "number";
1637
+ "property-type": ExpressionType;
1638
+ expression?: ExpressionSpecification$1;
1639
+ transition?: boolean;
1640
+ default?: number;
1641
+ } | {
1642
+ type: "string";
1643
+ "property-type": ExpressionType;
1644
+ expression?: ExpressionSpecification$1;
1645
+ transition?: boolean;
1646
+ default?: string;
1647
+ tokens?: boolean;
1648
+ } | {
1649
+ type: "boolean";
1650
+ "property-type": ExpressionType;
1651
+ expression?: ExpressionSpecification$1;
1652
+ transition?: boolean;
1653
+ default?: boolean;
1654
+ } | {
1655
+ type: "enum";
1656
+ "property-type": ExpressionType;
1657
+ expression?: ExpressionSpecification$1;
1658
+ values: {
1659
+ [_: string]: unknown;
1660
+ };
1661
+ transition?: boolean;
1662
+ default?: string;
1663
+ } | {
1664
+ type: "color";
1665
+ "property-type": ExpressionType;
1666
+ expression?: ExpressionSpecification$1;
1667
+ transition?: boolean;
1668
+ default?: string;
1669
+ overridable: boolean;
1670
+ } | {
1671
+ type: "array";
1672
+ value: "number";
1673
+ "property-type": ExpressionType;
1674
+ expression?: ExpressionSpecification$1;
1675
+ length?: number;
1676
+ transition?: boolean;
1677
+ default?: Array<number>;
1678
+ } | {
1679
+ type: "array";
1680
+ value: "string";
1681
+ "property-type": ExpressionType;
1682
+ expression?: ExpressionSpecification$1;
1683
+ length?: number;
1684
+ transition?: boolean;
1685
+ default?: Array<string>;
1686
+ } | {
1687
+ type: "resolvedImage";
1688
+ "property-type": ExpressionType;
1689
+ expression?: ExpressionSpecification$1;
1690
+ transition?: boolean;
1691
+ default?: string;
1692
+ };
1693
+ export declare const expression: {
1694
+ StyleExpression: typeof StyleExpression;
1695
+ isExpression: typeof isExpression;
1696
+ isExpressionFilter: typeof isExpressionFilter;
1697
+ createExpression: typeof createExpression;
1698
+ createPropertyExpression: typeof createPropertyExpression;
1699
+ normalizePropertyExpression: typeof normalizePropertyExpression;
1700
+ ZoomConstantExpression: typeof ZoomConstantExpression;
1701
+ ZoomDependentExpression: typeof ZoomDependentExpression;
1702
+ StylePropertyFunction: typeof StylePropertyFunction;
1703
+ };
1704
+ declare const styleFunction: {
1705
+ convertFunction: typeof convertFunction;
1706
+ createFunction: typeof createFunction;
1707
+ isFunction: typeof isFunction;
1708
+ };
1709
+ export declare const visit: {
1710
+ eachSource: typeof eachSource;
1711
+ eachLayer: typeof eachLayer;
1712
+ eachProperty: typeof eachProperty;
1713
+ };
1714
+
1715
+ export {
1716
+ ExpressionSpecification$1 as ExpressionSpecification,
1717
+ _default as latest,
1718
+ _default$1 as migrate,
1719
+ _default$2 as composite,
1720
+ createFilter as featureFilter,
1721
+ diffStyles as diff,
1722
+ styleFunction as function,
1723
+ validateStyle as validate,
1724
+ };
1725
+
1726
+ export {};