@tileflow/core 0.1.0-alpha.30 → 0.1.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.d.ts CHANGED
@@ -32,7 +32,423 @@ declare function registerTileflowWorldRequestBridge(input: {
32
32
  declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
33
33
  declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
34
34
 
35
+ declare const expressionBrand: unique symbol;
36
+ declare const themeValueBrand: unique symbol;
37
+ declare const zoomBrand: unique symbol;
38
+ declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
39
+ type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
40
+ type TileflowThemeTokenPrimitive = {
41
+ color: string;
42
+ font: string;
43
+ image: string;
44
+ number: number;
45
+ };
46
+ /** A JSON-safe semantic reference. The category is carried at runtime as well as in its type. */
47
+ type TileflowThemeTokenReference<TCategory extends TileflowThemeTokenCategory = TileflowThemeTokenCategory> = {
48
+ readonly category: TCategory;
49
+ readonly kind: 'theme-token';
50
+ readonly token: string;
51
+ readonly [themeValueBrand]: TileflowThemeTokenPrimitive[TCategory];
52
+ };
53
+ /** An explicit opt-out from theme substitution. A reason is mandatory for auditability. */
54
+ type TileflowFixedValue<T> = {
55
+ readonly kind: 'theme-fixed';
56
+ readonly reason: string;
57
+ readonly value: T;
58
+ readonly [themeValueBrand]: T;
59
+ };
60
+ type TileflowThemeColorMix = {
61
+ readonly amount: TileflowThemeNumberValue;
62
+ readonly from: TileflowThemeColorValue;
63
+ readonly kind: 'theme-color';
64
+ readonly operation: 'mix';
65
+ readonly space: 'oklch';
66
+ readonly to: TileflowThemeColorValue;
67
+ readonly [themeValueBrand]: string;
68
+ };
69
+ type TileflowThemeColorAlpha = {
70
+ readonly color: TileflowThemeColorValue;
71
+ readonly kind: 'theme-color';
72
+ readonly opacity: TileflowThemeNumberValue;
73
+ readonly operation: 'alpha';
74
+ readonly [themeValueBrand]: string;
75
+ };
76
+ type TileflowThemeColorOperation = TileflowThemeColorAlpha | TileflowThemeColorMix;
77
+ type TileflowThemeNumberValue = number | TileflowFixedValue<number> | TileflowThemeTokenReference<'number'>;
78
+ type TileflowThemeColorValue = string | TileflowFixedValue<string> | TileflowThemeColorOperation | TileflowThemeTokenReference<'color'>;
79
+ type TileflowThemeFontValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'font'>;
80
+ type TileflowThemeImageValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'image'>;
81
+ type TileflowExpression<T> = {
82
+ readonly kind: 'expression';
83
+ readonly value: readonly unknown[];
84
+ /** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
85
+ readonly [expressionBrand]: T;
86
+ };
87
+ type TileflowZoomValueCommon<T> = {
88
+ readonly kind: 'zoom';
89
+ readonly stops: readonly (readonly [number, T])[];
90
+ readonly [zoomBrand]?: T;
91
+ };
92
+ type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
93
+ readonly base: number;
94
+ readonly interpolation: 'exponential';
95
+ } | {
96
+ readonly base?: never;
97
+ readonly interpolation: 'linear' | 'step';
98
+ });
99
+
100
+ /** A color literal, semantic color token, color operation, expression, or zoom ramp. */
101
+ type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
102
+ /** An image name, semantic image token, expression, or zoom ramp. */
103
+ type TileflowImageStyleValue = TileflowExpression<string> | TileflowThemeImageValue | TileflowZoomValue<TileflowThemeImageValue>;
104
+ /** A number, semantic number token, expression, or zoom ramp. */
105
+ type TileflowNumberStyleValue = TileflowExpression<number> | TileflowThemeNumberValue | TileflowZoomValue<TileflowThemeNumberValue>;
106
+ /** A visual numeric array whose components may be themed, or whose full shape is fixed. */
107
+ type TileflowThemeNumberArrayValue = readonly TileflowThemeNumberValue[] | TileflowFixedValue<readonly number[]>;
108
+ /** A visual numeric array, expression, or zoom ramp with explicit theme intent. */
109
+ type TileflowNumberArrayStyleValue = TileflowExpression<readonly number[]> | TileflowThemeNumberArrayValue | TileflowZoomValue<TileflowThemeNumberArrayValue>;
110
+ /** A two-dimensional visual offset with category-safe numeric components. */
111
+ type TileflowNumberOffsetStyleValue = readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]>>;
112
+ /** Top, right, bottom, and left visual insets with category-safe numeric components. */
113
+ type TileflowNumberInsetsStyleValue = readonly [
114
+ TileflowThemeNumberValue,
115
+ TileflowThemeNumberValue,
116
+ TileflowThemeNumberValue,
117
+ TileflowThemeNumberValue
118
+ ] | TileflowFixedValue<readonly [number, number, number, number]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [
119
+ TileflowThemeNumberValue,
120
+ TileflowThemeNumberValue,
121
+ TileflowThemeNumberValue,
122
+ TileflowThemeNumberValue
123
+ ] | TileflowFixedValue<readonly [number, number, number, number]>>;
124
+ /** A structural value that does not participate in semantic theme-token substitution. */
125
+ type TileflowStructuralStyleValue<T> = T | TileflowExpression<T> | TileflowZoomValue<T>;
126
+ /** Structural text, including expressions and zoom-dependent literal strings. */
127
+ type TileflowStringStyleValue = TileflowStructuralStyleValue<string>;
128
+ type TileflowLineCap = 'butt' | 'round' | 'square';
129
+ type TileflowLineJoin = 'bevel' | 'miter' | 'round';
130
+ type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
131
+ type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
132
+ type TileflowPriorityOrder = 'higher-first' | 'lower-first';
133
+ type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
134
+ type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
135
+ type TileflowIconAnchor = TileflowTextAnchor;
136
+ type TileflowAlignment = 'auto' | 'map' | 'viewport';
137
+ type TileflowIconTextFit = 'both' | 'height' | 'none' | 'width';
138
+ /** Visibility and zoom bounds shared by every visual primitive. */
139
+ type TileflowLayerRange = {
140
+ maxZoom?: number;
141
+ minZoom?: number;
142
+ visible?: boolean;
143
+ };
144
+ type TileflowBackgroundPaint = {
145
+ color?: TileflowColorStyleValue;
146
+ opacity?: TileflowNumberStyleValue;
147
+ pattern?: TileflowImageStyleValue;
148
+ };
149
+ type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
150
+ type TileflowFillPaint = {
151
+ antialias?: boolean;
152
+ color?: TileflowColorStyleValue;
153
+ opacity?: TileflowNumberStyleValue;
154
+ pattern?: TileflowImageStyleValue;
155
+ translate?: TileflowNumberOffsetStyleValue;
156
+ translateAnchor?: 'map' | 'viewport';
157
+ };
158
+ type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
159
+ type TileflowLinePaint = {
160
+ blur?: TileflowNumberStyleValue;
161
+ color?: TileflowColorStyleValue;
162
+ dash?: TileflowNumberArrayStyleValue;
163
+ gapWidth?: TileflowNumberStyleValue;
164
+ offset?: TileflowNumberStyleValue;
165
+ opacity?: TileflowNumberStyleValue;
166
+ pattern?: TileflowImageStyleValue;
167
+ translate?: TileflowNumberOffsetStyleValue;
168
+ translateAnchor?: 'map' | 'viewport';
169
+ width?: TileflowNumberStyleValue;
170
+ };
171
+ type TileflowLineLayout = {
172
+ cap?: TileflowStructuralStyleValue<TileflowLineCap>;
173
+ join?: TileflowStructuralStyleValue<TileflowLineJoin>;
174
+ miterLimit?: TileflowNumberStyleValue;
175
+ roundLimit?: TileflowNumberStyleValue;
176
+ };
177
+ type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
178
+ /** Repeated diagonal marks placed along a stroked geographic feature. */
179
+ type TileflowLineHatchStyle = TileflowLayerRange & {
180
+ angle?: TileflowNumberStyleValue;
181
+ color?: TileflowColorStyleValue;
182
+ opacity?: TileflowNumberStyleValue;
183
+ /** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
184
+ pattern?: TileflowImageStyleValue;
185
+ /**
186
+ * Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
187
+ * selects the closest height to the rendered line width so marks retain a
188
+ * nearly fixed screen-pixel thickness instead of stretching with the road.
189
+ * Requires `pattern` to be a literal sprite-name prefix.
190
+ */
191
+ patternWidths?: TileflowThemeNumberArrayValue;
192
+ size?: TileflowNumberStyleValue;
193
+ spacing?: TileflowNumberStyleValue;
194
+ };
195
+ type TileflowTextPaint = {
196
+ color?: TileflowColorStyleValue;
197
+ haloBlur?: TileflowNumberStyleValue;
198
+ haloColor?: TileflowColorStyleValue;
199
+ haloWidth?: TileflowNumberStyleValue;
200
+ opacity?: TileflowNumberStyleValue;
201
+ };
202
+ /**
203
+ * One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
204
+ * whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
205
+ */
206
+ type TileflowTextBackground = {
207
+ /** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
208
+ color: TileflowColorStyleValue;
209
+ /** `lines` fits one strip to each shaped line. */
210
+ fit: 'lines';
211
+ /** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
212
+ padding?: TileflowThemeNumberValue;
213
+ };
214
+ type TileflowTextLayout = {
215
+ allowOverlap?: boolean;
216
+ anchor?: TileflowTextAnchor;
217
+ /**
218
+ * Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
219
+ * derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
220
+ */
221
+ background?: TileflowTextBackground;
222
+ field?: TileflowStringStyleValue;
223
+ font?: TileflowThemeFontValue;
224
+ fallbacks?: readonly TileflowThemeFontValue[];
225
+ ignorePlacement?: boolean;
226
+ justify?: TileflowTextJustify;
227
+ keepUpright?: boolean;
228
+ letterSpacing?: TileflowNumberStyleValue;
229
+ lineHeight?: TileflowNumberStyleValue;
230
+ maxAngle?: TileflowNumberStyleValue;
231
+ maxWidth?: TileflowNumberStyleValue;
232
+ offset?: TileflowNumberOffsetStyleValue;
233
+ optional?: boolean;
234
+ padding?: TileflowNumberStyleValue;
235
+ pitchAlignment?: TileflowAlignment;
236
+ radialOffset?: TileflowNumberStyleValue;
237
+ rotate?: TileflowNumberStyleValue;
238
+ rotationAlignment?: TileflowAlignment;
239
+ size?: TileflowNumberStyleValue;
240
+ transform?: 'lowercase' | 'none' | 'uppercase';
241
+ variableAnchors?: readonly TileflowTextAnchor[];
242
+ };
243
+ type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
244
+ type TileflowIconPaint = {
245
+ color?: TileflowColorStyleValue;
246
+ haloBlur?: TileflowNumberStyleValue;
247
+ haloColor?: TileflowColorStyleValue;
248
+ haloWidth?: TileflowNumberStyleValue;
249
+ opacity?: TileflowNumberStyleValue;
250
+ };
251
+ type TileflowIconLayout = {
252
+ allowOverlap?: boolean;
253
+ anchor?: TileflowIconAnchor;
254
+ image?: TileflowImageStyleValue;
255
+ ignorePlacement?: boolean;
256
+ keepUpright?: boolean;
257
+ offset?: TileflowNumberOffsetStyleValue;
258
+ optional?: boolean;
259
+ padding?: TileflowNumberStyleValue;
260
+ pitchAlignment?: TileflowAlignment;
261
+ rotate?: TileflowNumberStyleValue;
262
+ rotationAlignment?: TileflowAlignment;
263
+ size?: TileflowNumberStyleValue;
264
+ textFit?: TileflowIconTextFit;
265
+ textFitPadding?: TileflowNumberInsetsStyleValue;
266
+ };
267
+ type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
268
+ type TileflowSymbolPlacementStyle = TileflowLayerRange & {
269
+ placement?: TileflowSymbolPlacement;
270
+ priority?: TileflowStructuralStyleValue<number>;
271
+ /** Collision order for the semantic priority value. Defaults to `higher-first`. */
272
+ priorityOrder?: TileflowPriorityOrder;
273
+ spacing?: TileflowNumberStyleValue;
274
+ zOrder?: TileflowSymbolZOrder;
275
+ };
276
+ type TileflowCirclePaint = {
277
+ blur?: TileflowNumberStyleValue;
278
+ color?: TileflowColorStyleValue;
279
+ opacity?: TileflowNumberStyleValue;
280
+ pitchAlignment?: 'map' | 'viewport';
281
+ pitchScale?: 'map' | 'viewport';
282
+ priority?: TileflowStructuralStyleValue<number>;
283
+ /** Drawing order for the semantic priority value. Defaults to `higher-first`. */
284
+ priorityOrder?: TileflowPriorityOrder;
285
+ radius?: TileflowNumberStyleValue;
286
+ strokeColor?: TileflowColorStyleValue;
287
+ strokeOpacity?: TileflowNumberStyleValue;
288
+ strokeWidth?: TileflowNumberStyleValue;
289
+ translate?: TileflowNumberOffsetStyleValue;
290
+ translateAnchor?: 'map' | 'viewport';
291
+ };
292
+ type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
293
+ type TileflowExtrusionPaint = {
294
+ base?: TileflowNumberStyleValue;
295
+ color?: TileflowColorStyleValue;
296
+ height?: TileflowNumberStyleValue;
297
+ opacity?: TileflowNumberStyleValue;
298
+ pattern?: TileflowImageStyleValue;
299
+ verticalGradient?: boolean;
300
+ };
301
+ type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
302
+ /** A polygon rendered as a fill and, when requested, a separate line layer. */
303
+ type TileflowAreaStyle = {
304
+ fill?: TileflowFillStyle;
305
+ outline?: TileflowLineStyle;
306
+ };
307
+ /** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
308
+ type TileflowLineStackStyle = {
309
+ casing?: TileflowLineStyle;
310
+ fill?: TileflowLineStyle;
311
+ shadow?: TileflowLineStyle;
312
+ };
313
+ /** A symbol layer composed from one placement policy and optional text/icon parts. */
314
+ type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
315
+ icon?: TileflowIconStyle;
316
+ text?: TileflowTextStyle;
317
+ };
318
+ /** A symbol style that may also materialize a separate circle marker layer. */
319
+ type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
320
+ marker?: TileflowCircleStyle;
321
+ };
322
+
35
323
  type TileflowColor = `#${string}`;
