@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,82 +0,0 @@
1
- // @flow
2
-
3
- declare module 'tracked_parameters_proxy' {
4
- declare type Description = any;
5
-
6
- declare function registerParameter(
7
- containerObject: any,
8
- scope: Array<string>,
9
- name: string,
10
- description?: Description | null,
11
- changeValueCallback?: any | null
12
- ): void;
13
-
14
- declare function registerButton(
15
- scope: Array<string>,
16
- buttonTitle: string,
17
- onClick: any
18
- ): void;
19
-
20
- declare function registerBinding(
21
- containerObject: any,
22
- scope: Array<string>,
23
- name: string,
24
- description?: Object,
25
- ): void;
26
-
27
- declare function refreshUI(): void;
28
-
29
- declare interface ITrackedParameters {
30
- constructor(map: any): void;
31
-
32
- registerParameter(
33
- containerObject: any,
34
- scope: Array<string>,
35
- name: string,
36
- description?: Description | null,
37
- changeValueCallback?: any | null
38
- ): void;
39
-
40
- registerButton(
41
- scope: Array<string>,
42
- buttonTitle: string,
43
- onClick: any
44
- ): void;
45
-
46
- registerBinding(
47
- containerObject: any,
48
- scope: Array<string>,
49
- name: string,
50
- description?: Object,
51
- ): void;
52
-
53
- refreshUI(): void;
54
- }
55
-
56
- declare class TrackedParameters implements ITrackedParameters {
57
- constructor(map: any): void;
58
-
59
- registerParameter(
60
- containerObject: any,
61
- scope: Array<string>,
62
- name: string,
63
- description?: Description | null,
64
- changeValueCallback?: any | null
65
- ): void;
66
-
67
- registerButton(
68
- scope: Array<string>,
69
- buttonTitle: string,
70
- onClick: any
71
- ): void;
72
-
73
- registerBinding(
74
- containerObject: any,
75
- scope: Array<string>,
76
- name: string,
77
- description?: Object,
78
- ): void;
79
-
80
- refreshUI(): void;
81
- }
82
- }
@@ -1,49 +0,0 @@
1
- // @flow
2
- declare module "@mapbox/vector-tile" {
3
- import type Pbf from 'pbf';
4
- import type Point from '@mapbox/point-geometry';
5
- import type { GeoJSONFeature } from '@mapbox/geojson-types';
6
-
7
- declare export interface IVectorTile {
8
- layers: {[_: string]: IVectorTileLayer};
9
- }
10
- declare export interface IVectorTileLayer {
11
- version?: ?number;
12
- name: string;
13
- extent: number;
14
- length: number;
15
- feature(i: number): IVectorTileFeature;
16
- }
17
- declare export interface IVectorTileFeature {
18
- extent: number;
19
- type: 1 | 2 | 3;
20
- id: number;
21
- properties: {[_: string]: string | number | boolean};
22
-
23
- loadGeometry(): Array<Array<Point>>;
24
- toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
25
- }
26
-
27
- declare export class VectorTile implements IVectorTile {
28
- constructor(pbf: Pbf): VectorTile;
29
- layers: {[_: string]: IVectorTileLayer};
30
- }
31
- declare export class VectorTileLayer implements IVectorTileLayer {
32
- version?: ?number;
33
- name: string;
34
- extent: number;
35
- length: number;
36
- feature(i: number): IVectorTileFeature;
37
- }
38
- declare export class VectorTileFeature implements IVectorTileFeature {
39
- extent: number;
40
- type: 1 | 2 | 3;
41
- id: number;
42
- properties: {[_: string]: string | number | boolean};
43
-
44
- loadGeometry(): Array<Array<Point>>;
45
- toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
46
-
47
- static types: ['Unknown', 'Point', 'LineString', 'Polygon'];
48
- }
49
- }
@@ -1,41 +0,0 @@
1
- // @flow strict
2
-
3
- type GLenum = number;
4
- type GLintptr = number;
5
- type GLsizei = number;
6
- type GLuint = number;
7
-
8
- declare interface WebGLVertexArrayObject {
9
- prototype: WebGLVertexArrayObject;
10
- new(): WebGLVertexArrayObject;
11
- }
12
-
13
- declare interface WebGLQuery {
14
- prototype: WebGLQuery;
15
- new(): WebGLQuery;
16
- }
17
-
18
- declare class WebGL2RenderingContext extends WebGLRenderingContext {
19
- R8: 0x8229;
20
- R32F: 0x822E;
21
- RGBA16F: 0x881A;
22
- RED: 0x1903;
23
- HALF_FLOAT: 0x140B;
24
- QUERY_RESULT: 0x8866;
25
- MIN: 0x8007;
26
- MAX: 0x8008;
27
- INTERLEAVED_ATTRIBS: 0x8C8C;
28
- SEPARATE_ATTRIBS: 0x8C8D;
29
-
30
- createVertexArray: () => WebGLVertexArrayObject | null;
31
- deleteVertexArray: (vertexArray: WebGLVertexArrayObject | null) => void;
32
- bindVertexArray: (array: WebGLVertexArrayObject | null) => void;
33
- getBufferSubData: (target: GLenum, srcByteOffset: GLintptr, dstBuffer: $ArrayBufferView, dstOffset?: GLuint, length?: GLuint) => void;
34
- drawElementsInstanced: (mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) => void;
35
- vertexAttribDivisor: (index: GLuint, divisor: GLuint) => void;
36
- createQuery: () => WebGLQuery;
37
- beginQuery: (target: GLenum, query: WebGLQuery) => void;
38
- endQuery: (target: GLenum) => void;
39
- deleteQuery: (query: WebGLQuery) => void;
40
- getQueryParameter: (query: WebGLQuery, pname: GLenum) => GLuint;
41
- };
@@ -1,7 +0,0 @@
1
- // @flow
2
-
3
- import spec from './v8.json';
4
-
5
- export type StyleReference = typeof spec;
6
-
7
- export default spec;
@@ -1,15 +0,0 @@
1
- // @flow
2
-
3
- import validateExpression from './validate_expression.js';
4
- import validateString from './validate_string.js';
5
-
6
- import type {ValidationOptions} from './validate.js';
7
- import type ValidationError from '../error/validation_error.js';
8
-
9
- export default function validateFormatted(options: ValidationOptions): Array<ValidationError> {
10
- if (validateString(options).length === 0) {
11
- return [];
12
- }
13
-
14
- return validateExpression(options);
15
- }
@@ -1,15 +0,0 @@
1
- // @flow
2
-
3
- import validateExpression from './validate_expression.js';
4
- import validateString from './validate_string.js';
5
-
6
- import type {ValidationOptions} from './validate.js';
7
- import type ValidationError from '../error/validation_error.js';
8
-
9
- export default function validateImage(options: ValidationOptions): Array<ValidationError> {
10
- if (validateString(options).length === 0) {
11
- return [];
12
- }
13
-
14
- return validateExpression(options);
15
- }
@@ -1,18 +0,0 @@
1
- // @flow
2
-
3
- import getType from '../util/get_type.js';
4
- import ValidationError from '../error/validation_error.js';
5
-
6
- import type {ValidationOptions} from './validate.js';
7
-
8
- export default function validateString(options: $Shape<ValidationOptions>): Array<ValidationError> {
9
- const value = options.value;
10
- const key = options.key;
11
- const type = getType(value);
12
-
13
- if (type !== 'string') {
14
- return [new ValidationError(key, value, `string expected, ${type} found`)];
15
- }
16
-
17
- return [];
18
- }
@@ -1,29 +0,0 @@
1
- // @flow
2
- import validate from './validate.js';
3
- import latestStyleSpec from '../reference/latest.js';
4
- import validateGlyphsURL from './validate_glyphs_url.js';
5
-
6
- import ValidationError from '../error/validation_error.js';
7
-
8
- import type {ValidationOptions} from './validate.js';
9
- import type {StyleSpecification} from '../types.js';
10
-
11
- type StyleValidationOptions = {
12
- key?: $PropertyType<ValidationOptions, 'key'>
13
- }
14
-
15
- export default function validateStyle(style: StyleSpecification, styleSpec: Object = latestStyleSpec, options: StyleValidationOptions = {}): ValidationError[] {
16
- const errors = validate({
17
- key: options.key || '',
18
- value: style,
19
- valueSpec: styleSpec.$root,
20
- styleSpec,
21
- style,
22
- objectElementValidators: {
23
- glyphs: validateGlyphsURL,
24
- '*': () => []
25
- }
26
- });
27
-
28
- return errors;
29
- }