@mapbox/mapbox-gl-style-spec 14.14.0-beta.1 → 14.14.0-beta.2

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.
@@ -14,7 +14,7 @@ export type IconsetParams = {id: string};
14
14
  export type ImageOptions = {
15
15
  params?: ImageParams;
16
16
  iconset?: IconsetParams;
17
- }
17
+ };
18
18
 
19
19
  type SerializedImageOptions = {
20
20
  params?: Record<string, SerializedExpression>;
@@ -19,7 +19,7 @@ export type StringifiedImageVariant = Brand<string, 'ImageVariant'>;
19
19
  export type RasterizationOptions = {
20
20
  params?: Record<string, Color>;
21
21
  transform?: DOMMatrix;
22
- }
22
+ };
23
23
 
24
24
  /**
25
25
  * `ImageVariant` is a component of {@link ResolvedImage}
@@ -34,8 +34,19 @@ export type ResolvedImageTypeT = {
34
34
 
35
35
  export type EvaluationKind = 'constant' | 'source' | 'camera' | 'composite';
36
36
 
37
- export type Type = NullTypeT | NumberTypeT | StringTypeT | BooleanTypeT | ColorTypeT | ObjectTypeT | ValueTypeT |
38
- ArrayType | ErrorTypeT | CollatorTypeT | FormattedTypeT | ResolvedImageTypeT;
37
+ export type Type =
38
+ | NullTypeT
39
+ | NumberTypeT
40
+ | StringTypeT
41
+ | BooleanTypeT
42
+ | ColorTypeT
43
+ | ObjectTypeT
44
+ | ValueTypeT
45
+ | ArrayType
46
+ | ErrorTypeT
47
+ | CollatorTypeT
48
+ | FormattedTypeT
49
+ | ResolvedImageTypeT;
39
50
 
40
51
  export type ArrayType = {
41
52
  kind: 'array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
- "version": "14.14.0-beta.1",
3
+ "version": "14.14.0-beta.2",
4
4
  "description": "a specification for mapbox gl styles",
5
5
  "author": "Mapbox",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
package/style-spec.ts CHANGED
@@ -5,7 +5,7 @@ export type ExpressionSpecification = {
5
5
  interpolated: boolean,
6
6
  parameters?: ExpressionParameters,
7
7
  relaxZoomRestriction?: boolean
8
- }
8
+ };
9
9
 
10
10
  export type StylePropertySpecification = {
11
11
  type: 'number',
package/types.ts CHANGED
@@ -45,19 +45,19 @@ export type FunctionSpecification<T> = {
45
45
  };
46
46
 
47
47
  export type CameraFunctionSpecification<T> =
48
- | { type: 'exponential', stops: Array<[number, T]> }
49
- | { type: 'interval', stops: Array<[number, T]> };
48
+ | {type: 'exponential', stops: Array<[number, T]>}
49
+ | {type: 'interval', stops: Array<[number, T]>};
50
50
 
51
51
  export type SourceFunctionSpecification<T> =
52
- | { type: 'exponential', stops: Array<[number, T]>, property: string, default?: T }
53
- | { type: 'interval', stops: Array<[number, T]>, property: string, default?: T }
54
- | { type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T }
55
- | { type: 'identity', property: string, default?: T };
52
+ | {type: 'exponential', stops: Array<[number, T]>, property: string, default?: T}
53
+ | {type: 'interval', stops: Array<[number, T]>, property: string, default?: T}
54
+ | {type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T}
55
+ | {type: 'identity', property: string, default?: T};
56
56
 
57
57
  export type CompositeFunctionSpecification<T> =
58
- | { type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
59
- | { type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
60
- | { type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T };
58
+ | {type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T}
59
+ | {type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T}
60
+ | {type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T};
61
61
 
62
62
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
63
  export type ExpressionSpecification = [string, ...any[]];
@@ -120,19 +120,19 @@ export type StyleSpecification = {
120
120
  * @experimental This property is experimental and subject to change in future versions.
121
121
  */
122
122
  "featuresets"?: FeaturesetsSpecification
123
- }
123
+ };
124
124
 
125
125
  export type SourcesSpecification = {
126
126
  [_: string]: SourceSpecification
127
- }
127
+ };
128
128
 
129
129
  export type ModelsSpecification = {
130
130
  [_: string]: ModelSpecification
131
- }
131
+ };
132
132
 
