@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.
- package/bin/gl-style-composite.js +0 -5
- package/bin/gl-style-format.js +0 -5
- package/bin/gl-style-migrate.js +0 -5
- package/bin/gl-style-validate.js +0 -5
- package/{composite.js → composite.ts} +1 -1
- package/data/{extent.js → extent.ts} +0 -2
- package/{deref.js → deref.ts} +7 -9
- package/{diff.js → diff.ts} +44 -21
- package/dist/index.cjs +794 -1226
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1746 -0
- package/dist/index.es.js +794 -1226
- package/dist/index.es.js.map +1 -1
- package/{empty.js → empty.ts} +1 -2
- package/error/{parsing_error.js → parsing_error.ts} +0 -2
- package/error/{validation_error.js → validation_error.ts} +5 -5
- package/expression/{compound_expression.js → compound_expression.ts} +29 -19
- package/expression/definitions/{assertion.js → assertion.ts} +16 -13
- package/expression/definitions/{at.js → at.ts} +12 -13
- package/expression/definitions/{case.js → case.ts} +12 -11
- package/expression/definitions/{coalesce.js → coalesce.ts} +11 -11
- package/expression/definitions/{coercion.js → coercion.ts} +21 -20
- package/expression/definitions/{collator.js → collator.ts} +11 -11
- package/expression/definitions/{comparison.js → comparison.ts} +30 -24
- package/expression/definitions/{config.js → config.ts} +16 -16
- package/expression/definitions/{distance.js → distance.ts} +60 -52
- package/expression/definitions/{format.js → format.ts} +26 -15
- package/expression/definitions/{image.js → image.ts} +12 -12
- package/expression/definitions/{in.js → in.ts} +22 -13
- package/expression/definitions/{index.js → index.ts} +70 -83
- package/expression/definitions/{index_of.js → index_of.ts} +24 -15
- package/expression/definitions/{interpolate.js → interpolate.ts} +44 -25
- package/expression/definitions/{length.js → length.ts} +11 -10
- package/expression/definitions/{let.js → let.ts} +10 -7
- package/expression/definitions/{literal.js → literal.ts} +11 -12
- package/expression/definitions/{match.js → match.ts} +25 -15
- package/expression/definitions/{number_format.js → number_format.ts} +10 -10
- package/expression/definitions/{slice.js → slice.ts} +23 -15
- package/expression/definitions/{step.js → step.ts} +14 -12
- package/expression/definitions/{var.js → var.ts} +5 -7
- package/expression/definitions/{within.js → within.ts} +41 -29
- package/expression/{evaluation_context.js → evaluation_context.ts} +26 -23
- package/expression/expression.ts +29 -0
- package/expression/{index.js → index.ts} +208 -110
- package/expression/{is_constant.js → is_constant.ts} +5 -7
- package/expression/{parsing_context.js → parsing_context.ts} +47 -34
- package/expression/{parsing_error.js → parsing_error.ts} +0 -2
- package/expression/{runtime_error.js → runtime_error.ts} +0 -2
- package/expression/{scope.js → scope.ts} +5 -5
- package/expression/{stops.js → stops.ts} +2 -4
- package/expression/types/{collator.js → collator.ts} +1 -3
- package/expression/types/{formatted.js → formatted.ts} +8 -7
- package/expression/types/{resolved_image.js → resolved_image.ts} +5 -7
- package/expression/{types.js → types.ts} +53 -45
- package/expression/{values.js → values.ts} +12 -12
- package/feature_filter/{convert.js → convert.ts} +19 -18
- package/feature_filter/{index.js → index.ts} +39 -21
- package/{format.js → format.ts} +3 -3
- package/function/{convert.js → convert.ts} +44 -44
- package/function/{index.js → index.ts} +12 -12
- package/{group_by_layout.js → group_by_layout.ts} +11 -8
- package/migrate/{expressions.js → expressions.ts} +7 -16
- package/migrate/{v8.js → v8.ts} +2 -2
- package/migrate/{v9.js → v9.ts} +2 -2
- package/{migrate.js → migrate.ts} +3 -3
- package/package.json +19 -18
- package/{read_style.js → read_style.ts} +5 -4
- package/reference/latest.ts +5 -0
- package/reference/v8.json +264 -7
- package/rollup.config.js +6 -24
- package/{style-spec.js → style-spec.ts} +41 -36
- package/test.js +3 -2
- package/types/config_options.ts +13 -0
- package/types/lut.ts +7 -0
- package/types/tile_id.ts +5 -0
- package/{types.js → types.ts} +527 -165
- package/util/{color.js → color.ts} +89 -3
- package/util/{color_spaces.js → color_spaces.ts} +12 -14
- package/util/{deep_equal.js → deep_equal.ts} +1 -3
- package/util/{extend.js → extend.ts} +1 -3
- package/util/{geometry_util.js → geometry_util.ts} +23 -11
- package/util/{get_type.js → get_type.ts} +1 -3
- package/util/{interpolate.js → interpolate.ts} +1 -3
- package/util/{properties.js → properties.ts} +5 -4
- package/util/{random.js → random.ts} +0 -2
- package/util/{ref_properties.js → ref_properties.ts} +0 -1
- package/util/{result.js → result.ts} +7 -5
- package/util/{unbundle_jsonlint.js → unbundle_jsonlint.ts} +5 -5
- package/validate/{validate.js → validate.ts} +33 -35
- package/validate/{validate_array.js → validate_array.ts} +5 -7
- package/validate/{validate_boolean.js → validate_boolean.ts} +3 -5
- package/validate/{validate_color.js → validate_color.ts} +3 -5
- package/validate/{validate_enum.js → validate_enum.ts} +4 -5
- package/validate/{validate_expression.js → validate_expression.ts} +7 -9
- package/validate/{validate_filter.js → validate_filter.ts} +16 -12
- package/validate/{validate_fog.js → validate_fog.ts} +4 -6
- package/validate/validate_formatted.ts +13 -0
- package/validate/{validate_function.js → validate_function.ts} +14 -16
- package/validate/{validate_glyphs_url.js → validate_glyphs_url.ts} +3 -5
- package/validate/validate_image.ts +13 -0
- package/validate/{validate_import.js → validate_import.ts} +6 -8
- package/validate/{validate_layer.js → validate_layer.ts} +17 -15
- package/validate/{validate_layout_property.js → validate_layout_property.ts} +3 -5
- package/validate/{validate_light.js → validate_light.ts} +4 -6
- package/validate/{validate_lights.js → validate_lights.ts} +7 -9
- package/validate/{validate_model.js → validate_model.ts} +4 -6
- package/validate/{validate_number.js → validate_number.ts} +4 -6
- package/validate/{validate_object.js → validate_object.ts} +5 -8
- package/validate/{validate_paint_property.js → validate_paint_property.ts} +3 -5
- package/validate/{validate_projection.js → validate_projection.ts} +4 -6
- package/validate/{validate_property.js → validate_property.ts} +15 -15
- package/validate/{validate_source.js → validate_source.ts} +16 -13
- package/validate/validate_string.ts +16 -0
- package/validate/validate_style.ts +33 -0
- package/validate/{validate_terrain.js → validate_terrain.ts} +5 -7
- package/{validate_mapbox_api_supported.js → validate_mapbox_api_supported.ts} +22 -18
- package/{validate_style.min.js → validate_style.min.ts} +20 -21
- package/{validate_style.js → validate_style.ts} +9 -9
- package/{visit.js → visit.ts} +22 -17
- package/.eslintrc +0 -10
- package/expression/expression.js +0 -28
- package/flow-typed/cheap-ruler.js +0 -25
- package/flow-typed/geojson.js +0 -44
- package/flow-typed/gl-matrix.js +0 -119
- package/flow-typed/gl.js +0 -5
- package/flow-typed/intl.js +0 -58
- package/flow-typed/kdbush.js +0 -9
- package/flow-typed/mapbox-gl-supported.js +0 -16
- package/flow-typed/mapbox-unitbezier.js +0 -14
- package/flow-typed/offscreen-canvas.js +0 -9
- package/flow-typed/pbf.js +0 -26
- package/flow-typed/point-geometry.js +0 -46
- package/flow-typed/potpack.js +0 -13
- package/flow-typed/tiny-sdf.js +0 -31
- package/flow-typed/tracked_parameters_proxy.js +0 -82
- package/flow-typed/vector-tile.js +0 -49
- package/flow-typed/webgl2.js +0 -41
- package/reference/latest.js +0 -7
- package/validate/validate_formatted.js +0 -15
- package/validate/validate_image.js +0 -15
- package/validate/validate_string.js +0 -18
- 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
|
-
}
|
package/flow-typed/webgl2.js
DELETED
|
@@ -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
|
-
};
|
package/reference/latest.js
DELETED
|
@@ -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
|
-
}
|