324
+ type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
325
+ type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
326
+ type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
327
+ type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
328
+ type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
329
+ type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
330
+ type TileflowRoadExtras = {
331
+ paths?: boolean;
332
+ };
333
+ type TileflowRoadLayerStyle = TileflowLineStackStyle & {
334
+ hatch?: TileflowLineHatchStyle;
335
+ };
336
+ type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
337
+ type TileflowRoadTreatmentLayerStyle = {
338
+ casing?: TileflowRoadTreatmentLineStyle;
339
+ fill?: TileflowRoadTreatmentLineStyle;
340
+ shadow?: TileflowRoadTreatmentLineStyle;
341
+ };
342
+ type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
343
+ enabled?: boolean;
344
+ widthScale?: TileflowThemeNumberValue;
345
+ };
346
+ type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
347
+ type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
348
+ type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
349
+ type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
350
+ type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
351
+ enabled?: boolean;
352
+ };
353
+ type TileflowRoadAreaStyle = {
354
+ pedestrian?: TileflowAreaStyle;
355
+ pier?: TileflowAreaStyle;
356
+ road?: TileflowAreaStyle;
357
+ };
358
+ type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
359
+ type TileflowRoadRoundaboutStyle = {
360
+ casing?: TileflowCircleStyle;
361
+ fill?: TileflowCircleStyle;
362
+ };
363
+ type TileflowRoadSidewalkStyle = {
364
+ outline?: TileflowLineStyle;
365
+ pattern?: TileflowFillStyle;
366
+ surface?: TileflowFillStyle;
367
+ };
368
+ type TileflowRoadsModuleConfig = {
369
+ type: 'roads';
370
+ areas?: TileflowRoadAreaStyle;
371
+ classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
372
+ crossings?: TileflowRoadCrossingStyle;
373
+ detail?: TileflowRoadDetail;
374
+ extras?: TileflowRoadExtras;
375
+ hierarchy?: TileflowRoadHierarchy;
376
+ modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
377
+ mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
378
+ oneWayMarkers?: boolean;
379
+ outline?: TileflowRoadOutline;
380
+ restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
381
+ roundabouts?: TileflowRoadRoundaboutStyle;
382
+ serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
383
+ sidewalks?: TileflowRoadSidewalkStyle;
384
+ structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
385
+ weight?: TileflowRoadWeight;
386
+ widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
387
+ };
388
+ type TileflowLabelDetail = 'none' | 'major' | 'all';
389
+ type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
390
+ type TileflowRoadLabelDetail = TileflowRoadDetail;
391
+ type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
392
+ type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
393
+ type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
394
+ type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
395
+ type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
396
+ type TileflowRoadShieldStyles = {
397
+ default?: TileflowSymbolStyle;
398
+ detail?: TileflowSymbolStyle;
399
+ kinds?: Record<string, {
400
+ image: TileflowThemeImageValue;
401
+ }>;
402
+ overview?: TileflowSymbolStyle;
403
+ textColors?: Record<string, {
404
+ color: TileflowThemeColorValue;
405
+ }>;
406
+ };
407
+ type TileflowLabelStyles = {
408
+ aerodrome?: TileflowSymbolStyle;
409
+ junctions?: TileflowSymbolStyle;
410
+ places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
411
+ roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
412
+ shields?: TileflowRoadShieldStyles;
413
+ water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
414
+ };
415
+ type TileflowLabelsModuleConfig = {
416
+ type: 'labels';
417
+ aerodromeCodes?: TileflowAerodromeCodeDetail;
418
+ collisionPriority?: TileflowLabelCollisionPriority;
419
+ junctions?: boolean;
420
+ language?: TileflowLabelLanguage;
421
+ places?: TileflowLabelDetail;
422
+ roadClasses?: readonly TileflowRoadClass[];
423
+ roads?: TileflowRoadLabelDetail;
424
+ shields?: TileflowRoadShieldDetail;
425
+ styles?: TileflowLabelStyles;
426
+ water?: TileflowLabelDetail;
427
+ };
428
+ /** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
429
+ declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
430
+ type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
431
+ type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
432
+ type TileflowPoiColorMode = 'uniform' | 'category';
433
+ type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
434
+ /** Optional category-local cap within the module's canonical density tiers. */
435
+ density?: TileflowPoiDensity;
436
+ };
437
+ type TileflowPoiModuleConfig = {
438
+ type: 'poi';
439
+ categories?: readonly TileflowPoiCategory[];
440
+ color?: TileflowPoiColorMode;
441
+ density?: TileflowPoiDensity;
442
+ icons?: boolean;
443
+ labels?: boolean;
444
+ minZoom?: number;
445
+ placement?: {
446
+ coupleIconAndLabel?: boolean;
447
+ iconPadding?: number;
448
+ textPadding?: number;
449
+ };
450
+ styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
451
+ };
36
452
  type MapLibreSprite = string | Array<{
37
453
  id: string;
38
454
  url: string;
@@ -94,6 +510,207 @@ type TileflowStyleFontFace = {
94
510
  weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
95
511
  };
96
512
 
513
+ type TileflowAddressesModuleOptions = {
514
+ /** Styling for OpenMapTiles point house-number labels. */
515
+ labels?: TileflowSymbolStyle;
516
+ };
517
+ type TileflowAddressesModuleConfig = TileflowAddressesModuleOptions & {
518
+ type: 'addresses';
519
+ };
520
+
521
+ type TileflowAerowaysModuleOptions = {
522
+ area?: TileflowAreaStyle;
523
+ runway?: TileflowLineStackStyle;
524
+ runwayRef?: TileflowSymbolStyle;
525
+ taxiway?: TileflowLineStackStyle;
526
+ };
527
+ type TileflowAerowaysModuleConfig = TileflowAerowaysModuleOptions & {
528
+ type: 'aeroways';
529
+ };
530
+
531
+ type TileflowBoundariesModuleOptions = {
532
+ admin2?: TileflowLineStyle;
533
+ admin4?: TileflowLineStyle;
534
+ disputed?: TileflowLineStyle;
535
+ maritime?: TileflowLineStyle;
536
+ };
537
+ type TileflowBoundariesModuleConfig = TileflowBoundariesModuleOptions & {
538
+ type: 'boundaries';
539
+ };
540
+
541
+ type TileflowBuildingMode = '3d' | 'flat';
542
+ type TileflowBuildingsModuleOptions = {
543
+ businessCorridor?: TileflowAreaStyle;
544
+ extrusion?: TileflowExtrusionStyle;
545
+ flat?: TileflowAreaStyle;
546
+ mode?: TileflowBuildingMode;
547
+ };
548
+ type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
549
+ type: 'buildings';
550
+ };
551
+
552
+ type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'education' | 'government' | 'industrial' | 'medical' | 'military' | 'parking' | 'railway' | 'recreation' | 'residential';
553
+ type TileflowLandcoverClass = 'farmland' | 'flowerbed' | 'grass' | 'ice' | 'meadow' | 'protected' | 'recreationGround' | 'rock' | 'sand' | 'scrub' | 'urbanPark' | 'villageGreen' | 'wetland' | 'wood';
554
+ type TileflowLandModuleOptions = {
555
+ background?: TileflowBackgroundStyle;
556
+ globalLandcover?: TileflowFillStyle;
557
+ landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
558
+ landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
559
+ };
560
+ type TileflowLandModuleConfig = TileflowLandModuleOptions & {
561
+ type: 'land';
562
+ };
563
+
564
+ declare const tileflowLandformClasses: readonly ["peak", "volcano", "saddle", "ridge", "cliff", "arete"];
565
+ type TileflowLandformClass = (typeof tileflowLandformClasses)[number];
566
+ type TileflowLandformsModuleOptions = {
567
+ classes?: Partial<Record<TileflowLandformClass, TileflowSymbolStyle>>;
568
+ /** Append source elevation in metres when the feature provides it. */
569
+ elevation?: boolean;
570
+ };
571
+ type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
572
+ type: 'landforms';
573
+ };
574
+
575
+ /** Labels anchored inside polygon features; point-feature labels remain on their feature style. */
576
+ type TileflowNauticalAreaLabelStyles = {
577
+ coverage?: TileflowSymbolStyle;
578
+ hazards?: TileflowSymbolStyle;
579
+ navigationAreas?: TileflowSymbolStyle;
580
+ reefs?: TileflowSymbolStyle;
581
+ wrecks?: TileflowSymbolStyle;
582
+ };
583
+ type TileflowNauticalModuleOptions = {
584
+ aids?: TileflowMarkerSymbolStyle;
585
+ coverage?: TileflowAreaStyle;
586
+ hazardAreas?: TileflowAreaStyle;
587
+ hazards?: TileflowMarkerSymbolStyle;
588
+ labels?: TileflowNauticalAreaLabelStyles;
589
+ lighthouses?: TileflowMarkerSymbolStyle;
590
+ lights?: TileflowMarkerSymbolStyle;
591
+ navigationAreas?: TileflowAreaStyle;
592
+ reefs?: TileflowAreaStyle;
593
+ soundings?: TileflowMarkerSymbolStyle;
594
+ wreckAreas?: TileflowAreaStyle;
595
+ wrecks?: TileflowMarkerSymbolStyle;
596
+ };
597
+ type TileflowNauticalModuleConfig = TileflowNauticalModuleOptions & {
598
+ type: 'nautical';
599
+ };
600
+
601
+ type TileflowTransitModuleOptions = {
602
+ cableway?: TileflowLineStyle;
603
+ ferry?: TileflowLineStyle;
604
+ rail?: TileflowTransitRailStyle;
605
+ railHatching?: TileflowTransitRailStyle;
606
+ serviceRail?: TileflowTransitRailStyle;
607
+ };
608
+ type TileflowTransitRailStyle = {
609
+ bridge?: TileflowLineStyle;
610
+ surface?: TileflowLineStyle;
611
+ tunnel?: TileflowLineStyle;
612
+ };
613
+ type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
614
+ type: 'transit';
615
+ };
616
+
617
+ type TileflowVegetationMode = '3d' | 'flat';
618
+ type TileflowVegetationThreeDimensionalStyle = {
619
+ barkColor?: TileflowThemeColorValue;
620
+ broadleafColors?: readonly TileflowThemeColorValue[];
621
+ coniferColors?: readonly TileflowThemeColorValue[];
622
+ crownScale?: TileflowThemeNumberValue;
623
+ heightScale?: TileflowThemeNumberValue;
624
+ };
625
+ type TileflowVegetationModuleOptions = {
626
+ flat?: TileflowCircleStyle;
627
+ minZoom?: number;
628
+ mode?: TileflowVegetationMode;
629
+ threeDimensional?: TileflowVegetationThreeDimensionalStyle;
630
+ };
631
+ type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
632
+ type: 'vegetation';
633
+ };
634
+
635
+ type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
636
+ type TileflowWaterModuleOptions = {
637
+ bathymetry?: TileflowFillStyle;
638
+ /** Opt-in approximate contours traced from discrete bathymetry polygon band edges. */
639
+ bathymetryContours?: TileflowLineStyle;
640
+ /** Opt-in labels for bathymetry polygon band floors, not measured survey soundings. */
641
+ bathymetryLabels?: TileflowSymbolStyle;
642
+ bodies?: TileflowAreaStyle;
643
+ intermittent?: {
644
+ bodies?: TileflowAreaStyle;
645
+ waterways?: TileflowLineStyle;
646
+ };
647
+ waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
648
+ };
649
+ type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
650
+ type: 'water';
651
+ };
652
+
653
+ type TileflowSemanticModules = {
654
+ addresses?: TileflowAddressesModuleConfig;
655
+ aeroways?: TileflowAerowaysModuleConfig;
656
+ boundaries?: TileflowBoundariesModuleConfig;
657
+ buildings?: TileflowBuildingsModuleConfig;
658
+ labels?: TileflowLabelsModuleConfig;
659
+ land?: TileflowLandModuleConfig;
660
+ landforms?: TileflowLandformsModuleConfig;
661
+ nautical?: TileflowNauticalModuleConfig;
662
+ poi?: TileflowPoiModuleConfig;
663
+ roads?: TileflowRoadsModuleConfig;
664
+ transit?: TileflowTransitModuleConfig;
665
+ vegetation?: TileflowVegetationModuleConfig;
666
+ water?: TileflowWaterModuleConfig;
667
+ };
668
+ type TileflowSemanticModuleName = keyof TileflowSemanticModules;
669
+
670
+ /**
671
+ * Layer metadata naming the semantic module that owns a compiled layer, such as `roads` or `water`.
672
+ * Runtime features that address a module, such as map emphasis, read it instead of physical layer
673
+ * IDs. Layers that a theme blend splits or copies keep it.
674
+ */
675
+ declare const tileflowLayerDomainMetadataKey: "tileflow:domain";
676
+
677
+ type TileflowLayerDomain = TileflowSemanticModuleName | 'terrain';
678
+
679
+ /**
680
+ * Map emphasis lets an application's own content read first: chosen modules of the map recede
681
+ * towards the map's ground colour, and the map's labels and icons fade, except inside an area the
682
+ * application keeps at full strength. It only touches layers that a Tileflow map compiled, which
683
+ * name their module in their metadata; an application's own layers are never changed.
684
+ *
685
+ * This module plans which paint values an emphasis changes and computes each value for a strength
686
+ * from 0 (the map as designed) to 1 (the full emphasis). The browser controller writes them.
687
+ */
688
+ /** A module of a compiled Tileflow map, such as `roads`, `transit`, `boundaries`, or `water`. */
689
+ type TileflowEmphasisModule = TileflowLayerDomain;
690
+ /** A GeoJSON polygon or multipolygon, in longitude and latitude. */
691
+ type TileflowEmphasisArea = Readonly<{
692
+ coordinates: readonly (readonly (readonly number[])[])[];
693
+ type: 'Polygon';
694
+ }> | Readonly<{
695
+ coordinates: readonly (readonly (readonly (readonly number[])[])[])[];
696
+ type: 'MultiPolygon';
697
+ }>;
698
+ /** How the map steps back so an application's content reads first. */
699
+ type TileflowEmphasis = Readonly<{
700
+ /**
701
+ * Modules whose ground recedes towards the map's ground colour, and how far, from 0 (as
702
+ * designed) to 1 (the ground colour itself). Artwork that cannot be recoloured, such as
703
+ * patterns, fades by the same amount instead.
704
+ */
705
+ recede?: Readonly<Partial<Record<TileflowEmphasisModule, number>>>;
706
+ /** The share of their opacity the map's labels and icons keep, from 0 to 1. */
707
+ labels?: number;
708
+ /** An area in which the map's labels and icons keep their full strength. */
709
+ keep?: TileflowEmphasisArea;
710
+ }>;
711
+ /** Why an emphasis cannot be shown, or undefined when it can. */
712
+ declare function validateTileflowEmphasis(value: unknown): TypeError | undefined;
713
+
97
714
  /**
98
715
  * Browser helpers for theme transitions and blends. They use only methods that MapLibre GL JS maps
99
716
  * provide and check each one at runtime, so a map without them falls back to an immediate change.
@@ -102,6 +719,8 @@ type TileflowThemeMotionMap = {
102
719
  areTilesLoaded?: unknown;
103
720
  getCanvas?: unknown;
104
721
  getImage?: unknown;
722
+ getLayer?: unknown;
723
+ getStyle?: unknown;
105
724
  isStyleLoaded?: unknown;
106
725
  off(event: string, listener: (event?: unknown) => void): unknown;
107
726
  on(event: string, listener: (event?: unknown) => void): unknown;
@@ -237,12 +856,21 @@ type TileflowThemeController = {
237
856
  getBlend(): TileflowThemeBlendState | undefined;
238
857
  /** The theme the map shows; during a blend, the nearest theme. */
