maplibre-gl 2.2.0 → 2.3.1-pre.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 (80) hide show
  1. package/build/generate-struct-arrays.ts +0 -2
  2. package/build/generate-style-spec.ts +2 -3
  3. package/build/generate-typings.ts +12 -2
  4. package/build/rollup_plugins.ts +0 -4
  5. package/dist/maplibre-gl-csp-worker.js +1 -1
  6. package/dist/maplibre-gl-csp.js +1 -1
  7. package/dist/maplibre-gl-dev.js +368 -1404
  8. package/dist/maplibre-gl.d.ts +19 -11
  9. package/dist/maplibre-gl.js +4 -4
  10. package/dist/style-spec/index.d.ts +1779 -0
  11. package/package.json +10 -12
  12. package/src/data/array_types.g.ts +0 -5
  13. package/src/data/bucket/fill_bucket.ts +0 -2
  14. package/src/data/bucket/fill_extrusion_bucket.ts +0 -2
  15. package/src/data/bucket/symbol_bucket.test.ts +30 -19
  16. package/src/data/feature_position_map.ts +1 -2
  17. package/src/gl/framebuffer.ts +3 -2
  18. package/src/gl/index_buffer.ts +1 -2
  19. package/src/gl/vertex_buffer.ts +1 -2
  20. package/src/index.test.ts +9 -0
  21. package/src/index.ts +12 -4
  22. package/src/render/image_manager.ts +5 -7
  23. package/src/render/program/pattern.ts +0 -2
  24. package/src/render/program.ts +0 -4
  25. package/src/render/vertex_array_object.ts +1 -3
  26. package/src/source/geojson_worker_source.ts +0 -4
  27. package/src/source/query_features.ts +0 -3
  28. package/src/source/rtl_text_plugin.ts +3 -4
  29. package/src/source/source_cache.ts +0 -2
  30. package/src/source/tile_id.ts +8 -8
  31. package/src/source/worker.ts +2 -11
  32. package/src/source/worker_tile.ts +12 -3
  33. package/src/style/format_section_override.ts +1 -2
  34. package/src/style/properties.ts +1 -3
  35. package/src/style/style.ts +5 -5
  36. package/src/style/style_layer/custom_style_layer.ts +1 -2
  37. package/src/style/style_layer/symbol_style_layer.ts +1 -3
  38. package/src/style-spec/CHANGELOG.md +10 -0
  39. package/src/style-spec/composite.test.ts +7 -8
  40. package/src/style-spec/expression/compound_expression.ts +0 -4
  41. package/src/style-spec/expression/definitions/assertion.ts +2 -4
  42. package/src/style-spec/expression/definitions/case.ts +1 -2
  43. package/src/style-spec/expression/definitions/coalesce.ts +1 -3
  44. package/src/style-spec/expression/definitions/coercion.ts +2 -4
  45. package/src/style-spec/expression/definitions/match.ts +0 -3
  46. package/src/style-spec/expression/index.ts +13 -15
  47. package/src/style-spec/expression/parsing_context.ts +4 -4
  48. package/src/style-spec/expression/parsing_error.ts +2 -2
  49. package/src/style-spec/expression/values.ts +0 -2
  50. package/src/style-spec/feature_filter/feature_filter.test.ts +7 -0
  51. package/src/style-spec/function/convert.ts +1 -3
  52. package/src/style-spec/migrate/v8.test.ts +12 -14
  53. package/src/style-spec/migrate/v9.test.ts +2 -4
  54. package/src/style-spec/migrate.test.ts +6 -8
  55. package/src/style-spec/package.json +2 -1
  56. package/src/style-spec/reference/latest.ts +1 -1
  57. package/src/style-spec/style-spec.ts +11 -10
  58. package/src/style-spec/types.g.ts +2 -3
  59. package/src/symbol/collision_index.ts +0 -3
  60. package/src/symbol/path_interpolator.ts +0 -2
  61. package/src/symbol/placement.ts +14 -9
  62. package/src/symbol/shaping.ts +0 -4
  63. package/src/symbol/symbol_layout.ts +56 -56
  64. package/src/ui/camera.ts +0 -10
  65. package/src/ui/control/geolocate_control.ts +4 -6
  66. package/src/ui/handler/handler_util.ts +1 -2
  67. package/src/ui/handler/scroll_zoom.ts +0 -2
  68. package/src/ui/handler_manager.ts +0 -2
  69. package/src/ui/map.test.ts +11 -0
  70. package/src/ui/map.ts +11 -0
  71. package/src/util/ajax.ts +1 -2
  72. package/src/util/color_ramp.ts +1 -2
  73. package/src/util/dictionary_coder.ts +1 -3
  74. package/src/util/dispatcher.ts +1 -4
  75. package/src/util/dom.ts +0 -3
  76. package/src/util/image.ts +1 -3
  77. package/src/util/struct_array.ts +0 -5
  78. package/src/util/task_queue.ts +1 -3
  79. package/src/util/util.ts +2 -3
  80. package/src/util/web_worker_transfer.ts +5 -6