133
133
  export type IconsetsSpecification = {
134
134
  [_: string]: IconsetSpecification
135
- }
135
+ };
136
136
 
137
137
  export type LightSpecification = {
138
138
  "anchor"?: PropertyValueSpecification<"map" | "viewport">,
@@ -143,13 +143,13 @@ export type LightSpecification = {
143
143
  "color-use-theme"?: PropertyValueSpecification<string>,
144
144
  "intensity"?: PropertyValueSpecification<number>,
145
145
  "intensity-transition"?: TransitionSpecification
146
- }
146
+ };
147
147
 
148
148
  export type TerrainSpecification = {
149
149
  "source": string,
150
150
  "exaggeration"?: PropertyValueSpecification<number>,
151
151
  "exaggeration-transition"?: TransitionSpecification
152
- }
152
+ };
153
153
 
154
154
  export type FogSpecification = {
155
155
  "range"?: PropertyValueSpecification<[number, number]>,
@@ -169,7 +169,7 @@ export type FogSpecification = {
169
169
  "star-intensity-transition"?: TransitionSpecification,
170
170
  "vertical-range"?: PropertyValueSpecification<[number, number]>,
171
171
  "vertical-range-transition"?: TransitionSpecification
172
- }
172
+ };
173
173
 
174
174
  export type SnowSpecification = {
175
175
  /**
@@ -219,7 +219,7 @@ export type SnowSpecification = {
219
219
  */
220
220
  "flake-size"?: PropertyValueSpecification<number>,
221
221
  "flake-size-transition"?: TransitionSpecification
222
- }
222
+ };
223
223
 
224
224
  export type RainSpecification = {
225
225
  /**
@@ -274,22 +274,22 @@ export type RainSpecification = {
274
274
  */
275
275
  "distortion-strength"?: PropertyValueSpecification<number>,
276
276
  "distortion-strength-transition"?: TransitionSpecification
277
- }
277
+ };
278
278
 
279
279
  export type CameraSpecification = {
280
280
  "camera-projection"?: PropertyValueSpecification<"perspective" | "orthographic">,
281
281
  "camera-projection-transition"?: TransitionSpecification
282
- }
282
+ };
283
283
 
284
284
  export type ColorThemeSpecification = {
285
285
  "data"?: ExpressionSpecification
286
- }
286
+ };
287
287
 
288
288
  export type ProjectionSpecification = {
289
289
  "name": "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel" | "globe",
290
290
  "center"?: [number, number],
291
291
  "parallels"?: [number, number]
292
- }
292
+ };
293
293
 
294
294
  export type ImportSpecification = {
295
295
  "id": string,
@@ -297,7 +297,7 @@ export type ImportSpecification = {
297
297
  "config"?: ConfigSpecification,
298
298
  "data"?: StyleSpecification,
299
299
  "color-theme"?: ColorThemeSpecification | null | undefined
300
- }
300
+ };
301
301
 
302
302
  export type IndoorSpecification = {
303
303
  /**
@@ -308,15 +308,15 @@ export type IndoorSpecification = {
308
308
  * @experimental This property is experimental and subject to change in future versions.
309
309
  */
310
310
  "buildingFeaturesetId"?: ExpressionSpecification
311
- }
311
+ };
312
312
 
313
313
  export type ConfigSpecification = {
314
314
  [_: string]: unknown
315
- }
315
+ };
316
316
 
317
317
  export type SchemaSpecification = {
318
318
  [_: string]: OptionSpecification
319
- }
319
+ };
320
320
 
321
321
  export type OptionSpecification = {
322
322
  "default": ExpressionSpecification,
@@ -327,14 +327,14 @@ export type OptionSpecification = {
327
327
  "stepValue"?: number,
328
328
  "values"?: Array<unknown>,
329
329
  "metadata"?: unknown
330
- }
330
+ };
331
331
 
332
332
  /**
333
333
  * @experimental This is experimental and subject to change in future versions.
334
334
  */
335
335
  export type FeaturesetsSpecification = {
336
336
  [_: string]: FeaturesetSpecification
337
- }
337
+ };
338
338
 
339
339
  /**
340
340
  * @experimental This is experimental and subject to change in future versions.
@@ -348,7 +348,7 @@ export type FeaturesetSpecification = {
348
348
  * @experimental This property is experimental and subject to change in future versions.
349
349
  */