239
858
  getCurrent(): TileflowRuntimeStyle;
859
+ /** The emphasis requested last, or undefined when the map is shown as designed. */
860
+ getEmphasis(): TileflowEmphasis | undefined;
240
861
  /**
241
862
  * Shows a blend of themes. The first request for a set of themes loads their styles and
242
863
  * prepares one style that holds all of them; later requests for the same themes only move the
243
864
  * position and take effect at once, so they can follow an animation or a slider.
244
865
  */
245
866
  setBlend(request: TileflowThemeBlendRequest, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
867
+ /**
868
+ * Makes chosen modules of the map recede and its labels and icons fade, so an application's own
869
+ * content reads first; `undefined` returns the map to its design. The change eases over the
870
+ * transition, and the emphasis stays through later theme changes and blend positions. Values
871
+ * that MapLibre evaluates per feature change at once, under a cross-fade.
872
+ */
873
+ setEmphasis(emphasis: TileflowEmphasis | undefined, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
246
874
  setTheme(style: TileflowRuntimeStyle, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
247
875
  };
248
876
  /**
@@ -331,4 +959,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
331
959
  worldRequestBridge?: TileflowWorldRequestBridge;
332
960
  }): TileflowTransformRequest<TRequest, TResourceType> | undefined;
333
961
 
334
- export { type TileflowAsyncAnalyticsTiming, type TileflowAtmosphereMap, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowSessionSender, type TileflowSessionStarter, type TileflowStyleFontLoadOptions, type TileflowStyleSwitchMap, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol };
962
+ export { type TileflowAsyncAnalyticsTiming, type TileflowAtmosphereMap, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowSessionSender, type TileflowSessionStarter, type TileflowStyleFontLoadOptions, type TileflowStyleSwitchMap, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowLayerDomainMetadataKey, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, validateTileflowEmphasis };