@mapbox/mapbox-gl-style-spec 14.6.0 → 14.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/index.cjs +206 -337
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +54 -27
  4. package/dist/index.es.js +206 -337
  5. package/dist/index.es.js.map +1 -1
  6. package/expression/compound_expression.ts +1 -2
  7. package/expression/definitions/assertion.ts +1 -2
  8. package/expression/definitions/at.ts +0 -1
  9. package/expression/definitions/case.ts +0 -1
  10. package/expression/definitions/coalesce.ts +1 -2
  11. package/expression/definitions/coercion.ts +1 -2
  12. package/expression/definitions/collator.ts +7 -5
  13. package/expression/definitions/distance.ts +1 -1
  14. package/expression/definitions/format.ts +4 -4
  15. package/expression/definitions/index.ts +0 -1
  16. package/expression/definitions/interpolate.ts +1 -2
  17. package/expression/definitions/length.ts +1 -2
  18. package/expression/definitions/match.ts +0 -1
  19. package/expression/definitions/number_format.ts +5 -5
  20. package/expression/definitions/step.ts +0 -1
  21. package/expression/definitions/within.ts +3 -3
  22. package/expression/expression.ts +4 -4
  23. package/expression/index.ts +3 -6
  24. package/expression/is_constant.ts +1 -0
  25. package/expression/parsing_context.ts +28 -5
  26. package/expression/values.ts +1 -2
  27. package/feature_filter/index.ts +6 -5
  28. package/group_by_layout.ts +2 -2
  29. package/package.json +1 -1
  30. package/reference/v8.json +158 -30
  31. package/rollup.config.js +1 -2
  32. package/style-spec.ts +2 -3
  33. package/types.ts +57 -35
  34. package/union-to-intersection.ts +4 -0
  35. package/util/color.ts +1 -0
  36. package/util/color_spaces.ts +0 -1
  37. package/util/deep_equal.ts +1 -1
  38. package/util/geometry_util.ts +1 -2
  39. package/validate/validate.ts +2 -3
  40. package/validate/validate_expression.ts +0 -1
  41. package/validate/validate_function.ts +1 -1
  42. package/validate/validate_property.ts +2 -3
  43. package/validate/validate_style.ts +1 -2
  44. package/validate_style.min.ts +0 -1
  45. package/visit.ts +2 -2
package/dist/index.d.ts CHANGED
@@ -205,6 +205,10 @@ type StyleSpecification = {
205
205
  "projection"?: ProjectionSpecification;
206
206
  "layers": Array<LayerSpecification>;
207
207
  "models"?: ModelsSpecification;
208
+ /**
209
+ * @experimental This property is experimental and subject to change in future versions.
210
+ */
211
+ "featuresets"?: FeaturesetsSpecification;
208
212
  };
