@mapbox/mapbox-gl-style-spec 14.4.0 → 14.5.0

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