@versatiles/png-renderer 0.0.0 → 2.0.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.
@@ -0,0 +1,2764 @@
1
+ /// <reference types="geojson" />
2
+ //#endregion
3
+ //#region src/types.g.d.ts
4
+ type ColorSpecification = string;
5
+ type ProjectionDefinitionT = [string, string, number];
6
+ type ProjectionDefinitionSpecification = string | ProjectionDefinitionT | PropertyValueSpecification<ProjectionDefinitionT>;
7
+ type PaddingSpecification = number | number[];
8
+ type NumberArraySpecification = number | number[];
9
+ type ColorArraySpecification = string | string[];
10
+ type VariableAnchorOffsetCollectionSpecification = Array<string | [number, number]>;
11
+ type SpriteSpecification = string | {
12
+ id: string;
13
+ url: string;
14
+ }[];
15
+ type FormattedSpecification = string;
16
+ type ResolvedImageSpecification = string;
17
+ type PromoteIdSpecification = {
18
+ [_: string]: string;
19
+ } | string;
20
+ type ExpressionInputType = string | number | boolean;
21
+ type VariableExpressionSpecification = ['var', string];
22
+ type CollatorExpressionSpecification = ['collator', {
23
+ 'case-sensitive'?: boolean | ExpressionSpecification;
24
+ 'diacritic-sensitive'?: boolean | ExpressionSpecification;
25
+ locale?: string | ExpressionSpecification;
26
+ }];
27
+ type InterpolationSpecification = ['linear'] | ['exponential', number] | ['cubic-bezier', number, number, number, number];
28
+ type ExpressionSpecification = ['array', ExpressionSpecification] | ['array', 'string' | 'number' | 'boolean', ExpressionSpecification] | ['array', 'string' | 'number' | 'boolean', number, ExpressionSpecification] | ['boolean', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | CollatorExpressionSpecification | ['format', ...(string | ['image', ExpressionSpecification] | ExpressionSpecification | {
29
+ 'font-scale'?: number | ExpressionSpecification;
30
+ 'text-font'?: ExpressionSpecification;
31
+ 'text-color'?: ColorSpecification | ExpressionSpecification;
32
+ 'vertical-align'?: 'bottom' | 'center' | 'top';
33
+ })[]] | ['image', string | ExpressionSpecification] | ['literal', unknown] | ['semiliteral', unknown] | ['number', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | ['number-format', number | ExpressionSpecification, {
34
+ 'locale'?: string | ExpressionSpecification;
35
+ 'currency'?: string | ExpressionSpecification;
36
+ 'min-fraction-digits'?: number | ExpressionSpecification;
37
+ 'max-fraction-digits'?: number | ExpressionSpecification;
38
+ }] | ['number-format', number | ExpressionSpecification, {
39
+ 'locale'?: string | ExpressionSpecification;
40
+ 'unit'?: string | ExpressionSpecification;
41
+ 'min-fraction-digits'?: number | ExpressionSpecification;
42
+ 'max-fraction-digits'?: number | ExpressionSpecification;
43
+ }] | ['object', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | ['string', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | ['to-boolean', unknown | ExpressionSpecification] | ['to-color', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | ['to-number', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] | ['to-string', unknown | ExpressionSpecification] | ['typeof', unknown | ExpressionSpecification] | ['accumulated'] | ['feature-state', string | ExpressionSpecification] | ['geometry-type'] | ['id'] | ['line-progress'] | ['properties'] | ['at', number | ExpressionSpecification, ExpressionSpecification] | ['get', string | ExpressionSpecification, ExpressionSpecification?] | ['global-state', string] | ['has', string | ExpressionSpecification, ExpressionSpecification?] | ['in', null | ExpressionInputType | ExpressionSpecification, string | ExpressionSpecification] | ['index-of', null | ExpressionInputType | ExpressionSpecification, string | ExpressionSpecification, (number | ExpressionSpecification)?] | ['length', string | ExpressionSpecification] | ['slice', string | ExpressionSpecification, number | ExpressionSpecification, (number | ExpressionSpecification)?] | ['!', boolean | ExpressionSpecification] | ['!=', null | ExpressionInputType | ExpressionSpecification, null | ExpressionInputType | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['<', string | number | ExpressionSpecification, string | number | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['<=', string | number | ExpressionSpecification, string | number | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['==', null | ExpressionInputType | ExpressionSpecification, null | ExpressionInputType | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['>', string | number | ExpressionSpecification, string | number | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['>=', string | number | ExpressionSpecification, string | number | ExpressionSpecification, (CollatorExpressionSpecification | VariableExpressionSpecification)?] | ['all', ...(boolean | ExpressionSpecification)[]] | ['any', ...(boolean | ExpressionSpecification)[]] | ['case', boolean | ExpressionSpecification, null | ExpressionInputType | ExpressionSpecification, ...(boolean | null | ExpressionInputType | ExpressionSpecification)[], null | ExpressionInputType | ExpressionSpecification] | ['coalesce', ...(ExpressionInputType | ExpressionSpecification)[]] | ['match', string | number | ExpressionSpecification, string | number | string[] | number[], null | ExpressionInputType | ExpressionSpecification, ...(string | number | string[] | number[] | null | ExpressionInputType | ExpressionSpecification)[],
44
+ // repeated as above
45
+ null | ExpressionInputType | ExpressionSpecification] | ['within', GeoJSON.GeoJSON] | ['interpolate', InterpolationSpecification, number | ExpressionSpecification, ...(number | ColorSpecification | ExpressionSpecification | ProjectionDefinitionSpecification)[]] | ['interpolate-hcl', InterpolationSpecification, number | ExpressionSpecification, ...(number | ColorSpecification | ExpressionSpecification)[]] | ['interpolate-lab', InterpolationSpecification, number | ExpressionSpecification, ...(number | ColorSpecification | ExpressionSpecification)[]] | ['step', number | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, ...(number | ExpressionInputType | ExpressionSpecification)[]] | ['let', string, ExpressionInputType | ExpressionSpecification, ...(string | ExpressionInputType | ExpressionSpecification)[]] | VariableExpressionSpecification | ['concat', ...(ExpressionInputType | ExpressionSpecification)[]] | ['downcase', string | ExpressionSpecification] | ['is-supported-script', string | ExpressionSpecification] | ['join', string[] | ExpressionSpecification, string | ExpressionSpecification] | ['resolved-locale', CollatorExpressionSpecification] | ['split', string | ExpressionSpecification, string | ExpressionSpecification] | ['upcase', string | ExpressionSpecification] | ['rgb', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification] | ['rgba', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification] | ['to-rgba', ColorSpecification | ExpressionSpecification] | ['-', number | ExpressionSpecification, (number | ExpressionSpecification)?] | ['*', number | ExpressionSpecification, number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] | ['/', number | ExpressionSpecification, number | ExpressionSpecification] | ['%', number | ExpressionSpecification, number | ExpressionSpecification] | ['^', number | ExpressionSpecification, number | ExpressionSpecification] | ['+', ...(number | ExpressionSpecification)[]] | ['abs', number | ExpressionSpecification] | ['acos', number | ExpressionSpecification] | ['asin', number | ExpressionSpecification] | ['atan', number | ExpressionSpecification] | ['ceil', number | ExpressionSpecification] | ['cos', number | ExpressionSpecification] | ['distance', GeoJSON.GeoJSON] | ['e'] | ['floor', number | ExpressionSpecification] | ['ln', number | ExpressionSpecification] | ['ln2'] | ['log10', number | ExpressionSpecification] | ['log2', number | ExpressionSpecification] | ['max', number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] | ['min', number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] | ['pi'] | ['round', number | ExpressionSpecification] | ['sin', number | ExpressionSpecification] | ['sqrt', number | ExpressionSpecification] | ['tan', number | ExpressionSpecification] | ['zoom'] | ['heatmap-density'] | ['elevation'] | ['global-state', string];
46
+ type ExpressionFilterSpecification = boolean | ExpressionSpecification;
47
+ type LegacyFilterSpecification = ['has', string] | ['!has', string] | ['==', string, string | number | boolean] | ['!=', string, string | number | boolean] | ['>', string, string | number | boolean] | ['>=', string, string | number | boolean] | ['<', string, string | number | boolean] | ['<=', string, string | number | boolean] | ['in', string, ...(string | number | boolean)[]] | ['!in', string, ...(string | number | boolean)[]] | ['all', ...LegacyFilterSpecification[]] | ['any', ...LegacyFilterSpecification[]] | ['none', ...LegacyFilterSpecification[]];
48
+ type FilterSpecification = ExpressionFilterSpecification | LegacyFilterSpecification;
49
+ type VisibilitySpecification = 'visible' | 'none' | ExpressionSpecification;
50
+ type TransitionSpecification = {
51
+ duration?: number;
52
+ delay?: number;
53
+ };
54
+ type CameraFunctionSpecification<T> = {
55
+ type: 'exponential';
56
+ stops: Array<[number, T]>;
57
+ } | {
58
+ type: 'interval';
59
+ stops: Array<[number, T]>;
60
+ };
61
+ type SourceFunctionSpecification<T> = {
62
+ type: 'exponential';
63
+ stops: Array<[number, T]>;
64
+ property: string;
65
+ default?: T;
66
+ } | {
67
+ type: 'interval';
68
+ stops: Array<[number, T]>;
69
+ property: string;
70
+ default?: T;
71
+ } | {
72
+ type: 'categorical';
73
+ stops: Array<[string | number | boolean, T]>;
74
+ property: string;
75
+ default?: T;
76
+ } | {
77
+ type: 'identity';
78
+ property: string;
79
+ default?: T;
80
+ };
81
+ type CompositeFunctionSpecification<T> = {
82
+ type: 'exponential';
83
+ stops: Array<[{
84
+ zoom: number;
85
+ value: number;
86
+ }, T]>;
87
+ property: string;
88
+ default?: T;
89
+ } | {
90
+ type: 'interval';
91
+ stops: Array<[{
92
+ zoom: number;
93
+ value: number;
94
+ }, T]>;
95
+ property: string;
96
+ default?: T;
97
+ } | {
98
+ type: 'categorical';
99
+ stops: Array<[{
100
+ zoom: number;
101
+ value: string | number | boolean;
102
+ }, T]>;
103
+ property: string;
104
+ default?: T;
105
+ };
106
+ type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
107
+ type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification;
108
+ type SchemaSpecification = {
109
+ default?: unknown;
110
+ };
111
+ type StateSpecification = Record<string, SchemaSpecification>;
112
+ type MLFontFace = {
113
+ url: string;
114
+ "unicode-range"?: string[];
115
+ };
116
+ type FontFacesSpecification = Record<string, string | Array<MLFontFace>>;
117
+ type StyleSpecification = {
118
+ /**
119
+ * Style specification version number. Must be 8.
120
+ *
121
+ * @example
122
+ * ```json
123
+ * 8
124
+ * ```
125
+ */
126
+ "version": 8;
127
+ /**
128
+ * A human-readable name for the style.
129
+ *
130
+ * @example
131
+ * ```json
132
+ * "Bright"
133
+ * ```
134
+ */
135
+ "name"?: string;
136
+ /**
137
+ * Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
138
+ *
139
+ * @example
140
+ * ```json
141
+ * {
142
+ * "styleeditor:slimmode": true,
143
+ * "styleeditor:comment": "Style generated 1677776383",
144
+ * "styleeditor:version": "3.14.159265",
145
+ * "example:object": {
146
+ * "String": "one",
147
+ * "Number": 2,
148
+ * "Boolean": false
149
+ * }
150
+ * }
151
+ * ```
152
+ */
153
+ "metadata"?: unknown;
154
+ /**
155
+ * Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
156
+ *
157
+ * @example
158
+ * ```json
159
+ * [-73.9749, 40.7736]
160
+ * ```
161
+ */
162
+ "center"?: [number, number];
163
+ /**
164
+ * Default map center altitude in meters above sea level. The style center altitude defines the altitude where the camera is looking at and will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
165
+ *
166
+ * @example
167
+ * ```json
168
+ * 123.4
169
+ * ```
170
+ */
171
+ "centerAltitude"?: number;
172
+ /**
173
+ * Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
174
+ *
175
+ * @example
176
+ * ```json
177
+ * 12.5
178
+ * ```
179
+ */
180
+ "zoom"?: number;
181
+ /**
182
+ * Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
183
+ *
184
+ * @example
185
+ * ```json
186
+ * 29
187
+ * ```
188
+ */
189
+ "bearing"?: number;
190
+ /**
191
+ * Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
192
+ *
193
+ * @example
194
+ * ```json
195
+ * 50
196
+ * ```
197
+ */
198
+ "pitch"?: number;
199
+ /**
200
+ * Default roll, in degrees. The roll angle is measured counterclockwise about the camera boresight. The style roll will be used only if the map has not been positioned by other means (e.g. map options or user interaction).
201
+ *
202
+ * @example
203
+ * ```json
204
+ * 45
205
+ * ```
206
+ */
207
+ "roll"?: number;
208
+ /**
209
+ * An object used to define default values when using the [`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression.
210
+ *
211
+ * @default
212
+ * ```json
213
+ * {}
214
+ * ```
215
+ *
216
+ * @example
217
+ * ```json
218
+ * {
219
+ * "chargerType": {"default": ["CCS", "CHAdeMO", "Type2"]},
220
+ * "minPreferredChargingSpeed": {"default": 50}
221
+ * }
222
+ * ```
223
+ */
224
+ "state"?: StateSpecification;
225
+ /**
226
+ * The global light source.
227
+ *
228
+ * @example
229
+ * ```json
230
+ * {"anchor": "viewport", "color": "white", "intensity": 0.4}
231
+ * ```
232
+ */
233
+ "light"?: LightSpecification;
234
+ /**
235
+ * The map's sky configuration. **Note:** this definition is still experimental and is under development in maplibre-gl-js.
236
+ *
237
+ * @example
238
+ * ```json
239
+ * {
240
+ * "sky-color": "#199EF3",
241
+ * "sky-horizon-blend": 0.5,
242
+ * "horizon-color": "#ffffff",
243
+ * "horizon-fog-blend": 0.5,
244
+ * "fog-color": "#0000ff",
245
+ * "fog-ground-blend": 0.5,
246
+ * "atmosphere-blend": [
247
+ * "interpolate",
248
+ * ["linear"],
249
+ * ["zoom"],
250
+ * 0,
251
+ * 1,
252
+ * 10,
253
+ * 1,
254
+ * 12,
255
+ * 0
256
+ * ]
257
+ * }
258
+ * ```
259
+ */
260
+ "sky"?: SkySpecification;
261
+ /**
262
+ * The projection configuration
263
+ *
264
+ * @example
265
+ * ```json
266
+ * {
267
+ * "type": [
268
+ * "interpolate",
269
+ * ["linear"],
270
+ * ["zoom"],
271
+ * 10,
272
+ * "vertical-perspective",
273
+ * 12,
274
+ * "mercator"
275
+ * ]
276
+ * }
277
+ * ```
278
+ */
279
+ "projection"?: ProjectionSpecification;
280
+ /**
281
+ * The terrain configuration.
282
+ *
283
+ * @example
284
+ * ```json
285
+ * {"source": "raster-dem-source", "exaggeration": 0.5}
286
+ * ```
287
+ */
288
+ "terrain"?: TerrainSpecification;
289
+ /**
290
+ * Sources state which data the map should display. Specify the type of source with the `type` property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.
291
+ *
292
+ * Tiled sources (vector and raster) must specify their details according to the [TileJSON specification](https://github.com/mapbox/tilejson-spec).
293
+ *
294
+ * @example
295
+ * ```json
296
+ * {
297
+ * "maplibre-demotiles": {
298
+ * "type": "vector",
299
+ * "url": "https://demotiles.maplibre.org/tiles/tiles.json"
300
+ * },
301
+ * "maplibre-tilejson": {
302
+ * "type": "vector",
303
+ * "url": "http://api.example.com/tilejson.json"
304
+ * },
305
+ * "maplibre-streets": {
306
+ * "type": "vector",
307
+ * "tiles": [
308
+ * "http://a.example.com/tiles/{z}/{x}/{y}.pbf",
309
+ * "http://b.example.com/tiles/{z}/{x}/{y}.pbf"
310
+ * ],
311
+ * "maxzoom": 14
312
+ * },
313
+ * "wms-imagery": {
314
+ * "type": "raster",
315
+ * "tiles": [
316
+ * "http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example"
317
+ * ],
318
+ * "tileSize": 256
319
+ * }
320
+ * }
321
+ * ```
322
+ */
323
+ "sources": {
324
+ [_: string]: SourceSpecification;
325
+ };
326
+ /**
327
+ * An array of `{id: 'my-sprite', url: 'https://example.com/sprite'}` objects. Each object should represent a unique URL to load a sprite from and and a unique ID to use as a prefix when referencing images from that sprite (i.e. 'my-sprite:image'). All the URLs are internally extended to load both .json and .png files. If the `id` field is equal to 'default', the prefix is omitted (just 'image' instead of 'default:image'). All the IDs and URLs must be unique. For backwards compatibility, instead of an array, one can also provide a single string that represent a URL to load the sprite from. The images in this case won't be prefixed.
328
+ *
329
+ * @example
330
+ * ```json
331
+ * "https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite"
332
+ * ```
333
+ */
334
+ "sprite"?: SpriteSpecification;
335
+ /**
336
+ * A URL template for loading signed-distance-field glyph sets in PBF format.
337
+ *
338
+ * If this property is set, any text in the `text-field` layout property is displayed in the font stack named by the `text-font` layout property based on glyphs located at the URL specified by this property. Otherwise, font faces will be determined by the `text-font` property based on the local environment.
339
+ *
340
+ * The URL must include:
341
+ *
342
+ * - `{fontstack}` - When requesting glyphs, this token is replaced with a comma separated list of fonts from a font stack specified in the `text-font` property of a symbol layer.
343
+ *
344
+ * - `{range}` - When requesting glyphs, this token is replaced with a range of 256 Unicode code points. For example, to load glyphs for the Unicode Basic Latin and Basic Latin-1 Supplement blocks, the range would be 0-255. The actual ranges that are loaded are determined at runtime based on what text needs to be displayed.
345
+ *
346
+ * The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).
347
+ *
348
+ * @example
349
+ * ```json
350
+ * "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf"
351
+ * ```
352
+ */
353
+ "glyphs"?: string;
354
+ /**
355
+ * The `font-faces` property can be used to specify what font files to use for rendering text. Font faces contain information needed to render complex texts such as [Devanagari](https://en.wikipedia.org/wiki/Devanagari), [Khmer](https://en.wikipedia.org/wiki/Khmer_script) among many others.<h2>Unicode range</h2>The optional `unicode-range` property can be used to only use a particular font file for characters within the specified unicode range(s). Its value should be an array of strings, each indicating a start and end of a unicode range, similar to the [CSS descriptor with the same name](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range). This allows specifying multiple non-consecutive unicode ranges. When not specified, the default value is `U+0-10FFFF`, meaning the font file will be used for all unicode characters.
356
+ *
357
+ * Refer to the [Unicode Character Code Charts](https://www.unicode.org/charts/) to see ranges for scripts supported by Unicode. To see what unicode code-points are available in a font, use a tool like [FontDrop](https://fontdrop.info/).
358
+ *
359
+ * <h2>Font Resolution</h2>For every name in a symbol layer’s [`text-font`](./layers.md#text-font) array, characters are matched if they are covered one of the by the font files in the corresponding entry of the `font-faces` map. Any still-unmatched characters then fall back to the [`glyphs`](./glyphs.md) URL if provided.
360
+ *
361
+ * <h2>Supported Fonts</h2>What type of fonts are supported is implementation-defined. Unsupported fonts are ignored.
362
+ *
363
+ * @example
364
+ * ```json
365
+ * {
366
+ * "Noto Sans Regular": [
367
+ * {
368
+ * "url": "https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansKhmer/hinted/ttf/NotoSansKhmer-Regular.ttf",
369
+ * "unicode-range": ["U+1780-17FF"]
370
+ * },
371
+ * {
372
+ * "url": "https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansDevanagari/hinted/ttf/NotoSansDevanagari-Regular.ttf",
373
+ * "unicode-range": ["U+0900-097F"]
374
+ * },
375
+ * {
376
+ * "url": "https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansMyanmar/hinted/ttf/NotoSansMyanmar-Regular.ttf",
377
+ * "unicode-range": ["U+1000-109F"]
378
+ * },
379
+ * {
380
+ * "url": "https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansEthiopic/hinted/ttf/NotoSansEthiopic-Regular.ttf",
381
+ * "unicode-range": ["U+1200-137F"]
382
+ * }
383
+ * ],
384
+ * "Unifont": "https://ftp.gnu.org/gnu/unifont/unifont-15.0.01/unifont-15.0.01.ttf"
385
+ * }
386
+ * ```
387
+ */
388
+ "font-faces"?: FontFacesSpecification;
389
+ /**
390
+ * A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.
391
+ *
392
+ * In addition to this global definition via `transition`, if any individual paint or layout property are marked as `Transitionable`, a corresponding `*-transition` property is avaliable to fine-tune the property’s animation between old and new values based on similar `duration` and `delay` values.
393
+ *
394
+ * For example, [`fill-color`](layers/#fill-color) is marked as `Transitionable`, so it can transition either independently via `fill-color-transition` or globally via the style's `transition` property:
395
+ *
396
+ * @example
397
+ * ```json
398
+ * {"duration": 300, "delay": 0}
399
+ * ```
400
+ */
401
+ "transition"?: TransitionSpecification;
402
+ /**
403
+ * A style's `layers` property lists all the layers available in that style. The type of layer is specified by the `type` property, and must be one of `background`, `fill`, `line`, `symbol`, `raster`, `circle`, `fill-extrusion`, `heatmap`, `hillshade`, `color-relief`.
404
+ *
405
+ * Except for layers of the `background` type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.
406
+ *
407
+ * @example
408
+ * ```json
409
+ * [
410
+ * {
411
+ * "id": "coastline",
412
+ * "source": "maplibre",
413
+ * "source-layer": "countries",
414
+ * "type": "line",
415
+ * "paint": {"line-color": "#198EC8"}
416
+ * }
417
+ * ]
418
+ * ```
419
+ */
420
+ "layers": Array<LayerSpecification>;
421
+ };
422
+ type LightSpecification = {
423
+ /**
424
+ * Whether extruded geometries are lit relative to the map or viewport.
425
+ *
426
+ * @default
427
+ * ```json
428
+ * "viewport"
429
+ * ```
430
+ *
431
+ * @example
432
+ * ```json
433
+ * "map"
434
+ * ```
435
+ */
436
+ "anchor"?: PropertyValueSpecification<"map" | "viewport">;
437
+ /**
438
+ * Position of the light source relative to lit (extruded) geometries, in `[r radial coordinate, a azimuthal angle, p polar angle]` where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).
439
+ *
440
+ * @default
441
+ * ```json
442
+ * [1.15, 210, 30]
443
+ * ```
444
+ *
445
+ * @example
446
+ * ```json
447
+ * [1.5, 90, 80]
448
+ * ```
449
+ */
450
+ "position"?: PropertyValueSpecification<[number, number, number]>;
451
+ "position-transition"?: TransitionSpecification;
452
+ /**
453
+ * Color tint for lighting extruded geometries.
454
+ *
455
+ * @default
456
+ * ```json
457
+ * "#ffffff"
458
+ * ```
459
+ */
460
+ "color"?: PropertyValueSpecification<ColorSpecification>;
461
+ "color-transition"?: TransitionSpecification;
462
+ /**
463
+ * Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.
464
+ *
465
+ * @default
466
+ * ```json
467
+ * 0.5
468
+ * ```
469
+ */
470
+ "intensity"?: PropertyValueSpecification<number>;
471
+ "intensity-transition"?: TransitionSpecification;
472
+ };
473
+ type SkySpecification = {
474
+ /**
475
+ * The base color for the sky.
476
+ *
477
+ * @default
478
+ * ```json
479
+ * "#88C6FC"
480
+ * ```
481
+ */
482
+ "sky-color"?: PropertyValueSpecification<ColorSpecification>;
483
+ "sky-color-transition"?: TransitionSpecification;
484
+ /**
485
+ * The base color at the horizon.
486
+ *
487
+ * @default
488
+ * ```json
489
+ * "#ffffff"
490
+ * ```
491
+ */
492
+ "horizon-color"?: PropertyValueSpecification<ColorSpecification>;
493
+ "horizon-color-transition"?: TransitionSpecification;
494
+ /**
495
+ * The base color for the fog. Requires 3D terrain.
496
+ *
497
+ * @default
498
+ * ```json
499
+ * "#ffffff"
500
+ * ```
501
+ */
502
+ "fog-color"?: PropertyValueSpecification<ColorSpecification>;
503
+ "fog-color-transition"?: TransitionSpecification;
504
+ /**
505
+ * How to blend the fog over the 3D terrain. Where 0 is the map center and 1 is the horizon.
506
+ *
507
+ * @default
508
+ * ```json
509
+ * 0.5
510
+ * ```
511
+ */
512
+ "fog-ground-blend"?: PropertyValueSpecification<number>;
513
+ "fog-ground-blend-transition"?: TransitionSpecification;
514
+ /**
515
+ * How to blend the fog color and the horizon color. Where 0 is using the horizon color only and 1 is using the fog color only.
516
+ *
517
+ * @default
518
+ * ```json
519
+ * 0.8
520
+ * ```
521
+ */
522
+ "horizon-fog-blend"?: PropertyValueSpecification<number>;
523
+ "horizon-fog-blend-transition"?: TransitionSpecification;
524
+ /**
525
+ * How to blend the sky color and the horizon color. Where 1 is blending the color at the middle of the sky and 0 is not blending at all and using the sky color only.
526
+ *
527
+ * @default
528
+ * ```json
529
+ * 0.8
530
+ * ```
531
+ */
532
+ "sky-horizon-blend"?: PropertyValueSpecification<number>;
533
+ "sky-horizon-blend-transition"?: TransitionSpecification;
534
+ /**
535
+ * How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using globe projection.
536
+ *
537
+ * @default
538
+ * ```json
539
+ * 0.8
540
+ * ```
541
+ */
542
+ "atmosphere-blend"?: PropertyValueSpecification<number>;
543
+ "atmosphere-blend-transition"?: TransitionSpecification;
544
+ };
545
+ type ProjectionSpecification = {
546
+ /**
547
+ * The projection definition type. Can be specified as a string, a transition state, or an expression.
548
+ *
549
+ * @default
550
+ * ```json
551
+ * "mercator"
552
+ * ```
553
+ */
554
+ "type"?: PropertyValueSpecification<ProjectionDefinitionSpecification>;
555
+ };
556
+ type TerrainSpecification = {
557
+ /**
558
+ * The source for the terrain data.
559
+ */
560
+ "source": string;
561
+ /**
562
+ * The exaggeration of the terrain - how high it will look.
563
+ *
564
+ * @default
565
+ * ```json
566
+ * 1
567
+ * ```
568
+ */
569
+ "exaggeration"?: number;
570
+ };
571
+ type VectorSourceSpecification = {
572
+ /**
573
+ * The type of the source.
574
+ */
575
+ "type": "vector";
576
+ /**
577
+ * A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.
578
+ */
579
+ "url"?: string;
580
+ /**
581
+ * An array of one or more tile source URLs, as in the TileJSON spec.
582
+ */
583
+ "tiles"?: Array<string>;
584
+ /**
585
+ * An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.
586
+ *
587
+ * @default
588
+ * ```json
589
+ * [-180, -85.051129, 180, 85.051129]
590
+ * ```
591
+ */
592
+ "bounds"?: [number, number, number, number];
593
+ /**
594
+ * Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.
595
+ *
596
+ * @default
597
+ * ```json
598
+ * "xyz"
599
+ * ```
600
+ */
601
+ "scheme"?: "xyz" | "tms";
602
+ /**
603
+ * Minimum zoom level for which tiles are available, as in the TileJSON spec.
604
+ */
605
+ "minzoom"?: number;
606
+ /**
607
+ * Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.
608
+ *
609
+ * @default
610
+ * ```json
611
+ * 22
612
+ * ```
613
+ */
614
+ "maxzoom"?: number;
615
+ /**
616
+ * Contains an attribution to be displayed when the map is shown to a user.
617
+ */
618
+ "attribution"?: string;
619
+ /**
620
+ * A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers.
621
+ */
622
+ "promoteId"?: PromoteIdSpecification;
623
+ /**
624
+ * A setting to determine whether a source's tiles are cached locally.
625
+ */
626
+ "volatile"?: boolean;
627
+ /**
628
+ * The encoding used by this source. Mapbox Vector Tiles encoding is used by default.
629
+ *
630
+ * @default
631
+ * ```json
632
+ * "mvt"
633
+ * ```
634
+ */
635
+ "encoding"?: "mvt" | "mlt";
636
+ };
637
+ type RasterSourceSpecification = {
638
+ /**
639
+ * The type of the source.
640
+ */
641
+ "type": "raster";
642
+ /**
643
+ * A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.
644
+ */
645
+ "url"?: string;
646
+ /**
647
+ * An array of one or more tile source URLs, as in the TileJSON spec.
648
+ */
649
+ "tiles"?: Array<string>;
650
+ /**
651
+ * An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.
652
+ *
653
+ * @default
654
+ * ```json
655
+ * [-180, -85.051129, 180, 85.051129]
656
+ * ```
657
+ */
658
+ "bounds"?: [number, number, number, number];
659
+ /**
660
+ * Minimum zoom level for which tiles are available, as in the TileJSON spec.
661
+ */
662
+ "minzoom"?: number;
663
+ /**
664
+ * Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.
665
+ *
666
+ * @default
667
+ * ```json
668
+ * 22
669
+ * ```
670
+ */
671
+ "maxzoom"?: number;
672
+ /**
673
+ * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
674
+ *
675
+ * @default
676
+ * ```json
677
+ * 512
678
+ * ```
679
+ */
680
+ "tileSize"?: number;
681
+ /**
682
+ * Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.
683
+ *
684
+ * @default
685
+ * ```json
686
+ * "xyz"
687
+ * ```
688
+ */
689
+ "scheme"?: "xyz" | "tms";
690
+ /**
691
+ * Contains an attribution to be displayed when the map is shown to a user.
692
+ */
693
+ "attribution"?: string;
694
+ /**
695
+ * A setting to determine whether a source's tiles are cached locally.
696
+ */
697
+ "volatile"?: boolean;
698
+ };
699
+ type RasterDEMSourceSpecification = {
700
+ /**
701
+ * The type of the source.
702
+ */
703
+ "type": "raster-dem";
704
+ /**
705
+ * A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.
706
+ */
707
+ "url"?: string;
708
+ /**
709
+ * An array of one or more tile source URLs, as in the TileJSON spec.
710
+ */
711
+ "tiles"?: Array<string>;
712
+ /**
713
+ * An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.
714
+ *
715
+ * @default
716
+ * ```json
717
+ * [-180, -85.051129, 180, 85.051129]
718
+ * ```
719
+ */
720
+ "bounds"?: [number, number, number, number];
721
+ /**
722
+ * Minimum zoom level for which tiles are available, as in the TileJSON spec.
723
+ */
724
+ "minzoom"?: number;
725
+ /**
726
+ * Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.
727
+ *
728
+ * @default
729
+ * ```json
730
+ * 22
731
+ * ```
732
+ */
733
+ "maxzoom"?: number;
734
+ /**
735
+ * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
736
+ *
737
+ * @default
738
+ * ```json
739
+ * 512
740
+ * ```
741
+ */
742
+ "tileSize"?: number;
743
+ /**
744
+ * Contains an attribution to be displayed when the map is shown to a user.
745
+ */
746
+ "attribution"?: string;
747
+ /**
748
+ * The encoding used by this source. Mapbox Terrain RGB is used by default.
749
+ *
750
+ * @default
751
+ * ```json
752
+ * "mapbox"
753
+ * ```
754
+ */
755
+ "encoding"?: "terrarium" | "mapbox" | "custom";
756
+ /**
757
+ * Value that will be multiplied by the red channel value when decoding. Only used on custom encodings.
758
+ *
759
+ * @default
760
+ * ```json
761
+ * 1
762
+ * ```
763
+ */
764
+ "redFactor"?: number;
765
+ /**
766
+ * Value that will be multiplied by the blue channel value when decoding. Only used on custom encodings.
767
+ *
768
+ * @default
769
+ * ```json
770
+ * 1
771
+ * ```
772
+ */
773
+ "blueFactor"?: number;
774
+ /**
775
+ * Value that will be multiplied by the green channel value when decoding. Only used on custom encodings.
776
+ *
777
+ * @default
778
+ * ```json
779
+ * 1
780
+ * ```
781
+ */
782
+ "greenFactor"?: number;
783
+ /**
784
+ * Value that will be added to the encoding mix when decoding. Only used on custom encodings.
785
+ */
786
+ "baseShift"?: number;
787
+ /**
788
+ * A setting to determine whether a source's tiles are cached locally.
789
+ */
790
+ "volatile"?: boolean;
791
+ };
792
+ type GeoJSONSourceSpecification = {
793
+ /**
794
+ * The data type of the GeoJSON source.
795
+ */
796
+ "type": "geojson";
797
+ /**
798
+ * A URL to a GeoJSON file, or inline GeoJSON.
799
+ */
800
+ "data": GeoJSON.GeoJSON | string;
801
+ /**
802
+ * Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).
803
+ *
804
+ * @default
805
+ * ```json
806
+ * 18
807
+ * ```
808
+ */
809
+ "maxzoom"?: number;
810
+ /**
811
+ * Contains an attribution to be displayed when the map is shown to a user.
812
+ */
813
+ "attribution"?: string;
814
+ /**
815
+ * Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.
816
+ *
817
+ * @default
818
+ * ```json
819
+ * 128
820
+ * ```
821
+ */
822
+ "buffer"?: number;
823
+ /**
824
+ * An expression for filtering features prior to processing them for rendering.
825
+ */
826
+ "filter"?: FilterSpecification;
827
+ /**
828
+ * Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).
829
+ *
830
+ * @default
831
+ * ```json
832
+ * 0.375
833
+ * ```
834
+ */
835
+ "tolerance"?: number;
836
+ /**
837
+ * If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:
838
+ *
839
+ * * `cluster` Is `true` if the point is a cluster
840
+ *
841
+ * * `cluster_id` A unique id for the cluster to be used in conjunction with the [cluster inspection methods](https://maplibre.org/maplibre-gl-js/docs/API/classes/GeoJSONSource/#getclusterexpansionzoom)
842
+ *
843
+ * * `point_count` Number of original points grouped into this cluster
844
+ *
845
+ * * `point_count_abbreviated` An abbreviated point count
846
+ */
847
+ "cluster"?: boolean;
848
+ /**
849
+ * Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.
850
+ *
851
+ * @default
852
+ * ```json
853
+ * 50
854
+ * ```
855
+ */
856
+ "clusterRadius"?: number;
857
+ /**
858
+ * Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.
859
+ */
860
+ "clusterMaxZoom"?: number;
861
+ /**
862
+ * Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`.
863
+ */
864
+ "clusterMinPoints"?: number;
865
+ /**
866
+ * An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) - it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.
867
+ *
868
+ * Example: `{"sum": ["+", ["get", "scalerank"]]}`.
869
+ *
870
+ * For more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:
871
+ *
872
+ * `{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`
873
+ */
874
+ "clusterProperties"?: unknown;
875
+ /**
876
+ * Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values.
877
+ */
878
+ "lineMetrics"?: boolean;
879
+ /**
880
+ * Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values.
881
+ */
882
+ "generateId"?: boolean;
883
+ /**
884
+ * A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`.
885
+ */
886
+ "promoteId"?: PromoteIdSpecification;
887
+ };
888
+ type VideoSourceSpecification = {
889
+ /**
890
+ * The data type of the video source.
891
+ */
892
+ "type": "video";
893
+ /**
894
+ * URLs to video content in order of preferred format.
895
+ */
896
+ "urls": Array<string>;
897
+ /**
898
+ * Corners of video specified in longitude, latitude pairs.
899
+ */
900
+ "coordinates": [[number, number], [number, number], [number, number], [number, number]];
901
+ };
902
+ type ImageSourceSpecification = {
903
+ /**
904
+ * The data type of the image source.
905
+ */
906
+ "type": "image";
907
+ /**
908
+ * URL that points to an image. Optional: a source created without a url starts empty and renders nothing until an image is set at runtime.
909
+ */
910
+ "url"?: string;
911
+ /**
912
+ * Corners of image specified in longitude, latitude pairs.
913
+ */
914
+ "coordinates": [[number, number], [number, number], [number, number], [number, number]];
915
+ };
916
+ type SourceSpecification = VectorSourceSpecification | RasterSourceSpecification | RasterDEMSourceSpecification | GeoJSONSourceSpecification | VideoSourceSpecification | ImageSourceSpecification;
917
+ type FillLayerSpecification = {
918
+ /**
919
+ * Unique layer name.
920
+ */
921
+ "id": string;
922
+ "type": "fill";
923
+ /**
924
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
925
+ *
926
+ * @example
927
+ * ```json
928
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
929
+ * ```
930
+ */
931
+ "metadata"?: unknown;
932
+ /**
933
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
934
+ */
935
+ "source": string;
936
+ /**
937
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
938
+ */
939
+ "source-layer"?: string;
940
+ /**
941
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
942
+ */
943
+ "minzoom"?: number;
944
+ /**
945
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
946
+ */
947
+ "maxzoom"?: number;
948
+ /**
949
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
950
+ */
951
+ "filter"?: FilterSpecification;
952
+ /**
953
+ * Layout properties for the layer.
954
+ */
955
+ "layout"?: {
956
+ /**
957
+ * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
958
+ */
959
+ "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
960
+ /**
961
+ * Whether this layer is displayed.
962
+ *
963
+ * @default
964
+ * ```json
965
+ * "visible"
966
+ * ```
967
+ */
968
+ "visibility"?: VisibilitySpecification;
969
+ };
970
+ /**
971
+ * Default paint properties for this layer.
972
+ */
973
+ "paint"?: {
974
+ /**
975
+ * Whether or not the fill should be antialiased.
976
+ *
977
+ * @default
978
+ * ```json
979
+ * true
980
+ * ```
981
+ */
982
+ "fill-antialias"?: PropertyValueSpecification<boolean>;
983
+ /**
984
+ * The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
985
+ *
986
+ * @default
987
+ * ```json
988
+ * 1
989
+ * ```
990
+ */
991
+ "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
992
+ "fill-opacity-transition"?: TransitionSpecification;
993
+ /**
994
+ * Opacity applied to the layer as a whole. Unlike `fill-opacity` and alpha values in `fill-color`, which are applied per feature and accumulate where fills overlap, `fill-layer-opacity` is applied once so overlapping fills appear as a single surface at the given opacity. When both `fill-opacity` and `fill-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then `fill-layer-opacity` composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
995
+ *
996
+ * ![fill-opacity vs. fill-layer-opacity](assets/fill-layer-opacity.svg)
997
+ *
998
+ * @default
999
+ * ```json
1000
+ * 1
1001
+ * ```
1002
+ */
1003
+ "fill-layer-opacity"?: PropertyValueSpecification<number>;
1004
+ "fill-layer-opacity-transition"?: TransitionSpecification;
1005
+ /**
1006
+ * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. When used with an SDF fill pattern, this serves as the foreground color of the pattern.
1007
+ *
1008
+ * @default
1009
+ * ```json
1010
+ * "#000000"
1011
+ * ```
1012
+ */
1013
+ "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1014
+ "fill-color-transition"?: TransitionSpecification;
1015
+ /**
1016
+ * The outline color of the fill. Matches the value of `fill-color` if unspecified.
1017
+ */
1018
+ "fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1019
+ "fill-outline-color-transition"?: TransitionSpecification;
1020
+ /**
1021
+ * The geometry's offset. Values are `[x, y]` where negatives indicate left and up, respectively.
1022
+ *
1023
+ * @default
1024
+ * ```json
1025
+ * [0, 0]
1026
+ * ```
1027
+ */
1028
+ "fill-translate"?: PropertyValueSpecification<[number, number]>;
1029
+ "fill-translate-transition"?: TransitionSpecification;
1030
+ /**
1031
+ * Controls the frame of reference for `fill-translate`.
1032
+ *
1033
+ * @default
1034
+ * ```json
1035
+ * "map"
1036
+ * ```
1037
+ */
1038
+ "fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
1039
+ /**
1040
+ * Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
1041
+ */
1042
+ "fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
1043
+ "fill-pattern-transition"?: TransitionSpecification;
1044
+ };
1045
+ };
1046
+ type LineLayerSpecification = {
1047
+ /**
1048
+ * Unique layer name.
1049
+ */
1050
+ "id": string;
1051
+ "type": "line";
1052
+ /**
1053
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
1054
+ *
1055
+ * @example
1056
+ * ```json
1057
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
1058
+ * ```
1059
+ */
1060
+ "metadata"?: unknown;
1061
+ /**
1062
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
1063
+ */
1064
+ "source": string;
1065
+ /**
1066
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
1067
+ */
1068
+ "source-layer"?: string;
1069
+ /**
1070
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
1071
+ */
1072
+ "minzoom"?: number;
1073
+ /**
1074
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
1075
+ */
1076
+ "maxzoom"?: number;
1077
+ /**
1078
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1079
+ */
1080
+ "filter"?: FilterSpecification;
1081
+ /**
1082
+ * Layout properties for the layer.
1083
+ */
1084
+ "layout"?: {
1085
+ /**
1086
+ * The display of line endings.
1087
+ *
1088
+ * @default
1089
+ * ```json
1090
+ * "butt"
1091
+ * ```
1092
+ */
1093
+ "line-cap"?: DataDrivenPropertyValueSpecification<"butt" | "round" | "square">;
1094
+ /**
1095
+ * The display of lines when joining.
1096
+ *
1097
+ * @default
1098
+ * ```json
1099
+ * "miter"
1100
+ * ```
1101
+ */
1102
+ "line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">;
1103
+ /**
1104
+ * Used to automatically convert miter joins to bevel joins for sharp angles.
1105
+ *
1106
+ * @default
1107
+ * ```json
1108
+ * 2
1109
+ * ```
1110
+ */
1111
+ "line-miter-limit"?: DataDrivenPropertyValueSpecification<number>;
1112
+ /**
1113
+ * Used to automatically convert round joins to miter joins for shallow angles.
1114
+ *
1115
+ * @default
1116
+ * ```json
1117
+ * 1.05
1118
+ * ```
1119
+ */
1120
+ "line-round-limit"?: DataDrivenPropertyValueSpecification<number>;
1121
+ /**
1122
+ * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
1123
+ */
1124
+ "line-sort-key"?: DataDrivenPropertyValueSpecification<number>;
1125
+ /**
1126
+ * Whether this layer is displayed.
1127
+ *
1128
+ * @default
1129
+ * ```json
1130
+ * "visible"
1131
+ * ```
1132
+ */
1133
+ "visibility"?: VisibilitySpecification;
1134
+ };
1135
+ /**
1136
+ * Default paint properties for this layer.
1137
+ */
1138
+ "paint"?: {
1139
+ /**
1140
+ * The opacity at which the line will be drawn.
1141
+ *
1142
+ * @default
1143
+ * ```json
1144
+ * 1
1145
+ * ```
1146
+ */
1147
+ "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
1148
+ "line-opacity-transition"?: TransitionSpecification;
1149
+ /**
1150
+ * Opacity applied to the layer as a whole. Unlike `line-opacity` and alpha values in `line-color`, which are applied per feature and accumulate where lines overlap, `line-layer-opacity` is applied once so overlapping lines appear as a single surface at the given opacity. When both `line-opacity` and `line-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then layer-opacity composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
1151
+ *
1152
+ * ![line-opacity vs. line-layer-opacity](assets/line-layer-opacity.svg)
1153
+ *
1154
+ * @default
1155
+ * ```json
1156
+ * 1
1157
+ * ```
1158
+ */
1159
+ "line-layer-opacity"?: PropertyValueSpecification<number>;
1160
+ "line-layer-opacity-transition"?: TransitionSpecification;
1161
+ /**
1162
+ * The color with which the line will be drawn.
1163
+ *
1164
+ * @default
1165
+ * ```json
1166
+ * "#000000"
1167
+ * ```
1168
+ */
1169
+ "line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1170
+ "line-color-transition"?: TransitionSpecification;
1171
+ /**
1172
+ * The geometry's offset. Values are `[x, y]` where negatives indicate left and up, respectively.
1173
+ *
1174
+ * @default
1175
+ * ```json
1176
+ * [0, 0]
1177
+ * ```
1178
+ */
1179
+ "line-translate"?: PropertyValueSpecification<[number, number]>;
1180
+ "line-translate-transition"?: TransitionSpecification;
1181
+ /**
1182
+ * Controls the frame of reference for `line-translate`.
1183
+ *
1184
+ * @default
1185
+ * ```json
1186
+ * "map"
1187
+ * ```
1188
+ */
1189
+ "line-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
1190
+ /**
1191
+ * Stroke thickness.
1192
+ *
1193
+ * @default
1194
+ * ```json
1195
+ * 1
1196
+ * ```
1197
+ */
1198
+ "line-width"?: DataDrivenPropertyValueSpecification<number>;
1199
+ "line-width-transition"?: TransitionSpecification;
1200
+ /**
1201
+ * Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
1202
+ */
1203
+ "line-gap-width"?: DataDrivenPropertyValueSpecification<number>;
1204
+ "line-gap-width-transition"?: TransitionSpecification;
1205
+ /**
1206
+ * The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
1207
+ */
1208
+ "line-offset"?: DataDrivenPropertyValueSpecification<number>;
1209
+ "line-offset-transition"?: TransitionSpecification;
1210
+ /**
1211
+ * Blur applied to the line, in pixels.
1212
+ */
1213
+ "line-blur"?: DataDrivenPropertyValueSpecification<number>;
1214
+ "line-blur-transition"?: TransitionSpecification;
1215
+ /**
1216
+ * Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Zoom-dependent expressions will be evaluated only at integer zoom levels. The only way to create an array value is using `["literal", [...]]`; arrays cannot be read from or derived from feature properties.
1217
+ */
1218
+ "line-dasharray"?: DataDrivenPropertyValueSpecification<Array<number>>;
1219
+ "line-dasharray-transition"?: TransitionSpecification;
1220
+ /**
1221
+ * Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
1222
+ */
1223
+ "line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
1224
+ "line-pattern-transition"?: TransitionSpecification;
1225
+ /**
1226
+ * Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.
1227
+ */
1228
+ "line-gradient"?: ExpressionSpecification;
1229
+ };
1230
+ };
1231
+ type SymbolLayerSpecification = {
1232
+ /**
1233
+ * Unique layer name.
1234
+ */
1235
+ "id": string;
1236
+ "type": "symbol";
1237
+ /**
1238
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
1239
+ *
1240
+ * @example
1241
+ * ```json
1242
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
1243
+ * ```
1244
+ */
1245
+ "metadata"?: unknown;
1246
+ /**
1247
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
1248
+ */
1249
+ "source": string;
1250
+ /**
1251
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
1252
+ */
1253
+ "source-layer"?: string;
1254
+ /**
1255
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
1256
+ */
1257
+ "minzoom"?: number;
1258
+ /**
1259
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
1260
+ */
1261
+ "maxzoom"?: number;
1262
+ /**
1263
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1264
+ */
1265
+ "filter"?: FilterSpecification;
1266
+ /**
1267
+ * Layout properties for the layer.
1268
+ */
1269
+ "layout"?: {
1270
+ /**
1271
+ * Label placement relative to its geometry.
1272
+ *
1273
+ * @default
1274
+ * ```json
1275
+ * "point"
1276
+ * ```
1277
+ */
1278
+ "symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">;
1279
+ /**
1280
+ * Distance between two symbol anchors.
1281
+ *
1282
+ * @default
1283
+ * ```json
1284
+ * 250
1285
+ * ```
1286
+ */
1287
+ "symbol-spacing"?: PropertyValueSpecification<number>;
1288
+ /**
1289
+ * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
1290
+ */
1291
+ "symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
1292
+ /**
1293
+ * Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.
1294
+ */
1295
+ "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
1296
+ /**
1297
+ * Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.
1298
+ *
1299
+ * @default
1300
+ * ```json
1301
+ * "auto"
1302
+ * ```
1303
+ */
1304
+ "symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">;
1305
+ /**
1306
+ * If true, the icon will be visible even if it collides with other previously drawn symbols.
1307
+ */
1308
+ "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
1309
+ /**
1310
+ * Allows for control over whether to show an icon when it overlaps other symbols on the map. If `icon-overlap` is not set, `icon-allow-overlap` is used instead.
1311
+ */
1312
+ "icon-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1313
+ /**
1314
+ * If true, other symbols can be visible even if they collide with the icon.
1315
+ */
1316
+ "icon-ignore-placement"?: PropertyValueSpecification<boolean>;
1317
+ /**
1318
+ * If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
1319
+ */
1320
+ "icon-optional"?: PropertyValueSpecification<boolean>;
1321
+ /**
1322
+ * In combination with `symbol-placement`, determines the rotation behavior of icons.
1323
+ *
1324
+ * @default
1325
+ * ```json
1326
+ * "auto"
1327
+ * ```
1328
+ */
1329
+ "icon-rotation-alignment"?: DataDrivenPropertyValueSpecification<"map" | "viewport" | "auto">;
1330
+ /**
1331
+ * Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.
1332
+ *
1333
+ * @default
1334
+ * ```json
1335
+ * 1
1336
+ * ```
1337
+ */
1338
+ "icon-size"?: DataDrivenPropertyValueSpecification<number>;
1339
+ /**
1340
+ * Scales the icon to fit around the associated text.
1341
+ *
1342
+ * @default
1343
+ * ```json
1344
+ * "none"
1345
+ * ```
1346
+ */
1347
+ "icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">;
1348
+ /**
1349
+ * Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.
1350
+ *
1351
+ * @default
1352
+ * ```json
1353
+ * [0, 0, 0, 0]
1354
+ * ```
1355
+ */
1356
+ "icon-text-fit-padding"?: PropertyValueSpecification<[number, number, number, number]>;
1357
+ /**
1358
+ * Name of image in sprite to use for drawing an image background.
1359
+ */
1360
+ "icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
1361
+ /**
1362
+ * Rotates the icon clockwise.
1363
+ */
1364
+ "icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
1365
+ /**
1366
+ * Size of additional area round the icon bounding box used for detecting symbol collisions.
1367
+ *
1368
+ * @default
1369
+ * ```json
1370
+ * [2]
1371
+ * ```
1372
+ */
1373
+ "icon-padding"?: DataDrivenPropertyValueSpecification<PaddingSpecification>;
1374
+ /**
1375
+ * If true, the icon may be flipped to prevent it from being rendered upside-down.
1376
+ */
1377
+ "icon-keep-upright"?: PropertyValueSpecification<boolean>;
1378
+ /**
1379
+ * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.
1380
+ *
1381
+ * @default
1382
+ * ```json
1383
+ * [0, 0]
1384
+ * ```
1385
+ */
1386
+ "icon-offset"?: DataDrivenPropertyValueSpecification<[number, number]>;
1387
+ /**
1388
+ * Part of the icon placed closest to the anchor.
1389
+ *
1390
+ * @default
1391
+ * ```json
1392
+ * "center"
1393
+ * ```
1394
+ */
1395
+ "icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
1396
+ /**
1397
+ * Orientation of icon when map is pitched.
1398
+ *
1399
+ * @default
1400
+ * ```json
1401
+ * "auto"
1402
+ * ```
1403
+ */
1404
+ "icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
1405
+ /**
1406
+ * Orientation of text when map is pitched.
1407
+ *
1408
+ * @default
1409
+ * ```json
1410
+ * "auto"
1411
+ * ```
1412
+ */
1413
+ "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
1414
+ /**
1415
+ * In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
1416
+ *
1417
+ * @default
1418
+ * ```json
1419
+ * "auto"
1420
+ * ```
1421
+ */
1422
+ "text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "viewport-glyph" | "auto">;
1423
+ /**
1424
+ * Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
1425
+ */
1426
+ "text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>;
1427
+ /**
1428
+ * Fonts to use for displaying text. If the `glyphs` root property is specified, this array is joined together and interpreted as a font stack name. Otherwise, it is interpreted as a cascading fallback list of local font names.
1429
+ *
1430
+ * @default
1431
+ * ```json
1432
+ * ["Open Sans Regular", "Arial Unicode MS Regular"]
1433
+ * ```
1434
+ */
1435
+ "text-font"?: DataDrivenPropertyValueSpecification<Array<string>>;
1436
+ /**
1437
+ * Font size.
1438
+ *
1439
+ * @default
1440
+ * ```json
1441
+ * 16
1442
+ * ```
1443
+ */
1444
+ "text-size"?: DataDrivenPropertyValueSpecification<number>;
1445
+ /**
1446
+ * The maximum line width for text wrapping.
1447
+ *
1448
+ * @default
1449
+ * ```json
1450
+ * 10
1451
+ * ```
1452
+ */
1453
+ "text-max-width"?: DataDrivenPropertyValueSpecification<number>;
1454
+ /**
1455
+ * Text leading value for multi-line text.
1456
+ *
1457
+ * @default
1458
+ * ```json
1459
+ * 1.2
1460
+ * ```
1461
+ */
1462
+ "text-line-height"?: PropertyValueSpecification<number>;
1463
+ /**
1464
+ * Text tracking amount.
1465
+ */
1466
+ "text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>;
1467
+ /**
1468
+ * Text justification options.
1469
+ *
1470
+ * @default
1471
+ * ```json
1472
+ * "center"
1473
+ * ```
1474
+ */
1475
+ "text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
1476
+ /**
1477
+ * Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.
1478
+ */
1479
+ "text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
1480
+ /**
1481
+ * To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.
1482
+ *
1483
+ * @example
1484
+ * ```json
1485
+ * ["center", "left", "right"]
1486
+ * ```
1487
+ */
1488
+ "text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
1489
+ /**
1490
+ * To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use `text-justify: auto` to choose justification based on anchor position.
1491
+ *
1492
+ * The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.
1493
+ *
1494
+ * When present, this property takes precedence over `text-anchor`, `text-variable-anchor`, `text-offset`, and `text-radial-offset`.
1495
+ *
1496
+ * ```json
1497
+ *
1498
+ * { "text-variable-anchor-offset": ["top", [0, 4], "left", [3,0], "bottom", [1, 1]] }
1499
+ *
1500
+ * ```
1501
+ *
1502
+ * When the renderer chooses the `top` anchor, `[0, 4]` will be used for `text-offset`; the text will be shifted down by 4 ems.
1503
+ *
1504
+ * When the renderer chooses the `left` anchor, `[3, 0]` will be used for `text-offset`; the text will be shifted right by 3 ems.
1505
+ *
1506
+ * @example
1507
+ * ```json
1508
+ * ["top", [0, 4], "left", [3, 0], "bottom", [1, 1]]
1509
+ * ```
1510
+ */
1511
+ "text-variable-anchor-offset"?: DataDrivenPropertyValueSpecification<VariableAnchorOffsetCollectionSpecification>;
1512
+ /**
1513
+ * Part of the text placed closest to the anchor.
1514
+ *
1515
+ * @default
1516
+ * ```json
1517
+ * "center"
1518
+ * ```
1519
+ */
1520
+ "text-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
1521
+ /**
1522
+ * Maximum angle change between adjacent characters.
1523
+ *
1524
+ * @default
1525
+ * ```json
1526
+ * 45
1527
+ * ```
1528
+ */
1529
+ "text-max-angle"?: PropertyValueSpecification<number>;
1530
+ /**
1531
+ * The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
1532
+ */
1533
+ "text-writing-mode"?: PropertyValueSpecification<Array<"horizontal" | "vertical">>;
1534
+ /**
1535
+ * Rotates the text clockwise.
1536
+ */
1537
+ "text-rotate"?: DataDrivenPropertyValueSpecification<number>;
1538
+ /**
1539
+ * Size of the additional area around the text bounding box used for detecting symbol collisions.
1540
+ *
1541
+ * @default
1542
+ * ```json
1543
+ * 2
1544
+ * ```
1545
+ */
1546
+ "text-padding"?: PropertyValueSpecification<number>;
1547
+ /**
1548
+ * If true, the text may be flipped vertically to prevent it from being rendered upside-down.
1549
+ *
1550
+ * @default
1551
+ * ```json
1552
+ * true
1553
+ * ```
1554
+ */
1555
+ "text-keep-upright"?: PropertyValueSpecification<boolean>;
1556
+ /**
1557
+ * Specifies how to capitalize text, similar to the CSS `text-transform` property.
1558
+ *
1559
+ * @default
1560
+ * ```json
1561
+ * "none"
1562
+ * ```
1563
+ */
1564
+ "text-transform"?: DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">;
1565
+ /**
1566
+ * Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.
1567
+ *
1568
+ * @default
1569
+ * ```json
1570
+ * [0, 0]
1571
+ * ```
1572
+ */
1573
+ "text-offset"?: DataDrivenPropertyValueSpecification<[number, number]>;
1574
+ /**
1575
+ * If true, the text will be visible even if it collides with other previously drawn symbols.
1576
+ */
1577
+ "text-allow-overlap"?: PropertyValueSpecification<boolean>;
1578
+ /**
1579
+ * Allows for control over whether to show symbol text when it overlaps other symbols on the map. If `text-overlap` is not set, `text-allow-overlap` is used instead
1580
+ */
1581
+ "text-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1582
+ /**
1583
+ * If true, other symbols can be visible even if they collide with the text.
1584
+ */
1585
+ "text-ignore-placement"?: PropertyValueSpecification<boolean>;
1586
+ /**
1587
+ * If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
1588
+ */
1589
+ "text-optional"?: PropertyValueSpecification<boolean>;
1590
+ /**
1591
+ * The height above the anchor, in meters, at which the symbol is placed. Use `symbol-height-anchor` to control what this height is measured from.
1592
+ */
1593
+ "symbol-height-offset"?: DataDrivenPropertyValueSpecification<number>;
1594
+ /**
1595
+ * Defines what `symbol-height-offset` is measured from.
1596
+ *
1597
+ * @default
1598
+ * ```json
1599
+ * "ground"
1600
+ * ```
1601
+ */
1602
+ "symbol-height-anchor"?: PropertyValueSpecification<"ground" | "absolute">;
1603
+ /**
1604
+ * Whether this layer is displayed.
1605
+ *
1606
+ * @default
1607
+ * ```json
1608
+ * "visible"
1609
+ * ```
1610
+ */
1611
+ "visibility"?: VisibilitySpecification;
1612
+ };
1613
+ /**
1614
+ * Default paint properties for this layer.
1615
+ */
1616
+ "paint"?: {
1617
+ /**
1618
+ * The opacity at which the icon will be drawn.
1619
+ *
1620
+ * @default
1621
+ * ```json
1622
+ * 1
1623
+ * ```
1624
+ */
1625
+ "icon-opacity"?: DataDrivenPropertyValueSpecification<number>;
1626
+ "icon-opacity-transition"?: TransitionSpecification;
1627
+ /**
1628
+ * The color of the icon. This can only be used with SDF icons.
1629
+ *
1630
+ * @default
1631
+ * ```json
1632
+ * "#000000"
1633
+ * ```
1634
+ */
1635
+ "icon-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1636
+ "icon-color-transition"?: TransitionSpecification;
1637
+ /**
1638
+ * The color of the icon's halo. Icon halos can only be used with SDF icons.
1639
+ *
1640
+ * @default
1641
+ * ```json
1642
+ * "rgba(0, 0, 0, 0)"
1643
+ * ```
1644
+ */
1645
+ "icon-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1646
+ "icon-halo-color-transition"?: TransitionSpecification;
1647
+ /**
1648
+ * Distance of halo to the icon outline.
1649
+ *
1650
+ * The unit is in pixels only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for `@2x` sprites, etc.
1651
+ */
1652
+ "icon-halo-width"?: DataDrivenPropertyValueSpecification<number>;
1653
+ "icon-halo-width-transition"?: TransitionSpecification;
1654
+ /**
1655
+ * Fade out the halo towards the outside.
1656
+ */
1657
+ "icon-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
1658
+ "icon-halo-blur-transition"?: TransitionSpecification;
1659
+ /**
1660
+ * Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
1661
+ *
1662
+ * @default
1663
+ * ```json
1664
+ * [0, 0]
1665
+ * ```
1666
+ */
1667
+ "icon-translate"?: PropertyValueSpecification<[number, number]>;
1668
+ "icon-translate-transition"?: TransitionSpecification;
1669
+ /**
1670
+ * Controls the frame of reference for `icon-translate`.
1671
+ *
1672
+ * @default
1673
+ * ```json
1674
+ * "map"
1675
+ * ```
1676
+ */
1677
+ "icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
1678
+ /**
1679
+ * The opacity at which the text will be drawn.
1680
+ *
1681
+ * @default
1682
+ * ```json
1683
+ * 1
1684
+ * ```
1685
+ */
1686
+ "text-opacity"?: DataDrivenPropertyValueSpecification<number>;
1687
+ "text-opacity-transition"?: TransitionSpecification;
1688
+ /**
1689
+ * The color with which the text will be drawn.
1690
+ *
1691
+ * @default
1692
+ * ```json
1693
+ * "#000000"
1694
+ * ```
1695
+ */
1696
+ "text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1697
+ "text-color-transition"?: TransitionSpecification;
1698
+ /**
1699
+ * The color of the text's halo, which helps it stand out from backgrounds.
1700
+ *
1701
+ * @default
1702
+ * ```json
1703
+ * "rgba(0, 0, 0, 0)"
1704
+ * ```
1705
+ */
1706
+ "text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1707
+ "text-halo-color-transition"?: TransitionSpecification;
1708
+ /**
1709
+ * Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
1710
+ */
1711
+ "text-halo-width"?: DataDrivenPropertyValueSpecification<number>;
1712
+ "text-halo-width-transition"?: TransitionSpecification;
1713
+ /**
1714
+ * The halo's fadeout distance towards the outside.
1715
+ */
1716
+ "text-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
1717
+ "text-halo-blur-transition"?: TransitionSpecification;
1718
+ /**
1719
+ * Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
1720
+ *
1721
+ * @default
1722
+ * ```json
1723
+ * [0, 0]
1724
+ * ```
1725
+ */
1726
+ "text-translate"?: PropertyValueSpecification<[number, number]>;
1727
+ "text-translate-transition"?: TransitionSpecification;
1728
+ /**
1729
+ * Controls the frame of reference for `text-translate`.
1730
+ *
1731
+ * @default
1732
+ * ```json
1733
+ * "map"
1734
+ * ```
1735
+ */
1736
+ "text-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
1737
+ };
1738
+ };
1739
+ type CircleLayerSpecification = {
1740
+ /**
1741
+ * Unique layer name.
1742
+ */
1743
+ "id": string;
1744
+ "type": "circle";
1745
+ /**
1746
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
1747
+ *
1748
+ * @example
1749
+ * ```json
1750
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
1751
+ * ```
1752
+ */
1753
+ "metadata"?: unknown;
1754
+ /**
1755
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
1756
+ */
1757
+ "source": string;
1758
+ /**
1759
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
1760
+ */
1761
+ "source-layer"?: string;
1762
+ /**
1763
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
1764
+ */
1765
+ "minzoom"?: number;
1766
+ /**
1767
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
1768
+ */
1769
+ "maxzoom"?: number;
1770
+ /**
1771
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1772
+ */
1773
+ "filter"?: FilterSpecification;
1774
+ /**
1775
+ * Layout properties for the layer.
1776
+ */
1777
+ "layout"?: {
1778
+ /**
1779
+ * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
1780
+ */
1781
+ "circle-sort-key"?: DataDrivenPropertyValueSpecification<number>;
1782
+ /**
1783
+ * Whether this layer is displayed.
1784
+ *
1785
+ * @default
1786
+ * ```json
1787
+ * "visible"
1788
+ * ```
1789
+ */
1790
+ "visibility"?: VisibilitySpecification;
1791
+ };
1792
+ /**
1793
+ * Default paint properties for this layer.
1794
+ */
1795
+ "paint"?: {
1796
+ /**
1797
+ * Circle radius.
1798
+ *
1799
+ * @default
1800
+ * ```json
1801
+ * 5
1802
+ * ```
1803
+ */
1804
+ "circle-radius"?: DataDrivenPropertyValueSpecification<number>;
1805
+ "circle-radius-transition"?: TransitionSpecification;
1806
+ /**
1807
+ * The fill color of the circle.
1808
+ *
1809
+ * @default
1810
+ * ```json
1811
+ * "#000000"
1812
+ * ```
1813
+ */
1814
+ "circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1815
+ "circle-color-transition"?: TransitionSpecification;
1816
+ /**
1817
+ * Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
1818
+ */
1819
+ "circle-blur"?: DataDrivenPropertyValueSpecification<number>;
1820
+ "circle-blur-transition"?: TransitionSpecification;
1821
+ /**
1822
+ * The opacity at which the circle will be drawn.
1823
+ *
1824
+ * @default
1825
+ * ```json
1826
+ * 1
1827
+ * ```
1828
+ */
1829
+ "circle-opacity"?: DataDrivenPropertyValueSpecification<number>;
1830
+ "circle-opacity-transition"?: TransitionSpecification;
1831
+ /**
1832
+ * The geometry's offset. Values are `[x, y]` where negatives indicate left and up, respectively.
1833
+ *
1834
+ * @default
1835
+ * ```json
1836
+ * [0, 0]
1837
+ * ```
1838
+ */
1839
+ "circle-translate"?: PropertyValueSpecification<[number, number]>;
1840
+ "circle-translate-transition"?: TransitionSpecification;
1841
+ /**
1842
+ * Controls the frame of reference for `circle-translate`.
1843
+ *
1844
+ * @default
1845
+ * ```json
1846
+ * "map"
1847
+ * ```
1848
+ */
1849
+ "circle-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
1850
+ /**
1851
+ * Controls the scaling behavior of the circle when the map is pitched.
1852
+ *
1853
+ * @default
1854
+ * ```json
1855
+ * "map"
1856
+ * ```
1857
+ */
1858
+ "circle-pitch-scale"?: PropertyValueSpecification<"map" | "viewport">;
1859
+ /**
1860
+ * Orientation of circle when map is pitched.
1861
+ *
1862
+ * @default
1863
+ * ```json
1864
+ * "viewport"
1865
+ * ```
1866
+ */
1867
+ "circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
1868
+ /**
1869
+ * The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
1870
+ */
1871
+ "circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
1872
+ "circle-stroke-width-transition"?: TransitionSpecification;
1873
+ /**
1874
+ * The stroke color of the circle.
1875
+ *
1876
+ * @default
1877
+ * ```json
1878
+ * "#000000"
1879
+ * ```
1880
+ */
1881
+ "circle-stroke-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1882
+ "circle-stroke-color-transition"?: TransitionSpecification;
1883
+ /**
1884
+ * The opacity of the circle's stroke.
1885
+ *
1886
+ * @default
1887
+ * ```json
1888
+ * 1
1889
+ * ```
1890
+ */
1891
+ "circle-stroke-opacity"?: DataDrivenPropertyValueSpecification<number>;
1892
+ "circle-stroke-opacity-transition"?: TransitionSpecification;
1893
+ };
1894
+ };
1895
+ type HeatmapLayerSpecification = {
1896
+ /**
1897
+ * Unique layer name.
1898
+ */
1899
+ "id": string;
1900
+ "type": "heatmap";
1901
+ /**
1902
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
1903
+ *
1904
+ * @example
1905
+ * ```json
1906
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
1907
+ * ```
1908
+ */
1909
+ "metadata"?: unknown;
1910
+ /**
1911
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
1912
+ */
1913
+ "source": string;
1914
+ /**
1915
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
1916
+ */
1917
+ "source-layer"?: string;
1918
+ /**
1919
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
1920
+ */
1921
+ "minzoom"?: number;
1922
+ /**
1923
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
1924
+ */
1925
+ "maxzoom"?: number;
1926
+ /**
1927
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1928
+ */
1929
+ "filter"?: FilterSpecification;
1930
+ /**
1931
+ * Layout properties for the layer.
1932
+ */
1933
+ "layout"?: {
1934
+ /**
1935
+ * Whether this layer is displayed.
1936
+ *
1937
+ * @default
1938
+ * ```json
1939
+ * "visible"
1940
+ * ```
1941
+ */
1942
+ "visibility"?: VisibilitySpecification;
1943
+ };
1944
+ /**
1945
+ * Default paint properties for this layer.
1946
+ */
1947
+ "paint"?: {
1948
+ /**
1949
+ * Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.
1950
+ *
1951
+ * @default
1952
+ * ```json
1953
+ * 30
1954
+ * ```
1955
+ */
1956
+ "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
1957
+ "heatmap-radius-transition"?: TransitionSpecification;
1958
+ /**
1959
+ * A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.
1960
+ *
1961
+ * @default
1962
+ * ```json
1963
+ * 1
1964
+ * ```
1965
+ */
1966
+ "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
1967
+ /**
1968
+ * Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
1969
+ *
1970
+ * @default
1971
+ * ```json
1972
+ * 1
1973
+ * ```
1974
+ */
1975
+ "heatmap-intensity"?: PropertyValueSpecification<number>;
1976
+ "heatmap-intensity-transition"?: TransitionSpecification;
1977
+ /**
1978
+ * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
1979
+ *
1980
+ * @default
1981
+ * ```json
1982
+ * [
1983
+ * "interpolate",
1984
+ * ["linear"],
1985
+ * ["heatmap-density"],
1986
+ * 0,
1987
+ * "rgba(0, 0, 255, 0)",
1988
+ * 0.1,
1989
+ * "royalblue",
1990
+ * 0.3,
1991
+ * "cyan",
1992
+ * 0.5,
1993
+ * "lime",
1994
+ * 0.7,
1995
+ * "yellow",
1996
+ * 1,
1997
+ * "red"
1998
+ * ]
1999
+ * ```
2000
+ */
2001
+ "heatmap-color"?: ExpressionSpecification;
2002
+ /**
2003
+ * The global opacity at which the heatmap layer will be drawn.
2004
+ *
2005
+ * @default
2006
+ * ```json
2007
+ * 1
2008
+ * ```
2009
+ */
2010
+ "heatmap-opacity"?: PropertyValueSpecification<number>;
2011
+ "heatmap-opacity-transition"?: TransitionSpecification;
2012
+ };
2013
+ };
2014
+ type FillExtrusionLayerSpecification = {
2015
+ /**
2016
+ * Unique layer name.
2017
+ */
2018
+ "id": string;
2019
+ "type": "fill-extrusion";
2020
+ /**
2021
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
2022
+ *
2023
+ * @example
2024
+ * ```json
2025
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
2026
+ * ```
2027
+ */
2028
+ "metadata"?: unknown;
2029
+ /**
2030
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
2031
+ */
2032
+ "source": string;
2033
+ /**
2034
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
2035
+ */
2036
+ "source-layer"?: string;
2037
+ /**
2038
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
2039
+ */
2040
+ "minzoom"?: number;
2041
+ /**
2042
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
2043
+ */
2044
+ "maxzoom"?: number;
2045
+ /**
2046
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2047
+ */
2048
+ "filter"?: FilterSpecification;
2049
+ /**
2050
+ * Layout properties for the layer.
2051
+ */
2052
+ "layout"?: {
2053
+ /**
2054
+ * Whether this layer is displayed.
2055
+ *
2056
+ * @default
2057
+ * ```json
2058
+ * "visible"
2059
+ * ```
2060
+ */
2061
+ "visibility"?: VisibilitySpecification;
2062
+ /**
2063
+ * The distance from each fill extrusion corner, measured along the adjacent edges, that is replaced by a rounded corner. A value of `0` disables rounded corners.
2064
+ */
2065
+ "fill-extrusion-rounded-corner-distance"?: number;
2066
+ };
2067
+ /**
2068
+ * Default paint properties for this layer.
2069
+ */
2070
+ "paint"?: {
2071
+ /**
2072
+ * The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.
2073
+ *
2074
+ * @default
2075
+ * ```json
2076
+ * 1
2077
+ * ```
2078
+ */
2079
+ "fill-extrusion-opacity"?: PropertyValueSpecification<number>;
2080
+ "fill-extrusion-opacity-transition"?: TransitionSpecification;
2081
+ /**
2082
+ * The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.
2083
+ *
2084
+ * @default
2085
+ * ```json
2086
+ * "#000000"
2087
+ * ```
2088
+ */
2089
+ "fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
2090
+ "fill-extrusion-color-transition"?: TransitionSpecification;
2091
+ /**
2092
+ * The geometry's offset. Values are `[x, y]` where negatives indicate left and up (on the flat plane), respectively.
2093
+ *
2094
+ * @default
2095
+ * ```json
2096
+ * [0, 0]
2097
+ * ```
2098
+ */
2099
+ "fill-extrusion-translate"?: PropertyValueSpecification<[number, number]>;
2100
+ "fill-extrusion-translate-transition"?: TransitionSpecification;
2101
+ /**
2102
+ * Controls the frame of reference for `fill-extrusion-translate`.
2103
+ *
2104
+ * @default
2105
+ * ```json
2106
+ * "map"
2107
+ * ```
2108
+ */
2109
+ "fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
2110
+ /**
2111
+ * Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
2112
+ */
2113
+ "fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
2114
+ "fill-extrusion-pattern-transition"?: TransitionSpecification;
2115
+ /**
2116
+ * The height with which to extrude this layer. Negative values extrude below ground level, so a floor that is entirely underground can be expressed.
2117
+ */
2118
+ "fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
2119
+ "fill-extrusion-height-transition"?: TransitionSpecification;
2120
+ /**
2121
+ * The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`. Negative values extrude below ground level, e.g. underground floors.
2122
+ */
2123
+ "fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
2124
+ "fill-extrusion-base-transition"?: TransitionSpecification;
2125
+ /**
2126
+ * Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.
2127
+ *
2128
+ * @default
2129
+ * ```json
2130
+ * true
2131
+ * ```
2132
+ */
2133
+ "fill-extrusion-vertical-gradient"?: PropertyValueSpecification<boolean>;
2134
+ };
2135
+ };
2136
+ type RasterLayerSpecification = {
2137
+ /**
2138
+ * Unique layer name.
2139
+ */
2140
+ "id": string;
2141
+ "type": "raster";
2142
+ /**
2143
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
2144
+ *
2145
+ * @example
2146
+ * ```json
2147
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
2148
+ * ```
2149
+ */
2150
+ "metadata"?: unknown;
2151
+ /**
2152
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
2153
+ */
2154
+ "source": string;
2155
+ /**
2156
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
2157
+ */
2158
+ "source-layer"?: string;
2159
+ /**
2160
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
2161
+ */
2162
+ "minzoom"?: number;
2163
+ /**
2164
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
2165
+ */
2166
+ "maxzoom"?: number;
2167
+ /**
2168
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2169
+ */
2170
+ "filter"?: FilterSpecification;
2171
+ /**
2172
+ * Layout properties for the layer.
2173
+ */
2174
+ "layout"?: {
2175
+ /**
2176
+ * Whether this layer is displayed.
2177
+ *
2178
+ * @default
2179
+ * ```json
2180
+ * "visible"
2181
+ * ```
2182
+ */
2183
+ "visibility"?: VisibilitySpecification;
2184
+ };
2185
+ /**
2186
+ * Default paint properties for this layer.
2187
+ */
2188
+ "paint"?: {
2189
+ /**
2190
+ * The opacity at which the image will be drawn.
2191
+ *
2192
+ * @default
2193
+ * ```json
2194
+ * 1
2195
+ * ```
2196
+ */
2197
+ "raster-opacity"?: PropertyValueSpecification<number>;
2198
+ "raster-opacity-transition"?: TransitionSpecification;
2199
+ /**
2200
+ * Rotates hues around the color wheel.
2201
+ */
2202
+ "raster-hue-rotate"?: PropertyValueSpecification<number>;
2203
+ "raster-hue-rotate-transition"?: TransitionSpecification;
2204
+ /**
2205
+ * Increase or reduce the brightness of the image. The value is the minimum brightness.
2206
+ */
2207
+ "raster-brightness-min"?: PropertyValueSpecification<number>;
2208
+ "raster-brightness-min-transition"?: TransitionSpecification;
2209
+ /**
2210
+ * Increase or reduce the brightness of the image. The value is the maximum brightness.
2211
+ *
2212
+ * @default
2213
+ * ```json
2214
+ * 1
2215
+ * ```
2216
+ */
2217
+ "raster-brightness-max"?: PropertyValueSpecification<number>;
2218
+ "raster-brightness-max-transition"?: TransitionSpecification;
2219
+ /**
2220
+ * Increase or reduce the saturation of the image.
2221
+ */
2222
+ "raster-saturation"?: PropertyValueSpecification<number>;
2223
+ "raster-saturation-transition"?: TransitionSpecification;
2224
+ /**
2225
+ * Increase or reduce the contrast of the image.
2226
+ */
2227
+ "raster-contrast"?: PropertyValueSpecification<number>;
2228
+ "raster-contrast-transition"?: TransitionSpecification;
2229
+ /**
2230
+ * The resampling/interpolation method to use for overscaling, also known as texture magnification filter.
2231
+ * ![Visual comparison of linear resampling versus nearest resampling](assets/resampling.png)
2232
+ *
2233
+ * @default
2234
+ * ```json
2235
+ * "linear"
2236
+ * ```
2237
+ */
2238
+ "resampling"?: PropertyValueSpecification<"linear" | "nearest">;
2239
+ /**
2240
+ * The resampling/interpolation method to use for overscaling, also known as texture magnification filter. It is advised to use the generic `resampling` paint property instead.
2241
+ *
2242
+ * @default
2243
+ * ```json
2244
+ * "linear"
2245
+ * ```
2246
+ */
2247
+ "raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
2248
+ /**
2249
+ * Fade duration when a new tile is added, or when a video is started or its coordinates are updated.
2250
+ *
2251
+ * @default
2252
+ * ```json
2253
+ * 300
2254
+ * ```
2255
+ */
2256
+ "raster-fade-duration"?: PropertyValueSpecification<number>;
2257
+ };
2258
+ };
2259
+ type HillshadeLayerSpecification = {
2260
+ /**
2261
+ * Unique layer name.
2262
+ */
2263
+ "id": string;
2264
+ "type": "hillshade";
2265
+ /**
2266
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
2267
+ *
2268
+ * @example
2269
+ * ```json
2270
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
2271
+ * ```
2272
+ */
2273
+ "metadata"?: unknown;
2274
+ /**
2275
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
2276
+ */
2277
+ "source": string;
2278
+ /**
2279
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
2280
+ */
2281
+ "source-layer"?: string;
2282
+ /**
2283
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
2284
+ */
2285
+ "minzoom"?: number;
2286
+ /**
2287
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
2288
+ */
2289
+ "maxzoom"?: number;
2290
+ /**
2291
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2292
+ */
2293
+ "filter"?: FilterSpecification;
2294
+ /**
2295
+ * Layout properties for the layer.
2296
+ */
2297
+ "layout"?: {
2298
+ /**
2299
+ * Whether this layer is displayed.
2300
+ *
2301
+ * @default
2302
+ * ```json
2303
+ * "visible"
2304
+ * ```
2305
+ */
2306
+ "visibility"?: VisibilitySpecification;
2307
+ };
2308
+ /**
2309
+ * Default paint properties for this layer.
2310
+ */
2311
+ "paint"?: {
2312
+ /**
2313
+ * The direction of the light source(s) used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2314
+ *
2315
+ * @default
2316
+ * ```json
2317
+ * 335
2318
+ * ```
2319
+ */
2320
+ "hillshade-illumination-direction"?: PropertyValueSpecification<NumberArraySpecification>;
2321
+ /**
2322
+ * The altitude of the light source(s) used to generate the hillshading with 0 as sunset and 90 as noon. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2323
+ *
2324
+ * @default
2325
+ * ```json
2326
+ * 45
2327
+ * ```
2328
+ */
2329
+ "hillshade-illumination-altitude"?: PropertyValueSpecification<NumberArraySpecification>;
2330
+ /**
2331
+ * Direction of light source when map is rotated.
2332
+ *
2333
+ * @default
2334
+ * ```json
2335
+ * "viewport"
2336
+ * ```
2337
+ */
2338
+ "hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">;
2339
+ /**
2340
+ * Intensity of the hillshade
2341
+ *
2342
+ * @default
2343
+ * ```json
2344
+ * 0.5
2345
+ * ```
2346
+ */
2347
+ "hillshade-exaggeration"?: PropertyValueSpecification<number>;
2348
+ "hillshade-exaggeration-transition"?: TransitionSpecification;
2349
+ /**
2350
+ * The shading color of areas that face away from the light source(s). Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2351
+ *
2352
+ * @default
2353
+ * ```json
2354
+ * "#000000"
2355
+ * ```
2356
+ */
2357
+ "hillshade-shadow-color"?: PropertyValueSpecification<ColorArraySpecification>;
2358
+ "hillshade-shadow-color-transition"?: TransitionSpecification;
2359
+ /**
2360
+ * The shading color of areas that faces towards the light source(s). Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2361
+ *
2362
+ * @default
2363
+ * ```json
2364
+ * "#FFFFFF"
2365
+ * ```
2366
+ */
2367
+ "hillshade-highlight-color"?: PropertyValueSpecification<ColorArraySpecification>;
2368
+ "hillshade-highlight-color-transition"?: TransitionSpecification;
2369
+ /**
2370
+ * The shading color used to accentuate rugged terrain like sharp cliffs and gorges.
2371
+ *
2372
+ * @default
2373
+ * ```json
2374
+ * "#000000"
2375
+ * ```
2376
+ */
2377
+ "hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>;
2378
+ "hillshade-accent-color-transition"?: TransitionSpecification;
2379
+ /**
2380
+ * The hillshade algorithm to use, one of `standard`, `basic`, `combined`, `igor`, or `multidirectional`.
2381
+ * ![Visual comparison of standard, basic, igor, combined, and multidirectional hillshade-method](assets/hillshade_methods.png)
2382
+ *
2383
+ * @default
2384
+ * ```json
2385
+ * "standard"
2386
+ * ```
2387
+ */
2388
+ "hillshade-method"?: PropertyValueSpecification<"standard" | "basic" | "combined" | "igor" | "multidirectional">;
2389
+ /**
2390
+ * The resampling/interpolation method to use for overscaling, also known as texture magnification filter.
2391
+ * ![Visual comparison of linear resampling versus nearest resampling](assets/resampling.png)
2392
+ *
2393
+ * @default
2394
+ * ```json
2395
+ * "linear"
2396
+ * ```
2397
+ */
2398
+ "resampling"?: PropertyValueSpecification<"linear" | "nearest">;
2399
+ };
2400
+ };
2401
+ type ColorReliefLayerSpecification = {
2402
+ /**
2403
+ * Unique layer name.
2404
+ */
2405
+ "id": string;
2406
+ "type": "color-relief";
2407
+ /**
2408
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
2409
+ *
2410
+ * @example
2411
+ * ```json
2412
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
2413
+ * ```
2414
+ */
2415
+ "metadata"?: unknown;
2416
+ /**
2417
+ * Name of a source description to be used for this layer. Required for all layer types except `background`.
2418
+ */
2419
+ "source": string;
2420
+ /**
2421
+ * Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
2422
+ */
2423
+ "source-layer"?: string;
2424
+ /**
2425
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
2426
+ */
2427
+ "minzoom"?: number;
2428
+ /**
2429
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
2430
+ */
2431
+ "maxzoom"?: number;
2432
+ /**
2433
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2434
+ */
2435
+ "filter"?: FilterSpecification;
2436
+ /**
2437
+ * Layout properties for the layer.
2438
+ */
2439
+ "layout"?: {
2440
+ /**
2441
+ * Whether this layer is displayed.
2442
+ *
2443
+ * @default
2444
+ * ```json
2445
+ * "visible"
2446
+ * ```
2447
+ */
2448
+ "visibility"?: VisibilitySpecification;
2449
+ };
2450
+ /**
2451
+ * Default paint properties for this layer.
2452
+ */
2453
+ "paint"?: {
2454
+ /**
2455
+ * The opacity at which the color-relief will be drawn.
2456
+ *
2457
+ * @default
2458
+ * ```json
2459
+ * 1
2460
+ * ```
2461
+ */
2462
+ "color-relief-opacity"?: PropertyValueSpecification<number>;
2463
+ "color-relief-opacity-transition"?: TransitionSpecification;
2464
+ /**
2465
+ * Defines the color of each pixel based on its elevation. Should be an expression that uses `["elevation"]` as input.
2466
+ *
2467
+ * @example
2468
+ * ```json
2469
+ * [
2470
+ * "interpolate",
2471
+ * ["linear"],
2472
+ * ["elevation"],
2473
+ * 0,
2474
+ * "black",
2475
+ * 8849,
2476
+ * "white"
2477
+ * ]
2478
+ * ```
2479
+ */
2480
+ "color-relief-color"?: ExpressionSpecification;
2481
+ /**
2482
+ * The resampling/interpolation method to use for overscaling, also known as texture magnification filter.
2483
+ * ![Visual comparison of linear resampling versus nearest resampling](assets/resampling.png)
2484
+ *
2485
+ * @default
2486
+ * ```json
2487
+ * "linear"
2488
+ * ```
2489
+ */
2490
+ "resampling"?: PropertyValueSpecification<"linear" | "nearest">;
2491
+ };
2492
+ };
2493
+ type BackgroundLayerSpecification = {
2494
+ /**
2495
+ * Unique layer name.
2496
+ */
2497
+ "id": string;
2498
+ "type": "background";
2499
+ /**
2500
+ * Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.
2501
+ *
2502
+ * @example
2503
+ * ```json
2504
+ * {"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
2505
+ * ```
2506
+ */
2507
+ "metadata"?: unknown;
2508
+ /**
2509
+ * The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
2510
+ */
2511
+ "minzoom"?: number;
2512
+ /**
2513
+ * The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
2514
+ */
2515
+ "maxzoom"?: number;
2516
+ /**
2517
+ * Layout properties for the layer.
2518
+ */
2519
+ "layout"?: {
2520
+ /**
2521
+ * Whether this layer is displayed.
2522
+ *
2523
+ * @default
2524
+ * ```json
2525
+ * "visible"
2526
+ * ```
2527
+ */
2528
+ "visibility"?: VisibilitySpecification;
2529
+ };
2530
+ /**
2531
+ * Default paint properties for this layer.
2532
+ */
2533
+ "paint"?: {
2534
+ /**
2535
+ * The color with which the background will be drawn.
2536
+ *
2537
+ * @default
2538
+ * ```json
2539
+ * "#000000"
2540
+ * ```
2541
+ */
2542
+ "background-color"?: PropertyValueSpecification<ColorSpecification>;
2543
+ "background-color-transition"?: TransitionSpecification;
2544
+ /**
2545
+ * Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
2546
+ */
2547
+ "background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>;
2548
+ "background-pattern-transition"?: TransitionSpecification;
2549
+ /**
2550
+ * The opacity at which the background will be drawn.
2551
+ *
2552
+ * @default
2553
+ * ```json
2554
+ * 1
2555
+ * ```
2556
+ */
2557
+ "background-opacity"?: PropertyValueSpecification<number>;
2558
+ "background-opacity-transition"?: TransitionSpecification;
2559
+ };
2560
+ };
2561
+ type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | ColorReliefLayerSpecification | BackgroundLayerSpecification;
2562
+
2563
+ /** Options for {@link renderToSVG}. */
2564
+ interface RenderToSVGOptions {
2565
+ /**
2566
+ * The MapLibre style to render.
2567
+ *
2568
+ * Its sources must list their tile URLs directly (`tiles: [...]`). A style whose
2569
+ * sources only point at a TileJSON document (`url: '.../tiles.json'`) renders as an
2570
+ * **empty map without any error**, because the renderer does not fetch TileJSON. Styles
2571
+ * built with `@versatiles/style` come in that form, so pass them through its
2572
+ * `inlineSources()` first — see the examples on {@link renderToSVG}.
2573
+ */
2574
+ style: StyleSpecification;
2575
+ /**
2576
+ * Width of the image in pixels.
2577
+ * @defaultValue `1024`
2578
+ */
2579
+ width?: number;
2580
+ /**
2581
+ * Height of the image in pixels.
2582
+ * @defaultValue `1024`
2583
+ */
2584
+ height?: number;
2585
+ /**
2586
+ * Longitude of the map centre, in degrees.
2587
+ * @defaultValue `0`
2588
+ */
2589
+ lon?: number;
2590
+ /**
2591
+ * Latitude of the map centre, in degrees.
2592
+ * @defaultValue `0`
2593
+ */
2594
+ lat?: number;
2595
+ /**
2596
+ * Zoom level, as in MapLibre: each step doubles the scale. Fractional values are
2597
+ * allowed.
2598
+ * @defaultValue `2`
2599
+ */
2600
+ zoom?: number;
2601
+ /**
2602
+ * Draw the style's symbol layers: text labels and icons.
2603
+ *
2604
+ * Off by default, because labels are the least faithful part of the output. They are
2605
+ * drawn as horizontal text at the middle of their feature: labels that MapLibre curves
2606
+ * along a line (`symbol-placement: "line"`, typically street names) come out straight,
2607
+ * and there is no collision detection, so crowded label layers can overlap.
2608
+ *
2609
+ * The SVG names each label's font (`text-font`) and leaves resolving it to whatever
2610
+ * displays the SVG, so labels use the intended typeface only where that font is
2611
+ * installed or provided with `@font-face`.
2612
+ * @defaultValue `false`
2613
+ */
2614
+ renderLabels?: boolean;
2615
+ }
2616
+ /**
2617
+ * Renders a MapLibre style to an SVG image.
2618
+ *
2619
+ * Fetches the vector and raster tiles the view needs, then draws every layer as SVG
2620
+ * elements: fills and lines as paths, raster tiles and sprites as embedded images. The
2621
+ * result is a single self-contained SVG document — it references no external files, so
2622
+ * it can be saved, inlined into HTML or opened in a vector editor as is.
2623
+ *
2624
+ * Works in Node.js (22 or later) and in the browser. The same function is exported by
2625
+ * `@versatiles/svg-renderer`, `@versatiles/png-renderer` and
2626
+ * `@versatiles/maplibre-svg-export`; the examples import it from the first.
2627
+ *
2628
+ * @example Render a map in Node.js
2629
+ * ```ts
2630
+ * import { renderToSVG } from '@versatiles/svg-renderer';
2631
+ * import { inlineSources, osm } from '@versatiles/style';
2632
+ * import { writeFile } from 'node:fs/promises';
2633
+ *
2634
+ * // inlineSources() resolves the style's TileJSON sources into tile URLs,
2635
+ * // which the renderer needs. Without it the map comes out empty.
2636
+ * const style = await inlineSources(osm({ theme: 'colorful' }));
2637
+ *
2638
+ * const svg = await renderToSVG({
2639
+ * style,
2640
+ * width: 800,
2641
+ * height: 600,
2642
+ * lon: 13.4, // Berlin
2643
+ * lat: 52.52,
2644
+ * zoom: 12,
2645
+ * });
2646
+ *
2647
+ * await writeFile('berlin.svg', svg);
2648
+ * ```
2649
+ *
2650
+ * @example Render a hosted style in the browser
2651
+ * ```ts
2652
+ * import { renderToSVG } from '@versatiles/svg-renderer';
2653
+ *
2654
+ * // This hosted style already lists its tile URLs, so it can be used directly.
2655
+ * const style = await fetch(
2656
+ * 'https://tiles.versatiles.org/assets/styles/colorful/style.json',
2657
+ * ).then((response) => response.json());
2658
+ *
2659
+ * document.body.innerHTML = await renderToSVG({ style, width: 800, height: 600, zoom: 3 });
2660
+ * ```
2661
+ *
2662
+ * @example Include labels and icons
2663
+ * ```ts
2664
+ * const svg = await renderToSVG({ style, lon: 13.4, lat: 52.52, zoom: 14, renderLabels: true });
2665
+ * ```
2666
+ *
2667
+ * @param options - What to render and how large. Only `style` is required.
2668
+ * @returns The SVG document, as a string beginning with `<svg`.
2669
+ * @throws If `width` or `height` is not positive.
2670
+ */
2671
+ declare function renderToSVG(options: RenderToSVGOptions): Promise<string>;
2672
+
2673
+ /**
2674
+ * Options for {@link renderToPNG}: everything {@link RenderToSVGOptions} takes, plus the
2675
+ * pixel density of the image and the fonts to draw labels with.
2676
+ */
2677
+ interface RenderToPNGOptions extends RenderToSVGOptions {
2678
+ /**
2679
+ * Pixel density, like a device pixel ratio. The image is `width * scale` by
2680
+ * `height * scale` pixels, while the map is laid out as if it were `width` by `height`
2681
+ * — so lines, text and icons keep their size and gain detail, as in a 2× screenshot.
2682
+ * Use `2` for a sharp image on high-resolution screens.
2683
+ * @defaultValue `1`
2684
+ */
2685
+ scale?: number;
2686
+ /**
2687
+ * Font files to draw labels with, as `{ "<text-font name>": "<path to a font file>" }`.
2688
+ *
2689
+ * A style only *names* its fonts (`"text-font": ["noto_sans_regular"]`). MapLibre
2690
+ * draws them from pre-rendered glyphs on the style's glyph server, which this renderer
2691
+ * does not use: it draws text with real font files instead. Map each name the style
2692
+ * uses to a TTF, OTF, WOFF or WOFF2 file. A name left unmapped falls back to a font
2693
+ * installed on the machine, which is usually not the one the style asked for.
2694
+ *
2695
+ * Fonts are registered process-wide, so a name registered by one call stays available
2696
+ * to every later call. Only matters when {@link RenderToSVGOptions.renderLabels} is on.
2697
+ */
2698
+ fonts?: Record<string, string>;
2699
+ }
2700
+ /**
2701
+ * Renders a MapLibre style to a PNG image.
2702
+ *
2703
+ * Takes the same options as {@link renderToSVG} and draws the same map, but rasterizes it
2704
+ * directly instead of producing SVG — no browser or SVG rasterizer needed. Satellite and
2705
+ * other raster tiles in WebP work too, which many SVG rasterizers cannot decode.
2706
+ *
2707
+ * **Node.js only.** It draws with the native canvas backend `@napi-rs/canvas`, a dependency
2708
+ * of this package that npm installs together with it, including the prebuilt binary for
2709
+ * the platform. If that binary is missing (e.g. installed with `--omit=optional`, or
2710
+ * `node_modules` copied from another OS or CPU architecture), this function throws an error
2711
+ * that names the platform and the missing package.
2712
+ *
2713
+ * @example Render a map to a file
2714
+ * ```ts
2715
+ * import { renderToPNG } from '@versatiles/png-renderer';
2716
+ * import { inlineSources, osm } from '@versatiles/style';
2717
+ * import { writeFile } from 'node:fs/promises';
2718
+ *
2719
+ * // As with renderToSVG, the style's sources must list their tile URLs.
2720
+ * const style = await inlineSources(osm({ theme: 'colorful' }));
2721
+ *
2722
+ * const png = await renderToPNG({
2723
+ * style,
2724
+ * width: 800,
2725
+ * height: 600,
2726
+ * lon: 13.4, // Berlin
2727
+ * lat: 52.52,
2728
+ * zoom: 12,
2729
+ * scale: 2, // 1600 × 1200 pixels, for high-resolution screens
2730
+ * });
2731
+ *
2732
+ * await writeFile('berlin.png', png);
2733
+ * ```
2734
+ *
2735
+ * @example Draw labels in the style's own fonts
2736
+ * ```ts
2737
+ * // The VersaTiles styles use Noto Sans. One source is `npm install @fontsource/noto-sans`
2738
+ * // (its "latin" files cover Western European scripts; it ships others alongside).
2739
+ * const files = 'node_modules/@fontsource/noto-sans/files';
2740
+ * const png = await renderToPNG({
2741
+ * style,
2742
+ * lon: 13.4,
2743
+ * lat: 52.52,
2744
+ * zoom: 14,
2745
+ * renderLabels: true,
2746
+ * fonts: {
2747
+ * noto_sans_regular: `${files}/noto-sans-latin-400-normal.woff2`,
2748
+ * noto_sans_bold: `${files}/noto-sans-latin-700-normal.woff2`,
2749
+ * },
2750
+ * });
2751
+ * ```
2752
+ *
2753
+ * @param options - What to render, how large, and at what pixel density. Only `style` is
2754
+ * required.
2755
+ * @returns The encoded PNG file. It is typed as a `Uint8Array` so that using this package
2756
+ * does not require Node's type definitions; at runtime it is a Node `Buffer`, and either
2757
+ * way it can be written with `fs.writeFile` as is.
2758
+ * @throws If the `@napi-rs/canvas` binary cannot be loaded, if `width`, `height` or `scale` is not
2759
+ * positive, or if a font in `fonts` cannot be loaded.
2760
+ */
2761
+ declare function renderToPNG(options: RenderToPNGOptions): Promise<Uint8Array>;
2762
+
2763
+ export { renderToPNG, renderToSVG };
2764
+ export type { RenderToPNGOptions, RenderToSVGOptions };