@tileflow/core 0.1.0-alpha.3 → 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/LICENSE +201 -0
- package/README.md +273 -26
- package/THIRD_PARTY_NOTICES.md +327 -0
- package/dist/browser.d.ts +962 -0
- package/dist/browser.js +6237 -0
- package/dist/build.d.ts +574 -0
- package/dist/build.js +25423 -0
- package/dist/capture-scene-D6soWztE.d.ts +161 -0
- package/dist/capture.d.ts +9 -0
- package/dist/capture.js +276 -0
- package/dist/config-reference.json +32261 -0
- package/dist/icon-composition-BiOTwrvD.d.ts +1331 -0
- package/dist/index.d.ts +1114 -162
- package/dist/index.js +18714 -3479
- package/dist/manifest-types-CTT2eLbp.d.ts +790 -0
- package/dist/manifest.d.ts +9 -0
- package/dist/manifest.js +368 -0
- package/dist/native-profile.d.ts +188 -0
- package/dist/native-profile.js +9316 -0
- package/dist/native.d.ts +355 -0
- package/dist/native.js +5552 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +1317 -0
- package/docs/authoring-model.md +241 -0
- package/docs/capture-scenes.md +36 -0
- package/docs/compiled-style-performance.md +263 -0
- package/docs/data-is-separate-from-design.md +345 -0
- package/docs/globe-atmosphere.md +83 -0
- package/docs/hosted-session-authorization.md +108 -0
- package/docs/map-and-terrain-examples.md +149 -0
- package/docs/map-emphasis.md +89 -0
- package/docs/native-artifact-profile.md +145 -0
- package/docs/native-resource-urls.md +367 -0
- package/docs/public-api-and-browser-subpath.md +93 -0
- package/docs/shared-visual-primitives.md +81 -0
- package/docs/theme-transitions-and-blends.md +221 -0
- package/docs/themes-and-module-styles.md +83 -0
- package/package.json +58 -8
|
@@ -0,0 +1,790 @@
|
|
|
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
|
+
/** Visibility and zoom bounds shared by every visual primitive. */
|
|
129
|
+
type TileflowLayerRange = {
|
|
130
|
+
maxZoom?: number;
|
|
131
|
+
minZoom?: number;
|
|
132
|
+
visible?: boolean;
|
|
133
|
+
};
|
|
134
|
+
type TileflowBackgroundPaint = {
|
|
135
|
+
color?: TileflowColorStyleValue;
|
|
136
|
+
opacity?: TileflowNumberStyleValue;
|
|
137
|
+
pattern?: TileflowImageStyleValue;
|
|
138
|
+
};
|
|
139
|
+
type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
|
|
140
|
+
type TileflowFillPaint = {
|
|
141
|
+
antialias?: boolean;
|
|
142
|
+
color?: TileflowColorStyleValue;
|
|
143
|
+
opacity?: TileflowNumberStyleValue;
|
|
144
|
+
pattern?: TileflowImageStyleValue;
|
|
145
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
146
|
+
translateAnchor?: 'map' | 'viewport';
|
|
147
|
+
};
|
|
148
|
+
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
149
|
+
type TileflowLinePaint = {
|
|
150
|
+
blur?: TileflowNumberStyleValue;
|
|
151
|
+
color?: TileflowColorStyleValue;
|
|
152
|
+
dash?: TileflowNumberArrayStyleValue;
|
|
153
|
+
gapWidth?: TileflowNumberStyleValue;
|
|
154
|
+
offset?: TileflowNumberStyleValue;
|
|
155
|
+
opacity?: TileflowNumberStyleValue;
|
|
156
|
+
pattern?: TileflowImageStyleValue;
|
|
157
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
158
|
+
translateAnchor?: 'map' | 'viewport';
|
|
159
|
+
width?: TileflowNumberStyleValue;
|
|
160
|
+
};
|
|
161
|
+
type TileflowLineLayout = {
|
|
162
|
+
cap?: TileflowStructuralStyleValue<TileflowLineCap>;
|
|
163
|
+
join?: TileflowStructuralStyleValue<TileflowLineJoin>;
|
|
164
|
+
miterLimit?: TileflowNumberStyleValue;
|
|
165
|
+
roundLimit?: TileflowNumberStyleValue;
|
|
166
|
+
};
|
|
167
|
+
type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
|
|
168
|
+
/** Repeated diagonal marks placed along a stroked geographic feature. */
|
|
169
|
+
type TileflowLineHatchStyle = TileflowLayerRange & {
|
|
170
|
+
angle?: TileflowNumberStyleValue;
|
|
171
|
+
color?: TileflowColorStyleValue;
|
|
172
|
+
opacity?: TileflowNumberStyleValue;
|
|
173
|
+
/** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
|
|
174
|
+
pattern?: TileflowImageStyleValue;
|
|
175
|
+
/**
|
|
176
|
+
* Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
|
|
177
|
+
* selects the closest height to the rendered line width so marks retain a
|
|
178
|
+
* nearly fixed screen-pixel thickness instead of stretching with the road.
|
|
179
|
+
* Requires `pattern` to be a literal sprite-name prefix.
|
|
180
|
+
*/
|
|
181
|
+
patternWidths?: TileflowThemeNumberArrayValue;
|
|
182
|
+
size?: TileflowNumberStyleValue;
|
|
183
|
+
spacing?: TileflowNumberStyleValue;
|
|
184
|
+
};
|
|
185
|
+
type TileflowTextPaint = {
|
|
186
|
+
color?: TileflowColorStyleValue;
|
|
187
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
188
|
+
haloColor?: TileflowColorStyleValue;
|
|
189
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
190
|
+
opacity?: TileflowNumberStyleValue;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
|
|
194
|
+
* whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
|
|
195
|
+
*/
|
|
196
|
+
type TileflowTextBackground = {
|
|
197
|
+
/** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
|
|
198
|
+
color: TileflowColorStyleValue;
|
|
199
|
+
/** `lines` fits one strip to each shaped line. */
|
|
200
|
+
fit: 'lines';
|
|
201
|
+
/** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
|
|
202
|
+
padding?: TileflowThemeNumberValue;
|
|
203
|
+
};
|
|
204
|
+
type TileflowTextLayout = {
|
|
205
|
+
allowOverlap?: boolean;
|
|
206
|
+
anchor?: TileflowTextAnchor;
|
|
207
|
+
/**
|
|
208
|
+
* Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
|
|
209
|
+
* derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
|
|
210
|
+
*/
|
|
211
|
+
background?: TileflowTextBackground;
|
|
212
|
+
field?: TileflowStringStyleValue;
|
|
213
|
+
font?: TileflowThemeFontValue;
|
|
214
|
+
fallbacks?: readonly TileflowThemeFontValue[];
|
|
215
|
+
ignorePlacement?: boolean;
|
|
216
|
+
justify?: TileflowTextJustify;
|
|
217
|
+
keepUpright?: boolean;
|
|
218
|
+
letterSpacing?: TileflowNumberStyleValue;
|
|
219
|
+
lineHeight?: TileflowNumberStyleValue;
|
|
220
|
+
maxAngle?: TileflowNumberStyleValue;
|
|
221
|
+
maxWidth?: TileflowNumberStyleValue;
|
|
222
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
223
|
+
optional?: boolean;
|
|
224
|
+
padding?: TileflowNumberStyleValue;
|
|
225
|
+
pitchAlignment?: TileflowAlignment;
|
|
226
|
+
radialOffset?: TileflowNumberStyleValue;
|
|
227
|
+
rotate?: TileflowNumberStyleValue;
|
|
228
|
+
rotationAlignment?: TileflowAlignment;
|
|
229
|
+
size?: TileflowNumberStyleValue;
|
|
230
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
231
|
+
variableAnchors?: readonly TileflowTextAnchor[];
|
|
232
|
+
};
|
|
233
|
+
type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
|
|
234
|
+
type TileflowIconPaint = {
|
|
235
|
+
color?: TileflowColorStyleValue;
|
|
236
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
237
|
+
haloColor?: TileflowColorStyleValue;
|
|
238
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
239
|
+
opacity?: TileflowNumberStyleValue;
|
|
240
|
+
};
|
|
241
|
+
type TileflowIconLayout = {
|
|
242
|
+
allowOverlap?: boolean;
|
|
243
|
+
anchor?: TileflowIconAnchor;
|
|
244
|
+
image?: TileflowImageStyleValue;
|
|
245
|
+
ignorePlacement?: boolean;
|
|
246
|
+
keepUpright?: boolean;
|
|
247
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
248
|
+
optional?: boolean;
|
|
249
|
+
padding?: TileflowNumberStyleValue;
|
|
250
|
+
pitchAlignment?: TileflowAlignment;
|
|
251
|
+
rotate?: TileflowNumberStyleValue;
|
|
252
|
+
rotationAlignment?: TileflowAlignment;
|
|
253
|
+
size?: TileflowNumberStyleValue;
|
|
254
|
+
textFit?: TileflowIconTextFit;
|
|
255
|
+
textFitPadding?: TileflowNumberInsetsStyleValue;
|
|
256
|
+
};
|
|
257
|
+
type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
|
|
258
|
+
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
259
|
+
placement?: TileflowSymbolPlacement;
|
|
260
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
261
|
+
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
262
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
263
|
+
spacing?: TileflowNumberStyleValue;
|
|
264
|
+
zOrder?: TileflowSymbolZOrder;
|
|
265
|
+
};
|
|
266
|
+
type TileflowCirclePaint = {
|
|
267
|
+
blur?: TileflowNumberStyleValue;
|
|
268
|
+
color?: TileflowColorStyleValue;
|
|
269
|
+
opacity?: TileflowNumberStyleValue;
|
|
270
|
+
pitchAlignment?: 'map' | 'viewport';
|
|
271
|
+
pitchScale?: 'map' | 'viewport';
|
|
272
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
273
|
+
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
274
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
275
|
+
radius?: TileflowNumberStyleValue;
|
|
276
|
+
strokeColor?: TileflowColorStyleValue;
|
|
277
|
+
strokeOpacity?: TileflowNumberStyleValue;
|
|
278
|
+
strokeWidth?: TileflowNumberStyleValue;
|
|
279
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
280
|
+
translateAnchor?: 'map' | 'viewport';
|
|
281
|
+
};
|
|
282
|
+
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
283
|
+
type TileflowExtrusionPaint = {
|
|
284
|
+
base?: TileflowNumberStyleValue;
|
|
285
|
+
color?: TileflowColorStyleValue;
|
|
286
|
+
height?: TileflowNumberStyleValue;
|
|
287
|
+
opacity?: TileflowNumberStyleValue;
|
|
288
|
+
pattern?: TileflowImageStyleValue;
|
|
289
|
+
verticalGradient?: boolean;
|
|
290
|
+
};
|
|
291
|
+
type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
|
|
292
|
+
/** A polygon rendered as a fill and, when requested, a separate line layer. */
|
|
293
|
+
type TileflowAreaStyle = {
|
|
294
|
+
fill?: TileflowFillStyle;
|
|
295
|
+
outline?: TileflowLineStyle;
|
|
296
|
+
};
|
|
297
|
+
/** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
|
|
298
|
+
type TileflowLineStackStyle = {
|
|
299
|
+
casing?: TileflowLineStyle;
|
|
300
|
+
fill?: TileflowLineStyle;
|
|
301
|
+
shadow?: TileflowLineStyle;
|
|
302
|
+
};
|
|
303
|
+
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
304
|
+
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
305
|
+
icon?: TileflowIconStyle;
|
|
306
|
+
text?: TileflowTextStyle;
|
|
307
|
+
};
|
|
308
|
+
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
309
|
+
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
310
|
+
marker?: TileflowCircleStyle;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
type TileflowColor = `#${string}`;
|
|
314
|
+
type TileflowTypographyStyle = {
|
|
315
|
+
/** Ordered exact fallback face names; CSS generic families are allowed for local fonts. */
|
|
316
|
+
fallbacks?: readonly string[];
|
|
317
|
+
/** Exact OpenType full name or exact remote glyph face name. */
|
|
318
|
+
font?: string;
|
|
319
|
+
letterSpacing?: number;
|
|
320
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
321
|
+
};
|
|
322
|
+
type ResolvedTileflowTypographyStyle = Required<Pick<TileflowTypographyStyle, 'font'>> & Omit<TileflowTypographyStyle, 'font'>;
|
|
323
|
+
type ResolvedTileflowTypography = ResolvedTileflowTypographyStyle & {
|
|
324
|
+
places: ResolvedTileflowTypographyStyle;
|
|
325
|
+
roads: ResolvedTileflowTypographyStyle;
|
|
326
|
+
water: ResolvedTileflowTypographyStyle;
|
|
327
|
+
poi: ResolvedTileflowTypographyStyle;
|
|
328
|
+
};
|
|
329
|
+
type TileflowTerrainMode = 'none' | 'hillshade' | '3d';
|
|
330
|
+
type TileflowTerrainEncoding = 'mapbox' | 'terrarium';
|
|
331
|
+
type TileflowTerrainLayerRange = {
|
|
332
|
+
maxZoom?: number;
|
|
333
|
+
minZoom?: number;
|
|
334
|
+
visible?: boolean;
|
|
335
|
+
};
|
|
336
|
+
type TileflowTerrainHillshadeStyle = TileflowTerrainLayerRange & {
|
|
337
|
+
accentColor?: TileflowThemeColorValue;
|
|
338
|
+
exaggeration?: TileflowThemeNumberValue;
|
|
339
|
+
highlightColor?: TileflowThemeColorValue;
|
|
340
|
+
illuminationAnchor?: 'map' | 'viewport';
|
|
341
|
+
illuminationDirection?: TileflowThemeNumberValue;
|
|
342
|
+
shadowColor?: TileflowThemeColorValue;
|
|
343
|
+
};
|
|
344
|
+
type TileflowTerrainContourLineStyle = TileflowTerrainLayerRange & {
|
|
345
|
+
color?: TileflowThemeColorValue;
|
|
346
|
+
opacity?: TileflowThemeNumberValue;
|
|
347
|
+
width?: TileflowThemeNumberValue;
|
|
348
|
+
};
|
|
349
|
+
type TileflowTerrainContourLabelStyle = TileflowTerrainLayerRange & {
|
|
350
|
+
color?: TileflowThemeColorValue;
|
|
351
|
+
font?: TileflowThemeFontValue;
|
|
352
|
+
haloColor?: TileflowThemeColorValue;
|
|
353
|
+
haloWidth?: TileflowThemeNumberValue;
|
|
354
|
+
opacity?: TileflowThemeNumberValue;
|
|
355
|
+
size?: TileflowThemeNumberValue;
|
|
356
|
+
spacing?: TileflowThemeNumberValue;
|
|
357
|
+
};
|
|
358
|
+
type TileflowTerrainContoursConfig = {
|
|
359
|
+
/** Maximum native zoom exposed by the DEM tile template. */
|
|
360
|
+
demMaxZoom: number;
|
|
361
|
+
/** Explicit HTTP(S) DEM template containing {z}, {x}, and {y}. */
|
|
362
|
+
demUrl: string;
|
|
363
|
+
index?: TileflowTerrainContourLineStyle;
|
|
364
|
+
labels?: TileflowTerrainContourLabelStyle;
|
|
365
|
+
maxZoom?: number;
|
|
366
|
+
minZoom?: number;
|
|
367
|
+
minor?: TileflowTerrainContourLineStyle;
|
|
368
|
+
multiplier?: number;
|
|
369
|
+
overzoom?: number;
|
|
370
|
+
sourceId?: string;
|
|
371
|
+
/** Zoom-indexed [minor, index] elevation intervals. */
|
|
372
|
+
thresholds: Readonly<Record<number, readonly [number, number]>>;
|
|
373
|
+
};
|
|
374
|
+
type TileflowTerrainConfig = {
|
|
375
|
+
attribution?: string;
|
|
376
|
+
contours?: TileflowTerrainContoursConfig;
|
|
377
|
+
encoding?: TileflowTerrainEncoding;
|
|
378
|
+
exaggeration?: number;
|
|
379
|
+
hillshade?: TileflowTerrainHillshadeStyle;
|
|
380
|
+
mode?: TileflowTerrainMode;
|
|
381
|
+
sourceId?: string;
|
|
382
|
+
url?: string;
|
|
383
|
+
};
|
|
384
|
+
type TileflowTerrain = TileflowTerrainMode | TileflowTerrainConfig;
|
|
385
|
+
type TileflowViewConfig = {
|
|
386
|
+
bearing?: number;
|
|
387
|
+
center?: readonly [number, number];
|
|
388
|
+
pitch?: number;
|
|
389
|
+
zoom?: number;
|
|
390
|
+
};
|
|
391
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
392
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
393
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
394
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
395
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
396
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
397
|
+
type TileflowRoadExtras = {
|
|
398
|
+
paths?: boolean;
|
|
399
|
+
};
|
|
400
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
401
|
+
hatch?: TileflowLineHatchStyle;
|
|
402
|
+
};
|
|
403
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
404
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
405
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
406
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
407
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
408
|
+
};
|
|
409
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
410
|
+
enabled?: boolean;
|
|
411
|
+
widthScale?: TileflowThemeNumberValue;
|
|
412
|
+
};
|
|
413
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
414
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
415
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
416
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
417
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
418
|
+
enabled?: boolean;
|
|
419
|
+
};
|
|
420
|
+
type TileflowRoadAreaStyle = {
|
|
421
|
+
pedestrian?: TileflowAreaStyle;
|
|
422
|
+
pier?: TileflowAreaStyle;
|
|
423
|
+
road?: TileflowAreaStyle;
|
|
424
|
+
};
|
|
425
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
426
|
+
type TileflowRoadRoundaboutStyle = {
|
|
427
|
+
casing?: TileflowCircleStyle;
|
|
428
|
+
fill?: TileflowCircleStyle;
|
|
429
|
+
};
|
|
430
|
+
type TileflowRoadSidewalkStyle = {
|
|
431
|
+
outline?: TileflowLineStyle;
|
|
432
|
+
pattern?: TileflowFillStyle;
|
|
433
|
+
surface?: TileflowFillStyle;
|
|
434
|
+
};
|
|
435
|
+
type TileflowRoadsModuleConfig = {
|
|
436
|
+
type: 'roads';
|
|
437
|
+
areas?: TileflowRoadAreaStyle;
|
|
438
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
439
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
440
|
+
detail?: TileflowRoadDetail;
|
|
441
|
+
extras?: TileflowRoadExtras;
|
|
442
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
443
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
444
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
445
|
+
oneWayMarkers?: boolean;
|
|
446
|
+
outline?: TileflowRoadOutline;
|
|
447
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
448
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
449
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
450
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
451
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
452
|
+
weight?: TileflowRoadWeight;
|
|
453
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
454
|
+
};
|
|
455
|
+
type TileflowRoadsModuleOptions = Omit<TileflowRoadsModuleConfig, 'type'>;
|
|
456
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
457
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
458
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
459
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
460
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
461
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
462
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
463
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
464
|
+
type TileflowRoadShieldStyles = {
|
|
465
|
+
default?: TileflowSymbolStyle;
|
|
466
|
+
detail?: TileflowSymbolStyle;
|
|
467
|
+
kinds?: Record<string, {
|
|
468
|
+
image: TileflowThemeImageValue;
|
|
469
|
+
}>;
|
|
470
|
+
overview?: TileflowSymbolStyle;
|
|
471
|
+
textColors?: Record<string, {
|
|
472
|
+
color: TileflowThemeColorValue;
|
|
473
|
+
}>;
|
|
474
|
+
};
|
|
475
|
+
type TileflowLabelStyles = {
|
|
476
|
+
aerodrome?: TileflowSymbolStyle;
|
|
477
|
+
junctions?: TileflowSymbolStyle;
|
|
478
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
479
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
480
|
+
shields?: TileflowRoadShieldStyles;
|
|
481
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
482
|
+
};
|
|
483
|
+
type TileflowLabelsModuleConfig = {
|
|
484
|
+
type: 'labels';
|
|
485
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
486
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
487
|
+
junctions?: boolean;
|
|
488
|
+
language?: TileflowLabelLanguage;
|
|
489
|
+
places?: TileflowLabelDetail;
|
|
490
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
491
|
+
roads?: TileflowRoadLabelDetail;
|
|
492
|
+
shields?: TileflowRoadShieldDetail;
|
|
493
|
+
styles?: TileflowLabelStyles;
|
|
494
|
+
water?: TileflowLabelDetail;
|
|
495
|
+
};
|
|
496
|
+
type TileflowLabelsModuleOptions = Omit<TileflowLabelsModuleConfig, 'type'>;
|
|
497
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
498
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
499
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
500
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
501
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
502
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
|
|
503
|
+
/** Optional category-local cap within the module's canonical density tiers. */
|
|
504
|
+
density?: TileflowPoiDensity;
|
|
505
|
+
};
|
|
506
|
+
type TileflowPoiModuleConfig = {
|
|
507
|
+
type: 'poi';
|
|
508
|
+
categories?: readonly TileflowPoiCategory[];
|
|
509
|
+
color?: TileflowPoiColorMode;
|
|
510
|
+
density?: TileflowPoiDensity;
|
|
511
|
+
icons?: boolean;
|
|
512
|
+
labels?: boolean;
|
|
513
|
+
minZoom?: number;
|
|
514
|
+
placement?: {
|
|
515
|
+
coupleIconAndLabel?: boolean;
|
|
516
|
+
iconPadding?: number;
|
|
517
|
+
textPadding?: number;
|
|
518
|
+
};
|
|
519
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
520
|
+
};
|
|
521
|
+
type TileflowPoiModuleOptions = Omit<TileflowPoiModuleConfig, 'type'>;
|
|
522
|
+
type MapLibreSprite = string | Array<{
|
|
523
|
+
id: string;
|
|
524
|
+
url: string;
|
|
525
|
+
}>;
|
|
526
|
+
type TileflowProjection = 'globe' | 'mercator';
|
|
527
|
+
type TileflowLight = {
|
|
528
|
+
anchor?: 'map' | 'viewport';
|
|
529
|
+
color?: TileflowColor;
|
|
530
|
+
intensity?: number;
|
|
531
|
+
position?: readonly [number, number, number];
|
|
532
|
+
};
|
|
533
|
+
type MapLibreStyle = {
|
|
534
|
+
sky?: Record<string, unknown>;
|
|
535
|
+
version: 8;
|
|
536
|
+
name: string;
|
|
537
|
+
glyphs?: string;
|
|
538
|
+
light?: TileflowLight;
|
|
539
|
+
projection?: {
|
|
540
|
+
type: TileflowProjection;
|
|
541
|
+
};
|
|
542
|
+
sprite?: MapLibreSprite;
|
|
543
|
+
sources: Record<string, Record<string, unknown>>;
|
|
544
|
+
layers: Array<Record<string, unknown>>;
|
|
545
|
+
terrain?: Record<string, unknown>;
|
|
546
|
+
metadata?: Record<string, unknown>;
|
|
547
|
+
};
|
|
548
|
+
type ValidationMessage = {
|
|
549
|
+
level: 'error' | 'warning';
|
|
550
|
+
path: string;
|
|
551
|
+
message: string;
|
|
552
|
+
};
|
|
553
|
+
type ValidationResult = {
|
|
554
|
+
valid: boolean;
|
|
555
|
+
messages: ValidationMessage[];
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
declare const defaultTileflowManifestUrl = "/tileflow/manifest.json";
|
|
559
|
+
declare const defaultTileflowRuntimeView: Readonly<{
|
|
560
|
+
bearing: 0;
|
|
561
|
+
center: readonly [number, number];
|
|
562
|
+
pitch: 0;
|
|
563
|
+
zoom: 2;
|
|
564
|
+
}>;
|
|
565
|
+
type TileflowAnalytics = {
|
|
566
|
+
apiUrl?: string;
|
|
567
|
+
endpoint?: string;
|
|
568
|
+
enabled?: boolean;
|
|
569
|
+
mapId?: string;
|
|
570
|
+
metadata?: Record<string, unknown>;
|
|
571
|
+
projectId?: string;
|
|
572
|
+
sdkVersion?: string;
|
|
573
|
+
source?: string;
|
|
574
|
+
styleId?: string;
|
|
575
|
+
surfaceId?: string;
|
|
576
|
+
};
|
|
577
|
+
declare function normalizeTileflowSurfaceId(value: unknown): string;
|
|
578
|
+
type TileflowSessionGrantResponse = {
|
|
579
|
+
billingEnabled?: false;
|
|
580
|
+
disposition?: 'ordinary' | 'unbilled_fail_open';
|
|
581
|
+
expiresAt?: string;
|
|
582
|
+
grant?: string;
|
|
583
|
+
meterMode?: 'disabled' | 'shadow' | 'enforced';
|
|
584
|
+
ok: boolean;
|
|
585
|
+
resourceOrigins?: string[];
|
|
586
|
+
sessionId: string;
|
|
587
|
+
usageMode?: 'session';
|
|
588
|
+
code?: string;
|
|
589
|
+
retryWithNewSession?: boolean;
|
|
590
|
+
};
|
|
591
|
+
type TileflowSessionController = {
|
|
592
|
+
readonly sessionId: string;
|
|
593
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
594
|
+
};
|
|
595
|
+
type TileflowMapMode = 'interactive' | 'image';
|
|
596
|
+
type TileflowMapModeOptions = {
|
|
597
|
+
mode?: TileflowMapMode;
|
|
598
|
+
};
|
|
599
|
+
/** Runtime-ready logical map with all relative theme resources already resolved. */
|
|
600
|
+
type TileflowRuntimeManifestMap = TileflowRuntimeManifestMapEntry & {
|
|
601
|
+
apiUrl?: string;
|
|
602
|
+
name: string;
|
|
603
|
+
};
|
|
604
|
+
/** `system` is a selector and therefore reserved as a published theme name. */
|
|
605
|
+
type TileflowThemeSelection = string | 'system';
|
|
606
|
+
type TileflowResolvedRuntimeTheme = TileflowRuntimeManifestTheme & {
|
|
607
|
+
name: string;
|
|
608
|
+
};
|
|
609
|
+
type TileflowRuntimeStyle = {
|
|
610
|
+
analytics?: TileflowAnalytics;
|
|
611
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
612
|
+
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
613
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
614
|
+
revision?: string;
|
|
615
|
+
style: MapLibreStyle | string;
|
|
616
|
+
theme?: string;
|
|
617
|
+
};
|
|
618
|
+
declare const tileflowStyleFontFacesMetadataKey: "tileflow:fontFaces";
|
|
619
|
+
declare const tileflowStyleFontFaceLimits: Readonly<{
|
|
620
|
+
maximumCount: 16;
|
|
621
|
+
maximumSourceLength: 2048;
|
|
622
|
+
}>;
|
|
623
|
+
type TileflowStyleFontFace = {
|
|
624
|
+
family: string;
|
|
625
|
+
source: string;
|
|
626
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
627
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
628
|
+
};
|
|
629
|
+
/** One published Tileflow map. Renderer-specific styles are not framework Map inputs. */
|
|
630
|
+
type TileflowRuntimeSource = {
|
|
631
|
+
manifestUrl?: string;
|
|
632
|
+
map: string;
|
|
633
|
+
};
|
|
634
|
+
type TileflowRuntimeStyleOptions = {
|
|
635
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
636
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
637
|
+
source: TileflowRuntimeSource;
|
|
638
|
+
theme?: TileflowThemeSelection;
|
|
639
|
+
};
|
|
640
|
+
type TileflowRuntimeSourceValidation = {
|
|
641
|
+
ok: true;
|
|
642
|
+
} | {
|
|
643
|
+
code: 'invalid-source' | 'missing-source';
|
|
644
|
+
error: string;
|
|
645
|
+
ok: false;
|
|
646
|
+
};
|
|
647
|
+
type TileflowManifestLoadOptions = {
|
|
648
|
+
source: TileflowRuntimeSource;
|
|
649
|
+
};
|
|
650
|
+
type TileflowManifestFetchOptions = {
|
|
651
|
+
/** Successful manifests are shared for this duration. Set to 0 to bypass the cache. */
|
|
652
|
+
cacheTtlMs?: number;
|
|
653
|
+
fetch?: typeof globalThis.fetch;
|
|
654
|
+
signal?: AbortSignal;
|
|
655
|
+
/** Hard request timeout in milliseconds. Defaults to 10 seconds and is capped at 60 seconds. */
|
|
656
|
+
timeoutMs?: number;
|
|
657
|
+
};
|
|
658
|
+
type TileflowRuntimeViewOptions = TileflowViewConfig & {
|
|
659
|
+
fallback?: TileflowViewConfig;
|
|
660
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
661
|
+
};
|
|
662
|
+
type TileflowRuntimeCenterLike = readonly [number, number] | {
|
|
663
|
+
lat: number;
|
|
664
|
+
lng: number;
|
|
665
|
+
} | {
|
|
666
|
+
lat: number;
|
|
667
|
+
lon: number;
|
|
668
|
+
};
|
|
669
|
+
declare function shouldLoadTileflowManifest(options: TileflowManifestLoadOptions): boolean;
|
|
670
|
+
declare function validateTileflowRuntimeSource(source: unknown): TileflowRuntimeSourceValidation;
|
|
671
|
+
/** Validate the only runtime selection grammar: one concrete portable name or `system`. */
|
|
672
|
+
declare function validateTileflowThemeSelection(value: unknown): value is TileflowThemeSelection;
|
|
673
|
+
/**
|
|
674
|
+
* A continuous blend of named themes of one Tileflow map. `position` places the map between
|
|
675
|
+
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
676
|
+
* to the third.
|
|
677
|
+
*/
|
|
678
|
+
type TileflowThemeBlendSelection = Readonly<{
|
|
679
|
+
/** From 0 to `themes.length - 1`. */
|
|
680
|
+
position: number;
|
|
681
|
+
/** Two to eight concrete theme names of the map, in blend order. */
|
|
682
|
+
themes: readonly string[];
|
|
683
|
+
}>;
|
|
684
|
+
declare const tileflowThemeBlendLimits: Readonly<{
|
|
685
|
+
maximumThemes: 8;
|
|
686
|
+
minimumThemes: 2;
|
|
687
|
+
}>;
|
|
688
|
+
declare function validateTileflowThemeBlendSelection(value: unknown): value is TileflowThemeBlendSelection;
|
|
689
|
+
/** The theme nearest to a blend position, which a blend shows when it cannot blend. */
|
|
690
|
+
declare function nearestTileflowBlendTheme(blend: TileflowThemeBlendSelection): string;
|
|
691
|
+
/** Resolves every theme of a blend to its published runtime style, in blend order. */
|
|
692
|
+
declare function resolveTileflowRuntimeThemeBlend(options: {
|
|
693
|
+
blend: TileflowThemeBlendSelection;
|
|
694
|
+
manifestMap: TileflowRuntimeManifestMap;
|
|
695
|
+
source: TileflowRuntimeSource;
|
|
696
|
+
}): TileflowRuntimeStyle[];
|
|
697
|
+
declare function assertValidTileflowRuntimeSource(source: unknown): asserts source is TileflowRuntimeSource;
|
|
698
|
+
declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
|
|
699
|
+
/** Resolve one concrete published theme without consulting ambient browser state. */
|
|
700
|
+
declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme): TileflowResolvedRuntimeTheme;
|
|
701
|
+
/** Strictly reads Tileflow-owned web-font metadata from a compiled MapLibre style. */
|
|
702
|
+
declare function getTileflowStyleFontFaces(style: Pick<MapLibreStyle, 'metadata'>): TileflowStyleFontFace[];
|
|
703
|
+
declare function normalizeTileflowUrl(value: string): string;
|
|
704
|
+
declare function createTileflowSessionId(): string;
|
|
705
|
+
declare function createTileflowSessionController(input: {
|
|
706
|
+
fetch?: typeof fetch;
|
|
707
|
+
grantTimeoutMs?: number;
|
|
708
|
+
now?: () => Date;
|
|
709
|
+
sessionIdFactory?: () => string;
|
|
710
|
+
source: string;
|
|
711
|
+
}): TileflowSessionController;
|
|
712
|
+
declare function resolveTileflowAnalyticsRequestUrl(url: string, analytics: TileflowAnalytics | undefined, sessionId: string): string | undefined;
|
|
713
|
+
declare function startTileflowSession(analytics: TileflowAnalytics | undefined, input: {
|
|
714
|
+
mapId?: string;
|
|
715
|
+
sessionId: string;
|
|
716
|
+
source: string;
|
|
717
|
+
styleId?: string;
|
|
718
|
+
}): void;
|
|
719
|
+
declare function getTileflowAnalyticsApiUrl(analytics: TileflowAnalytics): string;
|
|
720
|
+
declare function mergeTileflowAnalytics(userAnalytics: TileflowAnalytics | undefined, runtimeAnalytics: TileflowAnalytics | undefined): TileflowAnalytics | undefined;
|
|
721
|
+
declare function resolveTileflowMapMode(options: TileflowMapModeOptions): TileflowMapMode;
|
|
722
|
+
declare function resolveTileflowRuntimeView(options: TileflowRuntimeViewOptions): TileflowViewConfig;
|
|
723
|
+
declare function normalizeTileflowRuntimeCenter(center: TileflowRuntimeCenterLike | undefined, fallback?: readonly [number, number]): [number, number];
|
|
724
|
+
declare function loadTileflowManifest(url: string, options?: TileflowManifestFetchOptions): Promise<TileflowRuntimeManifest | null>;
|
|
725
|
+
declare function clearTileflowManifestCache(url?: string): void;
|
|
726
|
+
declare function resolveTileflowManifestMap(manifest: TileflowRuntimeManifest, mapName: string): TileflowRuntimeManifestMap | null;
|
|
727
|
+
declare function resolveTileflowStaticImageUrl(input: {
|
|
728
|
+
center: [number, number];
|
|
729
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
730
|
+
imageSize: {
|
|
731
|
+
height: number;
|
|
732
|
+
width: number;
|
|
733
|
+
} | null;
|
|
734
|
+
manifestMap: TileflowRuntimeManifestMap | null;
|
|
735
|
+
theme?: TileflowThemeSelection;
|
|
736
|
+
zoom: number;
|
|
737
|
+
}): string | undefined;
|
|
738
|
+
declare function normalizeTileflowStaticImageSize(input: {
|
|
739
|
+
height: number;
|
|
740
|
+
width: number;
|
|
741
|
+
}): {
|
|
742
|
+
height: number;
|
|
743
|
+
width: number;
|
|
744
|
+
};
|
|
745
|
+
declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
|
|
746
|
+
|
|
747
|
+
/** The first and only public multi-theme runtime manifest contract. */
|
|
748
|
+
declare const tileflowRuntimeManifestVersion: 1;
|
|
749
|
+
declare const tileflowRuntimeManifestLimits: Readonly<{
|
|
750
|
+
maximumBytes: number;
|
|
751
|
+
}>;
|
|
752
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
753
|
+
type TileflowRuntimeManifestTheme = {
|
|
754
|
+
colorScheme: TileflowRuntimeColorScheme;
|
|
755
|
+
/** Complete font closure for this compiled theme. */
|
|
756
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
757
|
+
/** Content or deployment revision used for cache identity and receipts. */
|
|
758
|
+
revision?: string;
|
|
759
|
+
/** Hosted style identity, when different from the logical map identity. */
|
|
760
|
+
styleId?: string;
|
|
761
|
+
styleUrl: string;
|
|
762
|
+
};
|
|
763
|
+
type TileflowRuntimeSystemThemes = {
|
|
764
|
+
dark: string;
|
|
765
|
+
light: string;
|
|
766
|
+
};
|
|
767
|
+
type TileflowRuntimeManifestMapEntry = {
|
|
768
|
+
apiUrl?: string;
|
|
769
|
+
defaultTheme: string;
|
|
770
|
+
environment?: string;
|
|
771
|
+
mapId?: string;
|
|
772
|
+
systemThemes?: TileflowRuntimeSystemThemes;
|
|
773
|
+
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
774
|
+
usageMode?: 'session';
|
|
775
|
+
view?: TileflowViewConfig;
|
|
776
|
+
worldGeneration?: 'v1';
|
|
777
|
+
};
|
|
778
|
+
/**
|
|
779
|
+
* One logical map catalog for local and Hosted delivery.
|
|
780
|
+
*
|
|
781
|
+
* Delivery-specific fields are optional metadata on a map. The wire shape never forks into
|
|
782
|
+
* self-hosted and Hosted variants, so every runtime follows the same theme resolution path.
|
|
783
|
+
*/
|
|
784
|
+
type TileflowRuntimeManifest = {
|
|
785
|
+
apiUrl?: string;
|
|
786
|
+
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
787
|
+
version: typeof tileflowRuntimeManifestVersion;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
export { type TileflowManifestFetchOptions as $, type TileflowAreaStyle as A, type TileflowBackgroundPaint as B, type TileflowCirclePaint as C, type TileflowColor as D, type TileflowColorStyleValue as E, type TileflowExtrusionPaint as F, type TileflowFillPaint as G, type TileflowIconAnchor as H, type TileflowIconLayout as I, type TileflowIconPaint as J, type TileflowIconStyle as K, type TileflowIconTextFit as L, type MapLibreStyle as M, type TileflowImageStyleValue as N, type TileflowLabelDetail as O, type TileflowLabelLanguage as P, type TileflowLabelStyles as Q, type TileflowLayerRange as R, type TileflowLight as S, type TileflowRuntimeManifest as T, type TileflowLineCap as U, type ValidationMessage as V, type TileflowLineHatchStyle as W, type TileflowLineJoin as X, type TileflowLineLayout as Y, type TileflowLinePaint as Z, type TileflowLineStackStyle as _, type TileflowRuntimeColorScheme as a, type TileflowTextBackground as a$, type TileflowManifestLoadOptions as a0, type TileflowMapMode as a1, type TileflowMapModeOptions as a2, type TileflowMarkerSymbolStyle as a3, type TileflowMountainBikeScale as a4, type TileflowNumberInsetsStyleValue as a5, type TileflowNumberStyleValue as a6, type TileflowPlaceLabelClass as a7, type TileflowPoiCategory as a8, type TileflowPoiCategoryStyle as a9, type TileflowRoadWeight as aA, type TileflowRuntimeCenterLike as aB, type TileflowRuntimeManifestMap as aC, type TileflowRuntimeSource as aD, type TileflowRuntimeSourceValidation as aE, type TileflowRuntimeStyle as aF, type TileflowRuntimeStyleOptions as aG, type TileflowRuntimeViewOptions as aH, type TileflowSessionController as aI, type TileflowSessionGrantResponse as aJ, type TileflowStringStyleValue as aK, type TileflowStructuralStyleValue as aL, type TileflowStyleFontFace as aM, type TileflowStyleValue as aN, type TileflowSymbolPlacement as aO, type TileflowSymbolPlacementStyle as aP, type TileflowSymbolZOrder as aQ, type TileflowTerrain as aR, type TileflowTerrainConfig as aS, type TileflowTerrainContourLabelStyle as aT, type TileflowTerrainContourLineStyle as aU, type TileflowTerrainContoursConfig as aV, type TileflowTerrainEncoding as aW, type TileflowTerrainHillshadeStyle as aX, type TileflowTerrainLayerRange as aY, type TileflowTerrainMode as aZ, type TileflowTextAnchor as a_, type TileflowPoiColorMode as aa, type TileflowPoiDensity as ab, type TileflowPriorityOrder as ac, type TileflowProjection as ad, type TileflowResolvedRuntimeTheme as ae, type TileflowRoadAreaStyle as af, type TileflowRoadClass as ag, type TileflowRoadClassStyle as ah, type TileflowRoadCrossingStyle as ai, type TileflowRoadDetail as aj, type TileflowRoadExtras as ak, type TileflowRoadHierarchy as al, type TileflowRoadLabelDetail as am, type TileflowRoadLayerStyle as an, type TileflowRoadModifier as ao, type TileflowRoadOutline as ap, type TileflowRoadRestriction as aq, type TileflowRoadRoundaboutStyle as ar, type TileflowRoadServiceType as as, type TileflowRoadShieldDetail as at, type TileflowRoadShieldStyles as au, type TileflowRoadSidewalkStyle as av, type TileflowRoadStructure as aw, type TileflowRoadTreatmentLayerStyle as ax, type TileflowRoadTreatmentLineStyle as ay, type TileflowRoadTreatmentStyle as az, type TileflowRuntimeManifestMapEntry as b, type TileflowTextJustify as b0, type TileflowTextLayout as b1, type TileflowTextPaint as b2, type TileflowTextStyle as b3, type TileflowThemeBlendSelection as b4, type TileflowThemeColorAlpha as b5, type TileflowThemeColorMix as b6, type TileflowThemeColorValue as b7, type TileflowThemeFontValue as b8, type TileflowThemeImageValue as b9, resolveTileflowAnalyticsRequestUrl as bA, resolveTileflowManifestMap as bB, resolveTileflowMapMode as bC, resolveTileflowRuntimeStyle as bD, resolveTileflowRuntimeTheme as bE, resolveTileflowRuntimeThemeBlend as bF, resolveTileflowRuntimeView as bG, resolveTileflowStaticImageUrl as bH, shouldLoadTileflowManifest as bI, startTileflowSession as bJ, tileflowPoiCategories as bK, tileflowStyleFontFaceLimits as bL, tileflowStyleFontFacesMetadataKey as bM, tileflowThemeBlendLimits as bN, tileflowThemeTokenCategories as bO, token as bP, validateTileflowRuntimeSource as bQ, validateTileflowThemeBlendSelection as bR, validateTileflowThemeSelection as bS, zoom as bT, type TileflowTypographyStyle as bU, type ResolvedTileflowTypography as bV, normalizeTileflowSurfaceId as bW, type TileflowThemeNumberValue as ba, type TileflowThemeSelection as bb, type TileflowThemeTokenCategory as bc, type TileflowThemeValue as bd, type TileflowViewConfig as be, type TileflowWaterLabelClass as bf, type TileflowZoomInterpolation as bg, type TileflowZoomValue as bh, type ValidationResult as bi, assertValidTileflowRuntimeSource as bj, clearTileflowManifestCache as bk, color as bl, createTileflowSessionController as bm, createTileflowSessionId as bn, defaultTileflowManifestUrl as bo, defaultTileflowRuntimeView as bp, fixed as bq, getTileflowAnalyticsApiUrl as br, getTileflowStyleFontFaces as bs, inferTileflowAnalyticsFromStyleUrl as bt, loadTileflowManifest as bu, mergeTileflowAnalytics as bv, nearestTileflowBlendTheme as bw, normalizeTileflowRuntimeCenter as bx, normalizeTileflowStaticImageSize as by, normalizeTileflowUrl as bz, type TileflowRuntimeManifestTheme as c, type TileflowRuntimeSystemThemes as d, tileflowRuntimeManifestVersion as e, type TileflowExpression as f, type TileflowFixedValue as g, type TileflowThemeTokenReference as h, type TileflowThemeColorOperation as i, type TileflowBackgroundStyle as j, type TileflowCircleStyle as k, type TileflowExtrusionStyle as l, type TileflowFillStyle as m, type TileflowLineStyle as n, type TileflowSymbolStyle as o, type TileflowRoadsModuleOptions as p, type TileflowRoadsModuleConfig as q, type TileflowLabelsModuleOptions as r, type TileflowLabelsModuleConfig as s, tileflowRuntimeManifestLimits as t, type TileflowPoiModuleOptions as u, type TileflowPoiModuleConfig as v, type MapLibreSprite as w, type TileflowAerodromeCodeDetail as x, type TileflowAlignment as y, type TileflowAnalytics as z };
|