350
350
  "selectors"?: Array<SelectorSpecification>
351
- }
351
+ };
352
352
 
353
353
  /**
354
354
  * @experimental This is experimental and subject to change in future versions.
@@ -370,7 +370,7 @@ export type SelectorSpecification = {
370
370
  * @experimental This property is experimental and subject to change in future versions.
371
371
  */
372
372
  "_uniqueFeatureID"?: boolean
373
- }
373
+ };
374
374
 
375
375
  /**
376
376
  * @experimental This is experimental and subject to change in future versions.
@@ -380,7 +380,7 @@ export type SelectorPropertySpecification = {
380
380
  * @experimental This property is experimental and subject to change in future versions.
381
381
  */
382
382
  [_: string]: unknown
383
- }
383
+ };
384
384
 
385
385
  export type VectorSourceSpecification = {
386
386
  "type": "vector",
@@ -398,7 +398,7 @@ export type VectorSourceSpecification = {
398
398
  "promoteId"?: PromoteIdSpecification,
399
399
  "volatile"?: boolean,
400
400
  [_: string]: unknown
401
- }
401
+ };
402
402
 
403
403
  export type RasterSourceSpecification = {
404
404
  "type": "raster",
@@ -416,7 +416,7 @@ export type RasterSourceSpecification = {
416
416
  "attribution"?: string,
417
417
  "volatile"?: boolean,
418
418
  [_: string]: unknown
419
- }
419
+ };
420
420
 
421
421
  export type RasterDEMSourceSpecification = {
422
422
  "type": "raster-dem",
@@ -434,7 +434,7 @@ export type RasterDEMSourceSpecification = {
434
434
  "encoding"?: "terrarium" | "mapbox",
435
435
  "volatile"?: boolean,
436
436
  [_: string]: unknown
437
- }
437
+ };
438
438
 