@@ -0,0 +1,1779 @@
1
+ // Generated by dts-bundle-generator v6.12.0
2
+
3
+ import Point from '@mapbox/point-geometry';
4
+
5
+ declare const _default: any;
6
+ /**
7
+ * Format a MapLibre GL Style. Returns a stringified style with its keys
8
+ * sorted in the same order as the reference style.
9
+ *
10
+ * The optional `space` argument is passed to
11
+ * [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
12
+ * to generate formatted output.
13
+ *
14
+ * If `space` is unspecified, a default of `2` spaces will be used.
15
+ *
16
+ * @private
17
+ * @param {Object} style a MapLibre GL Style
18
+ * @param {number} [space] space argument to pass to `JSON.stringify`
19
+ * @returns {string} stringified formatted JSON
20
+ * @example
21
+ * var fs = require('fs');
22
+ * var format = require('maplibre-gl-style-spec').format;
23
+ * var style = fs.readFileSync('./source.json', 'utf8');
24
+ * fs.writeFileSync('./dest.json', format(style));
25
+ * fs.writeFileSync('./dest.min.json', format(style, 0));
26
+ */
27
+ export declare function format(style: any, space?: number): string;
28
+ export declare type ColorSpecification = string;
29
+ export declare type PaddingSpecification = number | number[];
30
+ export declare type FormattedSpecification = string;
31
+ export declare type ResolvedImageSpecification = string;
32
+ export declare type PromoteIdSpecification = {
33
+ [_: string]: string;
34
+ } | string;
35
+ export declare type ExpressionInputType = string | number | boolean;
36
+ export declare type CollatorExpressionSpecification = [
37
+ "collator",
38
+ {
39
+ "case-sensitive"?: boolean | ExpressionSpecification;
40
+ "diacritic-sensitive"?: boolean | ExpressionSpecification;
41
+ locale?: string | ExpressionSpecification;
42
+ }
43
+ ];
44
+ export declare type InterpolationSpecification = [
45
+ "linear"
46
+ ] | [
47
+ "exponential",
48
+ number | ExpressionSpecification
49
+ ] | [
50
+ "cubic-bezier",
51
+ number | ExpressionSpecification,
52
+ number | ExpressionSpecification,
53
+ number | ExpressionSpecification,
54
+ number | ExpressionSpecification
55
+ ];
56
+ export declare type ExpressionSpecification = [
57
+ "array",
58
+ unknown | ExpressionSpecification
59
+ ] | [
60
+ "array",
61
+ ExpressionInputType | ExpressionSpecification,
62
+ unknown | ExpressionSpecification
63
+ ] | [
64
+ "array",
65
+ ExpressionInputType | ExpressionSpecification,
66
+ number | ExpressionSpecification,
67
+ unknown | ExpressionSpecification
68
+ ] | [
69
+ "boolean",
70
+ ...(unknown | ExpressionSpecification)[],
71
+ unknown | ExpressionSpecification
72
+ ] | CollatorExpressionSpecification | [
73
+ "format",
74
+ ...(string | [
75
+ "image",
76
+ ExpressionSpecification
77
+ ] | ExpressionSpecification | {
78
+ "font-scale"?: number | ExpressionSpecification;
79
+ "text-font"?: string[] | ExpressionSpecification;
80
+ "text-color": ColorSpecification | ExpressionSpecification;
81
+ })[]
82
+ ] | [
83
+ "image",
84
+ unknown | ExpressionSpecification
85
+ ] | [
86
+ "literal",
87
+ unknown
88
+ ] | [
89
+ "number",
90
+ unknown | ExpressionSpecification,
91
+ ...(unknown | ExpressionSpecification)[]
92
+ ] | [
93
+ "number-format",
94
+ number | ExpressionSpecification,
95
+ {
96
+ "locale"?: string | ExpressionSpecification;
97
+ "currency"?: string | ExpressionSpecification;
98
+ "min-fraction-digits"?: number | ExpressionSpecification;
99
+ "max-fraction-digits"?: number | ExpressionSpecification;
100
+ }
101
+ ] | [
102
+ "object",
103
+ unknown | ExpressionSpecification,
104
+ ...(unknown | ExpressionSpecification)[]
105
+ ] | [
106
+ "string",
107
+ unknown | ExpressionSpecification,
108
+ ...(unknown | ExpressionSpecification)[]
109
+ ] | [
110
+ "to-boolean",
111
+ unknown | ExpressionSpecification
112
+ ] | [
113
+ "to-color",
114
+ unknown | ExpressionSpecification,
115
+ ...(unknown | ExpressionSpecification)[]
116
+ ] | [
117
+ "to-number",
118
+ unknown | ExpressionSpecification,
119
+ ...(unknown | ExpressionSpecification)[]
120
+ ] | [
121
+ "to-string",
122
+ unknown | ExpressionSpecification
123
+ ] | [
124
+ "accumulated"
125
+ ] | [
126
+ "feature-state",
127
+ string
128
+ ] | [
129
+ "geometry-type"
130
+ ] | [
131
+ "id"
132
+ ] | [
133
+ "line-progress"
134
+ ] | [
135
+ "properties"
136
+ ] | [
137
+ "at",
138
+ number | ExpressionSpecification,
139
+ ExpressionSpecification
140
+ ] | [
141
+ "get",
142
+ string | ExpressionSpecification,
143
+ (Record<string, unknown> | ExpressionSpecification)?
144
+ ] | [
145
+ "has",
146
+ string | ExpressionSpecification,
147
+ (Record<string, unknown> | ExpressionSpecification)?
148
+ ] | [
149
+ "in",
150
+ ExpressionInputType | ExpressionSpecification,
151
+ ExpressionInputType | ExpressionSpecification
152
+ ] | [
153
+ "index-of",
154
+ ExpressionInputType | ExpressionSpecification,
155
+ ExpressionInputType | ExpressionSpecification
156
+ ] | [
157
+ "length",
158
+ string | ExpressionSpecification
159
+ ] | [
160
+ "slice",
161
+ string | ExpressionSpecification,
162
+ number | ExpressionSpecification
163
+ ] | [
164
+ "!",
165
+ boolean | ExpressionSpecification
166
+ ] | [
167
+ "!=",
168
+ ExpressionInputType | ExpressionSpecification,
169
+ ExpressionInputType | ExpressionSpecification,
170
+ CollatorExpressionSpecification?
171
+ ] | [
172
+ "<",
173
+ ExpressionInputType | ExpressionSpecification,
174
+ ExpressionInputType | ExpressionSpecification,
175
+ CollatorExpressionSpecification?
176
+ ] | [
177
+ "<=",
178
+ ExpressionInputType | ExpressionSpecification,
179
+ ExpressionInputType | ExpressionSpecification,
180
+ CollatorExpressionSpecification?
181
+ ] | [
182
+ "==",
183
+ ExpressionInputType | ExpressionSpecification,
184
+ ExpressionInputType | ExpressionSpecification,
185
+ CollatorExpressionSpecification?
186
+ ] | [
187
+ ">",
188
+ ExpressionInputType | ExpressionSpecification,
189
+ ExpressionInputType | ExpressionSpecification,
190
+ CollatorExpressionSpecification?
191
+ ] | [
192
+ ">=",
193
+ ExpressionInputType | ExpressionSpecification,
194
+ ExpressionInputType | ExpressionSpecification,
195
+ CollatorExpressionSpecification?
196
+ ] | [
197
+ "all",
198
+ ...(boolean | ExpressionSpecification)[]
199
+ ] | [
200
+ "any",
201
+ ...(boolean | ExpressionSpecification)[]
202
+ ] | [
203
+ "case",
204
+ boolean | ExpressionSpecification,
205
+ ExpressionInputType | ExpressionSpecification,
206
+ ...(boolean | ExpressionInputType | ExpressionSpecification)[],
207
+ ExpressionInputType | ExpressionSpecification
208
+ ] | [
209
+ "coalesce",
210
+ ExpressionInputType | ExpressionSpecification,
211
+ ExpressionInputType | ExpressionSpecification,
212
+ ...(ExpressionInputType | ExpressionSpecification)[]
213
+ ] | [
214
+ "match",
215
+ ExpressionInputType | ExpressionSpecification,
216
+ ExpressionInputType | ExpressionInputType[],
217
+ ExpressionInputType | ExpressionSpecification,
218
+ ...(ExpressionInputType | ExpressionInputType[] | ExpressionSpecification)[],
219
+ ExpressionInputType
220
+ ] | [
221
+ "within",
222
+ unknown | ExpressionSpecification
223
+ ] | [
224
+ "interpolate",
225
+ InterpolationSpecification,
226
+ number | ExpressionSpecification,
227
+ ...(number | ExpressionInputType | ExpressionSpecification)[]
228
+ ] | [
229
+ "interpolate-hcl",
230
+ InterpolationSpecification,
231
+ number | ExpressionSpecification,
232
+ number | ExpressionSpecification,
233
+ ExpressionInputType | ExpressionSpecification,
234
+ ...(number | ColorSpecification | ExpressionSpecification)[]
235
+ ] | [
236
+ "interpolate-lab",
237
+ InterpolationSpecification,
238
+ number | ExpressionSpecification,
239
+ number | ExpressionSpecification,
240
+ ExpressionInputType | ExpressionSpecification,
241
+ ...(number | ColorSpecification | ExpressionSpecification)[]
242
+ ] | [
243
+ "step",
244
+ number | ExpressionSpecification,
245
+ number | ExpressionSpecification,
246
+ ExpressionInputType | ExpressionSpecification,
247
+ ...(number | ExpressionInputType | ExpressionSpecification)[]
248
+ ] | [
249
+ "let",
250
+ string,
251
+ ExpressionInputType | ExpressionSpecification,
252
+ ...(string | ExpressionInputType | ExpressionSpecification)[]
253
+ ] | [
254
+ "var",
255
+ string
256
+ ] | [
257
+ "concat",
258
+ ExpressionInputType | ExpressionSpecification,
259
+ ExpressionInputType | ExpressionSpecification,
260
+ ...(ExpressionInputType | ExpressionSpecification)[]
261
+ ] | [
262
+ "downcase",
263
+ string | ExpressionSpecification
264
+ ] | [
265
+ "is-supported-script",
266
+ string | ExpressionSpecification
267
+ ] | [
268
+ "resolved-locale",
269
+ CollatorExpressionSpecification
270
+ ] | [
271
+ "upcase",
272
+ string | ExpressionSpecification
273
+ ] | [
274
+ "rgb",
275
+ number | ExpressionSpecification,
276
+ number | ExpressionSpecification,
277
+ number | ExpressionSpecification
278
+ ] | [
279
+ "rgba",
280
+ number | ExpressionSpecification,
281
+ number | ExpressionSpecification,
282
+ number | ExpressionSpecification,
283
+ number | ExpressionSpecification
284
+ ] | [
285
+ "to-rgba",
286
+ ColorSpecification | ExpressionSpecification
287
+ ] | [
288
+ "-",
289
+ number | ExpressionSpecification,
290
+ (number | ExpressionSpecification)?
291
+ ] | [
292
+ "*",
293
+ number | ExpressionSpecification,
294
+ number | ExpressionSpecification,
295
+ ...(number | ExpressionSpecification)[]
296
+ ] | [
297
+ "/",
298
+ number | ExpressionSpecification,
299
+ number | ExpressionSpecification
300
+ ] | [
301
+ "%",
302
+ number | ExpressionSpecification,
303
+ number | ExpressionSpecification
304
+ ] | [
305
+ "^",
306
+ number | ExpressionSpecification,
307
+ number | ExpressionSpecification
308
+ ] | [
309
+ "+",
310
+ number | ExpressionSpecification,
311
+ number | ExpressionSpecification,
312
+ ...(number | ExpressionSpecification)[]
313
+ ] | [
314
+ "abs",
315
+ number | ExpressionSpecification
316
+ ] | [
317
+ "acos",
318
+ number | ExpressionSpecification
319
+ ] | [
320
+ "asin",
321
+ number | ExpressionSpecification
322
+ ] | [
323
+ "atan",
324
+ number | ExpressionSpecification
325
+ ] | [
326
+ "ceil",
327
+ number | ExpressionSpecification
328
+ ] | [
329
+ "cos",
330
+ number | ExpressionSpecification
331
+ ] | [
332
+ "distance",
333
+ Record<string, unknown> | ExpressionSpecification
334
+ ] | [
335
+ "ExpressionSpecification"
336
+ ] | [
337
+ "floor",
338
+ number | ExpressionSpecification
339
+ ] | [
340
+ "ln",
341
+ number | ExpressionSpecification
342
+ ] | [
343
+ "ln2"
344
+ ] | [
345
+ "log10",
346
+ number | ExpressionSpecification
347
+ ] | [
348
+ "log2",
349
+ number | ExpressionSpecification
350
+ ] | [
351
+ "max",
352
+ number | ExpressionSpecification,
353
+ ...(number | ExpressionSpecification)[]
354
+ ] | [
355
+ "min",
356
+ number | ExpressionSpecification,
357
+ ...(number | ExpressionSpecification)[]
358
+ ] | [
359
+ "pi"
360
+ ] | [
361
+ "round",
362
+ number | ExpressionSpecification
363
+ ] | [
364
+ "sin",
365
+ number | ExpressionSpecification
366
+ ] | [
367
+ "sqrt",
368
+ number | ExpressionSpecification
369
+ ] | [
370
+ "tan",
371
+ number | ExpressionSpecification
372
+ ] | [
373
+ "zoom"
374
+ ] | [
375
+ "heatmap-density"
376
+ ];
377
+ export declare type ExpressionFilterSpecification = boolean | ExpressionSpecification;
378
+ export declare type LegacyFilterSpecification = [
379
+ "has",
380
+ string
381
+ ] | [
382
+ "!has",
383
+ string
384
+ ] | [
385
+ "==",
386
+ string,
387
+ string | number | boolean
388
+ ] | [
389
+ "!=",
390
+ string,
391
+ string | number | boolean
392
+ ] | [
393
+ ">",
394
+ string,
395
+ string | number | boolean
396
+ ] | [
397
+ ">=",
398
+ string,
399
+ string | number | boolean
400
+ ] | [
401
+ "<",
402
+ string,
403
+ string | number | boolean
404
+ ] | [
405
+ "<=",
406
+ string,
407
+ string | number | boolean
408
+ ] | [
409
+ "in",
410
+ string,
411
+ ...(string | number | boolean)[]
412
+ ] | [
413
+ "!in",
414
+ string,
415
+ ...(string | number | boolean)[]
416
+ ] | [
417
+ "all",
418
+ ...LegacyFilterSpecification[]
419
+ ] | [
420
+ "any",
421
+ ...LegacyFilterSpecification[]
422
+ ] | [
423
+ "none",
424
+ ...LegacyFilterSpecification[]
425
+ ];
426
+ export declare type FilterSpecification = ExpressionFilterSpecification | LegacyFilterSpecification;
427
+ export declare type TransitionSpecification = {
428
+ duration?: number;
429
+ delay?: number;
430
+ };
431
+ export declare type CameraFunctionSpecification<T> = {
432
+ type: "exponential";
433
+ stops: Array<[
434
+ number,
435
+ T
436
+ ]>;
437
+ } | {
438
+ type: "interval";
439
+ stops: Array<[
440
+ number,
441
+ T
442
+ ]>;
443
+ };
444
+ export declare type SourceFunctionSpecification<T> = {
445
+ type: "exponential";
446
+ stops: Array<[
447
+ number,
448
+ T
449
+ ]>;
450
+ property: string;
451
+ default?: T;
452
+ } | {
453
+ type: "interval";
454
+ stops: Array<[
455
+ number,
456
+ T
457
+ ]>;
458
+ property: string;
459
+ default?: T;
460
+ } | {
461
+ type: "categorical";
462
+ stops: Array<[
463
+ string | number | boolean,
464
+ T
465
+ ]>;
466
+ property: string;
467
+ default?: T;
468
+ } | {
469
+ type: "identity";
470
+ property: string;
471
+ default?: T;
472
+ };
473
+ export declare type CompositeFunctionSpecification<T> = {
474
+ type: "exponential";
475
+ stops: Array<[
476
+ {
477
+ zoom: number;
478
+ value: number;
479
+ },
480
+ T
481
+ ]>;
482
+ property: string;
483
+ default?: T;
484
+ } | {
485
+ type: "interval";
486
+ stops: Array<[
487
+ {
488
+ zoom: number;
489
+ value: number;
490
+ },
491
+ T
492
+ ]>;
493
+ property: string;
494
+ default?: T;
495
+ } | {
496
+ type: "categorical";
497
+ stops: Array<[
498
+ {
499
+ zoom: number;
500
+ value: string | number | boolean;
501
+ },
502
+ T
503
+ ]>;
504
+ property: string;
505
+ default?: T;
506
+ };
507
+ export declare type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
508
+ export declare type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification;
509
+ export declare type StyleSpecification = {
510
+ "version": 8;
511
+ "name"?: string;
512
+ "metadata"?: unknown;
513
+ "center"?: Array<number>;
514
+ "zoom"?: number;
515
+ "bearing"?: number;
516
+ "pitch"?: number;
517
+ "light"?: LightSpecification;
518
+ "terrain"?: TerrainSpecification;
519
+ "sources": {
520
+ [_: string]: SourceSpecification;
521
+ };
522
+ "sprite"?: string;
523
+ "glyphs"?: string;
524
+ "transition"?: TransitionSpecification;
525
+ "layers": Array<LayerSpecification>;
526
+ };
527
+ export declare type LightSpecification = {
528
+ "anchor"?: PropertyValueSpecification<"map" | "viewport">;
529
+ "position"?: PropertyValueSpecification<[
530
+ number,
531
+ number,
532
+ number
533
+ ]>;
534
+ "color"?: PropertyValueSpecification<ColorSpecification>;
535
+ "intensity"?: PropertyValueSpecification<number>;
536
+ };
537
+ export declare type TerrainSpecification = {
538
+ "source": string;
539
+ "exaggeration"?: number;
540
+ "elevationOffset"?: number;
541
+ };
542
+ export declare type VectorSourceSpecification = {
543
+ "type": "vector";
544
+ "url"?: string;
545
+ "tiles"?: Array<string>;
546
+ "bounds"?: [
547
+ number,
548
+ number,
549
+ number,
550
+ number
551
+ ];
552
+ "scheme"?: "xyz" | "tms";
553
+ "minzoom"?: number;
554
+ "maxzoom"?: number;
555
+ "attribution"?: string;
556
+ "promoteId"?: PromoteIdSpecification;
557
+ "volatile"?: boolean;
558
+ };
559
+ export declare type RasterSourceSpecification = {
560
+ "type": "raster";
561
+ "url"?: string;
562
+ "tiles"?: Array<string>;
563
+ "bounds"?: [
564
+ number,
565
+ number,
566
+ number,
567
+ number
568
+ ];
569
+ "minzoom"?: number;
570
+ "maxzoom"?: number;
571
+ "tileSize"?: number;
572
+ "scheme"?: "xyz" | "tms";
573
+ "attribution"?: string;
574
+ "volatile"?: boolean;
575
+ };
576
+ export declare type RasterDEMSourceSpecification = {
577
+ "type": "raster-dem";
578
+ "url"?: string;
579
+ "tiles"?: Array<string>;
580
+ "bounds"?: [
581
+ number,
582
+ number,
583
+ number,
584
+ number
585
+ ];
586
+ "minzoom"?: number;
587
+ "maxzoom"?: number;
588
+ "tileSize"?: number;
589
+ "attribution"?: string;
590
+ "encoding"?: "terrarium" | "mapbox";
591
+ "volatile"?: boolean;
592
+ };
593
+ export declare type GeoJSONSourceSpecification = {
594
+ "type": "geojson";
595
+ "data"?: unknown;
596
+ "maxzoom"?: number;
597
+ "attribution"?: string;
598
+ "buffer"?: number;
599
+ "filter"?: unknown;
600
+ "tolerance"?: number;
601
+ "cluster"?: boolean;
602
+ "clusterRadius"?: number;
603
+ "clusterMaxZoom"?: number;
604
+ "clusterMinPoints"?: number;
605
+ "clusterProperties"?: unknown;
606
+ "lineMetrics"?: boolean;
607
+ "generateId"?: boolean;
608
+ "promoteId"?: PromoteIdSpecification;
609
+ };
610
+ export declare type VideoSourceSpecification = {
611
+ "type": "video";
612
+ "urls": Array<string>;
613
+ "coordinates": [
614
+ [
615
+ number,
616
+ number
617
+ ],
618
+ [
619
+ number,
620
+ number
621
+ ],
622
+ [
623
+ number,
624
+ number
625
+ ],
626
+ [
627
+ number,
628
+ number
629
+ ]
630
+ ];
631
+ };
632
+ export declare type ImageSourceSpecification = {
633
+ "type": "image";
634
+ "url": string;
635
+ "coordinates": [
636
+ [
637
+ number,
638
+ number
639
+ ],
640
+ [
641
+ number,
642
+ number
643
+ ],
644
+ [
645
+ number,
646
+ number
647
+ ],
648
+ [
649
+ number,
650
+ number
651
+ ]
652
+ ];
653
+ };
654
+ export declare type SourceSpecification = VectorSourceSpecification | RasterSourceSpecification | RasterDEMSourceSpecification | GeoJSONSourceSpecification | VideoSourceSpecification | ImageSourceSpecification;
655
+ export declare type FillLayerSpecification = {
656
+ "id": string;
657
+ "type": "fill";
658
+ "metadata"?: unknown;
659
+ "source": string;
660
+ "source-layer"?: string;
661
+ "minzoom"?: number;
662
+ "maxzoom"?: number;
663
+ "filter"?: FilterSpecification;
664
+ "layout"?: {
665
+ "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
666
+ "visibility"?: "visible" | "none";
667
+ };
668
+ "paint"?: {
669
+ "fill-antialias"?: PropertyValueSpecification<boolean>;
670
+ "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
671
+ "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
672
+ "fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
673
+ "fill-translate"?: PropertyValueSpecification<[
674
+ number,
675
+ number
676
+ ]>;
677
+ "fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
678
+ "fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
679
+ };
680
+ };
681
+ export declare type LineLayerSpecification = {
682
+ "id": string;
683
+ "type": "line";
684
+ "metadata"?: unknown;
685
+ "source": string;
686
+ "source-layer"?: string;
687
+ "minzoom"?: number;
688
+ "maxzoom"?: number;
689
+ "filter"?: FilterSpecification;
690
+ "layout"?: {
691
+ "line-cap"?: PropertyValueSpecification<"butt" | "round" | "square">;
692
+ "line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">;
693
+ "line-miter-limit"?: PropertyValueSpecification<number>;
694
+ "line-round-limit"?: PropertyValueSpecification<number>;
695
+ "line-sort-key"?: DataDrivenPropertyValueSpecification<number>;
696
+ "visibility"?: "visible" | "none";
697
+ };
698
+ "paint"?: {
699
+ "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
700
+ "line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
701
+ "line-translate"?: PropertyValueSpecification<[
702
+ number,
703
+ number
704
+ ]>;
705
+ "line-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
706
+ "line-width"?: DataDrivenPropertyValueSpecification<number>;
707
+ "line-gap-width"?: DataDrivenPropertyValueSpecification<number>;
708
+ "line-offset"?: DataDrivenPropertyValueSpecification<number>;
709
+ "line-blur"?: DataDrivenPropertyValueSpecification<number>;
710
+ "line-dasharray"?: PropertyValueSpecification<Array<number>>;
711
+ "line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
712
+ "line-gradient"?: ExpressionSpecification;
713
+ };
714
+ };
715
+ export declare type SymbolLayerSpecification = {
716
+ "id": string;
717
+ "type": "symbol";
718
+ "metadata"?: unknown;
719
+ "source": string;
720
+ "source-layer"?: string;
721
+ "minzoom"?: number;
722
+ "maxzoom"?: number;
723
+ "filter"?: FilterSpecification;
724
+ "layout"?: {
725
+ "symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">;
726
+ "symbol-spacing"?: PropertyValueSpecification<number>;
727
+ "symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
728
+ "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
729
+ "symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">;
730
+ "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
731
+ "icon-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
732
+ "icon-ignore-placement"?: PropertyValueSpecification<boolean>;
733
+ "icon-optional"?: PropertyValueSpecification<boolean>;
734
+ "icon-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
735
+ "icon-size"?: DataDrivenPropertyValueSpecification<number>;
736
+ "icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">;
737
+ "icon-text-fit-padding"?: PropertyValueSpecification<[
738
+ number,
739
+ number,
740
+ number,
741
+ number
742
+ ]>;
743
+ "icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
744
+ "icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
745
+ "icon-padding"?: DataDrivenPropertyValueSpecification<PaddingSpecification>;
746
+ "icon-keep-upright"?: PropertyValueSpecification<boolean>;
747
+ "icon-offset"?: DataDrivenPropertyValueSpecification<[
748
+ number,
749
+ number
750
+ ]>;
751
+ "icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
752
+ "icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
753
+ "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
754
+ "text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "viewport-glyph" | "auto">;
755
+ "text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>;
756
+ "text-font"?: DataDrivenPropertyValueSpecification<Array<string>>;
757
+ "text-size"?: DataDrivenPropertyValueSpecification<number>;
758
+ "text-max-width"?: DataDrivenPropertyValueSpecification<number>;
759
+ "text-line-height"?: PropertyValueSpecification<number>;
760
+ "text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>;
761
+ "text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
762
+ "text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
763
+ "text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
764
+ "text-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
765
+ "text-max-angle"?: PropertyValueSpecification<number>;
766
+ "text-writing-mode"?: PropertyValueSpecification<Array<"horizontal" | "vertical">>;
767
+ "text-rotate"?: DataDrivenPropertyValueSpecification<number>;
768
+ "text-padding"?: PropertyValueSpecification<number>;
769
+ "text-keep-upright"?: PropertyValueSpecification<boolean>;
770
+ "text-transform"?: DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">;
771
+ "text-offset"?: DataDrivenPropertyValueSpecification<[
772
+ number,
773
+ number
774
+ ]>;
775
+ "text-allow-overlap"?: PropertyValueSpecification<boolean>;
776
+ "text-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
777
+ "text-ignore-placement"?: PropertyValueSpecification<boolean>;
778
+ "text-optional"?: PropertyValueSpecification<boolean>;
779
+ "visibility"?: "visible" | "none";
780
+ };
781
+ "paint"?: {
782
+ "icon-opacity"?: DataDrivenPropertyValueSpecification<number>;
783
+ "icon-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
784
+ "icon-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
785
+ "icon-halo-width"?: DataDrivenPropertyValueSpecification<number>;
786
+ "icon-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
787
+ "icon-translate"?: PropertyValueSpecification<[
788
+ number,
789
+ number
790
+ ]>;
791
+ "icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
792
+ "text-opacity"?: DataDrivenPropertyValueSpecification<number>;
793
+ "text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
794
+ "text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
795
+ "text-halo-width"?: DataDrivenPropertyValueSpecification<number>;
796
+ "text-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
797
+ "text-translate"?: PropertyValueSpecification<[
798
+ number,
799
+ number
800
+ ]>;
801
+ "text-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
802
+ };
803
+ };
804
+ export declare type CircleLayerSpecification = {
805
+ "id": string;
806
+ "type": "circle";
807
+ "metadata"?: unknown;
808
+ "source": string;
809
+ "source-layer"?: string;
810
+ "minzoom"?: number;
811
+ "maxzoom"?: number;
812
+ "filter"?: FilterSpecification;
813
+ "layout"?: {
814
+ "circle-sort-key"?: DataDrivenPropertyValueSpecification<number>;
815
+ "visibility"?: "visible" | "none";
816
+ };
817
+ "paint"?: {
818
+ "circle-radius"?: DataDrivenPropertyValueSpecification<number>;
819
+ "circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
820
+ "circle-blur"?: DataDrivenPropertyValueSpecification<number>;
821
+ "circle-opacity"?: DataDrivenPropertyValueSpecification<number>;
822
+ "circle-translate"?: PropertyValueSpecification<[
823
+ number,
824
+ number
825
+ ]>;
826
+ "circle-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
827
+ "circle-pitch-scale"?: PropertyValueSpecification<"map" | "viewport">;
828
+ "circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
829
+ "circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
830
+ "circle-stroke-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
831
+ "circle-stroke-opacity"?: DataDrivenPropertyValueSpecification<number>;
832
+ };
833
+ };
834
+ export declare type HeatmapLayerSpecification = {
835
+ "id": string;
836
+ "type": "heatmap";
837
+ "metadata"?: unknown;
838
+ "source": string;
839
+ "source-layer"?: string;
840
+ "minzoom"?: number;
841
+ "maxzoom"?: number;
842
+ "filter"?: FilterSpecification;
843
+ "layout"?: {
844
+ "visibility"?: "visible" | "none";
845
+ };
846
+ "paint"?: {
847
+ "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
848
+ "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
849
+ "heatmap-intensity"?: PropertyValueSpecification<number>;
850
+ "heatmap-color"?: ExpressionSpecification;
851
+ "heatmap-opacity"?: PropertyValueSpecification<number>;
852
+ };
853
+ };
854
+ export declare type FillExtrusionLayerSpecification = {
855
+ "id": string;
856
+ "type": "fill-extrusion";
857
+ "metadata"?: unknown;
858
+ "source": string;
859
+ "source-layer"?: string;
860
+ "minzoom"?: number;
861
+ "maxzoom"?: number;
862
+ "filter"?: FilterSpecification;
863
+ "layout"?: {
864
+ "visibility"?: "visible" | "none";
865
+ };
866
+ "paint"?: {
867
+ "fill-extrusion-opacity"?: PropertyValueSpecification<number>;
868
+ "fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
869
+ "fill-extrusion-translate"?: PropertyValueSpecification<[
870
+ number,
871
+ number
872
+ ]>;
873
+ "fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
874
+ "fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
875
+ "fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
876
+ "fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
877
+ "fill-extrusion-vertical-gradient"?: PropertyValueSpecification<boolean>;
878
+ };
879
+ };
880
+ export declare type RasterLayerSpecification = {
881
+ "id": string;
882
+ "type": "raster";
883
+ "metadata"?: unknown;
884
+ "source": string;
885
+ "source-layer"?: string;
886
+ "minzoom"?: number;
887
+ "maxzoom"?: number;
888
+ "filter"?: FilterSpecification;
889
+ "layout"?: {
890
+ "visibility"?: "visible" | "none";
891
+ };
892
+ "paint"?: {
893
+ "raster-opacity"?: PropertyValueSpecification<number>;
894
+ "raster-hue-rotate"?: PropertyValueSpecification<number>;
895
+ "raster-brightness-min"?: PropertyValueSpecification<number>;
896
+ "raster-brightness-max"?: PropertyValueSpecification<number>;
897
+ "raster-saturation"?: PropertyValueSpecification<number>;
898
+ "raster-contrast"?: PropertyValueSpecification<number>;
899
+ "raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
900
+ "raster-fade-duration"?: PropertyValueSpecification<number>;
901
+ };
902
+ };
903
+ export declare type HillshadeLayerSpecification = {
904
+ "id": string;
905
+ "type": "hillshade";
906
+ "metadata"?: unknown;
907
+ "source": string;
908
+ "source-layer"?: string;
909
+ "minzoom"?: number;
910
+ "maxzoom"?: number;
911
+ "filter"?: FilterSpecification;
912
+ "layout"?: {
913
+ "visibility"?: "visible" | "none";
914
+ };
915
+ "paint"?: {
916
+ "hillshade-illumination-direction"?: PropertyValueSpecification<number>;
917
+ "hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">;
918
+ "hillshade-exaggeration"?: PropertyValueSpecification<number>;
919
+ "hillshade-shadow-color"?: PropertyValueSpecification<ColorSpecification>;
920
+ "hillshade-highlight-color"?: PropertyValueSpecification<ColorSpecification>;
921
+ "hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>;
922
+ };
923
+ };
924
+ export declare type BackgroundLayerSpecification = {
925
+ "id": string;
926
+ "type": "background";
927
+ "metadata"?: unknown;
928
+ "minzoom"?: number;
929
+ "maxzoom"?: number;
930
+ "layout"?: {
931
+ "visibility"?: "visible" | "none";
932
+ };
933
+ "paint"?: {
934
+ "background-color"?: PropertyValueSpecification<ColorSpecification>;
935
+ "background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>;
936
+ "background-opacity"?: PropertyValueSpecification<number>;
937
+ };
938
+ };
939
+ export declare type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | BackgroundLayerSpecification;
940
+ /**
941
+ * Migrate a Mapbox GL Style to the latest version.
942
+ *
943
+ * @private
944
+ * @alias migrate
945
+ * @param {StyleSpecification} style a MapLibre GL Style
946
+ * @returns {StyleSpecification} a migrated style
947
+ * @example
948
+ * var fs = require('fs');
949
+ * var migrate = require('maplibre-gl-style-spec').migrate;
950
+ * var style = fs.readFileSync('./style.json', 'utf8');
951
+ * fs.writeFileSync('./style.json', JSON.stringify(migrate(style)));
952
+ */
953
+ export function migrate(style: StyleSpecification): StyleSpecification;
954
+ export function composite(style: StyleSpecification): StyleSpecification;
955
+ /**
956
+ * Given an array of layers, some of which may contain `ref` properties
957
+ * whose value is the `id` of another property, return a new array where
958
+ * such layers have been augmented with the 'type', 'source', etc. properties
959
+ * from the parent layer, and the `ref` property has been removed.
960
+ *
961
+ * The input is not modified. The output may contain references to portions
962
+ * of the input.
963
+ *
964
+ * @private
965
+ * @param {Array<Layer>} layers
966
+ * @returns {Array<Layer>}
967
+ */
968
+ export declare function derefLayers(layers: any): any;
969
+ declare function diffStyles(before: any, after: any): any[];
970
+ export declare class ValidationError {
971
+ message: string;
972
+ identifier: string;
973
+ line: number;
974
+ constructor(key: string, value: any & {
975
+ __line__: number;
976
+ }, message: string, identifier?: string | null);
977
+ }
978
+ export declare class ParsingError {
979
+ message: string;
980
+ error: Error;
981
+ line: number;
982
+ constructor(error: Error);
983
+ }
984
+ declare class ExpressionParsingError extends Error {
985
+ key: string;
986
+ message: string;
987
+ constructor(key: string, message: string);
988
+ }
989
+ /**
990
+ * An RGBA color value. Create instances from color strings using the static
991
+ * method `Color.parse`. The constructor accepts RGB channel values in the range
992
+ * `[0, 1]`, premultiplied by A.
993
+ *
994
+ * @param {number} r The red channel.
995
+ * @param {number} g The green channel.
996
+ * @param {number} b The blue channel.
997
+ * @param {number} a The alpha channel.
998
+ * @private
999
+ */
1000
+ export declare class Color {
1001
+ r: number;
1002
+ g: number;
1003
+ b: number;
1004
+ a: number;
1005
+ constructor(r: number, g: number, b: number, a?: number);
1006
+ static black: Color;
1007
+ static white: Color;
1008
+ static transparent: Color;
1009
+ static red: Color;
1010
+ /**
1011
+ * Parses valid CSS color strings and returns a `Color` instance.
1012
+ * @returns A `Color` instance, or `undefined` if the input is not a valid color string.
1013
+ */
1014
+ static parse(input?: string | Color | null): Color | void;
1015
+ /**
1016
+ * Returns an RGBA string representing the color value.
1017
+ *
1018
+ * @returns An RGBA string.
1019
+ * @example
1020
+ * var purple = new Color.parse('purple');
1021
+ * purple.toString; // = "rgba(128,0,128,1)"
1022
+ * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
1023
+ * translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
1024
+ */
1025
+ toString(): string;
1026
+ toArray(): [
1027
+ number,
1028
+ number,
1029
+ number,
1030
+ number
1031
+ ];
1032
+ }
1033
+ declare class Intl$Collator {
1034
+ constructor(locales?: string | string[], options?: CollatorOptions);
1035
+ compare(a: string, b: string): number;
1036
+ resolvedOptions(): any;
1037
+ }
1038
+ export declare type CollatorOptions = {
1039
+ localeMatcher?: "lookup" | "best fit";
1040
+ usage?: "sort" | "search";
1041
+ sensitivity?: "base" | "accent" | "case" | "variant";
1042
+ ignorePunctuation?: boolean;
1043
+ numeric?: boolean;
1044
+ caseFirst?: "upper" | "lower" | "false";
1045
+ };
1046
+ declare class Collator {
1047
+ locale: string | null;
1048
+ sensitivity: "base" | "accent" | "case" | "variant";
1049
+ collator: Intl$Collator;
1050
+ constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null);
1051
+ compare(lhs: string, rhs: string): number;
1052
+ resolvedLocale(): string;
1053
+ }
1054
+ export declare type ResolvedImageOptions = {
1055
+ name: string;
1056
+ available: boolean;
1057
+ };
1058
+ declare class ResolvedImage {
1059
+ name: string;
1060
+ available: boolean;
1061
+ constructor(options: ResolvedImageOptions);
1062
+ toString(): string;
1063
+ static fromString(name: string): ResolvedImage | null;
1064
+ }
1065
+ declare class FormattedSection {
1066
+ text: string;
1067
+ image: ResolvedImage | null;
1068
+ scale: number | null;
1069
+ fontStack: string | null;
1070
+ textColor: Color | null;
1071
+ constructor(text: string, image: ResolvedImage | null, scale: number | null, fontStack: string | null, textColor: Color | null);
1072
+ }
1073
+ declare class Formatted {
1074
+ sections: Array<FormattedSection>;
1075
+ constructor(sections: Array<FormattedSection>);
1076
+ static fromString(unformatted: string): Formatted;
1077
+ isEmpty(): boolean;
1078
+ static factory(text: Formatted | string): Formatted;
1079
+ toString(): string;
1080
+ }
1081
+ /**
1082
+ * A set of four numbers representing padding around a box. Create instances from
1083
+ * bare arrays or numeric values using the static method `Padding.parse`.
1084
+ * @private
1085
+ */
1086
+ export declare class Padding {
1087
+ /** Padding values are in CSS order: top, right, bottom, left */
1088
+ values: [
1089
+ number,
1090
+ number,
1091
+ number,
1092
+ number
1093
+ ];
1094
+ constructor(values: [
1095
+ number,
1096
+ number,
1097
+ number,
1098
+ number
1099
+ ]);
1100
+ /**
1101
+ * Numeric padding values
1102
+ * @returns A `Padding` instance, or `undefined` if the input is not a valid padding value.
1103
+ */
1104
+ static parse(input?: number | number[] | Padding | null): Padding | void;
1105
+ toString(): string;
1106
+ }
1107
+ export declare type NullTypeT = {
1108
+ kind: "null";
1109
+ };
1110
+ export declare type NumberTypeT = {
1111
+ kind: "number";
1112
+ };
1113
+ export declare type StringTypeT = {
1114
+ kind: "string";
1115
+ };
1116
+ export declare type BooleanTypeT = {
1117
+ kind: "boolean";
1118
+ };
1119
+ export declare type ColorTypeT = {
1120
+ kind: "color";
1121
+ };
1122
+ export declare type ObjectTypeT = {
1123
+ kind: "object";
1124
+ };
1125
+ export declare type ValueTypeT = {
1126
+ kind: "value";
1127
+ };
1128
+ export declare type ErrorTypeT = {
1129
+ kind: "error";
1130
+ };
1131
+ export declare type CollatorTypeT = {
1132
+ kind: "collator";
1133
+ };
1134
+ export declare type FormattedTypeT = {
1135
+ kind: "formatted";
1136
+ };
1137
+ export declare type PaddingTypeT = {
1138
+ kind: "padding";
1139
+ };
1140
+ export declare type ResolvedImageTypeT = {
1141
+ kind: "resolvedImage";
1142
+ };
1143
+ export declare type EvaluationKind = "constant" | "source" | "camera" | "composite";
1144
+ export declare type Type = NullTypeT | NumberTypeT | StringTypeT | BooleanTypeT | ColorTypeT | ObjectTypeT | ValueTypeT | // eslint-disable-line no-use-before-define
1145
+ ArrayType | ErrorTypeT | CollatorTypeT | FormattedTypeT | PaddingTypeT | ResolvedImageTypeT;
1146
+ export declare type ArrayType = {
1147
+ kind: "array";
1148
+ itemType: Type;
1149
+ N: number;
1150
+ };
1151
+ export declare type Value = null | string | boolean | number | Color | Collator | Formatted | Padding | ResolvedImage | ReadonlyArray<Value> | {
1152
+ readonly [x: string]: Value;
1153
+ };
1154
+ declare class LngLatBounds {
1155
+ _ne: LngLat;
1156
+ _sw: LngLat;
1157
+ constructor(sw?: any, ne?: any);
1158
+ /**
1159
+ * Set the northeast corner of the bounding box
1160
+ *
1161
+ * @param {LngLatLike} ne a {@link LngLatLike} object describing the northeast corner of the bounding box.
1162
+ * @returns {LngLatBounds} `this`
1163
+ */
1164
+ setNorthEast(ne: LngLatLike): this;
1165
+ /**
1166
+ * Set the southwest corner of the bounding box
1167
+ *
1168
+ * @param {LngLatLike} sw a {@link LngLatLike} object describing the southwest corner of the bounding box.
1169
+ * @returns {LngLatBounds} `this`
1170
+ */
1171
+ setSouthWest(sw: LngLatLike): this;
1172
+ /**
1173
+ * Extend the bounds to include a given LngLatLike or LngLatBoundsLike.
1174
+ *
1175
+ * @param {LngLatLike|LngLatBoundsLike} obj object to extend to
1176
+ * @returns {LngLatBounds} `this`
1177
+ */
1178
+ extend(obj: LngLatLike | LngLatBoundsLike): any;
1179
+ /**
1180
+ * Returns the geographical coordinate equidistant from the bounding box's corners.
1181
+ *
1182
+ * @returns {LngLat} The bounding box's center.
1183
+ * @example
1184
+ * var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
1185
+ * llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}
1186
+ */
1187
+ getCenter(): LngLat;
1188
+ /**
1189
+ * Returns the southwest corner of the bounding box.
1190
+ *
1191
+ * @returns {LngLat} The southwest corner of the bounding box.
1192
+ */
1193
+ getSouthWest(): LngLat;
1194
+ /**
1195
+ * Returns the northeast corner of the bounding box.
1196
+ *
1197
+ * @returns {LngLat} The northeast corner of the bounding box.
1198
+ */
1199
+ getNorthEast(): LngLat;
1200
+ /**
1201
+ * Returns the northwest corner of the bounding box.
1202
+ *
1203
+ * @returns {LngLat} The northwest corner of the bounding box.
1204
+ */
1205
+ getNorthWest(): LngLat;
1206
+ /**
1207
+ * Returns the southeast corner of the bounding box.
1208
+ *
1209
+ * @returns {LngLat} The southeast corner of the bounding box.
1210
+ */
1211
+ getSouthEast(): LngLat;
1212
+ /**
1213
+ * Returns the west edge of the bounding box.
1214
+ *
1215
+ * @returns {number} The west edge of the bounding box.
1216
+ */
1217
+ getWest(): number;
1218
+ /**
1219
+ * Returns the south edge of the bounding box.
1220
+ *
1221
+ * @returns {number} The south edge of the bounding box.
1222
+ */
1223
+ getSouth(): number;
1224
+ /**
1225
+ * Returns the east edge of the bounding box.
1226
+ *
1227
+ * @returns {number} The east edge of the bounding box.
1228
+ */
1229
+ getEast(): number;
1230
+ /**
1231
+ * Returns the north edge of the bounding box.
1232
+ *
1233
+ * @returns {number} The north edge of the bounding box.
1234
+ */
1235
+ getNorth(): number;
1236
+ /**
1237
+ * Returns the bounding box represented as an array.
1238
+ *
1239
+ * @returns {Array<Array<number>>} The bounding box represented as an array, consisting of the
1240
+ * southwest and northeast coordinates of the bounding represented as arrays of numbers.
1241
+ * @example
1242
+ * var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
1243
+ * llb.toArray(); // = [[-73.9876, 40.7661], [-73.9397, 40.8002]]
1244
+ */
1245
+ toArray(): number[][];
1246
+ /**
1247
+ * Return the bounding box represented as a string.
1248
+ *
1249
+ * @returns {string} The bounding box represents as a string of the format
1250
+ * `'LngLatBounds(LngLat(lng, lat), LngLat(lng, lat))'`.
1251
+ * @example
1252
+ * var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
1253
+ * llb.toString(); // = "LngLatBounds(LngLat(-73.9876, 40.7661), LngLat(-73.9397, 40.8002))"
1254
+ */
1255
+ toString(): string;
1256
+ /**
1257
+ * Check if the bounding box is an empty/`null`-type box.
1258
+ *
1259
+ * @returns {boolean} True if bounds have been defined, otherwise false.
1260
+ */
1261
+ isEmpty(): boolean;
1262
+ /**
1263
+ * Check if the point is within the bounding box.
1264
+ *
1265
+ * @param {LngLatLike} lnglat geographic point to check against.
1266
+ * @returns {boolean} True if the point is within the bounding box.
1267
+ * @example
1268
+ * var llb = new maplibregl.LngLatBounds(
1269
+ * new maplibregl.LngLat(-73.9876, 40.7661),
1270
+ * new maplibregl.LngLat(-73.9397, 40.8002)
1271
+ * );
1272
+ *
1273
+ * var ll = new maplibregl.LngLat(-73.9567, 40.7789);
1274
+ *
1275
+ * console.log(llb.contains(ll)); // = true
1276
+ */
1277
+ contains(lnglat: LngLatLike): boolean;
1278
+ /**
1279
+ * Converts an array to a `LngLatBounds` object.
1280
+ *
1281
+ * If a `LngLatBounds` object is passed in, the function returns it unchanged.
1282
+ *
1283
+ * Internally, the function calls `LngLat#convert` to convert arrays to `LngLat` values.
1284
+ *
1285
+ * @param {LngLatBoundsLike} input An array of two coordinates to convert, or a `LngLatBounds` object to return.
1286
+ * @returns {LngLatBounds} A new `LngLatBounds` object, if a conversion occurred, or the original `LngLatBounds` object.
1287
+ * @example
1288
+ * var arr = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
1289
+ * var llb = maplibregl.LngLatBounds.convert(arr);
1290
+ * llb; // = LngLatBounds {_sw: LngLat {lng: -73.9876, lat: 40.7661}, _ne: LngLat {lng: -73.9397, lat: 40.8002}}
1291
+ */
1292
+ static convert(input: LngLatBoundsLike | null): LngLatBounds;
1293
+ }
1294
+ /**
1295
+ * A {@link LngLatBounds} object, an array of {@link LngLatLike} objects in [sw, ne] order,
1296
+ * or an array of numbers in [west, south, east, north] order.
1297
+ *
1298
+ * @typedef {LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number]} LngLatBoundsLike
1299
+ * @example
1300
+ * var v1 = new maplibregl.LngLatBounds(
1301
+ * new maplibregl.LngLat(-73.9876, 40.7661),
1302
+ * new maplibregl.LngLat(-73.9397, 40.8002)
1303
+ * );
1304
+ * var v2 = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002])
1305
+ * var v3 = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
1306
+ */
1307
+ export declare type LngLatBoundsLike = LngLatBounds | [
1308
+ LngLatLike,
1309
+ LngLatLike
1310
+ ] | [
1311
+ number,
1312
+ number,
1313
+ number,
1314
+ number
1315
+ ];
1316
+ declare class LngLat {
1317
+ lng: number;
1318
+ lat: number;
1319
+ constructor(lng: number, lat: number);
1320
+ /**
1321
+ * Returns a new `LngLat` object whose longitude is wrapped to the range (-180, 180).
1322
+ *
1323
+ * @returns {LngLat} The wrapped `LngLat` object.
1324
+ * @example
1325
+ * var ll = new maplibregl.LngLat(286.0251, 40.7736);
1326
+ * var wrapped = ll.wrap();
1327
+ * wrapped.lng; // = -73.9749
1328
+ */
1329
+ wrap(): LngLat;
1330
+ /**
1331
+ * Returns the coordinates represented as an array of two numbers.
1332
+ *
1333
+ * @returns {Array<number>} The coordinates represeted as an array of longitude and latitude.
1334
+ * @example
1335
+ * var ll = new maplibregl.LngLat(-73.9749, 40.7736);
1336
+ * ll.toArray(); // = [-73.9749, 40.7736]
1337
+ */
1338
+ toArray(): number[];
1339
+ /**
1340
+ * Returns the coordinates represent as a string.
1341
+ *
1342
+ * @returns {string} The coordinates represented as a string of the format `'LngLat(lng, lat)'`.
1343
+ * @example
1344
+ * var ll = new maplibregl.LngLat(-73.9749, 40.7736);
1345
+ * ll.toString(); // = "LngLat(-73.9749, 40.7736)"
1346
+ */
1347
+ toString(): string;
1348
+ /**
1349
+ * Returns the approximate distance between a pair of coordinates in meters
1350
+ * Uses the Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)
1351
+ *
1352
+ * @param {LngLat} lngLat coordinates to compute the distance to
1353
+ * @returns {number} Distance in meters between the two coordinates.
1354
+ * @example
1355
+ * var new_york = new maplibregl.LngLat(-74.0060, 40.7128);
1356
+ * var los_angeles = new maplibregl.LngLat(-118.2437, 34.0522);
1357
+ * new_york.distanceTo(los_angeles); // = 3935751.690893987, "true distance" using a non-spherical approximation is ~3966km
1358
+ */
1359
+ distanceTo(lngLat: LngLat): number;
1360
+ /**
1361
+ * Returns a `LngLatBounds` from the coordinates extended by a given `radius`. The returned `LngLatBounds` completely contains the `radius`.
1362
+ *
1363
+ * @param {number} [radius=0] Distance in meters from the coordinates to extend the bounds.
1364
+ * @returns {LngLatBounds} A new `LngLatBounds` object representing the coordinates extended by the `radius`.
1365
+ * @example
1366
+ * var ll = new maplibregl.LngLat(-73.9749, 40.7736);
1367
+ * ll.toBounds(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]
1368
+ */
1369
+ toBounds(radius?: number): LngLatBounds;
1370
+ /**
1371
+ * Converts an array of two numbers or an object with `lng` and `lat` or `lon` and `lat` properties
1372
+ * to a `LngLat` object.
1373
+ *
1374
+ * If a `LngLat` object is passed in, the function returns it unchanged.
1375
+ *
1376
+ * @param {LngLatLike} input An array of two numbers or object to convert, or a `LngLat` object to return.
1377
+ * @returns {LngLat} A new `LngLat` object, if a conversion occurred, or the original `LngLat` object.
1378
+ * @example
1379
+ * var arr = [-73.9749, 40.7736];
1380
+ * var ll = maplibregl.LngLat.convert(arr);
1381
+ * ll; // = LngLat {lng: -73.9749, lat: 40.7736}
1382
+ */
1383
+ static convert(input: LngLatLike): LngLat;
1384
+ }
1385
+ /**
1386
+ * A {@link LngLat} object, an array of two numbers representing longitude and latitude,
1387
+ * or an object with `lng` and `lat` or `lon` and `lat` properties.
1388
+ *
1389
+ * @typedef {LngLat | {lng: number, lat: number} | {lon: number, lat: number} | [number, number]} LngLatLike
1390
+ * @example
1391
+ * var v1 = new maplibregl.LngLat(-122.420679, 37.772537);
1392
+ * var v2 = [-122.420679, 37.772537];
1393
+ * var v3 = {lon: -122.420679, lat: 37.772537};
1394
+ */
1395
+ export declare type LngLatLike = LngLat | {
1396
+ lng: number;
1397
+ lat: number;
1398
+ } | {
1399
+ lon: number;
1400
+ lat: number;
1401
+ } | [
1402
+ number,
1403
+ number
1404
+ ];
1405
+ declare class MercatorCoordinate {
1406
+ x: number;
1407
+ y: number;
1408
+ z: number;
1409
+ constructor(x: number, y: number, z?: number);
1410
+ /**
1411
+ * Project a `LngLat` to a `MercatorCoordinate`.
1412
+ *
1413
+ * @param {LngLatLike} lngLatLike The location to project.
1414
+ * @param {number} altitude The altitude in meters of the position.
1415
+ * @returns {MercatorCoordinate} The projected mercator coordinate.
1416
+ * @example
1417
+ * var coord = maplibregl.MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);
1418
+ * coord; // MercatorCoordinate(0.5, 0.5, 0)
1419
+ */
1420
+ static fromLngLat(lngLatLike: LngLatLike, altitude?: number): MercatorCoordinate;
1421
+ /**
1422
+ * Returns the `LngLat` for the coordinate.
1423
+ *
1424
+ * @returns {LngLat} The `LngLat` object.
1425
+ * @example
1426
+ * var coord = new maplibregl.MercatorCoordinate(0.5, 0.5, 0);
1427
+ * var lngLat = coord.toLngLat(); // LngLat(0, 0)
1428
+ */
1429
+ toLngLat(): LngLat;
1430
+ /**
1431
+ * Returns the altitude in meters of the coordinate.
1432
+ *
1433
+ * @returns {number} The altitude in meters.
1434
+ * @example
1435
+ * var coord = new maplibregl.MercatorCoordinate(0, 0, 0.02);
1436
+ * coord.toAltitude(); // 6914.281956295339
1437
+ */
1438
+ toAltitude(): number;
1439
+ /**
1440
+ * Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.
1441
+ *
1442
+ * For coordinates in real world units using meters, this naturally provides the scale
1443
+ * to transform into `MercatorCoordinate`s.
1444
+ *
1445
+ * @returns {number} Distance of 1 meter in `MercatorCoordinate` units.
1446
+ */
1447
+ meterInMercatorCoordinateUnits(): number;
1448
+ }
1449
+ declare class CanonicalTileID {
1450
+ z: number;
1451
+ x: number;
1452
+ y: number;
1453
+ key: string;
1454
+ constructor(z: number, x: number, y: number);
1455
+ equals(id: CanonicalTileID): boolean;
1456
+ url(urls: Array<string>, pixelRatio: number, scheme?: string | null): string;
1457
+ isChildOf(parent: CanonicalTileID): boolean;
1458
+ getTilePoint(coord: MercatorCoordinate): Point;
1459
+ toString(): string;
1460
+ }
1461
+ declare class EvaluationContext {
1462
+ globals: GlobalProperties;
1463
+ feature: Feature;
1464
+ featureState: FeatureState;
1465
+ formattedSection: FormattedSection;
1466
+ availableImages: Array<string>;
1467
+ canonical: CanonicalTileID;
1468
+ _parseColorCache: {
1469
+ [_: string]: Color;
1470
+ };
1471
+ constructor();
1472
+ id(): any;
1473
+ geometryType(): string;
1474
+ geometry(): import("@mapbox/point-geometry")[][];
1475
+ canonicalID(): CanonicalTileID;
1476
+ properties(): {
1477
+ [_: string]: any;
1478
+ };
1479
+ parseColor(input: string): Color;
1480
+ }
1481
+ /**
1482
+ * Expression
1483
+ */
1484
+ export interface Expression {
1485
+ readonly type: Type;
1486
+ evaluate(ctx: EvaluationContext): any;
1487
+ eachChild(fn: (a: Expression) => void): void;
1488
+ /**
1489
+ * Statically analyze the expression, attempting to enumerate possible outputs. Returns
1490
+ * false if the complete set of outputs is statically undecidable, otherwise true.
1491
+ */
1492
+ outputDefined(): boolean;
1493
+ }
1494
+ /**
1495
+ * A type used for returning and propagating errors. The first element of the union
1496
+ * represents success and contains a value, and the second represents an error and
1497
+ * contains an error value.
1498
+ * @private
1499
+ */
1500
+ export declare type Result<T, E> = {
1501
+ result: "success";
1502
+ value: T;
1503
+ } | {
1504
+ result: "error";
1505
+ value: E;
1506
+ };
1507
+ export declare type InterpolationType = {
1508
+ name: "linear";
1509
+ } | {
1510
+ name: "exponential";
1511
+ base: number;
1512
+ } | {
1513
+ name: "cubic-bezier";
1514
+ controlPoints: [
1515
+ number,
1516
+ number,
1517
+ number,
1518
+ number
1519
+ ];
1520
+ };
1521
+ export declare type Feature = {
1522
+ readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon";
1523
+ readonly id?: any;
1524
+ readonly properties: {
1525
+ [_: string]: any;
1526
+ };
1527
+ readonly patterns?: {
1528
+ [_: string]: {
1529
+ "min": string;
1530
+ "mid": string;
1531
+ "max": string;
1532
+ };
1533
+ };
1534
+ readonly geometry?: Array<Array<Point>>;
1535
+ };
1536
+ export declare type FeatureState = {
1537
+ [_: string]: any;
1538
+ };
1539
+ export declare type GlobalProperties = Readonly<{
1540
+ zoom: number;
1541
+ heatmapDensity?: number;
1542
+ lineProgress?: number;
1543
+ isSupportedScript?: (_: string) => boolean;
1544
+ accumulated?: Value;
1545
+ }>;
1546
+ declare class StyleExpression {
1547
+ expression: Expression;
1548
+ _evaluator: EvaluationContext;
1549
+ _defaultValue: Value;
1550
+ _warningHistory: {
1551
+ [key: string]: boolean;
1552
+ };
1553
+ _enumValues: {
1554
+ [_: string]: any;
1555
+ };
1556
+ constructor(expression: Expression, propertySpec?: StylePropertySpecification | null);
1557
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1558
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1559
+ }
1560
+ declare function isExpression(expression: unknown): boolean;
1561
+ declare function createExpression(expression: unknown, propertySpec?: StylePropertySpecification | null): Result<StyleExpression, Array<ExpressionParsingError>>;
1562
+ declare class ZoomConstantExpression<Kind extends EvaluationKind> {
1563
+ kind: Kind;
1564
+ isStateDependent: boolean;
1565
+ _styleExpression: StyleExpression;
1566
+ constructor(kind: Kind, expression: StyleExpression);
1567
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1568
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1569
+ }
1570
+ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
1571
+ kind: Kind;
1572
+ zoomStops: Array<number>;
1573
+ isStateDependent: boolean;
1574
+ _styleExpression: StyleExpression;
1575
+ interpolationType: InterpolationType;
1576
+ constructor(kind: Kind, expression: StyleExpression, zoomStops: Array<number>, interpolationType?: InterpolationType);
1577
+ evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1578
+ evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection): any;
1579
+ interpolationFactor(input: number, lower: number, upper: number): number;
1580
+ }
1581
+ export declare type ConstantExpression = {
1582
+ kind: "constant";
1583
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1584
+ };
1585
+ export declare type SourceExpression = {
1586
+ kind: "source";
1587
+ isStateDependent: boolean;
1588
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1589
+ };
1590
+ export declare type CameraExpression = {
1591
+ kind: "camera";
1592
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1593
+ readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1594
+ zoomStops: Array<number>;
1595
+ interpolationType: InterpolationType;
1596
+ };
1597
+ export declare type CompositeExpression = {
1598
+ kind: "composite";
1599
+ isStateDependent: boolean;
1600
+ readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1601
+ readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1602
+ zoomStops: Array<number>;
1603
+ interpolationType: InterpolationType;
1604
+ };
1605
+ export declare type StylePropertyExpression = ConstantExpression | SourceExpression | CameraExpression | CompositeExpression;
1606
+ declare function createPropertyExpression(expressionInput: unknown, propertySpec: StylePropertySpecification): Result<StylePropertyExpression, Array<ExpressionParsingError>>;
1607
+ declare class StylePropertyFunction<T> {
1608
+ _parameters: PropertyValueSpecification<T>;
1609
+ _specification: StylePropertySpecification;
1610
+ kind: EvaluationKind;
1611
+ evaluate: (globals: GlobalProperties, feature?: Feature) => any;
1612
+ interpolationFactor: ((input: number, lower: number, upper: number) => number);
1613
+ zoomStops: Array<number>;
1614
+ constructor(parameters: PropertyValueSpecification<T>, specification: StylePropertySpecification);
1615
+ static deserialize<T>(serialized: {
1616
+ _parameters: PropertyValueSpecification<T>;
1617
+ _specification: StylePropertySpecification;
1618
+ }): StylePropertyFunction<T>;
1619
+ static serialize<T>(input: StylePropertyFunction<T>): {
1620
+ _parameters: PropertyValueSpecification<T>;
1621
+ _specification: StylePropertySpecification;
1622
+ };
1623
+ }
1624
+ declare function normalizePropertyExpression<T>(value: PropertyValueSpecification<T>, specification: StylePropertySpecification): StylePropertyExpression;
1625
+ export declare type FilterExpression = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID) => boolean;
1626
+ export declare type FeatureFilter = {
1627
+ filter: FilterExpression;
1628
+ needGeometry: boolean;
1629
+ };
1630
+ declare function isExpressionFilter(filter: any): filter is ExpressionFilterSpecification;
1631
+ declare function createFilter(filter: any): FeatureFilter;
1632
+ export declare type ExpectedTypes = {
1633
+ [_: string]: ExpressionInputType;
1634
+ };
1635
+ export function convertFilter(filter: FilterSpecification, expectedTypes?: ExpectedTypes): ExpressionFilterSpecification;
1636
+ declare function isFunction(value: any): boolean;
1637
+ declare function createFunction(parameters: any, propertySpec: any): {
1638
+ kind: string;
1639
+ interpolationType: {
1640
+ name: string;
1641
+ };
1642
+ interpolationFactor: any;
1643
+ zoomStops: any[];
1644
+ evaluate({ zoom }: {
1645
+ zoom: any;
1646
+ }, properties: any): any;
1647
+ } | {
1648
+ kind: string;
1649
+ interpolationType: {
1650
+ name: string;
1651
+ base: any;
1652
+ };
1653
+ interpolationFactor: any;
1654
+ zoomStops: any;
1655
+ evaluate: ({ zoom }: {
1656
+ zoom: any;
1657
+ }) => any;
1658
+ } | {
1659
+ kind: string;
1660
+ evaluate(_: any, feature: any): any;
1661
+ interpolationType?: undefined;
1662
+ interpolationFactor?: undefined;
1663
+ zoomStops?: undefined;
1664
+ };
1665
+ declare function convertFunction(parameters: any, propertySpec: StylePropertySpecification): any;
1666
+ declare function eachSource(style: StyleSpecification, callback: (_: SourceSpecification) => void): void;
1667
+ declare function eachLayer(style: StyleSpecification, callback: (_: LayerSpecification) => void): void;
1668
+ export declare type PropertyCallback = (a: {
1669
+ path: [
1670
+ string,
1671
+ "paint" | "layout",
1672
+ string
1673
+ ];
1674
+ key: string;
1675
+ value: PropertyValueSpecification<unknown> | DataDrivenPropertyValueSpecification<unknown>;
1676
+ reference: StylePropertySpecification;
1677
+ set: (a: PropertyValueSpecification<unknown> | DataDrivenPropertyValueSpecification<unknown>) => void;
1678
+ }) => void;
1679
+ declare function eachProperty(style: StyleSpecification, options: {
1680
+ paint?: boolean;
1681
+ layout?: boolean;
1682
+ }, callback: PropertyCallback): void;
1683
+ declare function validateStyle(style: StyleSpecification | string | Buffer, styleSpec?: any): Array<ValidationError>;
1684
+ export declare type ExpressionType = "data-driven" | "cross-faded" | "cross-faded-data-driven" | "color-ramp" | "data-constant" | "constant";
1685
+ export declare type ExpressionParameters = Array<"zoom" | "feature" | "feature-state" | "heatmap-density" | "line-progress">;
1686
+ export declare type ExpressionSpecificationDefinition = {
1687
+ interpolated: boolean;
1688
+ parameters: ExpressionParameters;
1689
+ };
1690
+ export declare type StylePropertySpecification = {
1691
+ type: "number";
1692
+ "property-type": ExpressionType;
1693
+ expression?: ExpressionSpecificationDefinition;
1694
+ transition: boolean;
1695
+ default?: number;
1696
+ } | {
1697
+ type: "string";
1698
+ "property-type": ExpressionType;
1699
+ expression?: ExpressionSpecificationDefinition;
1700
+ transition: boolean;
1701
+ default?: string;
1702
+ tokens?: boolean;
1703
+ } | {
1704
+ type: "boolean";
1705
+ "property-type": ExpressionType;
1706
+ expression?: ExpressionSpecificationDefinition;
1707
+ transition: boolean;
1708
+ default?: boolean;
1709
+ } | {
1710
+ type: "enum";
1711
+ "property-type": ExpressionType;
1712
+ expression?: ExpressionSpecificationDefinition;
1713
+ values: {
1714
+ [_: string]: {};
1715
+ };
1716
+ transition: boolean;
1717
+ default?: string;
1718
+ } | {
1719
+ type: "color";
1720
+ "property-type": ExpressionType;
1721
+ expression?: ExpressionSpecificationDefinition;
1722
+ transition: boolean;
1723
+ default?: string;
1724
+ overridable: boolean;
1725
+ } | {
1726
+ type: "array";
1727
+ value: "number";
1728
+ "property-type": ExpressionType;
1729
+ expression?: ExpressionSpecificationDefinition;
1730
+ length?: number;
1731
+ transition: boolean;
1732
+ default?: Array<number>;
1733
+ } | {
1734
+ type: "array";
1735
+ value: "string";
1736
+ "property-type": ExpressionType;
1737
+ expression?: ExpressionSpecificationDefinition;
1738
+ length?: number;
1739
+ transition: boolean;
1740
+ default?: Array<string>;
1741
+ } | {
1742
+ type: "padding";
1743
+ "property-type": ExpressionType;
1744
+ expression?: ExpressionSpecificationDefinition;
1745
+ transition: boolean;
1746
+ default?: number | Array<number>;
1747
+ };
1748
+ export declare const v8: any;
1749
+ export declare const expression: {
1750
+ StyleExpression: typeof StyleExpression;
1751
+ isExpression: typeof isExpression;
1752
+ isExpressionFilter: typeof isExpressionFilter;
1753
+ createExpression: typeof createExpression;
1754
+ createPropertyExpression: typeof createPropertyExpression;
1755
+ normalizePropertyExpression: typeof normalizePropertyExpression;
1756
+ ZoomConstantExpression: typeof ZoomConstantExpression;
1757
+ ZoomDependentExpression: typeof ZoomDependentExpression;
1758
+ StylePropertyFunction: typeof StylePropertyFunction;
1759
+ };
1760
+ declare const styleFunction: {
1761
+ convertFunction: typeof convertFunction;
1762
+ createFunction: typeof createFunction;
1763
+ isFunction: typeof isFunction;
1764
+ };
1765
+ export declare const visit: {
1766
+ eachSource: typeof eachSource;
1767
+ eachLayer: typeof eachLayer;
1768
+ eachProperty: typeof eachProperty;
1769
+ };
1770
+
1771
+ export {
1772
+ _default as latest,
1773
+ createFilter as featureFilter,
1774
+ diffStyles as diff,
1775
+ styleFunction as function,
1776
+ validateStyle as validate,
1777
+ };
1778
+
1779
+ export {};