@tileflow/core 0.1.0-alpha.4 → 0.1.0-alpha.41
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/LICENSE +201 -0
- package/README.md +318 -26
- package/THIRD_PARTY_NOTICES.md +444 -0
- package/dist/3d-CzLTD0RK.d.ts +1092 -0
- package/dist/3d.d.ts +1 -0
- package/dist/3d.js +12660 -0
- package/dist/browser.d.ts +2278 -0
- package/dist/browser.js +21826 -0
- package/dist/build.d.ts +595 -0
- package/dist/build.js +29737 -0
- package/dist/capture-shot-ChPQvPyi.d.ts +291 -0
- package/dist/capture.d.ts +9 -0
- package/dist/capture.js +510 -0
- package/dist/config-reference.json +40527 -0
- package/dist/icon-composition-HUh_Lj8Z.d.ts +2516 -0
- package/dist/index.d.ts +1805 -162
- package/dist/index.js +26400 -3488
- package/dist/manifest-types-DnhSJjCM.d.ts +902 -0
- package/dist/manifest.d.ts +9 -0
- package/dist/manifest.js +449 -0
- package/dist/native-profile.d.ts +206 -0
- package/dist/native-profile.js +9339 -0
- package/dist/native.d.ts +365 -0
- package/dist/native.js +5970 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +1445 -0
- package/dist/worker/camera-tile-worker.global.js +20 -0
- package/docs/application-tile-reading.md +86 -0
- package/docs/authoring-model.md +269 -0
- package/docs/boundary-areas-and-choropleths.md +217 -0
- package/docs/buildings-3d.md +608 -0
- package/docs/camera-moves-and-tile-cache.md +112 -0
- package/docs/capture-scenes.md +40 -0
- package/docs/capture-shots.md +173 -0
- package/docs/cartographic-defaults.md +210 -0
- package/docs/compiled-style-performance.md +286 -0
- package/docs/data-is-separate-from-design.md +610 -0
- package/docs/depth-markers.md +65 -0
- package/docs/dynamic-style-images.md +100 -0
- package/docs/globe-atmosphere.md +113 -0
- package/docs/hosted-session-authorization.md +106 -0
- package/docs/map-and-terrain-examples.md +156 -0
- package/docs/map-emphasis.md +89 -0
- package/docs/native-artifact-profile.md +152 -0
- package/docs/native-resource-urls.md +369 -0
- package/docs/nautical-marks.md +308 -0
- package/docs/public-api-and-browser-subpath.md +101 -0
- package/docs/route-drawing.md +191 -0
- package/docs/shared-visual-primitives.md +101 -0
- package/docs/street-lights.md +127 -0
- package/docs/street-sky.md +156 -0
- package/docs/style-states.md +73 -0
- package/docs/sun-and-light.md +167 -0
- package/docs/theme-transitions-and-blends.md +317 -0
- package/docs/themes-and-module-styles.md +156 -0
- package/docs/trees-3d.md +295 -0
- package/package.json +67 -8
|
@@ -0,0 +1,902 @@
|
|
|
1
|
+
declare const expressionBrand: unique symbol;
|
|
2
|
+
declare const themeValueBrand: unique symbol;
|
|
3
|
+
declare const zoomBrand: unique symbol;
|
|
4
|
+
declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
|
|
5
|
+
type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
|
|
6
|
+
type TileflowThemeTokenPrimitive = {
|
|
7
|
+
color: string;
|
|
8
|
+
font: string;
|
|
9
|
+
image: string;
|
|
10
|
+
number: number;
|
|
11
|
+
};
|
|
12
|
+
/** A JSON-safe semantic reference. The category is carried at runtime as well as in its type. */
|
|
13
|
+
type TileflowThemeTokenReference<TCategory extends TileflowThemeTokenCategory = TileflowThemeTokenCategory> = {
|
|
14
|
+
readonly category: TCategory;
|
|
15
|
+
readonly kind: 'theme-token';
|
|
16
|
+
readonly token: string;
|
|
17
|
+
readonly [themeValueBrand]: TileflowThemeTokenPrimitive[TCategory];
|
|
18
|
+
};
|
|
19
|
+
/** An explicit opt-out from theme substitution. A reason is mandatory for auditability. */
|
|
20
|
+
type TileflowFixedValue<T> = {
|
|
21
|
+
readonly kind: 'theme-fixed';
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
readonly value: T;
|
|
24
|
+
readonly [themeValueBrand]: T;
|
|
25
|
+
};
|
|
26
|
+
type TileflowThemeColorMix = {
|
|
27
|
+
readonly amount: TileflowThemeNumberValue;
|
|
28
|
+
readonly from: TileflowThemeColorValue;
|
|
29
|
+
readonly kind: 'theme-color';
|
|
30
|
+
readonly operation: 'mix';
|
|
31
|
+
readonly space: 'oklch';
|
|
32
|
+
readonly to: TileflowThemeColorValue;
|
|
33
|
+
readonly [themeValueBrand]: string;
|
|
34
|
+
};
|
|
35
|
+
type TileflowThemeColorAlpha = {
|
|
36
|
+
readonly color: TileflowThemeColorValue;
|
|
37
|
+
readonly kind: 'theme-color';
|
|
38
|
+
readonly opacity: TileflowThemeNumberValue;
|
|
39
|
+
readonly operation: 'alpha';
|
|
40
|
+
readonly [themeValueBrand]: string;
|
|
41
|
+
};
|
|
42
|
+
type TileflowThemeColorOperation = TileflowThemeColorAlpha | TileflowThemeColorMix;
|
|
43
|
+
type TileflowThemeNumberValue = number | TileflowFixedValue<number> | TileflowThemeTokenReference<'number'>;
|
|
44
|
+
type TileflowThemeColorValue = string | TileflowFixedValue<string> | TileflowThemeColorOperation | TileflowThemeTokenReference<'color'>;
|
|
45
|
+
type TileflowThemeFontValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'font'>;
|
|
46
|
+
type TileflowThemeImageValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'image'>;
|
|
47
|
+
type TileflowThemeValue<T> = T | TileflowFixedValue<T> | (T extends number ? TileflowThemeTokenReference<'number'> : T extends string ? TileflowThemeTokenReference<'color' | 'font' | 'image'> | TileflowThemeColorOperation : never);
|
|
48
|
+
declare const token: {
|
|
49
|
+
color(name: string): TileflowThemeTokenReference<"color">;
|
|
50
|
+
font(name: string): TileflowThemeTokenReference<"font">;
|
|
51
|
+
image(name: string): TileflowThemeTokenReference<"image">;
|
|
52
|
+
number(name: string): TileflowThemeTokenReference<"number">;
|
|
53
|
+
};
|
|
54
|
+
declare function fixed<T>(value: T, options: {
|
|
55
|
+
reason: string;
|
|
56
|
+
}): TileflowFixedValue<T>;
|
|
57
|
+
declare const color: {
|
|
58
|
+
alpha(value: TileflowThemeColorValue, opacity: TileflowThemeNumberValue): TileflowThemeColorAlpha;
|
|
59
|
+
mix(from: TileflowThemeColorValue, to: TileflowThemeColorValue, options: {
|
|
60
|
+
amount: TileflowThemeNumberValue;
|
|
61
|
+
space?: "oklch";
|
|
62
|
+
}): TileflowThemeColorMix;
|
|
63
|
+
};
|
|
64
|
+
type TileflowExpression<T> = {
|
|
65
|
+
readonly kind: 'expression';
|
|
66
|
+
readonly value: readonly unknown[];
|
|
67
|
+
/** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
|
|
68
|
+
readonly [expressionBrand]: T;
|
|
69
|
+
};
|
|
70
|
+
type TileflowZoomInterpolation = 'linear' | 'exponential';
|
|
71
|
+
type TileflowZoomValueCommon<T> = {
|
|
72
|
+
readonly kind: 'zoom';
|
|
73
|
+
readonly stops: readonly (readonly [number, T])[];
|
|
74
|
+
readonly [zoomBrand]?: T;
|
|
75
|
+
};
|
|
76
|
+
type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
|
|
77
|
+
readonly base: number;
|
|
78
|
+
readonly interpolation: 'exponential';
|
|
79
|
+
} | {
|
|
80
|
+
readonly base?: never;
|
|
81
|
+
readonly interpolation: 'linear' | 'step';
|
|
82
|
+
});
|
|
83
|
+
type TileflowStyleValue<T> = TileflowExpression<T> | TileflowThemeValue<T> | TileflowZoomValue<TileflowThemeValue<T>>;
|
|
84
|
+
declare const zoom: {
|
|
85
|
+
exponential<T>(base: number, stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
86
|
+
linear<T>(stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
87
|
+
step<T>(stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** A color literal, semantic color token, color operation, expression, or zoom ramp. */
|
|
91
|
+
type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
|
|
92
|
+
/** An image name, semantic image token, expression, or zoom ramp. */
|
|
93
|
+
type TileflowImageStyleValue = TileflowExpression<string> | TileflowThemeImageValue | TileflowZoomValue<TileflowThemeImageValue>;
|
|
94
|
+
/** A number, semantic number token, expression, or zoom ramp. */
|
|
95
|
+
type TileflowNumberStyleValue = TileflowExpression<number> | TileflowThemeNumberValue | TileflowZoomValue<TileflowThemeNumberValue>;
|
|
96
|
+
/** A visual numeric array whose components may be themed, or whose full shape is fixed. */
|
|
97
|
+
type TileflowThemeNumberArrayValue = readonly TileflowThemeNumberValue[] | TileflowFixedValue<readonly number[]>;
|
|
98
|
+
/** A visual numeric array, expression, or zoom ramp with explicit theme intent. */
|
|
99
|
+
type TileflowNumberArrayStyleValue = TileflowExpression<readonly number[]> | TileflowThemeNumberArrayValue | TileflowZoomValue<TileflowThemeNumberArrayValue>;
|
|
100
|
+
/** A two-dimensional visual offset with category-safe numeric components. */
|
|
101
|
+
type TileflowNumberOffsetStyleValue = readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]>>;
|
|
102
|
+
/** Top, right, bottom, and left visual insets with category-safe numeric components. */
|
|
103
|
+
type TileflowNumberInsetsStyleValue = readonly [
|
|
104
|
+
TileflowThemeNumberValue,
|
|
105
|
+
TileflowThemeNumberValue,
|
|
106
|
+
TileflowThemeNumberValue,
|
|
107
|
+
TileflowThemeNumberValue
|
|
108
|
+
] | TileflowFixedValue<readonly [number, number, number, number]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [
|
|
109
|
+
TileflowThemeNumberValue,
|
|
110
|
+
TileflowThemeNumberValue,
|
|
111
|
+
TileflowThemeNumberValue,
|
|
112
|
+
TileflowThemeNumberValue
|
|
113
|
+
] | TileflowFixedValue<readonly [number, number, number, number]>>;
|
|
114
|
+
/** A structural value that does not participate in semantic theme-token substitution. */
|
|
115
|
+
type TileflowStructuralStyleValue<T> = T | TileflowExpression<T> | TileflowZoomValue<T>;
|
|
116
|
+
/** Structural text, including expressions and zoom-dependent literal strings. */
|
|
117
|
+
type TileflowStringStyleValue = TileflowStructuralStyleValue<string>;
|
|
118
|
+
type TileflowLineCap = 'butt' | 'round' | 'square';
|
|
119
|
+
type TileflowLineJoin = 'bevel' | 'miter' | 'round';
|
|
120
|
+
type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
|
|
121
|
+
type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
|
|
122
|
+
type TileflowPriorityOrder = 'higher-first' | 'lower-first';
|
|
123
|
+
type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
|
|
124
|
+
type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
|
|
125
|
+
type TileflowIconAnchor = TileflowTextAnchor;
|
|
126
|
+
type TileflowAlignment = 'auto' | 'map' | 'viewport';
|
|
127
|
+
type TileflowIconTextFit = 'both' | 'height' | 'none' | 'width';
|
|
128
|
+
/**
|
|
129
|
+
* How a symbol part treats collisions with symbols placed before it. `never` hides it, `always`
|
|
130
|
+
* shows it, and `cooperative` shows it unless the earlier symbol was placed with `never`.
|
|
131
|
+
*/
|
|
132
|
+
type TileflowSymbolOverlap = 'always' | 'cooperative' | 'never';
|
|
133
|
+
/** Visibility and zoom bounds shared by every visual primitive. */
|
|
134
|
+
type TileflowLayerRange = {
|
|
135
|
+
maxZoom?: number;
|
|
136
|
+
minZoom?: number;
|
|
137
|
+
visible?: boolean;
|
|
138
|
+
};
|
|
139
|
+
type TileflowBackgroundPaint = {
|
|
140
|
+
color?: TileflowColorStyleValue;
|
|
141
|
+
opacity?: TileflowNumberStyleValue;
|
|
142
|
+
pattern?: TileflowImageStyleValue;
|
|
143
|
+
};
|
|
144
|
+
type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
|
|
145
|
+
type TileflowFillPaint = {
|
|
146
|
+
antialias?: boolean;
|
|
147
|
+
color?: TileflowColorStyleValue;
|
|
148
|
+
opacity?: TileflowNumberStyleValue;
|
|
149
|
+
pattern?: TileflowImageStyleValue;
|
|
150
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
151
|
+
translateAnchor?: 'map' | 'viewport';
|
|
152
|
+
};
|
|
153
|
+
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
154
|
+
type TileflowLinePaint = {
|
|
155
|
+
blur?: TileflowNumberStyleValue;
|
|
156
|
+
color?: TileflowColorStyleValue;
|
|
157
|
+
dash?: TileflowNumberArrayStyleValue;
|
|
158
|
+
gapWidth?: TileflowNumberStyleValue;
|
|
159
|
+
offset?: TileflowNumberStyleValue;
|
|
160
|
+
opacity?: TileflowNumberStyleValue;
|
|
161
|
+
pattern?: TileflowImageStyleValue;
|
|
162
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
163
|
+
translateAnchor?: 'map' | 'viewport';
|
|
164
|
+
width?: TileflowNumberStyleValue;
|
|
165
|
+
};
|
|
166
|
+
type TileflowLineLayout = {
|
|
167
|
+
cap?: TileflowStructuralStyleValue<TileflowLineCap>;
|
|
168
|
+
join?: TileflowStructuralStyleValue<TileflowLineJoin>;
|
|
169
|
+
miterLimit?: TileflowNumberStyleValue;
|
|
170
|
+
roundLimit?: TileflowNumberStyleValue;
|
|
171
|
+
};
|
|
172
|
+
type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
|
|
173
|
+
/** Repeated diagonal marks placed along a stroked geographic feature. */
|
|
174
|
+
type TileflowLineHatchStyle = TileflowLayerRange & {
|
|
175
|
+
angle?: TileflowNumberStyleValue;
|
|
176
|
+
color?: TileflowColorStyleValue;
|
|
177
|
+
opacity?: TileflowNumberStyleValue;
|
|
178
|
+
/** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
|
|
179
|
+
pattern?: TileflowImageStyleValue;
|
|
180
|
+
/**
|
|
181
|
+
* Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
|
|
182
|
+
* selects the closest height to the rendered line width so marks retain a
|
|
183
|
+
* nearly fixed screen-pixel thickness instead of stretching with the road.
|
|
184
|
+
* Requires `pattern` to be a literal sprite-name prefix.
|
|
185
|
+
*/
|
|
186
|
+
patternWidths?: TileflowThemeNumberArrayValue;
|
|
187
|
+
size?: TileflowNumberStyleValue;
|
|
188
|
+
spacing?: TileflowNumberStyleValue;
|
|
189
|
+
};
|
|
190
|
+
type TileflowTextPaint = {
|
|
191
|
+
color?: TileflowColorStyleValue;
|
|
192
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
193
|
+
haloColor?: TileflowColorStyleValue;
|
|
194
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
195
|
+
opacity?: TileflowNumberStyleValue;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
|
|
199
|
+
* whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
|
|
200
|
+
*/
|
|
201
|
+
type TileflowTextBackground = {
|
|
202
|
+
/** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
|
|
203
|
+
color: TileflowColorStyleValue;
|
|
204
|
+
/** `lines` fits one strip to each shaped line. */
|
|
205
|
+
fit: 'lines';
|
|
206
|
+
/** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
|
|
207
|
+
padding?: TileflowThemeNumberValue;
|
|
208
|
+
};
|
|
209
|
+
type TileflowTextLayout = {
|
|
210
|
+
allowOverlap?: boolean;
|
|
211
|
+
anchor?: TileflowTextAnchor;
|
|
212
|
+
/**
|
|
213
|
+
* Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
|
|
214
|
+
* derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
|
|
215
|
+
*/
|
|
216
|
+
background?: TileflowTextBackground;
|
|
217
|
+
field?: TileflowStringStyleValue;
|
|
218
|
+
font?: TileflowThemeFontValue;
|
|
219
|
+
fallbacks?: readonly TileflowThemeFontValue[];
|
|
220
|
+
ignorePlacement?: boolean;
|
|
221
|
+
justify?: TileflowTextJustify;
|
|
222
|
+
keepUpright?: boolean;
|
|
223
|
+
letterSpacing?: TileflowNumberStyleValue;
|
|
224
|
+
lineHeight?: TileflowNumberStyleValue;
|
|
225
|
+
maxAngle?: TileflowNumberStyleValue;
|
|
226
|
+
maxWidth?: TileflowNumberStyleValue;
|
|
227
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
228
|
+
optional?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
231
|
+
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
232
|
+
* and `true` otherwise.
|
|
233
|
+
*/
|
|
234
|
+
overlap?: TileflowSymbolOverlap;
|
|
235
|
+
padding?: TileflowNumberStyleValue;
|
|
236
|
+
pitchAlignment?: TileflowAlignment;
|
|
237
|
+
radialOffset?: TileflowNumberStyleValue;
|
|
238
|
+
rotate?: TileflowNumberStyleValue;
|
|
239
|
+
rotationAlignment?: TileflowAlignment;
|
|
240
|
+
size?: TileflowNumberStyleValue;
|
|
241
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
242
|
+
variableAnchors?: readonly TileflowTextAnchor[];
|
|
243
|
+
};
|
|
244
|
+
type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
|
|
245
|
+
type TileflowIconPaint = {
|
|
246
|
+
color?: TileflowColorStyleValue;
|
|
247
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
248
|
+
haloColor?: TileflowColorStyleValue;
|
|
249
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
250
|
+
opacity?: TileflowNumberStyleValue;
|
|
251
|
+
};
|
|
252
|
+
type TileflowIconLayout = {
|
|
253
|
+
allowOverlap?: boolean;
|
|
254
|
+
anchor?: TileflowIconAnchor;
|
|
255
|
+
image?: TileflowImageStyleValue;
|
|
256
|
+
ignorePlacement?: boolean;
|
|
257
|
+
keepUpright?: boolean;
|
|
258
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
259
|
+
optional?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
262
|
+
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
263
|
+
* and `true` otherwise.
|
|
264
|
+
*/
|
|
265
|
+
overlap?: TileflowSymbolOverlap;
|
|
266
|
+
padding?: TileflowNumberStyleValue;
|
|
267
|
+
pitchAlignment?: TileflowAlignment;
|
|
268
|
+
rotate?: TileflowNumberStyleValue;
|
|
269
|
+
rotationAlignment?: TileflowAlignment;
|
|
270
|
+
size?: TileflowNumberStyleValue;
|
|
271
|
+
textFit?: TileflowIconTextFit;
|
|
272
|
+
textFitPadding?: TileflowNumberInsetsStyleValue;
|
|
273
|
+
};
|
|
274
|
+
type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
|
|
275
|
+
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
276
|
+
placement?: TileflowSymbolPlacement;
|
|
277
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
278
|
+
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
279
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
280
|
+
spacing?: TileflowNumberStyleValue;
|
|
281
|
+
zOrder?: TileflowSymbolZOrder;
|
|
282
|
+
};
|
|
283
|
+
type TileflowCirclePaint = {
|
|
284
|
+
blur?: TileflowNumberStyleValue;
|
|
285
|
+
color?: TileflowColorStyleValue;
|
|
286
|
+
opacity?: TileflowNumberStyleValue;
|
|
287
|
+
pitchAlignment?: 'map' | 'viewport';
|
|
288
|
+
pitchScale?: 'map' | 'viewport';
|
|
289
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
290
|
+
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
291
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
292
|
+
radius?: TileflowNumberStyleValue;
|
|
293
|
+
strokeColor?: TileflowColorStyleValue;
|
|
294
|
+
strokeOpacity?: TileflowNumberStyleValue;
|
|
295
|
+
strokeWidth?: TileflowNumberStyleValue;
|
|
296
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
297
|
+
translateAnchor?: 'map' | 'viewport';
|
|
298
|
+
};
|
|
299
|
+
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
300
|
+
type TileflowExtrusionPaint = {
|
|
301
|
+
base?: TileflowNumberStyleValue;
|
|
302
|
+
color?: TileflowColorStyleValue;
|
|
303
|
+
height?: TileflowNumberStyleValue;
|
|
304
|
+
opacity?: TileflowNumberStyleValue;
|
|
305
|
+
pattern?: TileflowImageStyleValue;
|
|
306
|
+
verticalGradient?: boolean;
|
|
307
|
+
};
|
|
308
|
+
type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
|
|
309
|
+
/** A polygon rendered as a fill and, when requested, a separate line layer. */
|
|
310
|
+
type TileflowAreaStyle = {
|
|
311
|
+
fill?: TileflowFillStyle;
|
|
312
|
+
outline?: TileflowLineStyle;
|
|
313
|
+
};
|
|
314
|
+
/** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
|
|
315
|
+
type TileflowLineStackStyle = {
|
|
316
|
+
casing?: TileflowLineStyle;
|
|
317
|
+
fill?: TileflowLineStyle;
|
|
318
|
+
shadow?: TileflowLineStyle;
|
|
319
|
+
};
|
|
320
|
+
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
321
|
+
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
322
|
+
icon?: TileflowIconStyle;
|
|
323
|
+
text?: TileflowTextStyle;
|
|
324
|
+
};
|
|
325
|
+
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
326
|
+
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
327
|
+
marker?: TileflowCircleStyle;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
type TileflowColor = `#${string}`;
|
|
331
|
+
type TileflowTypographyStyle = {
|
|
332
|
+
/** Ordered exact fallback face names; CSS generic families are allowed for local fonts. */
|
|
333
|
+
fallbacks?: readonly string[];
|
|
334
|
+
/** Exact OpenType full name or exact remote glyph face name. */
|
|
335
|
+
font?: string;
|
|
336
|
+
letterSpacing?: number;
|
|
337
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
338
|
+
};
|
|
339
|
+
type ResolvedTileflowTypographyStyle = Required<Pick<TileflowTypographyStyle, 'font'>> & Omit<TileflowTypographyStyle, 'font'>;
|
|
340
|
+
type ResolvedTileflowTypography = ResolvedTileflowTypographyStyle & {
|
|
341
|
+
places: ResolvedTileflowTypographyStyle;
|
|
342
|
+
roads: ResolvedTileflowTypographyStyle;
|
|
343
|
+
water: ResolvedTileflowTypographyStyle;
|
|
344
|
+
poi: ResolvedTileflowTypographyStyle;
|
|
345
|
+
};
|
|
346
|
+
type TileflowTerrainMode = 'none' | 'hillshade' | '3d';
|
|
347
|
+
type TileflowTerrainEncoding = 'mapbox' | 'terrarium';
|
|
348
|
+
type TileflowTerrainLayerRange = {
|
|
349
|
+
maxZoom?: number;
|
|
350
|
+
minZoom?: number;
|
|
351
|
+
visible?: boolean;
|
|
352
|
+
};
|
|
353
|
+
type TileflowTerrainHillshadeStyle = TileflowTerrainLayerRange & {
|
|
354
|
+
accentColor?: TileflowThemeColorValue;
|
|
355
|
+
exaggeration?: TileflowThemeNumberValue;
|
|
356
|
+
highlightColor?: TileflowThemeColorValue;
|
|
357
|
+
illuminationAnchor?: 'map' | 'viewport';
|
|
358
|
+
illuminationDirection?: TileflowThemeNumberValue;
|
|
359
|
+
shadowColor?: TileflowThemeColorValue;
|
|
360
|
+
};
|
|
361
|
+
type TileflowTerrainContourLineStyle = TileflowTerrainLayerRange & {
|
|
362
|
+
color?: TileflowThemeColorValue;
|
|
363
|
+
opacity?: TileflowThemeNumberValue;
|
|
364
|
+
width?: TileflowThemeNumberValue;
|
|
365
|
+
};
|
|
366
|
+
type TileflowTerrainContourLabelStyle = TileflowTerrainLayerRange & {
|
|
367
|
+
color?: TileflowThemeColorValue;
|
|
368
|
+
font?: TileflowThemeFontValue;
|
|
369
|
+
haloColor?: TileflowThemeColorValue;
|
|
370
|
+
haloWidth?: TileflowThemeNumberValue;
|
|
371
|
+
opacity?: TileflowThemeNumberValue;
|
|
372
|
+
size?: TileflowThemeNumberValue;
|
|
373
|
+
spacing?: TileflowThemeNumberValue;
|
|
374
|
+
};
|
|
375
|
+
type TileflowTerrainContoursConfig = {
|
|
376
|
+
/** Maximum native zoom exposed by the DEM tile template. */
|
|
377
|
+
demMaxZoom: number;
|
|
378
|
+
/**
|
|
379
|
+
* HTTP(S) DEM template containing {z}, {x}, and {y}. Defaults to the hosted Tileflow Terrain
|
|
380
|
+
* tiles, `{apiBaseUrl}/tiles/terrain/{z}/{x}/{y}.webp`, which follow the current release.
|
|
381
|
+
*/
|
|
382
|
+
demUrl?: string;
|
|
383
|
+
index?: TileflowTerrainContourLineStyle;
|
|
384
|
+
labels?: TileflowTerrainContourLabelStyle;
|
|
385
|
+
maxZoom?: number;
|
|
386
|
+
minZoom?: number;
|
|
387
|
+
minor?: TileflowTerrainContourLineStyle;
|
|
388
|
+
multiplier?: number;
|
|
389
|
+
overzoom?: number;
|
|
390
|
+
sourceId?: string;
|
|
391
|
+
/** Zoom-indexed [minor, index] elevation intervals. */
|
|
392
|
+
thresholds: Readonly<Record<number, readonly [number, number]>>;
|
|
393
|
+
};
|
|
394
|
+
type TileflowTerrainConfig = {
|
|
395
|
+
/** Explicit DEM tile templates, mutually exclusive with the TileJSON url. */
|
|
396
|
+
tiles?: readonly string[];
|
|
397
|
+
/** Native DEM resolution limits, independent of hillshade visibility. */
|
|
398
|
+
minZoom?: number;
|
|
399
|
+
maxZoom?: number;
|
|
400
|
+
/** Raster tile width in pixels. Defaults to the renderer default when omitted. */
|
|
401
|
+
tileSize?: 256 | 512;
|
|
402
|
+
attribution?: string;
|
|
403
|
+
contours?: TileflowTerrainContoursConfig;
|
|
404
|
+
encoding?: TileflowTerrainEncoding;
|
|
405
|
+
exaggeration?: number;
|
|
406
|
+
hillshade?: TileflowTerrainHillshadeStyle;
|
|
407
|
+
mode?: TileflowTerrainMode;
|
|
408
|
+
sourceId?: string;
|
|
409
|
+
url?: string;
|
|
410
|
+
};
|
|
411
|
+
type TileflowTerrain = TileflowTerrainMode | TileflowTerrainConfig;
|
|
412
|
+
type TileflowViewConfig = {
|
|
413
|
+
bearing?: number;
|
|
414
|
+
center?: readonly [number, number];
|
|
415
|
+
pitch?: number;
|
|
416
|
+
zoom?: number;
|
|
417
|
+
};
|
|
418
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
419
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
420
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
421
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
422
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
423
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
424
|
+
type TileflowRoadExtras = {
|
|
425
|
+
paths?: boolean;
|
|
426
|
+
};
|
|
427
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
428
|
+
hatch?: TileflowLineHatchStyle;
|
|
429
|
+
};
|
|
430
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
431
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
432
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
433
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
434
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
435
|
+
};
|
|
436
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
437
|
+
enabled?: boolean;
|
|
438
|
+
widthScale?: TileflowThemeNumberValue;
|
|
439
|
+
};
|
|
440
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
441
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
442
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
443
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
444
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
445
|
+
enabled?: boolean;
|
|
446
|
+
};
|
|
447
|
+
type TileflowRoadAreaStyle = {
|
|
448
|
+
pedestrian?: TileflowAreaStyle;
|
|
449
|
+
pier?: TileflowAreaStyle;
|
|
450
|
+
road?: TileflowAreaStyle;
|
|
451
|
+
};
|
|
452
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
453
|
+
type TileflowRoadRoundaboutStyle = {
|
|
454
|
+
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
455
|
+
borderWidth?: TileflowNumberStyleValue;
|
|
456
|
+
casing?: TileflowCircleStyle;
|
|
457
|
+
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
458
|
+
fallbackWidth?: TileflowNumberStyleValue;
|
|
459
|
+
fill?: TileflowCircleStyle;
|
|
460
|
+
};
|
|
461
|
+
/**
|
|
462
|
+
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
463
|
+
* streets its data holds.
|
|
464
|
+
*/
|
|
465
|
+
type TileflowRoadStreetLightStyle = {
|
|
466
|
+
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
467
|
+
color?: TileflowThemeColorValue;
|
|
468
|
+
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
469
|
+
enabled?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
472
|
+
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
473
|
+
* that map few lamps, which invents light; `none` nowhere.
|
|
474
|
+
*/
|
|
475
|
+
estimate?: 'lit' | 'streets' | 'none';
|
|
476
|
+
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
477
|
+
intensity?: TileflowThemeNumberValue;
|
|
478
|
+
};
|
|
479
|
+
type TileflowRoadSidewalkStyle = {
|
|
480
|
+
outline?: TileflowLineStyle;
|
|
481
|
+
pattern?: TileflowFillStyle;
|
|
482
|
+
surface?: TileflowFillStyle;
|
|
483
|
+
};
|
|
484
|
+
type TileflowRoadsModuleConfig = {
|
|
485
|
+
type: 'roads';
|
|
486
|
+
areas?: TileflowRoadAreaStyle;
|
|
487
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
488
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
489
|
+
detail?: TileflowRoadDetail;
|
|
490
|
+
extras?: TileflowRoadExtras;
|
|
491
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
492
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
493
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
494
|
+
oneWayMarkers?: boolean;
|
|
495
|
+
outline?: TileflowRoadOutline;
|
|
496
|
+
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
497
|
+
rampOrder?: 'below-roads' | 'by-class';
|
|
498
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
499
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
500
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
501
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
502
|
+
streetLights?: TileflowRoadStreetLightStyle;
|
|
503
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
504
|
+
weight?: TileflowRoadWeight;
|
|
505
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
506
|
+
};
|
|
507
|
+
type TileflowRoadsModuleOptions = Omit<TileflowRoadsModuleConfig, 'type'>;
|
|
508
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
509
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
510
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
511
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
512
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
513
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
514
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
515
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
516
|
+
type TileflowRoadShieldStyles = {
|
|
517
|
+
default?: TileflowSymbolStyle;
|
|
518
|
+
detail?: TileflowSymbolStyle;
|
|
519
|
+
kinds?: Record<string, {
|
|
520
|
+
image: TileflowThemeImageValue;
|
|
521
|
+
}>;
|
|
522
|
+
overview?: TileflowSymbolStyle;
|
|
523
|
+
textColors?: Record<string, {
|
|
524
|
+
color: TileflowThemeColorValue;
|
|
525
|
+
}>;
|
|
526
|
+
};
|
|
527
|
+
type TileflowLabelStyles = {
|
|
528
|
+
aerodrome?: TileflowSymbolStyle;
|
|
529
|
+
junctions?: TileflowSymbolStyle;
|
|
530
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
531
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
532
|
+
shields?: TileflowRoadShieldStyles;
|
|
533
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
534
|
+
};
|
|
535
|
+
type TileflowLabelsModuleConfig = {
|
|
536
|
+
type: 'labels';
|
|
537
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
538
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
539
|
+
junctions?: boolean;
|
|
540
|
+
language?: TileflowLabelLanguage;
|
|
541
|
+
places?: TileflowLabelDetail;
|
|
542
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
543
|
+
/** Share placement and repeated-name suppression across compatible road classes. */
|
|
544
|
+
roadGrouping?: 'class' | 'network';
|
|
545
|
+
/** Abbreviate recognized road-type words without translating the selected label language. */
|
|
546
|
+
roadNameFormat?: 'full' | 'compact';
|
|
547
|
+
/**
|
|
548
|
+
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
549
|
+
* vegetation. `ground` places them above flat footprints and below raised buildings,
|
|
550
|
+
* with map-aligned text by default.
|
|
551
|
+
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
552
|
+
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
553
|
+
* Shields and junction numbers keep their foreground placement.
|
|
554
|
+
*/
|
|
555
|
+
roadPlacement?: 'ground' | 'foreground';
|
|
556
|
+
/** Defaults to streets, including local street names where their geometry is enabled. */
|
|
557
|
+
roads?: TileflowRoadLabelDetail;
|
|
558
|
+
shields?: TileflowRoadShieldDetail;
|
|
559
|
+
styles?: TileflowLabelStyles;
|
|
560
|
+
water?: TileflowLabelDetail;
|
|
561
|
+
};
|
|
562
|
+
type TileflowLabelsModuleOptions = Omit<TileflowLabelsModuleConfig, 'type'>;
|
|
563
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
564
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
565
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
566
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
567
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
568
|
+
/**
|
|
569
|
+
* How POI categories are placed against each other. `importance` places every category in one
|
|
570
|
+
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
571
|
+
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
572
|
+
*/
|
|
573
|
+
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
574
|
+
/**
|
|
575
|
+
* The appearance of one POI category. With the default `importance` order every category shares
|
|
576
|
+
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
577
|
+
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
578
|
+
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
579
|
+
*/
|
|
580
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
581
|
+
type TileflowPoiModuleConfig = {
|
|
582
|
+
type: 'poi';
|
|
583
|
+
categories?: readonly TileflowPoiCategory[];
|
|
584
|
+
color?: TileflowPoiColorMode;
|
|
585
|
+
/** Defaults to 2. World's ranks decide which features are eligible at each zoom. */
|
|
586
|
+
density?: TileflowPoiDensity;
|
|
587
|
+
/** Category overrides of density, with the same zoom-dependent detail allowance. */
|
|
588
|
+
densityByCategory?: Partial<Record<TileflowPoiCategory, TileflowPoiDensity>>;
|
|
589
|
+
/** Zoom for the second extra rank of POI detail. Must exceed 16; defaults to 17. */
|
|
590
|
+
detailZoom?: number;
|
|
591
|
+
icons?: boolean;
|
|
592
|
+
labels?: boolean;
|
|
593
|
+
minZoom?: number;
|
|
594
|
+
placement?: {
|
|
595
|
+
/**
|
|
596
|
+
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
597
|
+
* `true`. Use false to place pictograms and names independently.
|
|
598
|
+
*/
|
|
599
|
+
coupleIconAndLabel?: boolean;
|
|
600
|
+
iconPadding?: number;
|
|
601
|
+
/**
|
|
602
|
+
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
603
|
+
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
604
|
+
* Defaults to parking and public toilets.
|
|
605
|
+
*/
|
|
606
|
+
iconOnlyTypes?: readonly string[];
|
|
607
|
+
/** Defaults to `importance`. */
|
|
608
|
+
order?: TileflowPoiPlacementOrder;
|
|
609
|
+
/**
|
|
610
|
+
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
611
|
+
* before the map's road and place labels, and the others after them. A map that gives street
|
|
612
|
+
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
613
|
+
* way. Unset, every POI is placed at the module's own position.
|
|
614
|
+
*/
|
|
615
|
+
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
616
|
+
/** Collision margin around the name, in pixels. Defaults to 3. */
|
|
617
|
+
textPadding?: number;
|
|
618
|
+
};
|
|
619
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
620
|
+
};
|
|
621
|
+
type TileflowPoiModuleOptions = Omit<TileflowPoiModuleConfig, 'type'>;
|
|
622
|
+
type MapLibreSprite = string | Array<{
|
|
623
|
+
id: string;
|
|
624
|
+
url: string;
|
|
625
|
+
}>;
|
|
626
|
+
type TileflowProjection = 'globe' | 'mercator';
|
|
627
|
+
type TileflowLight = {
|
|
628
|
+
anchor?: 'map' | 'viewport';
|
|
629
|
+
color?: TileflowColor;
|
|
630
|
+
intensity?: number;
|
|
631
|
+
position?: readonly [number, number, number];
|
|
632
|
+
};
|
|
633
|
+
type MapLibreStyle = {
|
|
634
|
+
sky?: Record<string, unknown>;
|
|
635
|
+
version: 8;
|
|
636
|
+
name: string;
|
|
637
|
+
glyphs?: string;
|
|
638
|
+
light?: TileflowLight;
|
|
639
|
+
projection?: {
|
|
640
|
+
type: TileflowProjection;
|
|
641
|
+
};
|
|
642
|
+
sprite?: MapLibreSprite;
|
|
643
|
+
sources: Record<string, Record<string, unknown>>;
|
|
644
|
+
layers: Array<Record<string, unknown>>;
|
|
645
|
+
terrain?: Record<string, unknown>;
|
|
646
|
+
metadata?: Record<string, unknown>;
|
|
647
|
+
};
|
|
648
|
+
type ValidationMessage = {
|
|
649
|
+
level: 'error' | 'warning';
|
|
650
|
+
path: string;
|
|
651
|
+
message: string;
|
|
652
|
+
};
|
|
653
|
+
type ValidationResult = {
|
|
654
|
+
valid: boolean;
|
|
655
|
+
messages: ValidationMessage[];
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
/** Artistic presets; selecting one never starts a clock or moves the real sun. */
|
|
659
|
+
declare const tileflowTimesOfDay: readonly ["day", "dawn", "dusk", "night"];
|
|
660
|
+
type TileflowTimeOfDay = (typeof tileflowTimesOfDay)[number];
|
|
661
|
+
/** A named theme family points to complete, already compiled themes. */
|
|
662
|
+
type TileflowTimeOfDayVariants = Readonly<Record<string, Readonly<Partial<Record<TileflowTimeOfDay, string>>>>>;
|
|
663
|
+
declare function isTileflowTimeOfDay(value: unknown): value is TileflowTimeOfDay;
|
|
664
|
+
|
|
665
|
+
declare const defaultTileflowManifestUrl = "/tileflow/manifest.json";
|
|
666
|
+
declare const defaultTileflowRuntimeView: Readonly<{
|
|
667
|
+
bearing: 0;
|
|
668
|
+
center: readonly [number, number];
|
|
669
|
+
pitch: 0;
|
|
670
|
+
zoom: 2;
|
|
671
|
+
}>;
|
|
672
|
+
type TileflowAnalytics = {
|
|
673
|
+
apiUrl?: string;
|
|
674
|
+
endpoint?: string;
|
|
675
|
+
enabled?: boolean;
|
|
676
|
+
mapId?: string;
|
|
677
|
+
metadata?: Record<string, unknown>;
|
|
678
|
+
projectId?: string;
|
|
679
|
+
sdkVersion?: string;
|
|
680
|
+
source?: string;
|
|
681
|
+
styleId?: string;
|
|
682
|
+
surfaceId?: string;
|
|
683
|
+
};
|
|
684
|
+
declare function normalizeTileflowSurfaceId(value: unknown): string;
|
|
685
|
+
type TileflowSessionGrantResponse = {
|
|
686
|
+
billingEnabled?: false;
|
|
687
|
+
disposition?: 'ordinary' | 'unbilled_fail_open';
|
|
688
|
+
expiresAt?: string;
|
|
689
|
+
grant?: string;
|
|
690
|
+
meterMode?: 'disabled' | 'shadow' | 'enforced';
|
|
691
|
+
ok: boolean;
|
|
692
|
+
resourceOrigins?: string[];
|
|
693
|
+
sessionId: string;
|
|
694
|
+
usageMode?: 'session';
|
|
695
|
+
code?: string;
|
|
696
|
+
retryWithNewSession?: boolean;
|
|
697
|
+
};
|
|
698
|
+
type TileflowSessionController = {
|
|
699
|
+
readonly sessionId: string;
|
|
700
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
701
|
+
};
|
|
702
|
+
type TileflowMapMode = 'interactive' | 'image';
|
|
703
|
+
type TileflowMapModeOptions = {
|
|
704
|
+
mode?: TileflowMapMode;
|
|
705
|
+
};
|
|
706
|
+
/** Runtime-ready logical map with all relative theme resources already resolved. */
|
|
707
|
+
type TileflowRuntimeManifestMap = TileflowRuntimeManifestMapEntry & {
|
|
708
|
+
apiUrl?: string;
|
|
709
|
+
name: string;
|
|
710
|
+
};
|
|
711
|
+
/** `system` is a selector and therefore reserved as a published theme name. */
|
|
712
|
+
type TileflowThemeSelection = string | 'system';
|
|
713
|
+
type TileflowResolvedRuntimeTheme = TileflowRuntimeManifestTheme & {
|
|
714
|
+
name: string;
|
|
715
|
+
};
|
|
716
|
+
type TileflowRuntimeStyle = {
|
|
717
|
+
analytics?: TileflowAnalytics;
|
|
718
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
719
|
+
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
720
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
721
|
+
revision?: string;
|
|
722
|
+
style: MapLibreStyle | string;
|
|
723
|
+
theme?: string;
|
|
724
|
+
};
|
|
725
|
+
declare const tileflowStyleFontFacesMetadataKey: "tileflow:fontFaces";
|
|
726
|
+
declare const tileflowStyleFontFaceLimits: Readonly<{
|
|
727
|
+
maximumCount: 16;
|
|
728
|
+
maximumSourceLength: 2048;
|
|
729
|
+
}>;
|
|
730
|
+
type TileflowStyleFontFace = {
|
|
731
|
+
family: string;
|
|
732
|
+
source: string;
|
|
733
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
734
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
735
|
+
};
|
|
736
|
+
/** One published Tileflow map. Renderer-specific styles are not framework Map inputs. */
|
|
737
|
+
type TileflowRuntimeSource = {
|
|
738
|
+
manifestUrl?: string;
|
|
739
|
+
map: string;
|
|
740
|
+
};
|
|
741
|
+
type TileflowRuntimeStyleOptions = {
|
|
742
|
+
timeOfDay?: TileflowTimeOfDay;
|
|
743
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
744
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
745
|
+
source: TileflowRuntimeSource;
|
|
746
|
+
theme?: TileflowThemeSelection;
|
|
747
|
+
};
|
|
748
|
+
type TileflowRuntimeSourceValidation = {
|
|
749
|
+
ok: true;
|
|
750
|
+
} | {
|
|
751
|
+
code: 'invalid-source' | 'missing-source';
|
|
752
|
+
error: string;
|
|
753
|
+
ok: false;
|
|
754
|
+
};
|
|
755
|
+
type TileflowManifestLoadOptions = {
|
|
756
|
+
source: TileflowRuntimeSource;
|
|
757
|
+
};
|
|
758
|
+
type TileflowManifestFetchOptions = {
|
|
759
|
+
/** Successful manifests are shared for this duration. Set to 0 to bypass the cache. */
|
|
760
|
+
cacheTtlMs?: number;
|
|
761
|
+
fetch?: typeof globalThis.fetch;
|
|
762
|
+
signal?: AbortSignal;
|
|
763
|
+
/** Hard request timeout in milliseconds. Defaults to 10 seconds and is capped at 60 seconds. */
|
|
764
|
+
timeoutMs?: number;
|
|
765
|
+
};
|
|
766
|
+
type TileflowRuntimeViewOptions = TileflowViewConfig & {
|
|
767
|
+
fallback?: TileflowViewConfig;
|
|
768
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
769
|
+
};
|
|
770
|
+
type TileflowRuntimeCenterLike = readonly [number, number] | {
|
|
771
|
+
lat: number;
|
|
772
|
+
lng: number;
|
|
773
|
+
} | {
|
|
774
|
+
lat: number;
|
|
775
|
+
lon: number;
|
|
776
|
+
};
|
|
777
|
+
declare function shouldLoadTileflowManifest(options: TileflowManifestLoadOptions): boolean;
|
|
778
|
+
declare function validateTileflowRuntimeSource(source: unknown): TileflowRuntimeSourceValidation;
|
|
779
|
+
/** Validate the only runtime selection grammar: one concrete portable name or `system`. */
|
|
780
|
+
declare function validateTileflowThemeSelection(value: unknown): value is TileflowThemeSelection;
|
|
781
|
+
/**
|
|
782
|
+
* A continuous blend of named themes of one Tileflow map. `position` places the map between
|
|
783
|
+
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
784
|
+
* to the third.
|
|
785
|
+
*/
|
|
786
|
+
type TileflowThemeBlendSelection = Readonly<{
|
|
787
|
+
/** From 0 to `themes.length - 1`. */
|
|
788
|
+
position: number;
|
|
789
|
+
/** Two to eight concrete theme names of the map, in blend order. */
|
|
790
|
+
themes: readonly string[];
|
|
791
|
+
}>;
|
|
792
|
+
declare const tileflowThemeBlendLimits: Readonly<{
|
|
793
|
+
maximumThemes: 8;
|
|
794
|
+
minimumThemes: 2;
|
|
795
|
+
}>;
|
|
796
|
+
declare function validateTileflowThemeBlendSelection(value: unknown): value is TileflowThemeBlendSelection;
|
|
797
|
+
/** The theme nearest to a blend position, which a blend shows when it cannot blend. */
|
|
798
|
+
declare function nearestTileflowBlendTheme(blend: TileflowThemeBlendSelection): string;
|
|
799
|
+
/** Resolves every theme of a blend to its published runtime style, in blend order. */
|
|
800
|
+
declare function resolveTileflowRuntimeThemeBlend(options: {
|
|
801
|
+
blend: TileflowThemeBlendSelection;
|
|
802
|
+
manifestMap: TileflowRuntimeManifestMap;
|
|
803
|
+
source: TileflowRuntimeSource;
|
|
804
|
+
}): TileflowRuntimeStyle[];
|
|
805
|
+
declare function assertValidTileflowRuntimeSource(source: unknown): asserts source is TileflowRuntimeSource;
|
|
806
|
+
declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
|
|
807
|
+
/** Resolve one concrete published theme without consulting ambient browser state. */
|
|
808
|
+
declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme, timeOfDay?: TileflowTimeOfDay): TileflowResolvedRuntimeTheme;
|
|
809
|
+
/** Strictly reads Tileflow-owned web-font metadata from a compiled MapLibre style. */
|
|
810
|
+
declare function getTileflowStyleFontFaces(style: Pick<MapLibreStyle, 'metadata'>): TileflowStyleFontFace[];
|
|
811
|
+
declare function normalizeTileflowUrl(value: string): string;
|
|
812
|
+
declare function createTileflowSessionId(): string;
|
|
813
|
+
declare function createTileflowSessionController(input: {
|
|
814
|
+
fetch?: typeof fetch;
|
|
815
|
+
grantTimeoutMs?: number;
|
|
816
|
+
now?: () => Date;
|
|
817
|
+
sessionIdFactory?: () => string;
|
|
818
|
+
source: string;
|
|
819
|
+
}): TileflowSessionController;
|
|
820
|
+
declare function resolveTileflowAnalyticsRequestUrl(url: string, analytics: TileflowAnalytics | undefined, sessionId: string): string | undefined;
|
|
821
|
+
declare function startTileflowSession(analytics: TileflowAnalytics | undefined, input: {
|
|
822
|
+
mapId?: string;
|
|
823
|
+
sessionId: string;
|
|
824
|
+
source: string;
|
|
825
|
+
styleId?: string;
|
|
826
|
+
}): void;
|
|
827
|
+
declare function getTileflowAnalyticsApiUrl(analytics: TileflowAnalytics): string;
|
|
828
|
+
declare function mergeTileflowAnalytics(userAnalytics: TileflowAnalytics | undefined, runtimeAnalytics: TileflowAnalytics | undefined): TileflowAnalytics | undefined;
|
|
829
|
+
declare function resolveTileflowMapMode(options: TileflowMapModeOptions): TileflowMapMode;
|
|
830
|
+
declare function resolveTileflowRuntimeView(options: TileflowRuntimeViewOptions): TileflowViewConfig;
|
|
831
|
+
declare function normalizeTileflowRuntimeCenter(center: TileflowRuntimeCenterLike | undefined, fallback?: readonly [number, number]): [number, number];
|
|
832
|
+
declare function loadTileflowManifest(url: string, options?: TileflowManifestFetchOptions): Promise<TileflowRuntimeManifest | null>;
|
|
833
|
+
declare function clearTileflowManifestCache(url?: string): void;
|
|
834
|
+
declare function resolveTileflowManifestMap(manifest: TileflowRuntimeManifest, mapName: string): TileflowRuntimeManifestMap | null;
|
|
835
|
+
declare function resolveTileflowStaticImageUrl(input: {
|
|
836
|
+
center: [number, number];
|
|
837
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
838
|
+
imageSize: {
|
|
839
|
+
height: number;
|
|
840
|
+
width: number;
|
|
841
|
+
} | null;
|
|
842
|
+
manifestMap: TileflowRuntimeManifestMap | null;
|
|
843
|
+
theme?: TileflowThemeSelection;
|
|
844
|
+
timeOfDay?: TileflowTimeOfDay;
|
|
845
|
+
zoom: number;
|
|
846
|
+
}): string | undefined;
|
|
847
|
+
declare function normalizeTileflowStaticImageSize(input: {
|
|
848
|
+
height: number;
|
|
849
|
+
width: number;
|
|
850
|
+
}): {
|
|
851
|
+
height: number;
|
|
852
|
+
width: number;
|
|
853
|
+
};
|
|
854
|
+
declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
|
|
855
|
+
|
|
856
|
+
/** The original public multi-theme runtime manifest contract. */
|
|
857
|
+
declare const tileflowRuntimeManifestVersion: 1;
|
|
858
|
+
/** V2 adds the optional time-of-day catalog; maps without it still publish V1. */
|
|
859
|
+
declare const tileflowTimeOfDayManifestVersion: 2;
|
|
860
|
+
declare const tileflowRuntimeManifestLimits: Readonly<{
|
|
861
|
+
maximumBytes: number;
|
|
862
|
+
}>;
|
|
863
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
864
|
+
type TileflowRuntimeManifestTheme = {
|
|
865
|
+
colorScheme: TileflowRuntimeColorScheme;
|
|
866
|
+
/** Complete font closure for this compiled theme. */
|
|
867
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
868
|
+
/** Content or deployment revision used for cache identity and receipts. */
|
|
869
|
+
revision?: string;
|
|
870
|
+
/** Hosted style identity, when different from the logical map identity. */
|
|
871
|
+
styleId?: string;
|
|
872
|
+
styleUrl: string;
|
|
873
|
+
};
|
|
874
|
+
type TileflowRuntimeSystemThemes = {
|
|
875
|
+
dark: string;
|
|
876
|
+
light: string;
|
|
877
|
+
};
|
|
878
|
+
type TileflowRuntimeManifestMapEntry = {
|
|
879
|
+
apiUrl?: string;
|
|
880
|
+
defaultTheme: string;
|
|
881
|
+
environment?: string;
|
|
882
|
+
mapId?: string;
|
|
883
|
+
systemThemes?: TileflowRuntimeSystemThemes;
|
|
884
|
+
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
885
|
+
timeOfDay?: TileflowTimeOfDayVariants;
|
|
886
|
+
usageMode?: 'session';
|
|
887
|
+
view?: TileflowViewConfig;
|
|
888
|
+
worldGeneration?: 'v1';
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* One logical map catalog for local and Hosted delivery.
|
|
892
|
+
*
|
|
893
|
+
* Delivery-specific fields are optional metadata on a map. The wire shape never forks into
|
|
894
|
+
* self-hosted and Hosted variants, so every runtime follows the same theme resolution path.
|
|
895
|
+
*/
|
|
896
|
+
type TileflowRuntimeManifest = {
|
|
897
|
+
apiUrl?: string;
|
|
898
|
+
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
899
|
+
version: typeof tileflowRuntimeManifestVersion | typeof tileflowTimeOfDayManifestVersion;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
export { type TileflowLineLayout as $, type TileflowAerodromeCodeDetail as A, type TileflowAlignment as B, type TileflowAnalytics as C, type TileflowAreaStyle as D, type TileflowBackgroundPaint as E, type TileflowCirclePaint as F, type TileflowColor as G, type TileflowColorStyleValue as H, type TileflowExtrusionPaint as I, type TileflowFillPaint as J, type TileflowIconAnchor as K, type TileflowIconLayout as L, type MapLibreStyle as M, type TileflowIconPaint as N, type TileflowIconStyle as O, type TileflowIconTextFit as P, type TileflowImageStyleValue as Q, type TileflowLabelDetail as R, type TileflowLabelLanguage as S, type TileflowRuntimeManifest as T, type TileflowLabelStyles as U, type ValidationMessage as V, type TileflowLayerRange as W, type TileflowLight as X, type TileflowLineCap as Y, type TileflowLineHatchStyle as Z, type TileflowLineJoin as _, type TileflowRuntimeColorScheme as a, type TileflowTerrainContoursConfig as a$, type TileflowLinePaint as a0, type TileflowLineStackStyle as a1, type TileflowManifestFetchOptions as a2, type TileflowManifestLoadOptions as a3, type TileflowMapMode as a4, type TileflowMapModeOptions as a5, type TileflowMarkerSymbolStyle as a6, type TileflowMountainBikeScale as a7, type TileflowNumberInsetsStyleValue as a8, type TileflowNumberStyleValue as a9, type TileflowRoadStreetLightStyle as aA, type TileflowRoadStructure as aB, type TileflowRoadTreatmentLayerStyle as aC, type TileflowRoadTreatmentLineStyle as aD, type TileflowRoadTreatmentStyle as aE, type TileflowRoadWeight as aF, type TileflowRuntimeCenterLike as aG, type TileflowRuntimeManifestMap as aH, type TileflowRuntimeSource as aI, type TileflowRuntimeSourceValidation as aJ, type TileflowRuntimeStyle as aK, type TileflowRuntimeStyleOptions as aL, type TileflowRuntimeViewOptions as aM, type TileflowSessionController as aN, type TileflowSessionGrantResponse as aO, type TileflowStringStyleValue as aP, type TileflowStructuralStyleValue as aQ, type TileflowStyleFontFace as aR, type TileflowStyleValue as aS, type TileflowSymbolOverlap as aT, type TileflowSymbolPlacement as aU, type TileflowSymbolPlacementStyle as aV, type TileflowSymbolZOrder as aW, type TileflowTerrain as aX, type TileflowTerrainConfig as aY, type TileflowTerrainContourLabelStyle as aZ, type TileflowTerrainContourLineStyle as a_, type TileflowPlaceLabelClass as aa, type TileflowPoiCategory as ab, type TileflowPoiCategoryStyle as ac, type TileflowPoiColorMode as ad, type TileflowPoiDensity as ae, type TileflowPoiPlacementOrder as af, type TileflowPriorityOrder as ag, type TileflowProjection as ah, type TileflowResolvedRuntimeTheme as ai, type TileflowRoadAreaStyle as aj, type TileflowRoadClass as ak, type TileflowRoadClassStyle as al, type TileflowRoadCrossingStyle as am, type TileflowRoadDetail as an, type TileflowRoadExtras as ao, type TileflowRoadHierarchy as ap, type TileflowRoadLabelDetail as aq, type TileflowRoadLayerStyle as ar, type TileflowRoadModifier as as, type TileflowRoadOutline as at, type TileflowRoadRestriction as au, type TileflowRoadRoundaboutStyle as av, type TileflowRoadServiceType as aw, type TileflowRoadShieldDetail as ax, type TileflowRoadShieldStyles as ay, type TileflowRoadSidewalkStyle as az, type TileflowRuntimeManifestMapEntry as b, zoom as b$, type TileflowTerrainEncoding as b0, type TileflowTerrainHillshadeStyle as b1, type TileflowTerrainLayerRange as b2, type TileflowTerrainMode as b3, type TileflowTextAnchor as b4, type TileflowTextBackground as b5, type TileflowTextJustify as b6, type TileflowTextLayout as b7, type TileflowTextPaint as b8, type TileflowTextStyle as b9, isTileflowTimeOfDay as bA, loadTileflowManifest as bB, mergeTileflowAnalytics as bC, nearestTileflowBlendTheme as bD, normalizeTileflowRuntimeCenter as bE, normalizeTileflowStaticImageSize as bF, normalizeTileflowUrl as bG, resolveTileflowAnalyticsRequestUrl as bH, resolveTileflowManifestMap as bI, resolveTileflowMapMode as bJ, resolveTileflowRuntimeStyle as bK, resolveTileflowRuntimeTheme as bL, resolveTileflowRuntimeThemeBlend as bM, resolveTileflowRuntimeView as bN, resolveTileflowStaticImageUrl as bO, shouldLoadTileflowManifest as bP, startTileflowSession as bQ, tileflowPoiCategories as bR, tileflowStyleFontFaceLimits as bS, tileflowStyleFontFacesMetadataKey as bT, tileflowThemeBlendLimits as bU, tileflowThemeTokenCategories as bV, tileflowTimesOfDay as bW, token as bX, validateTileflowRuntimeSource as bY, validateTileflowThemeBlendSelection as bZ, validateTileflowThemeSelection as b_, type TileflowThemeBlendSelection as ba, type TileflowThemeColorAlpha as bb, type TileflowThemeColorMix as bc, type TileflowThemeColorValue as bd, type TileflowThemeFontValue as be, type TileflowThemeImageValue as bf, type TileflowThemeNumberValue as bg, type TileflowThemeSelection as bh, type TileflowThemeTokenCategory as bi, type TileflowThemeValue as bj, type TileflowViewConfig as bk, type TileflowWaterLabelClass as bl, type TileflowZoomInterpolation as bm, type TileflowZoomValue as bn, type ValidationResult as bo, assertValidTileflowRuntimeSource as bp, clearTileflowManifestCache as bq, color as br, createTileflowSessionController as bs, createTileflowSessionId as bt, defaultTileflowManifestUrl as bu, defaultTileflowRuntimeView as bv, fixed as bw, getTileflowAnalyticsApiUrl as bx, getTileflowStyleFontFaces as by, inferTileflowAnalyticsFromStyleUrl as bz, type TileflowRuntimeManifestTheme as c, type TileflowTypographyStyle as c0, type ResolvedTileflowTypography as c1, normalizeTileflowSurfaceId as c2, type TileflowRuntimeSystemThemes as d, type TileflowTimeOfDay as e, type TileflowTimeOfDayVariants as f, tileflowRuntimeManifestVersion as g, tileflowTimeOfDayManifestVersion as h, type TileflowExpression as i, type TileflowFixedValue as j, type TileflowThemeTokenReference as k, type TileflowThemeColorOperation as l, type TileflowBackgroundStyle as m, type TileflowCircleStyle as n, type TileflowExtrusionStyle as o, type TileflowFillStyle as p, type TileflowLineStyle as q, type TileflowSymbolStyle as r, type TileflowRoadsModuleOptions as s, tileflowRuntimeManifestLimits as t, type TileflowRoadsModuleConfig as u, type TileflowLabelsModuleOptions as v, type TileflowLabelsModuleConfig as w, type TileflowPoiModuleOptions as x, type TileflowPoiModuleConfig as y, type MapLibreSprite as z };
|