439
439
  /**
440
440
  * @experimental This is experimental and subject to change in future versions.
@@ -455,7 +455,7 @@ export type RasterArraySourceSpecification = {
455
455
  "rasterLayers"?: unknown,
456
456
  "volatile"?: boolean,
457
457
  [_: string]: unknown
458
- }
458
+ };
459
459
 
460
460
  export type GeoJSONSourceSpecification = {
461
461
  "type": "geojson",
@@ -475,26 +475,26 @@ export type GeoJSONSourceSpecification = {
475
475
  "generateId"?: boolean,
476
476
  "promoteId"?: PromoteIdSpecification,
477
477
  "dynamic"?: boolean
478
- }
478
+ };
479
479
 
480
480
  export type VideoSourceSpecification = {
481
481
  "type": "video",
482
482
  "urls": Array<string>,
483
483
  "coordinates": [[number, number], [number, number], [number, number], [number, number]]
484
- }
484
+ };
485
485
 
486
486
  export type ImageSourceSpecification = {
487
487
  "type": "image",
488
488
  "url"?: string,
489
489
  "coordinates": [[number, number], [number, number], [number, number], [number, number]]
490
- }
490
+ };
491
491
 
492
492
  export type ModelSourceSpecification = {
493
493
  "type": "model" | "batched-model",
494
494
  "maxzoom"?: number,
495
495
  "minzoom"?: number,
496
496
  "tiles"?: Array<string>
497
- }
497
+ };
498
498
 
499
499
  export type SourceSpecification =
500
500
  | VectorSourceSpecification
@@ -504,7 +504,7 @@ export type SourceSpecification =
504
504
  | GeoJSONSourceSpecification
505
505
  | VideoSourceSpecification
506
506
  | ImageSourceSpecification
507
- | ModelSourceSpecification
507
+ | ModelSourceSpecification;
508
508
 
509
509
  export type IconsetSpecification =
510
510
  | {
@@ -514,7 +514,7 @@ export type IconsetSpecification =
514
514
  | {
515
515
  "type": "source",
516
516
  "source": string
517
- }
517
+ };
518
518
 
519
519
  export type ModelSpecification = string;
520
520
 
@@ -528,7 +528,7 @@ export type AmbientLightSpecification = {
528
528
  "intensity-transition"?: TransitionSpecification
529
529
  },
530
530
  "type": "ambient"
531
- }
531
+ };
532
532
 
533
533
  export type DirectionalLightSpecification = {
534
534
  "id": string,
@@ -549,7 +549,7 @@ export type DirectionalLightSpecification = {
549
549
  "shadow-intensity-transition"?: TransitionSpecification
550
550
  },
551
551
  "type": "directional"
552
- }
552
+ };
553
553
 
554
554
  export type FlatLightSpecification = {
555
555
  "id": string,
@@ -564,7 +564,7 @@ export type FlatLightSpecification = {
564
564
  "intensity-transition"?: TransitionSpecification
565
565
  },
566
566
  "type": "flat"
567
- }
567
+ };
568
568
 
569
569
  export type LightsSpecification =
570
570
  | AmbientLightSpecification
@@ -628,7 +628,7 @@ export type FillLayerSpecification = {
628
628
  "fill-tunnel-structure-color-transition"?: TransitionSpecification,
629
629
  "fill-tunnel-structure-color-use-theme"?: PropertyValueSpecification<string>
630
630
  }
631
- }
631
+ };
632
632
 
633
633
  /**
634
634
  * @deprecated Use `FillLayerSpecification['layout']` instead.
@@ -717,7 +717,7 @@ export type LineLayerSpecification = {
717
717
  "line-occlusion-opacity"?: PropertyValueSpecification<number>,
718
718
  "line-occlusion-opacity-transition"?: TransitionSpecification
719
719
  }
720
- }
720
+ };
721
721
 
722
722
  /**
723
723
  * @deprecated Use `LineLayerSpecification['layout']` instead.
@@ -846,7 +846,7 @@ export type SymbolLayerSpecification = {
846
846
  "symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>,
847
847
  "symbol-z-offset-transition"?: TransitionSpecification
848
848
  }
849
- }
849
+ };
850
850
 
851
851
  /**
852
852
  * @deprecated Use `SymbolLayerSpecification['layout']` instead.
@@ -901,7 +901,7 @@ export type CircleLayerSpecification = {
901
901
  "circle-emissive-strength"?: PropertyValueSpecification<number>,
902
902
  "circle-emissive-strength-transition"?: TransitionSpecification
903
903
  }
904
- }
904
+ };
905
905
 
906
906
  /**
907
907
  * @deprecated Use `CircleLayerSpecification['layout']` instead.
@@ -937,7 +937,7 @@ export type HeatmapLayerSpecification = {
937
937
  "heatmap-opacity"?: PropertyValueSpecification<number>,
938
938
  "heatmap-opacity-transition"?: TransitionSpecification
939
939
  }
940
- }
940
+ };
941
941
 
942
942
  /**
943
943
  * @deprecated Use `HeatmapLayerSpecification['layout']` instead.
@@ -1054,7 +1054,7 @@ export type FillExtrusionLayerSpecification = {
1054
1054
  "fill-extrusion-line-width-transition"?: TransitionSpecification,
1055
1055
  "fill-extrusion-cast-shadows"?: boolean
1056
1056
  }
1057
- }
1057
+ };
1058
1058
 
1059
1059
  /**
1060
1060
  * @deprecated Use `FillExtrusionLayerSpecification['layout']` instead.
@@ -1155,7 +1155,7 @@ export type BuildingLayerSpecification = {
1155
1155
  "building-facade-emissive-chance"?: PropertyValueSpecification<number>,
1156
1156
  "building-cutoff-fade-range"?: ExpressionSpecification
1157
1157
  }
1158
- }
1158
+ };
1159
1159
 
1160
1160
  /**
1161
1161
  * @deprecated Use `BuildingLayerSpecification['layout']` instead.
@@ -1213,7 +1213,7 @@ export type RasterLayerSpecification = {
1213
1213
  "raster-elevation"?: PropertyValueSpecification<number>,
1214
1214
  "raster-elevation-transition"?: TransitionSpecification
1215
1215
  }
1216
- }
1216
+ };
1217
1217
 
1218
1218
  /**
1219
1219
  * @deprecated Use `RasterLayerSpecification['layout']` instead.
@@ -1252,7 +1252,7 @@ export type RasterParticleLayerSpecification = {
1252
1252
  "raster-particle-elevation"?: PropertyValueSpecification<number>,
1253
1253
  "raster-particle-elevation-transition"?: TransitionSpecification
1254
1254
  }
1255
- }
1255
+ };
1256
1256
 
1257
1257
  /**
1258
1258
  * @deprecated Use `RasterParticleLayerSpecification['layout']` instead.
@@ -1294,7 +1294,7 @@ export type HillshadeLayerSpecification = {
1294
1294
  "hillshade-emissive-strength"?: PropertyValueSpecification<number>,
1295
1295
  "hillshade-emissive-strength-transition"?: TransitionSpecification
1296
1296
  }
1297
- }
1297
+ };
1298
1298
 
1299
1299
  /**
1300
1300
  * @deprecated Use `HillshadeLayerSpecification['layout']` instead.
@@ -1348,7 +1348,7 @@ export type ModelLayerSpecification = {
1348
1348
  "model-cutoff-fade-range"?: ExpressionSpecification,
1349
1349
  "model-front-cutoff"?: PropertyValueSpecification<[number, number, number]>
1350
1350
  }
1351
- }
1351
+ };
1352
1352
 
1353
1353
  /**
1354
1354
  * @deprecated Use `ModelLayerSpecification['layout']` instead.
@@ -1387,7 +1387,7 @@ export type BackgroundLayerSpecification = {
1387
1387
  "background-emissive-strength"?: PropertyValueSpecification<number>,
1388
1388
  "background-emissive-strength-transition"?: TransitionSpecification
1389
1389
  }
1390
- }
1390
+ };
1391
1391
 
1392
1392
  /**
1393
1393
  * @deprecated Use `BackgroundLayerSpecification['layout']` instead.
@@ -1427,7 +1427,7 @@ export type SkyLayerSpecification = {
1427
1427
  "sky-opacity"?: PropertyValueSpecification<number>,
1428
1428
  "sky-opacity-transition"?: TransitionSpecification
1429
1429
  }
1430
- }
1430
+ };
1431
1431
 
1432
1432
  /**
1433
1433
  * @deprecated Use `SkyLayerSpecification['layout']` instead.
@@ -1451,7 +1451,7 @@ export type SlotLayerSpecification = {
1451
1451
  "filter"?: never,
1452
1452
  "layout"?: never,
1453
1453
  "paint"?: never
1454
- }
1454
+ };
1455
1455
 
1456
1456
  export type ClipLayerSpecification = {
1457
1457
  "id": string,
@@ -1468,7 +1468,7 @@ export type ClipLayerSpecification = {
1468
1468
  "clip-layer-scope"?: ExpressionSpecification
1469
1469
  },
1470
1470
  "paint"?: never
1471
- }
1471
+ };
1472
1472
 
1473
1473
  /**
1474
1474
  * @deprecated Use `ClipLayerSpecification['layout']` instead.
@@ -32,7 +32,7 @@ export default function validateLayer(options: Options): Array<ValidationError>
32
32
  if (layer.id) {
33
33
  const layerId = unbundle(layer.id);
34
34
  for (let i = 0; i < options.arrayIndex; i++) {
35
- const otherLayer = style.layers[i] as LayerSpecification & { id: { __line__: number } };
35
+ const otherLayer = style.layers[i] as LayerSpecification & {id: {__line__: number}};
36
36
  if (unbundle(otherLayer.id) === layerId) {
37
37
  errors.push(new ValidationError(key, layer.id, `duplicate layer id "${layer.id}", previously used at line ${otherLayer.id.__line__}`));
38
38
  }
@@ -44,7 +44,7 @@ export default function validateLights(options: Options): Array<ValidationError>
44
44
  for (let i = 0; i < options.arrayIndex; i++) {
45
45
  const lightType = unbundle(light.type);
46
46
  // const otherLight = lights[i];
47
- const otherLight = lights[i] as LightsSpecification & { id: { __line__: number } };
47
+ const otherLight = lights[i] as LightsSpecification & {id: {__line__: number}};
48
48
  if (unbundle(otherLight.type) === lightType) {
49
49
  errors.push(new ValidationError(key, light.id, `duplicate light type "${light.type}", previously defined at line ${otherLight.id.__line__}`));
50
50
  }
package/visit.ts CHANGED
@@ -41,7 +41,7 @@ type PropertyCallback = (
41
41
  arg1: {
42
42
  path: [string, 'paint' | 'layout', string] // [layerid, paint/layout, property key];
43
43
  key: string;
44
- value: PropertyValueSpecification<unknown> ;
44
+ value: PropertyValueSpecification<unknown>;
45
45
  reference: StylePropertySpecification;
46
46
  set: (
47
47
  arg1: PropertyValueSpecification<unknown>,