209
213
  type SourcesSpecification = {
210
214
  [_: string]: SourceSpecification;
@@ -292,6 +296,20 @@ type OptionSpecification = {
292
296
  "values"?: Array<unknown>;
293
297
  "metadata"?: unknown;
294
298
  };
299
+ type FeaturesetsSpecification = {
300
+ [_: string]: FeaturesetSpecification;
301
+ };
302
+ type FeaturesetSpecification = {
303
+ "selectors"?: Array<SelectorSpecification>;
304
+ };
305
+ type SelectorSpecification = {
306
+ "layer": string;
307
+ "properties"?: SelectorPropertySpecification;
308
+ "featureNamespace"?: string;
309
+ };
310
+ type SelectorPropertySpecification = {
311
+ [_: string]: unknown;
312
+ };
295
313
  type VectorSourceSpecification = {
296
314
  "type": "vector";
297
315
  "url"?: string;
@@ -457,7 +475,7 @@ type DirectionalLightSpecification = {
457
475
  "color-transition"?: TransitionSpecification;
458
476
  "intensity"?: PropertyValueSpecification<number>;
459
477
  "intensity-transition"?: TransitionSpecification;
460
- "cast-shadows"?: ExpressionSpecification;
478
+ "cast-shadows"?: boolean;
461
479
  "shadow-intensity"?: PropertyValueSpecification<number>;
462
480
  "shadow-intensity-transition"?: TransitionSpecification;
463
481
  };
@@ -512,6 +530,8 @@ type FillLayerSpecification = {
512
530
  "fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
513
531
  "fill-emissive-strength"?: PropertyValueSpecification<number>;
514
532
  "fill-emissive-strength-transition"?: TransitionSpecification;
533
+ "fill-z-offset"?: DataDrivenPropertyValueSpecification<number>;
534
+ "fill-z-offset-transition"?: TransitionSpecification;
515
535
  };
516
536
  };
517
537
  type LineLayerSpecification = {
@@ -694,6 +714,12 @@ type SymbolLayerSpecification = {
694
714
  "icon-color-contrast"?: ExpressionSpecification;
695
715
  "icon-color-brightness-min"?: ExpressionSpecification;
696
716
  "icon-color-brightness-max"?: ExpressionSpecification;
717
+ "symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>;
718
+ "symbol-z-offset-transition"?: TransitionSpecification;
719
+ /**
720
+ * @experimental This property is experimental and subject to change in future versions.
721
+ */
722
+ "symbol-elevation-reference"?: PropertyValueSpecification<"sea" | "ground">;
697
723
  };
698
724
  };
699
725
  type CircleLayerSpecification = {
@@ -826,7 +852,7 @@ type FillExtrusionLayerSpecification = {
826
852
  "fill-extrusion-emissive-strength-transition"?: TransitionSpecification;
827
853
  "fill-extrusion-line-width"?: DataDrivenPropertyValueSpecification<number>;
828
854
  "fill-extrusion-line-width-transition"?: TransitionSpecification;
829
- "fill-extrusion-line-alignment"?: "inside" | "outside" | "center";
855
+ "fill-extrusion-cast-shadows"?: boolean;
830
856
  };
831
857
  };
832
858
  type RasterLayerSpecification = {
@@ -1344,6 +1370,29 @@ type CanonicalTileID = {
1344
1370
  x: number;
1345
1371
  y: number;
1346
1372
  };
1373
+ type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
1374
+ interface Expression {
1375
+ readonly type: Type;
1376
+ value?: any;
1377
+ evaluate: (ctx: EvaluationContext) => any;
1378
+ eachChild: (fn: (arg1: Expression) => void) => void;
1379
+ /**
1380
+ * Statically analyze the expression, attempting to enumerate possible outputs. Returns
1381
+ * false if the complete set of outputs is statically undecidable, otherwise true.
1382
+ */
1383
+ outputDefined: () => boolean;
1384
+ serialize: () => SerializedExpression;
1385
+ }
1386
+ type ConfigOptionValue = {
1387
+ default: Expression;
1388
+ value?: Expression;
1389
+ values?: Array<unknown>;
1390
+ minValue?: number;
1391
+ maxValue?: number;
1392
+ stepValue?: number;
1393
+ type?: "string" | "number" | "boolean" | "color";
1394
+ };
1395
+ type ConfigOptions = Map<string, ConfigOptionValue>;
1347
1396
  type FeatureDistanceData = {
1348
1397
  bearing: [
1349
1398
  number,
@@ -1373,30 +1422,7 @@ declare function isExpressionFilter(filter: unknown): boolean;
1373
1422
  * @param {string} layerType the type of the layer this filter will be applied to.
1374
1423
  * @returns {Function} filter-evaluating function
1375
1424
  */
1376
- declare function createFilter(filter?: FilterSpecification, layerType?: string): FeatureFilter;
1377
- type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
1378
- interface Expression {
1379
- readonly type: Type;
1380
- value?: any;
1381
- evaluate(ctx: EvaluationContext): any;
1382
- eachChild(fn: (arg1: Expression) => void): void;
1383
- /**
1384
- * Statically analyze the expression, attempting to enumerate possible outputs. Returns
1385
- * false if the complete set of outputs is statically undecidable, otherwise true.
1386
- */
1387
- outputDefined(): boolean;
1388
- serialize(): SerializedExpression;
1389
- }
1390
- type ConfigOptionValue = {
1391
- default: Expression;
1392
- value?: Expression;
1393
- values?: Array<unknown>;
1394
- minValue?: number;
1395
- maxValue?: number;
1396
- stepValue?: number;
1397
- type?: "string" | "number" | "boolean" | "color";
1398
- };
1399
- type ConfigOptions = Map<string, ConfigOptionValue>;
1425
+ declare function createFilter(filter?: FilterSpecification, scope?: string, options?: ConfigOptions | null, layerType?: string): FeatureFilter;
1400
1426
  declare class EvaluationContext {
1401
1427
  globals: GlobalProperties;
1402
1428
  feature: Feature | null | undefined;
@@ -1673,8 +1699,9 @@ export type StylePropertySpecification = {
1673
1699
  "property-type": ExpressionType;
1674
1700
  expression?: ExpressionSpecification$1;
1675
1701
  transition?: boolean;
1702
+ overridable?: boolean;
1676
1703
  default?: boolean;
1677
- tokens: never;
1704
+ tokens?: never;
1678
1705
  } | {
1679
1706
  type: "enum";
1680
1707
  "property-type": ExpressionType;