@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
@@ -1,5 +1,4 @@
1
- // @flow
2
- // Generated code; do not edit. Edit build/generate-flow-typed-style-spec.js instead.
1
+ // Generated code; do not edit. Edit build/generate-typed-style-spec.ts instead.
3
2
  /* eslint-disable */
4
3
 
5
4
  export type ColorSpecification = string;
@@ -19,7 +18,7 @@ export type FilterSpecification =
19
18
  | ['>=', string, string | number | boolean]
20
19
  | ['<', string, string | number | boolean]
21
20
  | ['<=', string, string | number | boolean]
22
- | Array<string | FilterSpecification>; // Can't type in, !in, all, any, none -- https://github.com/facebook/flow/issues/2443
21
+ | Array<string | FilterSpecification>;
23
22
 
24
23
  export type TransitionSpecification = {
25
24
  duration?: number,
@@ -28,22 +27,37 @@ export type TransitionSpecification = {
28
27
 
29
28
  // Note: doesn't capture interpolatable vs. non-interpolatable types.
30
29
 
30
+ export type PropertyFunctionStop<T> = [number, T];
31
+ export type ZoomAndPropertyFunctionStop<T> = [{zoom: number; value: string | number | boolean}, T];
32
+
33
+ /**
34
+ * @deprecated Use [Expressions](https://docs.mapbox.com/style-spec/reference/expressions/) syntax instead.
35
+ */
36
+ export type FunctionSpecification<T> = {
37
+ stops: Array<PropertyFunctionStop<T> | ZoomAndPropertyFunctionStop<T>>;
38
+ base?: number;
39
+ property?: string;
40
+ type?: 'identity' | 'exponential' | 'interval' | 'categorical';
41
+ colorSpace?: 'rgb' | 'lab' | 'hcl';
42
+ default?: T;
43
+ };
44
+
31
45
  export type CameraFunctionSpecification<T> =
32
- | {| type: 'exponential', stops: Array<[number, T]> |}
33
- | {| type: 'interval', stops: Array<[number, T]> |};
46
+ | { type: 'exponential', stops: Array<[number, T]> }
47
+ | { type: 'interval', stops: Array<[number, T]> };
34
48
 
35
49
  export type SourceFunctionSpecification<T> =
36
- | {| type: 'exponential', stops: Array<[number, T]>, property: string, default?: T |}
37
- | {| type: 'interval', stops: Array<[number, T]>, property: string, default?: T |}
38
- | {| type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T |}
39
- | {| type: 'identity', property: string, default?: T |};
50
+ | { type: 'exponential', stops: Array<[number, T]>, property: string, default?: T }
51
+ | { type: 'interval', stops: Array<[number, T]>, property: string, default?: T }
52
+ | { type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T }
53
+ | { type: 'identity', property: string, default?: T };
40
54
 
41
55
  export type CompositeFunctionSpecification<T> =
42
- | {| type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T |}
43
- | {| type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T |}
44
- | {| type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T |};
56
+ | { type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
57
+ | { type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
58
+ | { type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T };
45
59
 
46
- export type ExpressionSpecification = Array<mixed>;
60
+ export type ExpressionSpecification = [string, ...any[]];
47
61
 
48
62
  export type PropertyValueSpecification<T> =
49
63
  | T
@@ -52,25 +66,27 @@ export type PropertyValueSpecification<T> =
52
66
 
53
67
  export type DataDrivenPropertyValueSpecification<T> =
54
68
  | T
69
+ | FunctionSpecification<T>
55
70
  | CameraFunctionSpecification<T>
56
71
  | SourceFunctionSpecification<T>
57
72
  | CompositeFunctionSpecification<T>
58
73
  | ExpressionSpecification;
59
74
 
60
- export type StyleSpecification = {|
75
+ export type StyleSpecification = {
61
76
  "version": 8,
62
77
  "fragment"?: boolean,
63
78
  "name"?: string,
64
- "metadata"?: mixed,
79
+ "metadata"?: unknown,
65
80
  "center"?: Array<number>,
66
81
  "zoom"?: number,
67
82
  "bearing"?: number,
68
83
  "pitch"?: number,
69
84
  "light"?: LightSpecification,
70
85
  "lights"?: Array<LightsSpecification>,
71
- "terrain"?: ?TerrainSpecification,
86
+ "terrain"?: TerrainSpecification | null | undefined,
72
87
  "fog"?: FogSpecification,
73
88
  "camera"?: CameraSpecification,
89
+ "color-theme"?: ColorThemeSpecification,
74
90
  "imports"?: Array<ImportSpecification>,
75
91
  "schema"?: SchemaSpecification,
76
92
  "sources": SourcesSpecification,
@@ -80,7 +96,7 @@ export type StyleSpecification = {|
80
96
  "projection"?: ProjectionSpecification,
81
97
  "layers": Array<LayerSpecification>,
82
98
  "models"?: ModelsSpecification
83
- |}
99
+ }
84
100
 
85
101
  export type SourcesSpecification = {
86
102
  [_: string]: SourceSpecification
@@ -90,7 +106,7 @@ export type ModelsSpecification = {
90
106
  [_: string]: ModelSpecification
91
107
  }
92
108
 
93
- export type LightSpecification = {|
109
+ export type LightSpecification = {
94
110
  "anchor"?: PropertyValueSpecification<"map" | "viewport">,
95
111
  "position"?: PropertyValueSpecification<[number, number, number]>,
96
112
  "position-transition"?: TransitionSpecification,
@@ -98,15 +114,15 @@ export type LightSpecification = {|
98
114
  "color-transition"?: TransitionSpecification,
99
115
  "intensity"?: PropertyValueSpecification<number>,
100
116
  "intensity-transition"?: TransitionSpecification
101
- |}
117
+ }
102
118
 
103
- export type TerrainSpecification = {|
119
+ export type TerrainSpecification = {
104
120
  "source": string,
105
121
  "exaggeration"?: PropertyValueSpecification<number>,
106
122
  "exaggeration-transition"?: TransitionSpecification
107
- |}
123
+ }
108
124
 
109
- export type FogSpecification = {|
125
+ export type FogSpecification = {
110
126
  "range"?: PropertyValueSpecification<[number, number]>,
111
127
  "range-transition"?: TransitionSpecification,
112
128
  "color"?: PropertyValueSpecification<ColorSpecification>,
@@ -121,44 +137,48 @@ export type FogSpecification = {|
121
137
  "star-intensity-transition"?: TransitionSpecification,
122
138
  "vertical-range"?: PropertyValueSpecification<[number, number]>,
123
139
  "vertical-range-transition"?: TransitionSpecification
124
- |}
140
+ }
125
141
 
126
- export type CameraSpecification = {|
142
+ export type CameraSpecification = {
127
143
  "camera-projection"?: PropertyValueSpecification<"perspective" | "orthographic">,
128
144
  "camera-projection-transition"?: TransitionSpecification
129
- |}
145
+ }
146
+
147
+ export type ColorThemeSpecification = {
148
+ "data"?: ExpressionSpecification
149
+ }
130
150
 
131
- export type ProjectionSpecification = {|
151
+ export type ProjectionSpecification = {
132
152
  "name": "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel" | "globe",
133
153
  "center"?: [number, number],
134
154
  "parallels"?: [number, number]
135
- |}
155
+ }
136
156
 
137
- export type ImportSpecification = {|
157
+ export type ImportSpecification = {
138
158
  "id": string,
139
159
  "url": string,
140
160
  "config"?: ConfigSpecification,
141
161
  "data"?: StyleSpecification
142
- |}
162
+ }
143
163
 
144
164
  export type ConfigSpecification = {
145
- [_: string]: mixed
165
+ [_: string]: unknown
146
166
  }
147
167
 
148
168
  export type SchemaSpecification = {
149
169
  [_: string]: OptionSpecification
150
170
  }
151
171
 
152
- export type OptionSpecification = {|
153
- "default": mixed,
172
+ export type OptionSpecification = {
173
+ "default": ExpressionSpecification,
154
174
  "type"?: "string" | "number" | "boolean" | "color",
155
175
  "array"?: boolean,
156
176
  "minValue"?: number,
157
177
  "maxValue"?: number,
158
178
  "stepValue"?: number,
159
- "values"?: Array<mixed>,
160
- "metadata"?: mixed
161
- |}
179
+ "values"?: Array<unknown>,
180
+ "metadata"?: unknown
181
+ }
162
182
 
163
183
  export type VectorSourceSpecification = {
164
184
  "type": "vector",
@@ -171,7 +191,7 @@ export type VectorSourceSpecification = {
171
191
  "attribution"?: string,
172
192
  "promoteId"?: PromoteIdSpecification,
173
193
  "volatile"?: boolean,
174
- [_: string]: mixed
194
+ [_: string]: unknown
175
195
  }
176
196
 
177
197
  export type RasterSourceSpecification = {
@@ -185,7 +205,7 @@ export type RasterSourceSpecification = {
185
205
  "scheme"?: "xyz" | "tms",
186
206
  "attribution"?: string,
187
207
  "volatile"?: boolean,
188
- [_: string]: mixed
208
+ [_: string]: unknown
189
209
  }
190
210
 
191
211
  export type RasterDEMSourceSpecification = {
@@ -199,9 +219,12 @@ export type RasterDEMSourceSpecification = {
199
219
  "attribution"?: string,
200
220
  "encoding"?: "terrarium" | "mapbox",
201
221
  "volatile"?: boolean,
202
- [_: string]: mixed
222
+ [_: string]: unknown
203
223
  }
204
224
 
225
+ /**
226
+ * @experimental This is experimental and subject to change in future versions.
227
+ */
205
228
  export type RasterArraySourceSpecification = {
206
229
  "type": "raster-array",
207
230
  "url"?: string,
@@ -211,49 +234,49 @@ export type RasterArraySourceSpecification = {
211
234
  "maxzoom"?: number,
212
235
  "tileSize"?: number,
213
236
  "attribution"?: string,
214
- "rasterLayers"?: mixed,
237
+ "rasterLayers"?: unknown,
215
238
  "volatile"?: boolean,
216
- [_: string]: mixed
239
+ [_: string]: unknown
217
240
  }
218
241
 
219
- export type GeoJSONSourceSpecification = {|
242
+ export type GeoJSONSourceSpecification = {
220
243
  "type": "geojson",
221
- "data"?: mixed,
244
+ "data"?: GeoJSON.GeoJSON | string,
222
245
  "maxzoom"?: number,
223
246
  "minzoom"?: number,
224
247
  "attribution"?: string,
225
248
  "buffer"?: number,
226
- "filter"?: mixed,
249
+ "filter"?: unknown,
227
250
  "tolerance"?: number,
228
251
  "cluster"?: boolean,
229
252
  "clusterRadius"?: number,
230
253
  "clusterMaxZoom"?: number,
231
254
  "clusterMinPoints"?: number,
232
- "clusterProperties"?: mixed,
255
+ "clusterProperties"?: unknown,
233
256
  "lineMetrics"?: boolean,
234
257
  "generateId"?: boolean,
235
258
  "promoteId"?: PromoteIdSpecification,
236
259
  "dynamic"?: boolean
237
- |}
260
+ }
238
261
 
239
- export type VideoSourceSpecification = {|
262
+ export type VideoSourceSpecification = {
240
263
  "type": "video",
241
264
  "urls": Array<string>,
242
265
  "coordinates": [[number, number], [number, number], [number, number], [number, number]]
243
- |}
266
+ }
244
267
 
245
- export type ImageSourceSpecification = {|
268
+ export type ImageSourceSpecification = {
246
269
  "type": "image",
247
270
  "url"?: string,
248
271
  "coordinates": [[number, number], [number, number], [number, number], [number, number]]
249
- |}
272
+ }
250
273
 
251
- export type ModelSourceSpecification = {|
274
+ export type ModelSourceSpecification = {
252
275
  "type": "model" | "batched-model",
253
276
  "maxzoom"?: number,
254
277
  "minzoom"?: number,
255
278
  "tiles"?: Array<string>
256
- |}
279
+ }
257
280
 
258
281
  export type SourceSpecification =
259
282
  | VectorSourceSpecification
@@ -267,20 +290,20 @@ export type SourceSpecification =
267
290
 
268
291
  export type ModelSpecification = string;
269
292
 
270
- export type AmbientLightSpecification = {|
293
+ export type AmbientLightSpecification = {
271
294
  "id": string,
272
- "properties"?: {|
295
+ "properties"?: {
273
296
  "color"?: PropertyValueSpecification<ColorSpecification>,
274
297
  "color-transition"?: TransitionSpecification,
275
298
  "intensity"?: PropertyValueSpecification<number>,
276
299
  "intensity-transition"?: TransitionSpecification
277
- |},
300
+ },
278
301
  "type": "ambient"
279
- |}
302
+ }
280
303
 
281
- export type DirectionalLightSpecification = {|
304
+ export type DirectionalLightSpecification = {
282
305
  "id": string,
283
- "properties"?: {|
306
+ "properties"?: {
284
307
  "direction"?: PropertyValueSpecification<[number, number]>,
285
308
  "direction-transition"?: TransitionSpecification,
286
309
  "color"?: PropertyValueSpecification<ColorSpecification>,
@@ -290,13 +313,13 @@ export type DirectionalLightSpecification = {|
290
313
  "cast-shadows"?: ExpressionSpecification,
291
314
  "shadow-intensity"?: PropertyValueSpecification<number>,
292
315
  "shadow-intensity-transition"?: TransitionSpecification
293
- |},
316
+ },
294
317
  "type": "directional"
295
- |}
318
+ }
296
319
 
297
- export type FlatLightSpecification = {|
320
+ export type FlatLightSpecification = {
298
321
  "id": string,
299
- "properties"?: {|
322
+ "properties"?: {
300
323
  "anchor"?: PropertyValueSpecification<"map" | "viewport">,
301
324
  "position"?: PropertyValueSpecification<[number, number, number]>,
302
325
  "position-transition"?: TransitionSpecification,
@@ -304,30 +327,30 @@ export type FlatLightSpecification = {|
304
327
  "color-transition"?: TransitionSpecification,
305
328
  "intensity"?: PropertyValueSpecification<number>,
306
329
  "intensity-transition"?: TransitionSpecification
307
- |},
330
+ },
308
331
  "type": "flat"
309
- |}
332
+ }
310
333
 
311
334
  export type LightsSpecification =
312
335
  | AmbientLightSpecification
313
336
  | DirectionalLightSpecification
314
337
  | FlatLightSpecification;
315
338
 
316
- export type FillLayerSpecification = {|
339
+ export type FillLayerSpecification = {
317
340
  "id": string,
318
341
  "type": "fill",
319
- "metadata"?: mixed,
342
+ "metadata"?: unknown,
320
343
  "source": string,
321
344
  "source-layer"?: string,
322
345
  "slot"?: string,
323
346
  "minzoom"?: number,
324
347
  "maxzoom"?: number,
325
348
  "filter"?: FilterSpecification,
326
- "layout"?: {|
349
+ "layout"?: {
327
350
  "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>,
328
- "visibility"?: ExpressionSpecification
329
- |},
330
- "paint"?: {|
351
+ "visibility"?: "visible" | "none" | ExpressionSpecification
352
+ },
353
+ "paint"?: {
331
354
  "fill-antialias"?: PropertyValueSpecification<boolean>,
332
355
  "fill-opacity"?: DataDrivenPropertyValueSpecification<number>,
333
356
  "fill-opacity-transition"?: TransitionSpecification,
@@ -341,28 +364,42 @@ export type FillLayerSpecification = {|
341
364
  "fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
342
365
  "fill-emissive-strength"?: PropertyValueSpecification<number>,
343
366
  "fill-emissive-strength-transition"?: TransitionSpecification
344
- |}
345
- |}
367
+ }
368
+ }
369
+
370
+ /**
371
+ * @deprecated Use `FillLayerSpecification['layout']` instead.
372
+ */
373
+ export type FillLayout = FillLayerSpecification['layout'];
374
+
375
+ /**
376
+ * @deprecated Use `FillLayerSpecification['paint']` instead.
377
+ */
378
+ export type FillPaint = FillLayerSpecification['paint'];
346
379
 
347
- export type LineLayerSpecification = {|
380
+ export type LineLayerSpecification = {
348
381
  "id": string,
349
382
  "type": "line",
350
- "metadata"?: mixed,
383
+ "metadata"?: unknown,
351
384
  "source": string,
352
385
  "source-layer"?: string,
353
386
  "slot"?: string,
354
387
  "minzoom"?: number,
355
388
  "maxzoom"?: number,
356
389
  "filter"?: FilterSpecification,
357
- "layout"?: {|
390
+ "layout"?: {
358
391
  "line-cap"?: DataDrivenPropertyValueSpecification<"butt" | "round" | "square">,
359
392
  "line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter" | "none">,
360
393
  "line-miter-limit"?: PropertyValueSpecification<number>,
361
394
  "line-round-limit"?: PropertyValueSpecification<number>,
362
395
  "line-sort-key"?: DataDrivenPropertyValueSpecification<number>,
363
- "visibility"?: ExpressionSpecification
364
- |},
365
- "paint"?: {|
396
+ /**
397
+ * @experimental This property is experimental and subject to change in future versions.
398
+ */
399
+ "line-z-offset"?: DataDrivenPropertyValueSpecification<number>,
400
+ "visibility"?: "visible" | "none" | ExpressionSpecification
401
+ },
402
+ "paint"?: {
366
403
  "line-opacity"?: DataDrivenPropertyValueSpecification<number>,
367
404
  "line-opacity-transition"?: TransitionSpecification,
368
405
  "line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
@@ -382,26 +419,44 @@ export type LineLayerSpecification = {|
382
419
  "line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
383
420
  "line-gradient"?: ExpressionSpecification,
384
421
  "line-trim-offset"?: [number, number],
422
+ /**
423
+ * @experimental This property is experimental and subject to change in future versions.
424
+ */
425
+ "line-trim-fade-range"?: PropertyValueSpecification<[number, number]>,
426
+ "line-trim-color"?: PropertyValueSpecification<ColorSpecification>,
427
+ "line-trim-color-transition"?: TransitionSpecification,
385
428
  "line-emissive-strength"?: PropertyValueSpecification<number>,
386
429
  "line-emissive-strength-transition"?: TransitionSpecification,
387
430
  "line-border-width"?: DataDrivenPropertyValueSpecification<number>,
388
431
  "line-border-width-transition"?: TransitionSpecification,
389
432
  "line-border-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
390
- "line-border-color-transition"?: TransitionSpecification
391
- |}
392
- |}
433
+ "line-border-color-transition"?: TransitionSpecification,
434
+ "line-occlusion-opacity"?: PropertyValueSpecification<number>,
435
+ "line-occlusion-opacity-transition"?: TransitionSpecification
436
+ }
437
+ }
438
+
439
+ /**
440
+ * @deprecated Use `LineLayerSpecification['layout']` instead.
441
+ */
442
+ export type LineLayout = LineLayerSpecification['layout'];
443
+
444
+ /**
445
+ * @deprecated Use `LineLayerSpecification['paint']` instead.
446
+ */
447
+ export type LinePaint = LineLayerSpecification['paint'];
393
448
 
394
- export type SymbolLayerSpecification = {|
449
+ export type SymbolLayerSpecification = {
395
450
  "id": string,
396
451
  "type": "symbol",
397
- "metadata"?: mixed,
452
+ "metadata"?: unknown,
398
453
  "source": string,
399
454
  "source-layer"?: string,
400
455
  "slot"?: string,
401
456
  "minzoom"?: number,
402
457
  "maxzoom"?: number,
403
458
  "filter"?: FilterSpecification,
404
- "layout"?: {|
459
+ "layout"?: {
405
460
  "symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">,
406
461
  "symbol-spacing"?: PropertyValueSpecification<number>,
407
462
  "symbol-avoid-edges"?: PropertyValueSpecification<boolean>,
@@ -444,11 +499,13 @@ export type SymbolLayerSpecification = {|
444
499
  "text-allow-overlap"?: PropertyValueSpecification<boolean>,
445
500
  "text-ignore-placement"?: PropertyValueSpecification<boolean>,
446
501
  "text-optional"?: PropertyValueSpecification<boolean>,
447
- "visibility"?: ExpressionSpecification
448
- |},
449
- "paint"?: {|
502
+ "visibility"?: "visible" | "none" | ExpressionSpecification
503
+ },
504
+ "paint"?: {
450
505
  "icon-opacity"?: DataDrivenPropertyValueSpecification<number>,
451
506
  "icon-opacity-transition"?: TransitionSpecification,
507
+ "icon-occlusion-opacity"?: DataDrivenPropertyValueSpecification<number>,
508
+ "icon-occlusion-opacity-transition"?: TransitionSpecification,
452
509
  "icon-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
453
510
  "icon-emissive-strength-transition"?: TransitionSpecification,
454
511
  "text-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
@@ -468,6 +525,8 @@ export type SymbolLayerSpecification = {|
468
525
  "icon-image-cross-fade-transition"?: TransitionSpecification,
469
526
  "text-opacity"?: DataDrivenPropertyValueSpecification<number>,
470
527
  "text-opacity-transition"?: TransitionSpecification,
528
+ "text-occlusion-opacity"?: DataDrivenPropertyValueSpecification<number>,
529
+ "text-occlusion-opacity-transition"?: TransitionSpecification,
471
530
  "text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
472
531
  "text-color-transition"?: TransitionSpecification,
473
532
  "text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
@@ -483,24 +542,34 @@ export type SymbolLayerSpecification = {|
483
542
  "icon-color-contrast"?: ExpressionSpecification,
484
543
  "icon-color-brightness-min"?: ExpressionSpecification,
485
544
  "icon-color-brightness-max"?: ExpressionSpecification
486
- |}
487
- |}
545
+ }
546
+ }
547
+
548
+ /**
549
+ * @deprecated Use `SymbolLayerSpecification['layout']` instead.
550
+ */
551
+ export type SymbolLayout = SymbolLayerSpecification['layout'];
552
+
553
+ /**
554
+ * @deprecated Use `SymbolLayerSpecification['paint']` instead.
555
+ */
556
+ export type SymbolPaint = SymbolLayerSpecification['paint'];
488
557
 
489
- export type CircleLayerSpecification = {|
558
+ export type CircleLayerSpecification = {
490
559
  "id": string,
491
560
  "type": "circle",
492
- "metadata"?: mixed,
561
+ "metadata"?: unknown,
493
562
  "source": string,
494
563
  "source-layer"?: string,
495
564
  "slot"?: string,
496
565
  "minzoom"?: number,
497
566
  "maxzoom"?: number,
498
567
  "filter"?: FilterSpecification,
499
- "layout"?: {|
568
+ "layout"?: {
500
569
  "circle-sort-key"?: DataDrivenPropertyValueSpecification<number>,
501
- "visibility"?: ExpressionSpecification
502
- |},
503
- "paint"?: {|
570
+ "visibility"?: "visible" | "none" | ExpressionSpecification
571
+ },
572
+ "paint"?: {
504
573
  "circle-radius"?: DataDrivenPropertyValueSpecification<number>,
505
574
  "circle-radius-transition"?: TransitionSpecification,
506
575
  "circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
@@ -522,23 +591,33 @@ export type CircleLayerSpecification = {|
522
591
  "circle-stroke-opacity-transition"?: TransitionSpecification,
523
592
  "circle-emissive-strength"?: PropertyValueSpecification<number>,
524
593
  "circle-emissive-strength-transition"?: TransitionSpecification
525
- |}
526
- |}
594
+ }
595
+ }
596
+
597
+ /**
598
+ * @deprecated Use `CircleLayerSpecification['layout']` instead.
599
+ */
600
+ export type CircleLayout = CircleLayerSpecification['layout'];
601
+
602
+ /**
603
+ * @deprecated Use `CircleLayerSpecification['paint']` instead.
604
+ */
605
+ export type CirclePaint = CircleLayerSpecification['paint'];
527
606
 
528
- export type HeatmapLayerSpecification = {|
607
+ export type HeatmapLayerSpecification = {
529
608
  "id": string,
530
609
  "type": "heatmap",
531
- "metadata"?: mixed,
610
+ "metadata"?: unknown,
532
611
  "source": string,
533
612
  "source-layer"?: string,
534
613
  "slot"?: string,
535
614
  "minzoom"?: number,
536
615
  "maxzoom"?: number,
537
616
  "filter"?: FilterSpecification,
538
- "layout"?: {|
539
- "visibility"?: ExpressionSpecification
540
- |},
541
- "paint"?: {|
617
+ "layout"?: {
618
+ "visibility"?: "visible" | "none" | ExpressionSpecification
619
+ },
620
+ "paint"?: {
542
621
  "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>,
543
622
  "heatmap-radius-transition"?: TransitionSpecification,
544
623
  "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>,
@@ -547,24 +626,37 @@ export type HeatmapLayerSpecification = {|
547
626
  "heatmap-color"?: ExpressionSpecification,
548
627
  "heatmap-opacity"?: PropertyValueSpecification<number>,
549
628
  "heatmap-opacity-transition"?: TransitionSpecification
550
- |}
551
- |}
629
+ }
630
+ }
631
+
632
+ /**
633
+ * @deprecated Use `HeatmapLayerSpecification['layout']` instead.
634
+ */
635
+ export type HeatmapLayout = HeatmapLayerSpecification['layout'];
636
+
637
+ /**
638
+ * @deprecated Use `HeatmapLayerSpecification['paint']` instead.
639
+ */
640
+ export type HeatmapPaint = HeatmapLayerSpecification['paint'];
552
641
 
553
- export type FillExtrusionLayerSpecification = {|
642
+ export type FillExtrusionLayerSpecification = {
554
643
  "id": string,
555
644
  "type": "fill-extrusion",
556
- "metadata"?: mixed,
645
+ "metadata"?: unknown,
557
646
  "source": string,
558
647
  "source-layer"?: string,
559
648
  "slot"?: string,
560
649
  "minzoom"?: number,
561
650
  "maxzoom"?: number,
562
651
  "filter"?: FilterSpecification,
563
- "layout"?: {|
564
- "visibility"?: ExpressionSpecification,
652
+ "layout"?: {
653
+ "visibility"?: "visible" | "none" | ExpressionSpecification,
654
+ /**
655
+ * @experimental This property is experimental and subject to change in future versions.
656
+ */
565
657
  "fill-extrusion-edge-radius"?: ExpressionSpecification
566
- |},
567
- "paint"?: {|
658
+ },
659
+ "paint"?: {
568
660
  "fill-extrusion-opacity"?: PropertyValueSpecification<number>,
569
661
  "fill-extrusion-opacity-transition"?: TransitionSpecification,
570
662
  "fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
@@ -600,27 +692,40 @@ export type FillExtrusionLayerSpecification = {|
600
692
  "fill-extrusion-flood-light-ground-attenuation-transition"?: TransitionSpecification,
601
693
  "fill-extrusion-vertical-scale"?: PropertyValueSpecification<number>,
602
694
  "fill-extrusion-vertical-scale-transition"?: TransitionSpecification,
695
+ /**
696
+ * @experimental This property is experimental and subject to change in future versions.
697
+ */
603
698
  "fill-extrusion-rounded-roof"?: PropertyValueSpecification<boolean>,
604
699
  "fill-extrusion-cutoff-fade-range"?: ExpressionSpecification,
605
700
  "fill-extrusion-emissive-strength"?: PropertyValueSpecification<number>,
606
701
  "fill-extrusion-emissive-strength-transition"?: TransitionSpecification
607
- |}
608
- |}
702
+ }
703
+ }
704
+
705
+ /**
706
+ * @deprecated Use `FillExtrusionLayerSpecification['layout']` instead.
707
+ */
708
+ export type FillExtrusionLayout = FillExtrusionLayerSpecification['layout'];
709
+
710
+ /**
711
+ * @deprecated Use `FillExtrusionLayerSpecification['paint']` instead.
712
+ */
713
+ export type FillExtrusionPaint = FillExtrusionLayerSpecification['paint'];
609
714
 
610
- export type RasterLayerSpecification = {|
715
+ export type RasterLayerSpecification = {
611
716
  "id": string,
612
717
  "type": "raster",
613
- "metadata"?: mixed,
718
+ "metadata"?: unknown,
614
719
  "source": string,
615
720
  "source-layer"?: string,
616
721
  "slot"?: string,
617
722
  "minzoom"?: number,
618
723
  "maxzoom"?: number,
619
724
  "filter"?: FilterSpecification,
620
- "layout"?: {|
621
- "visibility"?: ExpressionSpecification
622
- |},
623
- "paint"?: {|
725
+ "layout"?: {
726
+ "visibility"?: "visible" | "none" | ExpressionSpecification
727
+ },
728
+ "paint"?: {
624
729
  "raster-opacity"?: PropertyValueSpecification<number>,
625
730
  "raster-opacity-transition"?: TransitionSpecification,
626
731
  "raster-color"?: ExpressionSpecification,
@@ -642,26 +747,39 @@ export type RasterLayerSpecification = {|
642
747
  "raster-fade-duration"?: PropertyValueSpecification<number>,
643
748
  "raster-emissive-strength"?: PropertyValueSpecification<number>,
644
749
  "raster-emissive-strength-transition"?: TransitionSpecification,
750
+ /**
751
+ * @experimental This property is experimental and subject to change in future versions.
752
+ */
645
753
  "raster-array-band"?: string,
646
754
  "raster-elevation"?: PropertyValueSpecification<number>,
647
755
  "raster-elevation-transition"?: TransitionSpecification
648
- |}
649
- |}
756
+ }
757
+ }
758
+
759
+ /**
760
+ * @deprecated Use `RasterLayerSpecification['layout']` instead.
761
+ */
762
+ export type RasterLayout = RasterLayerSpecification['layout'];
763
+
764
+ /**
765
+ * @deprecated Use `RasterLayerSpecification['paint']` instead.
766
+ */
767
+ export type RasterPaint = RasterLayerSpecification['paint'];
650
768
 
651
- export type RasterParticleLayerSpecification = {|
769
+ export type RasterParticleLayerSpecification = {
652
770
  "id": string,
653
771
  "type": "raster-particle",
654
- "metadata"?: mixed,
772
+ "metadata"?: unknown,
655
773
  "source": string,
656
774
  "source-layer"?: string,
657
775
  "slot"?: string,
658
776
  "minzoom"?: number,
659
777
  "maxzoom"?: number,
660
778
  "filter"?: FilterSpecification,
661
- "layout"?: {|
662
- "visibility"?: ExpressionSpecification
663
- |},
664
- "paint"?: {|
779
+ "layout"?: {
780
+ "visibility"?: "visible" | "none" | ExpressionSpecification
781
+ },
782
+ "paint"?: {
665
783
  "raster-particle-array-band"?: string,
666
784
  "raster-particle-count"?: number,
667
785
  "raster-particle-color"?: ExpressionSpecification,
@@ -671,23 +789,33 @@ export type RasterParticleLayerSpecification = {|
671
789
  "raster-particle-fade-opacity-factor"?: PropertyValueSpecification<number>,
672
790
  "raster-particle-fade-opacity-factor-transition"?: TransitionSpecification,
673
791
  "raster-particle-reset-rate-factor"?: number
674
- |}
675
- |}
792
+ }
793
+ }
794
+
795
+ /**
796
+ * @deprecated Use `RasterParticleLayerSpecification['layout']` instead.
797
+ */
798
+ export type RasterParticleLayout = RasterParticleLayerSpecification['layout'];
799
+
800
+ /**
801
+ * @deprecated Use `RasterParticleLayerSpecification['paint']` instead.
802
+ */
803
+ export type RasterParticlePaint = RasterParticleLayerSpecification['paint'];
676
804
 
677
- export type HillshadeLayerSpecification = {|
805
+ export type HillshadeLayerSpecification = {
678
806
  "id": string,
679
807
  "type": "hillshade",
680
- "metadata"?: mixed,
808
+ "metadata"?: unknown,
681
809
  "source": string,
682
810
  "source-layer"?: string,
683
811
  "slot"?: string,
684
812
  "minzoom"?: number,
685
813
  "maxzoom"?: number,
686
814
  "filter"?: FilterSpecification,
687
- "layout"?: {|
688
- "visibility"?: ExpressionSpecification
689
- |},
690
- "paint"?: {|
815
+ "layout"?: {
816
+ "visibility"?: "visible" | "none" | ExpressionSpecification
817
+ },
818
+ "paint"?: {
691
819
  "hillshade-illumination-direction"?: PropertyValueSpecification<number>,
692
820
  "hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">,
693
821
  "hillshade-exaggeration"?: PropertyValueSpecification<number>,
@@ -700,24 +828,34 @@ export type HillshadeLayerSpecification = {|
700
828
  "hillshade-accent-color-transition"?: TransitionSpecification,
701
829
  "hillshade-emissive-strength"?: PropertyValueSpecification<number>,
702
830
  "hillshade-emissive-strength-transition"?: TransitionSpecification
703
- |}
704
- |}
831
+ }
832
+ }
833
+
834
+ /**
835
+ * @deprecated Use `HillshadeLayerSpecification['layout']` instead.
836
+ */
837
+ export type HillshadeLayout = HillshadeLayerSpecification['layout'];
705
838
 
706
- export type ModelLayerSpecification = {|
839
+ /**
840
+ * @deprecated Use `HillshadeLayerSpecification['paint']` instead.
841
+ */
842
+ export type HillshadePaint = HillshadeLayerSpecification['paint'];
843
+
844
+ export type ModelLayerSpecification = {
707
845
  "id": string,
708
846
  "type": "model",
709
- "metadata"?: mixed,
847
+ "metadata"?: unknown,
710
848
  "source": string,
711
849
  "source-layer"?: string,
712
850
  "slot"?: string,
713
851
  "minzoom"?: number,
714
852
  "maxzoom"?: number,
715
853
  "filter"?: FilterSpecification,
716
- "layout"?: {|
717
- "visibility"?: ExpressionSpecification,
854
+ "layout"?: {
855
+ "visibility"?: "visible" | "none" | ExpressionSpecification,
718
856
  "model-id"?: DataDrivenPropertyValueSpecification<string>
719
- |},
720
- "paint"?: {|
857
+ },
858
+ "paint"?: {
721
859
  "model-opacity"?: PropertyValueSpecification<number>,
722
860
  "model-opacity-transition"?: TransitionSpecification,
723
861
  "model-rotation"?: DataDrivenPropertyValueSpecification<[number, number, number]>,
@@ -743,20 +881,33 @@ export type ModelLayerSpecification = {|
743
881
  "model-height-based-emissive-strength-multiplier-transition"?: TransitionSpecification,
744
882
  "model-cutoff-fade-range"?: ExpressionSpecification,
745
883
  "model-front-cutoff"?: PropertyValueSpecification<[number, number, number]>
746
- |}
747
- |}
884
+ }
885
+ }
886
+
887
+ /**
888
+ * @deprecated Use `ModelLayerSpecification['layout']` instead.
889
+ */
890
+ export type ModelLayout = ModelLayerSpecification['layout'];
748
891
 
749
- export type BackgroundLayerSpecification = {|
892
+ /**
893
+ * @deprecated Use `ModelLayerSpecification['paint']` instead.
894
+ */
895
+ export type ModelPaint = ModelLayerSpecification['paint'];
896
+
897
+ export type BackgroundLayerSpecification = {
750
898
  "id": string,
751
899
  "type": "background",
752
- "metadata"?: mixed,
900
+ "metadata"?: unknown,
901
+ "source"?: never,
902
+ "source-layer"?: never,
753
903
  "slot"?: string,
754
904
  "minzoom"?: number,
755
905
  "maxzoom"?: number,
756
- "layout"?: {|
757
- "visibility"?: ExpressionSpecification
758
- |},
759
- "paint"?: {|
906
+ "filter"?: never,
907
+ "layout"?: {
908
+ "visibility"?: "visible" | "none" | ExpressionSpecification
909
+ },
910
+ "paint"?: {
760
911
  "background-color"?: PropertyValueSpecification<ColorSpecification>,
761
912
  "background-color-transition"?: TransitionSpecification,
762
913
  "background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>,
@@ -764,20 +915,33 @@ export type BackgroundLayerSpecification = {|
764
915
  "background-opacity-transition"?: TransitionSpecification,
765
916
  "background-emissive-strength"?: PropertyValueSpecification<number>,
766
917
  "background-emissive-strength-transition"?: TransitionSpecification
767
- |}
768
- |}
918
+ }
919
+ }
920
+
921
+ /**
922
+ * @deprecated Use `BackgroundLayerSpecification['layout']` instead.
923
+ */
924
+ export type BackgroundLayout = BackgroundLayerSpecification['layout'];
769
925
 
770
- export type SkyLayerSpecification = {|
926
+ /**
927
+ * @deprecated Use `BackgroundLayerSpecification['paint']` instead.
928
+ */
929
+ export type BackgroundPaint = BackgroundLayerSpecification['paint'];
930
+
931
+ export type SkyLayerSpecification = {
771
932
  "id": string,
772
933
  "type": "sky",
773
- "metadata"?: mixed,
934
+ "metadata"?: unknown,
935
+ "source"?: never,
936
+ "source-layer"?: never,
774
937
  "slot"?: string,
775
938
  "minzoom"?: number,
776
939
  "maxzoom"?: number,
777
- "layout"?: {|
778
- "visibility"?: ExpressionSpecification
779
- |},
780
- "paint"?: {|
940
+ "filter"?: never,
941
+ "layout"?: {
942
+ "visibility"?: "visible" | "none" | ExpressionSpecification
943
+ },
944
+ "paint"?: {
781
945
  "sky-type"?: PropertyValueSpecification<"gradient" | "atmosphere">,
782
946
  "sky-atmosphere-sun"?: PropertyValueSpecification<[number, number]>,
783
947
  "sky-atmosphere-sun-intensity"?: number,
@@ -788,15 +952,56 @@ export type SkyLayerSpecification = {|
788
952
  "sky-atmosphere-color"?: ColorSpecification,
789
953
  "sky-opacity"?: PropertyValueSpecification<number>,
790
954
  "sky-opacity-transition"?: TransitionSpecification
791
- |}
792
- |}
955
+ }
956
+ }
957
+
958
+ /**
959
+ * @deprecated Use `SkyLayerSpecification['layout']` instead.
960
+ */
961
+ export type SkyLayout = SkyLayerSpecification['layout'];
793
962
 
794
- export type SlotLayerSpecification = {|
963
+ /**
964
+ * @deprecated Use `SkyLayerSpecification['paint']` instead.
965
+ */
966
+ export type SkyPaint = SkyLayerSpecification['paint'];
967
+
968
+ export type SlotLayerSpecification = {
795
969
  "id": string,
796
970
  "type": "slot",
797
- "metadata"?: mixed,
798
- "slot"?: string
799
- |}
971
+ "metadata"?: unknown,
972
+ "source"?: never,
973
+ "source-layer"?: never,
974
+ "slot"?: string,
975
+ "minzoom"?: never,
976
+ "maxzoom"?: never,
977
+ "filter"?: never,
978
+ "layout"?: never,
979
+ "paint"?: never
980
+ }
981
+
982
+ export type ClipLayerSpecification = {
983
+ "id": string,
984
+ "type": "clip",
985
+ "metadata"?: unknown,
986
+ "source": string,
987
+ "source-layer"?: string,
988
+ "slot"?: string,
989
+ "minzoom"?: number,
990
+ "maxzoom"?: number,
991
+ "filter"?: FilterSpecification,
992
+ "layout"?: {
993
+ /**
994
+ * @experimental This property is experimental and subject to change in future versions.
995
+ */
996
+ "clip-layer-types"?: ExpressionSpecification
997
+ },
998
+ "paint"?: never
999
+ }
1000
+
1001
+ /**
1002
+ * @deprecated Use `ClipLayerSpecification['layout']` instead.
1003
+ */
1004
+ export type ClipLayout = ClipLayerSpecification['layout'];
800
1005
 
801
1006
  export type LayerSpecification =
802
1007
  | FillLayerSpecification
@@ -811,5 +1016,162 @@ export type LayerSpecification =
811
1016
  | ModelLayerSpecification
812
1017
  | BackgroundLayerSpecification
813
1018
  | SkyLayerSpecification
814
- | SlotLayerSpecification;
1019
+ | SlotLayerSpecification
1020
+ | ClipLayerSpecification;
1021
+
1022
+ // Aliases for easier migration from @types/mapbox-gl
1023
+
1024
+ export type Layer = Pick<
1025
+ LayerSpecification,
1026
+ | "id"
1027
+ | "type"
1028
+ | "source"
1029
+ | "source-layer"
1030
+ | "slot"
1031
+ | "filter"
1032
+ | "layout"
1033
+ | "paint"
1034
+ | "minzoom"
1035
+ | "maxzoom"
1036
+ | "metadata"
1037
+ >;
1038
+
1039
+ /**
1040
+ * @deprecated Use `StyleSpecification` instead.
1041
+ */
1042
+ export type Style = StyleSpecification;
1043
+
1044
+ /**
1045
+ * @deprecated Use `LayerSpecification` instead.
1046
+ */
1047
+ export type AnyLayer = LayerSpecification;
1048
+
1049
+ /**
1050
+ * @deprecated Use `FillLayerSpecification` instead.
1051
+ */
1052
+ export type FillLayer = FillLayerSpecification;
1053
+
1054
+ /**
1055
+ * @deprecated Use `LineLayerSpecification` instead.
1056
+ */
1057
+ export type LineLayer = LineLayerSpecification;
1058
+
1059
+ /**
1060
+ * @deprecated Use `SymbolLayerSpecification` instead.
1061
+ */
1062
+ export type SymbolLayer = SymbolLayerSpecification;
1063
+
1064
+ /**
1065
+ * @deprecated Use `CircleLayerSpecification` instead.
1066
+ */
1067
+ export type CircleLayer = CircleLayerSpecification;
1068
+
1069
+ /**
1070
+ * @deprecated Use `HeatmapLayerSpecification` instead.
1071
+ */
1072
+ export type HeatmapLayer = HeatmapLayerSpecification;
1073
+
1074
+ /**
1075
+ * @deprecated Use `FillExtrusionLayerSpecification` instead.
1076
+ */
1077
+ export type FillExtrusionLayer = FillExtrusionLayerSpecification;
1078
+
1079
+ /**
1080
+ * @deprecated Use `RasterLayerSpecification` instead.
1081
+ */
1082
+ export type RasterLayer = RasterLayerSpecification;
1083
+
1084
+ /**
1085
+ * @deprecated Use `RasterParticleLayerSpecification` instead.
1086
+ */
1087
+ export type RasterParticleLayer = RasterParticleLayerSpecification;
1088
+
1089
+ /**
1090
+ * @deprecated Use `HillshadeLayerSpecification` instead.
1091
+ */
1092
+ export type HillshadeLayer = HillshadeLayerSpecification;
1093
+
1094
+ /**
1095
+ * @deprecated Use `ModelLayerSpecification` instead.
1096
+ */
1097
+ export type ModelLayer = ModelLayerSpecification;
1098
+
1099
+ /**
1100
+ * @deprecated Use `BackgroundLayerSpecification` instead.
1101
+ */
1102
+ export type BackgroundLayer = BackgroundLayerSpecification;
1103
+
1104
+ /**
1105
+ * @deprecated Use `SkyLayerSpecification` instead.
1106
+ */
1107
+ export type SkyLayer = SkyLayerSpecification;
1108
+
1109
+ /**
1110
+ * @deprecated Use `SlotLayerSpecification` instead.
1111
+ */
1112
+ export type SlotLayer = SlotLayerSpecification;
1113
+
1114
+ /**
1115
+ * @deprecated Use `ClipLayerSpecification` instead.
1116
+ */
1117
+ export type ClipLayer = ClipLayerSpecification;
1118
+
1119
+ /**
1120
+ * @deprecated
1121
+ */
1122
+ export type AnyLayout =
1123
+ | FillLayout
1124
+ | LineLayout
1125
+ | SymbolLayout
1126
+ | CircleLayout
1127
+ | HeatmapLayout
1128
+ | FillExtrusionLayout
1129
+ | RasterLayout
1130
+ | RasterParticleLayout
1131
+ | HillshadeLayout
1132
+ | ModelLayout
1133
+ | BackgroundLayout
1134
+ | SkyLayout
1135
+ | ClipLayout;
1136
+
1137
+ /**
1138
+ * @deprecated
1139
+ */
1140
+ export type AnyPaint =
1141
+ | FillPaint
1142
+ | LinePaint
1143
+ | SymbolPaint
1144
+ | CirclePaint
1145
+ | HeatmapPaint
1146
+ | FillExtrusionPaint
1147
+ | RasterPaint
1148
+ | RasterParticlePaint
1149
+ | HillshadePaint
1150
+ | ModelPaint
1151
+ | BackgroundPaint
1152
+ | SkyPaint;
1153
+
1154
+ /**
1155
+ * @deprecated Use `ExpressionSpecification` instead.
1156
+ */
1157
+ export type Expression = ExpressionSpecification;
1158
+
1159
+ /**
1160
+ * @deprecated Use `TransitionSpecification` instead.
1161
+ */
1162
+ export type Transition = TransitionSpecification;
1163
+
1164
+ /**
1165
+ * @deprecated Use `SourceSpecification` instead.
1166
+ */
1167
+ export type AnySourceData = SourceSpecification;
1168
+
1169
+ /**
1170
+ * @deprecated Use `SourcesSpecification` instead.
1171
+ */
1172
+ export type Sources = SourcesSpecification;
815
1173
 
1174
+ /**
1175
+ * @deprecated Use `ProjectionSpecification` instead.
1176
+ */
1177
+ export type Projection = ProjectionSpecification;