@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,962 @@
|
|
|
1
|
+
type TileflowFairUseNoticeState = 'GRACE' | 'MANAGED_REQUIRED';
|
|
2
|
+
type TileflowFairUseNotice = Readonly<{
|
|
3
|
+
action: string;
|
|
4
|
+
helpUrl: string;
|
|
5
|
+
message: string;
|
|
6
|
+
state: TileflowFairUseNoticeState;
|
|
7
|
+
}>;
|
|
8
|
+
type TileflowWorldProtocolRequest = Readonly<{
|
|
9
|
+
type?: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}>;
|
|
12
|
+
type TileflowWorldProtocolResponse = Readonly<{
|
|
13
|
+
cacheControl?: string;
|
|
14
|
+
data: ArrayBuffer;
|
|
15
|
+
etag?: string;
|
|
16
|
+
expires?: string;
|
|
17
|
+
}>;
|
|
18
|
+
type TileflowWorldProtocolHandler = (request: TileflowWorldProtocolRequest, abortController: AbortController) => Promise<TileflowWorldProtocolResponse>;
|
|
19
|
+
type TileflowWorldRequestBridge = Readonly<{
|
|
20
|
+
dispose: () => void;
|
|
21
|
+
rewriteUrl: (url: string) => string;
|
|
22
|
+
}>;
|
|
23
|
+
type TileflowFairUseNoticeController = Readonly<{
|
|
24
|
+
dispose: () => void;
|
|
25
|
+
update: (notice: TileflowFairUseNotice | null) => void;
|
|
26
|
+
}>;
|
|
27
|
+
declare function registerTileflowWorldRequestBridge(input: {
|
|
28
|
+
addProtocol: (name: string, handler: TileflowWorldProtocolHandler) => void;
|
|
29
|
+
fetch?: typeof fetch;
|
|
30
|
+
onNotice: (notice: TileflowFairUseNotice | null) => void;
|
|
31
|
+
}): TileflowWorldRequestBridge;
|
|
32
|
+
declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
|
|
33
|
+
declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
|
|
34
|
+
|
|
35
|
+
declare const expressionBrand: unique symbol;
|
|
36
|
+
declare const themeValueBrand: unique symbol;
|
|
37
|
+
declare const zoomBrand: unique symbol;
|
|
38
|
+
declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
|
|
39
|
+
type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
|
|
40
|
+
type TileflowThemeTokenPrimitive = {
|
|
41
|
+
color: string;
|
|
42
|
+
font: string;
|
|
43
|
+
image: string;
|
|
44
|
+
number: number;
|
|
45
|
+
};
|
|
46
|
+
/** A JSON-safe semantic reference. The category is carried at runtime as well as in its type. */
|
|
47
|
+
type TileflowThemeTokenReference<TCategory extends TileflowThemeTokenCategory = TileflowThemeTokenCategory> = {
|
|
48
|
+
readonly category: TCategory;
|
|
49
|
+
readonly kind: 'theme-token';
|
|
50
|
+
readonly token: string;
|
|
51
|
+
readonly [themeValueBrand]: TileflowThemeTokenPrimitive[TCategory];
|
|
52
|
+
};
|
|
53
|
+
/** An explicit opt-out from theme substitution. A reason is mandatory for auditability. */
|
|
54
|
+
type TileflowFixedValue<T> = {
|
|
55
|
+
readonly kind: 'theme-fixed';
|
|
56
|
+
readonly reason: string;
|
|
57
|
+
readonly value: T;
|
|
58
|
+
readonly [themeValueBrand]: T;
|
|
59
|
+
};
|
|
60
|
+
type TileflowThemeColorMix = {
|
|
61
|
+
readonly amount: TileflowThemeNumberValue;
|
|
62
|
+
readonly from: TileflowThemeColorValue;
|
|
63
|
+
readonly kind: 'theme-color';
|
|
64
|
+
readonly operation: 'mix';
|
|
65
|
+
readonly space: 'oklch';
|
|
66
|
+
readonly to: TileflowThemeColorValue;
|
|
67
|
+
readonly [themeValueBrand]: string;
|
|
68
|
+
};
|
|
69
|
+
type TileflowThemeColorAlpha = {
|
|
70
|
+
readonly color: TileflowThemeColorValue;
|
|
71
|
+
readonly kind: 'theme-color';
|
|
72
|
+
readonly opacity: TileflowThemeNumberValue;
|
|
73
|
+
readonly operation: 'alpha';
|
|
74
|
+
readonly [themeValueBrand]: string;
|
|
75
|
+
};
|
|
76
|
+
type TileflowThemeColorOperation = TileflowThemeColorAlpha | TileflowThemeColorMix;
|
|
77
|
+
type TileflowThemeNumberValue = number | TileflowFixedValue<number> | TileflowThemeTokenReference<'number'>;
|
|
78
|
+
type TileflowThemeColorValue = string | TileflowFixedValue<string> | TileflowThemeColorOperation | TileflowThemeTokenReference<'color'>;
|
|
79
|
+
type TileflowThemeFontValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'font'>;
|
|
80
|
+
type TileflowThemeImageValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'image'>;
|
|
81
|
+
type TileflowExpression<T> = {
|
|
82
|
+
readonly kind: 'expression';
|
|
83
|
+
readonly value: readonly unknown[];
|
|
84
|
+
/** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
|
|
85
|
+
readonly [expressionBrand]: T;
|
|
86
|
+
};
|
|
87
|
+
type TileflowZoomValueCommon<T> = {
|
|
88
|
+
readonly kind: 'zoom';
|
|
89
|
+
readonly stops: readonly (readonly [number, T])[];
|
|
90
|
+
readonly [zoomBrand]?: T;
|
|
91
|
+
};
|
|
92
|
+
type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
|
|
93
|
+
readonly base: number;
|
|
94
|
+
readonly interpolation: 'exponential';
|
|
95
|
+
} | {
|
|
96
|
+
readonly base?: never;
|
|
97
|
+
readonly interpolation: 'linear' | 'step';
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/** A color literal, semantic color token, color operation, expression, or zoom ramp. */
|
|
101
|
+
type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
|
|
102
|
+
/** An image name, semantic image token, expression, or zoom ramp. */
|
|
103
|
+
type TileflowImageStyleValue = TileflowExpression<string> | TileflowThemeImageValue | TileflowZoomValue<TileflowThemeImageValue>;
|
|
104
|
+
/** A number, semantic number token, expression, or zoom ramp. */
|
|
105
|
+
type TileflowNumberStyleValue = TileflowExpression<number> | TileflowThemeNumberValue | TileflowZoomValue<TileflowThemeNumberValue>;
|
|
106
|
+
/** A visual numeric array whose components may be themed, or whose full shape is fixed. */
|
|
107
|
+
type TileflowThemeNumberArrayValue = readonly TileflowThemeNumberValue[] | TileflowFixedValue<readonly number[]>;
|
|
108
|
+
/** A visual numeric array, expression, or zoom ramp with explicit theme intent. */
|
|
109
|
+
type TileflowNumberArrayStyleValue = TileflowExpression<readonly number[]> | TileflowThemeNumberArrayValue | TileflowZoomValue<TileflowThemeNumberArrayValue>;
|
|
110
|
+
/** A two-dimensional visual offset with category-safe numeric components. */
|
|
111
|
+
type TileflowNumberOffsetStyleValue = readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]>>;
|
|
112
|
+
/** Top, right, bottom, and left visual insets with category-safe numeric components. */
|
|
113
|
+
type TileflowNumberInsetsStyleValue = readonly [
|
|
114
|
+
TileflowThemeNumberValue,
|
|
115
|
+
TileflowThemeNumberValue,
|
|
116
|
+
TileflowThemeNumberValue,
|
|
117
|
+
TileflowThemeNumberValue
|
|
118
|
+
] | TileflowFixedValue<readonly [number, number, number, number]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [
|
|
119
|
+
TileflowThemeNumberValue,
|
|
120
|
+
TileflowThemeNumberValue,
|
|
121
|
+
TileflowThemeNumberValue,
|
|
122
|
+
TileflowThemeNumberValue
|
|
123
|
+
] | TileflowFixedValue<readonly [number, number, number, number]>>;
|
|
124
|
+
/** A structural value that does not participate in semantic theme-token substitution. */
|
|
125
|
+
type TileflowStructuralStyleValue<T> = T | TileflowExpression<T> | TileflowZoomValue<T>;
|
|
126
|
+
/** Structural text, including expressions and zoom-dependent literal strings. */
|
|
127
|
+
type TileflowStringStyleValue = TileflowStructuralStyleValue<string>;
|
|
128
|
+
type TileflowLineCap = 'butt' | 'round' | 'square';
|
|
129
|
+
type TileflowLineJoin = 'bevel' | 'miter' | 'round';
|
|
130
|
+
type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
|
|
131
|
+
type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
|
|
132
|
+
type TileflowPriorityOrder = 'higher-first' | 'lower-first';
|
|
133
|
+
type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
|
|
134
|
+
type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
|
|
135
|
+
type TileflowIconAnchor = TileflowTextAnchor;
|
|
136
|
+
type TileflowAlignment = 'auto' | 'map' | 'viewport';
|
|
137
|
+
type TileflowIconTextFit = 'both' | 'height' | 'none' | 'width';
|
|
138
|
+
/** Visibility and zoom bounds shared by every visual primitive. */
|
|
139
|
+
type TileflowLayerRange = {
|
|
140
|
+
maxZoom?: number;
|
|
141
|
+
minZoom?: number;
|
|
142
|
+
visible?: boolean;
|
|
143
|
+
};
|
|
144
|
+
type TileflowBackgroundPaint = {
|
|
145
|
+
color?: TileflowColorStyleValue;
|
|
146
|
+
opacity?: TileflowNumberStyleValue;
|
|
147
|
+
pattern?: TileflowImageStyleValue;
|
|
148
|
+
};
|
|
149
|
+
type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
|
|
150
|
+
type TileflowFillPaint = {
|
|
151
|
+
antialias?: boolean;
|
|
152
|
+
color?: TileflowColorStyleValue;
|
|
153
|
+
opacity?: TileflowNumberStyleValue;
|
|
154
|
+
pattern?: TileflowImageStyleValue;
|
|
155
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
156
|
+
translateAnchor?: 'map' | 'viewport';
|
|
157
|
+
};
|
|
158
|
+
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
159
|
+
type TileflowLinePaint = {
|
|
160
|
+
blur?: TileflowNumberStyleValue;
|
|
161
|
+
color?: TileflowColorStyleValue;
|
|
162
|
+
dash?: TileflowNumberArrayStyleValue;
|
|
163
|
+
gapWidth?: TileflowNumberStyleValue;
|
|
164
|
+
offset?: TileflowNumberStyleValue;
|
|
165
|
+
opacity?: TileflowNumberStyleValue;
|
|
166
|
+
pattern?: TileflowImageStyleValue;
|
|
167
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
168
|
+
translateAnchor?: 'map' | 'viewport';
|
|
169
|
+
width?: TileflowNumberStyleValue;
|
|
170
|
+
};
|
|
171
|
+
type TileflowLineLayout = {
|
|
172
|
+
cap?: TileflowStructuralStyleValue<TileflowLineCap>;
|
|
173
|
+
join?: TileflowStructuralStyleValue<TileflowLineJoin>;
|
|
174
|
+
miterLimit?: TileflowNumberStyleValue;
|
|
175
|
+
roundLimit?: TileflowNumberStyleValue;
|
|
176
|
+
};
|
|
177
|
+
type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
|
|
178
|
+
/** Repeated diagonal marks placed along a stroked geographic feature. */
|
|
179
|
+
type TileflowLineHatchStyle = TileflowLayerRange & {
|
|
180
|
+
angle?: TileflowNumberStyleValue;
|
|
181
|
+
color?: TileflowColorStyleValue;
|
|
182
|
+
opacity?: TileflowNumberStyleValue;
|
|
183
|
+
/** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
|
|
184
|
+
pattern?: TileflowImageStyleValue;
|
|
185
|
+
/**
|
|
186
|
+
* Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
|
|
187
|
+
* selects the closest height to the rendered line width so marks retain a
|
|
188
|
+
* nearly fixed screen-pixel thickness instead of stretching with the road.
|
|
189
|
+
* Requires `pattern` to be a literal sprite-name prefix.
|
|
190
|
+
*/
|
|
191
|
+
patternWidths?: TileflowThemeNumberArrayValue;
|
|
192
|
+
size?: TileflowNumberStyleValue;
|
|
193
|
+
spacing?: TileflowNumberStyleValue;
|
|
194
|
+
};
|
|
195
|
+
type TileflowTextPaint = {
|
|
196
|
+
color?: TileflowColorStyleValue;
|
|
197
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
198
|
+
haloColor?: TileflowColorStyleValue;
|
|
199
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
200
|
+
opacity?: TileflowNumberStyleValue;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
|
|
204
|
+
* whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
|
|
205
|
+
*/
|
|
206
|
+
type TileflowTextBackground = {
|
|
207
|
+
/** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
|
|
208
|
+
color: TileflowColorStyleValue;
|
|
209
|
+
/** `lines` fits one strip to each shaped line. */
|
|
210
|
+
fit: 'lines';
|
|
211
|
+
/** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
|
|
212
|
+
padding?: TileflowThemeNumberValue;
|
|
213
|
+
};
|
|
214
|
+
type TileflowTextLayout = {
|
|
215
|
+
allowOverlap?: boolean;
|
|
216
|
+
anchor?: TileflowTextAnchor;
|
|
217
|
+
/**
|
|
218
|
+
* Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
|
|
219
|
+
* derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
|
|
220
|
+
*/
|
|
221
|
+
background?: TileflowTextBackground;
|
|
222
|
+
field?: TileflowStringStyleValue;
|
|
223
|
+
font?: TileflowThemeFontValue;
|
|
224
|
+
fallbacks?: readonly TileflowThemeFontValue[];
|
|
225
|
+
ignorePlacement?: boolean;
|
|
226
|
+
justify?: TileflowTextJustify;
|
|
227
|
+
keepUpright?: boolean;
|
|
228
|
+
letterSpacing?: TileflowNumberStyleValue;
|
|
229
|
+
lineHeight?: TileflowNumberStyleValue;
|
|
230
|
+
maxAngle?: TileflowNumberStyleValue;
|
|
231
|
+
maxWidth?: TileflowNumberStyleValue;
|
|
232
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
233
|
+
optional?: boolean;
|
|
234
|
+
padding?: TileflowNumberStyleValue;
|
|
235
|
+
pitchAlignment?: TileflowAlignment;
|
|
236
|
+
radialOffset?: TileflowNumberStyleValue;
|
|
237
|
+
rotate?: TileflowNumberStyleValue;
|
|
238
|
+
rotationAlignment?: TileflowAlignment;
|
|
239
|
+
size?: TileflowNumberStyleValue;
|
|
240
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
241
|
+
variableAnchors?: readonly TileflowTextAnchor[];
|
|
242
|
+
};
|
|
243
|
+
type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
|
|
244
|
+
type TileflowIconPaint = {
|
|
245
|
+
color?: TileflowColorStyleValue;
|
|
246
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
247
|
+
haloColor?: TileflowColorStyleValue;
|
|
248
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
249
|
+
opacity?: TileflowNumberStyleValue;
|
|
250
|
+
};
|
|
251
|
+
type TileflowIconLayout = {
|
|
252
|
+
allowOverlap?: boolean;
|
|
253
|
+
anchor?: TileflowIconAnchor;
|
|
254
|
+
image?: TileflowImageStyleValue;
|
|
255
|
+
ignorePlacement?: boolean;
|
|
256
|
+
keepUpright?: boolean;
|
|
257
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
258
|
+
optional?: boolean;
|
|
259
|
+
padding?: TileflowNumberStyleValue;
|
|
260
|
+
pitchAlignment?: TileflowAlignment;
|
|
261
|
+
rotate?: TileflowNumberStyleValue;
|
|
262
|
+
rotationAlignment?: TileflowAlignment;
|
|
263
|
+
size?: TileflowNumberStyleValue;
|
|
264
|
+
textFit?: TileflowIconTextFit;
|
|
265
|
+
textFitPadding?: TileflowNumberInsetsStyleValue;
|
|
266
|
+
};
|
|
267
|
+
type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
|
|
268
|
+
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
269
|
+
placement?: TileflowSymbolPlacement;
|
|
270
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
271
|
+
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
272
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
273
|
+
spacing?: TileflowNumberStyleValue;
|
|
274
|
+
zOrder?: TileflowSymbolZOrder;
|
|
275
|
+
};
|
|
276
|
+
type TileflowCirclePaint = {
|
|
277
|
+
blur?: TileflowNumberStyleValue;
|
|
278
|
+
color?: TileflowColorStyleValue;
|
|
279
|
+
opacity?: TileflowNumberStyleValue;
|
|
280
|
+
pitchAlignment?: 'map' | 'viewport';
|
|
281
|
+
pitchScale?: 'map' | 'viewport';
|
|
282
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
283
|
+
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
284
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
285
|
+
radius?: TileflowNumberStyleValue;
|
|
286
|
+
strokeColor?: TileflowColorStyleValue;
|
|
287
|
+
strokeOpacity?: TileflowNumberStyleValue;
|
|
288
|
+
strokeWidth?: TileflowNumberStyleValue;
|
|
289
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
290
|
+
translateAnchor?: 'map' | 'viewport';
|
|
291
|
+
};
|
|
292
|
+
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
293
|
+
type TileflowExtrusionPaint = {
|
|
294
|
+
base?: TileflowNumberStyleValue;
|
|
295
|
+
color?: TileflowColorStyleValue;
|
|
296
|
+
height?: TileflowNumberStyleValue;
|
|
297
|
+
opacity?: TileflowNumberStyleValue;
|
|
298
|
+
pattern?: TileflowImageStyleValue;
|
|
299
|
+
verticalGradient?: boolean;
|
|
300
|
+
};
|
|
301
|
+
type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
|
|
302
|
+
/** A polygon rendered as a fill and, when requested, a separate line layer. */
|
|
303
|
+
type TileflowAreaStyle = {
|
|
304
|
+
fill?: TileflowFillStyle;
|
|
305
|
+
outline?: TileflowLineStyle;
|
|
306
|
+
};
|
|
307
|
+
/** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
|
|
308
|
+
type TileflowLineStackStyle = {
|
|
309
|
+
casing?: TileflowLineStyle;
|
|
310
|
+
fill?: TileflowLineStyle;
|
|
311
|
+
shadow?: TileflowLineStyle;
|
|
312
|
+
};
|
|
313
|
+
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
314
|
+
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
315
|
+
icon?: TileflowIconStyle;
|
|
316
|
+
text?: TileflowTextStyle;
|
|
317
|
+
};
|
|
318
|
+
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
319
|
+
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
320
|
+
marker?: TileflowCircleStyle;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
type TileflowColor = `#${string}`;
|
|
324
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
325
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
326
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
327
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
328
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
329
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
330
|
+
type TileflowRoadExtras = {
|
|
331
|
+
paths?: boolean;
|
|
332
|
+
};
|
|
333
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
334
|
+
hatch?: TileflowLineHatchStyle;
|
|
335
|
+
};
|
|
336
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
337
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
338
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
339
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
340
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
341
|
+
};
|
|
342
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
343
|
+
enabled?: boolean;
|
|
344
|
+
widthScale?: TileflowThemeNumberValue;
|
|
345
|
+
};
|
|
346
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
347
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
348
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
349
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
350
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
351
|
+
enabled?: boolean;
|
|
352
|
+
};
|
|
353
|
+
type TileflowRoadAreaStyle = {
|
|
354
|
+
pedestrian?: TileflowAreaStyle;
|
|
355
|
+
pier?: TileflowAreaStyle;
|
|
356
|
+
road?: TileflowAreaStyle;
|
|
357
|
+
};
|
|
358
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
359
|
+
type TileflowRoadRoundaboutStyle = {
|
|
360
|
+
casing?: TileflowCircleStyle;
|
|
361
|
+
fill?: TileflowCircleStyle;
|
|
362
|
+
};
|
|
363
|
+
type TileflowRoadSidewalkStyle = {
|
|
364
|
+
outline?: TileflowLineStyle;
|
|
365
|
+
pattern?: TileflowFillStyle;
|
|
366
|
+
surface?: TileflowFillStyle;
|
|
367
|
+
};
|
|
368
|
+
type TileflowRoadsModuleConfig = {
|
|
369
|
+
type: 'roads';
|
|
370
|
+
areas?: TileflowRoadAreaStyle;
|
|
371
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
372
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
373
|
+
detail?: TileflowRoadDetail;
|
|
374
|
+
extras?: TileflowRoadExtras;
|
|
375
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
376
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
377
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
378
|
+
oneWayMarkers?: boolean;
|
|
379
|
+
outline?: TileflowRoadOutline;
|
|
380
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
381
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
382
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
383
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
384
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
385
|
+
weight?: TileflowRoadWeight;
|
|
386
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
387
|
+
};
|
|
388
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
389
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
390
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
391
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
392
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
393
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
394
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
395
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
396
|
+
type TileflowRoadShieldStyles = {
|
|
397
|
+
default?: TileflowSymbolStyle;
|
|
398
|
+
detail?: TileflowSymbolStyle;
|
|
399
|
+
kinds?: Record<string, {
|
|
400
|
+
image: TileflowThemeImageValue;
|
|
401
|
+
}>;
|
|
402
|
+
overview?: TileflowSymbolStyle;
|
|
403
|
+
textColors?: Record<string, {
|
|
404
|
+
color: TileflowThemeColorValue;
|
|
405
|
+
}>;
|
|
406
|
+
};
|
|
407
|
+
type TileflowLabelStyles = {
|
|
408
|
+
aerodrome?: TileflowSymbolStyle;
|
|
409
|
+
junctions?: TileflowSymbolStyle;
|
|
410
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
411
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
412
|
+
shields?: TileflowRoadShieldStyles;
|
|
413
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
414
|
+
};
|
|
415
|
+
type TileflowLabelsModuleConfig = {
|
|
416
|
+
type: 'labels';
|
|
417
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
418
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
419
|
+
junctions?: boolean;
|
|
420
|
+
language?: TileflowLabelLanguage;
|
|
421
|
+
places?: TileflowLabelDetail;
|
|
422
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
423
|
+
roads?: TileflowRoadLabelDetail;
|
|
424
|
+
shields?: TileflowRoadShieldDetail;
|
|
425
|
+
styles?: TileflowLabelStyles;
|
|
426
|
+
water?: TileflowLabelDetail;
|
|
427
|
+
};
|
|
428
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
429
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
430
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
431
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
432
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
433
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
|
|
434
|
+
/** Optional category-local cap within the module's canonical density tiers. */
|
|
435
|
+
density?: TileflowPoiDensity;
|
|
436
|
+
};
|
|
437
|
+
type TileflowPoiModuleConfig = {
|
|
438
|
+
type: 'poi';
|
|
439
|
+
categories?: readonly TileflowPoiCategory[];
|
|
440
|
+
color?: TileflowPoiColorMode;
|
|
441
|
+
density?: TileflowPoiDensity;
|
|
442
|
+
icons?: boolean;
|
|
443
|
+
labels?: boolean;
|
|
444
|
+
minZoom?: number;
|
|
445
|
+
placement?: {
|
|
446
|
+
coupleIconAndLabel?: boolean;
|
|
447
|
+
iconPadding?: number;
|
|
448
|
+
textPadding?: number;
|
|
449
|
+
};
|
|
450
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
451
|
+
};
|
|
452
|
+
type MapLibreSprite = string | Array<{
|
|
453
|
+
id: string;
|
|
454
|
+
url: string;
|
|
455
|
+
}>;
|
|
456
|
+
type TileflowProjection = 'globe' | 'mercator';
|
|
457
|
+
type TileflowLight = {
|
|
458
|
+
anchor?: 'map' | 'viewport';
|
|
459
|
+
color?: TileflowColor;
|
|
460
|
+
intensity?: number;
|
|
461
|
+
position?: readonly [number, number, number];
|
|
462
|
+
};
|
|
463
|
+
type MapLibreStyle = {
|
|
464
|
+
sky?: Record<string, unknown>;
|
|
465
|
+
version: 8;
|
|
466
|
+
name: string;
|
|
467
|
+
glyphs?: string;
|
|
468
|
+
light?: TileflowLight;
|
|
469
|
+
projection?: {
|
|
470
|
+
type: TileflowProjection;
|
|
471
|
+
};
|
|
472
|
+
sprite?: MapLibreSprite;
|
|
473
|
+
sources: Record<string, Record<string, unknown>>;
|
|
474
|
+
layers: Array<Record<string, unknown>>;
|
|
475
|
+
terrain?: Record<string, unknown>;
|
|
476
|
+
metadata?: Record<string, unknown>;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
480
|
+
|
|
481
|
+
type TileflowAnalytics = {
|
|
482
|
+
apiUrl?: string;
|
|
483
|
+
endpoint?: string;
|
|
484
|
+
enabled?: boolean;
|
|
485
|
+
mapId?: string;
|
|
486
|
+
metadata?: Record<string, unknown>;
|
|
487
|
+
projectId?: string;
|
|
488
|
+
sdkVersion?: string;
|
|
489
|
+
source?: string;
|
|
490
|
+
styleId?: string;
|
|
491
|
+
surfaceId?: string;
|
|
492
|
+
};
|
|
493
|
+
type TileflowSessionController = {
|
|
494
|
+
readonly sessionId: string;
|
|
495
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
496
|
+
};
|
|
497
|
+
type TileflowRuntimeStyle = {
|
|
498
|
+
analytics?: TileflowAnalytics;
|
|
499
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
500
|
+
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
501
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
502
|
+
revision?: string;
|
|
503
|
+
style: MapLibreStyle | string;
|
|
504
|
+
theme?: string;
|
|
505
|
+
};
|
|
506
|
+
type TileflowStyleFontFace = {
|
|
507
|
+
family: string;
|
|
508
|
+
source: string;
|
|
509
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
510
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
type TileflowAddressesModuleOptions = {
|
|
514
|
+
/** Styling for OpenMapTiles point house-number labels. */
|
|
515
|
+
labels?: TileflowSymbolStyle;
|
|
516
|
+
};
|
|
517
|
+
type TileflowAddressesModuleConfig = TileflowAddressesModuleOptions & {
|
|
518
|
+
type: 'addresses';
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
type TileflowAerowaysModuleOptions = {
|
|
522
|
+
area?: TileflowAreaStyle;
|
|
523
|
+
runway?: TileflowLineStackStyle;
|
|
524
|
+
runwayRef?: TileflowSymbolStyle;
|
|
525
|
+
taxiway?: TileflowLineStackStyle;
|
|
526
|
+
};
|
|
527
|
+
type TileflowAerowaysModuleConfig = TileflowAerowaysModuleOptions & {
|
|
528
|
+
type: 'aeroways';
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
type TileflowBoundariesModuleOptions = {
|
|
532
|
+
admin2?: TileflowLineStyle;
|
|
533
|
+
admin4?: TileflowLineStyle;
|
|
534
|
+
disputed?: TileflowLineStyle;
|
|
535
|
+
maritime?: TileflowLineStyle;
|
|
536
|
+
};
|
|
537
|
+
type TileflowBoundariesModuleConfig = TileflowBoundariesModuleOptions & {
|
|
538
|
+
type: 'boundaries';
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
type TileflowBuildingMode = '3d' | 'flat';
|
|
542
|
+
type TileflowBuildingsModuleOptions = {
|
|
543
|
+
businessCorridor?: TileflowAreaStyle;
|
|
544
|
+
extrusion?: TileflowExtrusionStyle;
|
|
545
|
+
flat?: TileflowAreaStyle;
|
|
546
|
+
mode?: TileflowBuildingMode;
|
|
547
|
+
};
|
|
548
|
+
type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
|
|
549
|
+
type: 'buildings';
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'education' | 'government' | 'industrial' | 'medical' | 'military' | 'parking' | 'railway' | 'recreation' | 'residential';
|
|
553
|
+
type TileflowLandcoverClass = 'farmland' | 'flowerbed' | 'grass' | 'ice' | 'meadow' | 'protected' | 'recreationGround' | 'rock' | 'sand' | 'scrub' | 'urbanPark' | 'villageGreen' | 'wetland' | 'wood';
|
|
554
|
+
type TileflowLandModuleOptions = {
|
|
555
|
+
background?: TileflowBackgroundStyle;
|
|
556
|
+
globalLandcover?: TileflowFillStyle;
|
|
557
|
+
landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
|
|
558
|
+
landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
|
|
559
|
+
};
|
|
560
|
+
type TileflowLandModuleConfig = TileflowLandModuleOptions & {
|
|
561
|
+
type: 'land';
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
declare const tileflowLandformClasses: readonly ["peak", "volcano", "saddle", "ridge", "cliff", "arete"];
|
|
565
|
+
type TileflowLandformClass = (typeof tileflowLandformClasses)[number];
|
|
566
|
+
type TileflowLandformsModuleOptions = {
|
|
567
|
+
classes?: Partial<Record<TileflowLandformClass, TileflowSymbolStyle>>;
|
|
568
|
+
/** Append source elevation in metres when the feature provides it. */
|
|
569
|
+
elevation?: boolean;
|
|
570
|
+
};
|
|
571
|
+
type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
|
|
572
|
+
type: 'landforms';
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/** Labels anchored inside polygon features; point-feature labels remain on their feature style. */
|
|
576
|
+
type TileflowNauticalAreaLabelStyles = {
|
|
577
|
+
coverage?: TileflowSymbolStyle;
|
|
578
|
+
hazards?: TileflowSymbolStyle;
|
|
579
|
+
navigationAreas?: TileflowSymbolStyle;
|
|
580
|
+
reefs?: TileflowSymbolStyle;
|
|
581
|
+
wrecks?: TileflowSymbolStyle;
|
|
582
|
+
};
|
|
583
|
+
type TileflowNauticalModuleOptions = {
|
|
584
|
+
aids?: TileflowMarkerSymbolStyle;
|
|
585
|
+
coverage?: TileflowAreaStyle;
|
|
586
|
+
hazardAreas?: TileflowAreaStyle;
|
|
587
|
+
hazards?: TileflowMarkerSymbolStyle;
|
|
588
|
+
labels?: TileflowNauticalAreaLabelStyles;
|
|
589
|
+
lighthouses?: TileflowMarkerSymbolStyle;
|
|
590
|
+
lights?: TileflowMarkerSymbolStyle;
|
|
591
|
+
navigationAreas?: TileflowAreaStyle;
|
|
592
|
+
reefs?: TileflowAreaStyle;
|
|
593
|
+
soundings?: TileflowMarkerSymbolStyle;
|
|
594
|
+
wreckAreas?: TileflowAreaStyle;
|
|
595
|
+
wrecks?: TileflowMarkerSymbolStyle;
|
|
596
|
+
};
|
|
597
|
+
type TileflowNauticalModuleConfig = TileflowNauticalModuleOptions & {
|
|
598
|
+
type: 'nautical';
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
type TileflowTransitModuleOptions = {
|
|
602
|
+
cableway?: TileflowLineStyle;
|
|
603
|
+
ferry?: TileflowLineStyle;
|
|
604
|
+
rail?: TileflowTransitRailStyle;
|
|
605
|
+
railHatching?: TileflowTransitRailStyle;
|
|
606
|
+
serviceRail?: TileflowTransitRailStyle;
|
|
607
|
+
};
|
|
608
|
+
type TileflowTransitRailStyle = {
|
|
609
|
+
bridge?: TileflowLineStyle;
|
|
610
|
+
surface?: TileflowLineStyle;
|
|
611
|
+
tunnel?: TileflowLineStyle;
|
|
612
|
+
};
|
|
613
|
+
type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
|
|
614
|
+
type: 'transit';
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
type TileflowVegetationMode = '3d' | 'flat';
|
|
618
|
+
type TileflowVegetationThreeDimensionalStyle = {
|
|
619
|
+
barkColor?: TileflowThemeColorValue;
|
|
620
|
+
broadleafColors?: readonly TileflowThemeColorValue[];
|
|
621
|
+
coniferColors?: readonly TileflowThemeColorValue[];
|
|
622
|
+
crownScale?: TileflowThemeNumberValue;
|
|
623
|
+
heightScale?: TileflowThemeNumberValue;
|
|
624
|
+
};
|
|
625
|
+
type TileflowVegetationModuleOptions = {
|
|
626
|
+
flat?: TileflowCircleStyle;
|
|
627
|
+
minZoom?: number;
|
|
628
|
+
mode?: TileflowVegetationMode;
|
|
629
|
+
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
630
|
+
};
|
|
631
|
+
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
632
|
+
type: 'vegetation';
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
|
|
636
|
+
type TileflowWaterModuleOptions = {
|
|
637
|
+
bathymetry?: TileflowFillStyle;
|
|
638
|
+
/** Opt-in approximate contours traced from discrete bathymetry polygon band edges. */
|
|
639
|
+
bathymetryContours?: TileflowLineStyle;
|
|
640
|
+
/** Opt-in labels for bathymetry polygon band floors, not measured survey soundings. */
|
|
641
|
+
bathymetryLabels?: TileflowSymbolStyle;
|
|
642
|
+
bodies?: TileflowAreaStyle;
|
|
643
|
+
intermittent?: {
|
|
644
|
+
bodies?: TileflowAreaStyle;
|
|
645
|
+
waterways?: TileflowLineStyle;
|
|
646
|
+
};
|
|
647
|
+
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
648
|
+
};
|
|
649
|
+
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
650
|
+
type: 'water';
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
type TileflowSemanticModules = {
|
|
654
|
+
addresses?: TileflowAddressesModuleConfig;
|
|
655
|
+
aeroways?: TileflowAerowaysModuleConfig;
|
|
656
|
+
boundaries?: TileflowBoundariesModuleConfig;
|
|
657
|
+
buildings?: TileflowBuildingsModuleConfig;
|
|
658
|
+
labels?: TileflowLabelsModuleConfig;
|
|
659
|
+
land?: TileflowLandModuleConfig;
|
|
660
|
+
landforms?: TileflowLandformsModuleConfig;
|
|
661
|
+
nautical?: TileflowNauticalModuleConfig;
|
|
662
|
+
poi?: TileflowPoiModuleConfig;
|
|
663
|
+
roads?: TileflowRoadsModuleConfig;
|
|
664
|
+
transit?: TileflowTransitModuleConfig;
|
|
665
|
+
vegetation?: TileflowVegetationModuleConfig;
|
|
666
|
+
water?: TileflowWaterModuleConfig;
|
|
667
|
+
};
|
|
668
|
+
type TileflowSemanticModuleName = keyof TileflowSemanticModules;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Layer metadata naming the semantic module that owns a compiled layer, such as `roads` or `water`.
|
|
672
|
+
* Runtime features that address a module, such as map emphasis, read it instead of physical layer
|
|
673
|
+
* IDs. Layers that a theme blend splits or copies keep it.
|
|
674
|
+
*/
|
|
675
|
+
declare const tileflowLayerDomainMetadataKey: "tileflow:domain";
|
|
676
|
+
|
|
677
|
+
type TileflowLayerDomain = TileflowSemanticModuleName | 'terrain';
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Map emphasis lets an application's own content read first: chosen modules of the map recede
|
|
681
|
+
* towards the map's ground colour, and the map's labels and icons fade, except inside an area the
|
|
682
|
+
* application keeps at full strength. It only touches layers that a Tileflow map compiled, which
|
|
683
|
+
* name their module in their metadata; an application's own layers are never changed.
|
|
684
|
+
*
|
|
685
|
+
* This module plans which paint values an emphasis changes and computes each value for a strength
|
|
686
|
+
* from 0 (the map as designed) to 1 (the full emphasis). The browser controller writes them.
|
|
687
|
+
*/
|
|
688
|
+
/** A module of a compiled Tileflow map, such as `roads`, `transit`, `boundaries`, or `water`. */
|
|
689
|
+
type TileflowEmphasisModule = TileflowLayerDomain;
|
|
690
|
+
/** A GeoJSON polygon or multipolygon, in longitude and latitude. */
|
|
691
|
+
type TileflowEmphasisArea = Readonly<{
|
|
692
|
+
coordinates: readonly (readonly (readonly number[])[])[];
|
|
693
|
+
type: 'Polygon';
|
|
694
|
+
}> | Readonly<{
|
|
695
|
+
coordinates: readonly (readonly (readonly (readonly number[])[])[])[];
|
|
696
|
+
type: 'MultiPolygon';
|
|
697
|
+
}>;
|
|
698
|
+
/** How the map steps back so an application's content reads first. */
|
|
699
|
+
type TileflowEmphasis = Readonly<{
|
|
700
|
+
/**
|
|
701
|
+
* Modules whose ground recedes towards the map's ground colour, and how far, from 0 (as
|
|
702
|
+
* designed) to 1 (the ground colour itself). Artwork that cannot be recoloured, such as
|
|
703
|
+
* patterns, fades by the same amount instead.
|
|
704
|
+
*/
|
|
705
|
+
recede?: Readonly<Partial<Record<TileflowEmphasisModule, number>>>;
|
|
706
|
+
/** The share of their opacity the map's labels and icons keep, from 0 to 1. */
|
|
707
|
+
labels?: number;
|
|
708
|
+
/** An area in which the map's labels and icons keep their full strength. */
|
|
709
|
+
keep?: TileflowEmphasisArea;
|
|
710
|
+
}>;
|
|
711
|
+
/** Why an emphasis cannot be shown, or undefined when it can. */
|
|
712
|
+
declare function validateTileflowEmphasis(value: unknown): TypeError | undefined;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Browser helpers for theme transitions and blends. They use only methods that MapLibre GL JS maps
|
|
716
|
+
* provide and check each one at runtime, so a map without them falls back to an immediate change.
|
|
717
|
+
*/
|
|
718
|
+
type TileflowThemeMotionMap = {
|
|
719
|
+
areTilesLoaded?: unknown;
|
|
720
|
+
getCanvas?: unknown;
|
|
721
|
+
getImage?: unknown;
|
|
722
|
+
getLayer?: unknown;
|
|
723
|
+
getStyle?: unknown;
|
|
724
|
+
isStyleLoaded?: unknown;
|
|
725
|
+
off(event: string, listener: (event?: unknown) => void): unknown;
|
|
726
|
+
on(event: string, listener: (event?: unknown) => void): unknown;
|
|
727
|
+
project?: unknown;
|
|
728
|
+
redraw?: unknown;
|
|
729
|
+
setLayoutProperty?: unknown;
|
|
730
|
+
setLight?: unknown;
|
|
731
|
+
setPaintProperty?: unknown;
|
|
732
|
+
setSky?: unknown;
|
|
733
|
+
unproject?: unknown;
|
|
734
|
+
updateImage?: unknown;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
/** Structural MapLibre capabilities; importing this module never loads a renderer. */
|
|
738
|
+
type TileflowAtmosphereMap = {
|
|
739
|
+
getBearing(): number;
|
|
740
|
+
getCanvas(): HTMLCanvasElement;
|
|
741
|
+
getCenter(): {
|
|
742
|
+
lat: number;
|
|
743
|
+
lng: number;
|
|
744
|
+
};
|
|
745
|
+
getContainer(): HTMLElement;
|
|
746
|
+
getPitch(): number;
|
|
747
|
+
getZoom(): number;
|
|
748
|
+
getStyle(): {
|
|
749
|
+
metadata?: unknown;
|
|
750
|
+
projection?: {
|
|
751
|
+
type?: unknown;
|
|
752
|
+
};
|
|
753
|
+
} | undefined;
|
|
754
|
+
on(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
|
|
755
|
+
off(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* Render compiled globe atmosphere metadata. Call after constructing a browser map.
|
|
759
|
+
* Follows style replacements and releases its canvas, listeners, and pending frame on disposal.
|
|
760
|
+
*/
|
|
761
|
+
declare function attachTileflowAtmosphere(map: TileflowAtmosphereMap): () => void;
|
|
762
|
+
|
|
763
|
+
declare const tileflowMaplibreContourVersion: "0.1.0";
|
|
764
|
+
type TileflowContourProtocolRequest = Readonly<{
|
|
765
|
+
url: string;
|
|
766
|
+
}>;
|
|
767
|
+
type TileflowContourProtocolResponse = Readonly<{
|
|
768
|
+
cacheControl?: string | null;
|
|
769
|
+
data: ArrayBuffer;
|
|
770
|
+
expires?: Date | string | null;
|
|
771
|
+
}>;
|
|
772
|
+
type TileflowContourProtocolHandler = (request: TileflowContourProtocolRequest, abortController: AbortController) => Promise<TileflowContourProtocolResponse>;
|
|
773
|
+
type TileflowContourProtocolRegistry = {
|
|
774
|
+
addProtocol: (name: string, handler: TileflowContourProtocolHandler) => void;
|
|
775
|
+
};
|
|
776
|
+
type TileflowContourProtocolRegistrationOptions = {
|
|
777
|
+
/** Test/integration override; the default lazily initializes the pinned, bundled module. */
|
|
778
|
+
loadMaplibreContour?: () => Promise<unknown>;
|
|
779
|
+
};
|
|
780
|
+
/** Registers the one self-contained protocol emitted by every compiled contour source. */
|
|
781
|
+
declare function registerTileflowContourProtocol(registry: TileflowContourProtocolRegistry, options?: TileflowContourProtocolRegistrationOptions): void;
|
|
782
|
+
|
|
783
|
+
type TileflowPmtilesProtocolHandler = (request: Readonly<{
|
|
784
|
+
type?: string;
|
|
785
|
+
url: string;
|
|
786
|
+
}>, abortController: AbortController) => Promise<Readonly<{
|
|
787
|
+
cacheControl?: string;
|
|
788
|
+
data: unknown;
|
|
789
|
+
expires?: string;
|
|
790
|
+
}>>;
|
|
791
|
+
type TileflowPmtilesProtocolRegistry = Readonly<{
|
|
792
|
+
addProtocol: (name: string, handler: TileflowPmtilesProtocolHandler) => void;
|
|
793
|
+
}>;
|
|
794
|
+
type TileflowPmtilesProtocolRegistrationOptions = Readonly<{
|
|
795
|
+
maximumDirectoryDepth?: number;
|
|
796
|
+
}>;
|
|
797
|
+
declare const tileflowPmtilesMaximumDirectoryDepth: 32;
|
|
798
|
+
declare const tileflowPmtilesProtocol: "tileflow-pmtiles";
|
|
799
|
+
/** Register only Tileflow's managed PMTiles namespace. Third-party `pmtiles://` remains untouched. */
|
|
800
|
+
declare function registerTileflowPmtilesProtocol(registry: TileflowPmtilesProtocolRegistry, options?: TileflowPmtilesProtocolRegistrationOptions): void;
|
|
801
|
+
|
|
802
|
+
type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
|
|
803
|
+
/** Read the browser preference without persisting or mutating user state. */
|
|
804
|
+
declare function getTileflowSystemColorScheme(): TileflowRuntimeColorScheme;
|
|
805
|
+
/**
|
|
806
|
+
* Subscribe through one process-wide `matchMedia` listener, regardless of adapter or map count.
|
|
807
|
+
*/
|
|
808
|
+
declare function subscribeTileflowSystemColorScheme(listener: (scheme: TileflowRuntimeColorScheme) => void): () => void;
|
|
809
|
+
type TileflowThemeTransitionPhase = 'applying' | 'error' | 'preloading' | 'ready';
|
|
810
|
+
type TileflowThemeTransition = Readonly<{
|
|
811
|
+
currentTheme?: string;
|
|
812
|
+
error?: Error;
|
|
813
|
+
phase: TileflowThemeTransitionPhase;
|
|
814
|
+
targetTheme?: string;
|
|
815
|
+
}>;
|
|
816
|
+
type TileflowThemeTransitionResult = Readonly<{
|
|
817
|
+
error?: Error;
|
|
818
|
+
status: 'applied' | 'failed' | 'superseded';
|
|
819
|
+
theme?: string;
|
|
820
|
+
}>;
|
|
821
|
+
/**
|
|
822
|
+
* How a theme change appears. With a `duration`, the map cross-fades from the previous theme to
|
|
823
|
+
* the new one: a snapshot of the previous frame covers the map, follows the camera, and fades out
|
|
824
|
+
* once the new theme is drawn. A browser preference for reduced motion changes at once.
|
|
825
|
+
*/
|
|
826
|
+
type TileflowThemeTransitionOptions = Readonly<{
|
|
827
|
+
/** Cross-fade length in milliseconds, from 0 (the default, an immediate change) to 5000. */
|
|
828
|
+
duration?: number;
|
|
829
|
+
}>;
|
|
830
|
+
type TileflowThemeChangeOptions = Readonly<{
|
|
831
|
+
transition?: TileflowThemeTransitionOptions;
|
|
832
|
+
}>;
|
|
833
|
+
/**
|
|
834
|
+
* A continuous mix of two or more themes of the same map. `position` places the map between
|
|
835
|
+
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
836
|
+
* to the third. Ground colours, patterns, the sky, and light follow the position; labels and icons
|
|
837
|
+
* cross-fade when the nearest theme changes.
|
|
838
|
+
*/
|
|
839
|
+
type TileflowThemeBlendRequest = Readonly<{
|
|
840
|
+
position: number;
|
|
841
|
+
/** Two to eight concrete themes of one map, in blend order. */
|
|
842
|
+
themes: readonly TileflowRuntimeStyle[];
|
|
843
|
+
}>;
|
|
844
|
+
type TileflowThemeBlendState = Readonly<{
|
|
845
|
+
position: number;
|
|
846
|
+
themes: readonly string[];
|
|
847
|
+
}>;
|
|
848
|
+
type TileflowStyleSwitchMap = TileflowThemeMotionMap & {
|
|
849
|
+
off(event: string, listener: (event?: unknown) => void): unknown;
|
|
850
|
+
on(event: string, listener: (event?: unknown) => void): unknown;
|
|
851
|
+
setStyle: unknown;
|
|
852
|
+
};
|
|
853
|
+
type TileflowThemeController = {
|
|
854
|
+
dispose(): void;
|
|
855
|
+
/** The active blend, or undefined when the map shows one theme. */
|
|
856
|
+
getBlend(): TileflowThemeBlendState | undefined;
|
|
857
|
+
/** The theme the map shows; during a blend, the nearest theme. */
|
|
858
|
+
getCurrent(): TileflowRuntimeStyle;
|
|
859
|
+
/** The emphasis requested last, or undefined when the map is shown as designed. */
|
|
860
|
+
getEmphasis(): TileflowEmphasis | undefined;
|
|
861
|
+
/**
|
|
862
|
+
* Shows a blend of themes. The first request for a set of themes loads their styles and
|
|
863
|
+
* prepares one style that holds all of them; later requests for the same themes only move the
|
|
864
|
+
* position and take effect at once, so they can follow an animation or a slider.
|
|
865
|
+
*/
|
|
866
|
+
setBlend(request: TileflowThemeBlendRequest, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
|
|
867
|
+
/**
|
|
868
|
+
* Makes chosen modules of the map recede and its labels and icons fade, so an application's own
|
|
869
|
+
* content reads first; `undefined` returns the map to its design. The change eases over the
|
|
870
|
+
* transition, and the emphasis stays through later theme changes and blend positions. Values
|
|
871
|
+
* that MapLibre evaluates per feature change at once, under a cross-fade.
|
|
872
|
+
*/
|
|
873
|
+
setEmphasis(emphasis: TileflowEmphasis | undefined, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
|
|
874
|
+
setTheme(style: TileflowRuntimeStyle, options?: TileflowThemeChangeOptions): Promise<TileflowThemeTransitionResult>;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Transactionally changes a MapLibre style while preserving the map instance and camera.
|
|
878
|
+
* Independent font preloads start immediately; style application is serialized and last request wins.
|
|
879
|
+
*/
|
|
880
|
+
declare function createTileflowThemeController(options: {
|
|
881
|
+
initial: TileflowRuntimeStyle;
|
|
882
|
+
loadFonts?: (style: TileflowRuntimeStyle) => Promise<void>;
|
|
883
|
+
/** Loads a theme's style document for a blend; defaults to a same-origin-credentials fetch. */
|
|
884
|
+
loadStyle?: (url: string) => Promise<MapLibreStyle>;
|
|
885
|
+
map: TileflowStyleSwitchMap;
|
|
886
|
+
onTransition?: (transition: TileflowThemeTransition) => void;
|
|
887
|
+
timeoutMs?: number;
|
|
888
|
+
/** The default for every change; each change may pass its own. */
|
|
889
|
+
transition?: TileflowThemeTransitionOptions;
|
|
890
|
+
}): TileflowThemeController;
|
|
891
|
+
type TileflowMapLifecycleEvent = 'dataloading' | 'error' | 'idle' | 'load' | 'styledataloading';
|
|
892
|
+
type TileflowFrameScheduler<TFrame> = {
|
|
893
|
+
cancelFrame: (frame: TFrame) => void;
|
|
894
|
+
requestFrame: (callback: () => void) => TFrame;
|
|
895
|
+
};
|
|
896
|
+
type TileflowMapLifecycleSubscriber<TMap> = (map: TMap, event: TileflowMapLifecycleEvent, listener: () => void) => () => void;
|
|
897
|
+
type TileflowSessionSender = (analytics: TileflowAnalytics | undefined, input: {
|
|
898
|
+
mapId?: string;
|
|
899
|
+
sessionId: string;
|
|
900
|
+
source: string;
|
|
901
|
+
styleId?: string;
|
|
902
|
+
}) => void;
|
|
903
|
+
type TileflowSessionStarter = {
|
|
904
|
+
clear: () => void;
|
|
905
|
+
start: (analytics: TileflowAnalytics | undefined, styleId?: string) => boolean;
|
|
906
|
+
};
|
|
907
|
+
type TileflowMapLifecycleAttachment = {
|
|
908
|
+
dispose: () => void;
|
|
909
|
+
invalidate: (state?: TileflowMapReadinessState) => void;
|
|
910
|
+
};
|
|
911
|
+
type TileflowStyleFontLoadOptions = {
|
|
912
|
+
/** Already resolved manifest metadata. An explicit empty array avoids fetching the style. */
|
|
913
|
+
fontFaces?: readonly TileflowStyleFontFace[];
|
|
914
|
+
fetch?: typeof globalThis.fetch;
|
|
915
|
+
};
|
|
916
|
+
/** Loads content-addressed style font faces before MapLibre starts shaping labels. */
|
|
917
|
+
declare function loadTileflowStyleFonts(style: MapLibreStyle | string, options?: TileflowStyleFontLoadOptions): Promise<void>;
|
|
918
|
+
type TileflowTransformRequestParameters = {
|
|
919
|
+
url: string;
|
|
920
|
+
};
|
|
921
|
+
type TileflowComposedRequest<TRequest extends TileflowTransformRequestParameters> = Pick<TRequest, 'url'> & Partial<Omit<TRequest, 'url'>>;
|
|
922
|
+
type TileflowTransformRequest<TRequest extends TileflowTransformRequestParameters, TResourceType> = (url: string, resourceType?: TResourceType) => Promise<TileflowComposedRequest<TRequest>> | TileflowComposedRequest<TRequest> | undefined;
|
|
923
|
+
type TileflowUserTransformRequest<TRequest extends TileflowTransformRequestParameters, TResourceType> = (url: string, resourceType?: TResourceType) => Promise<TRequest> | TRequest | undefined;
|
|
924
|
+
type TileflowAsyncAnalyticsTiming = 'request' | 'resolution';
|
|
925
|
+
declare function createTileflowSessionStarter(options: {
|
|
926
|
+
getSessionId?: () => string;
|
|
927
|
+
sessionId: string;
|
|
928
|
+
source: string;
|
|
929
|
+
startSession?: TileflowSessionSender;
|
|
930
|
+
}): TileflowSessionStarter;
|
|
931
|
+
declare function attachTileflowMapLifecycle<TMap, TFrame>(options: {
|
|
932
|
+
getSession?: () => {
|
|
933
|
+
analytics: TileflowAnalytics | undefined;
|
|
934
|
+
styleId?: string;
|
|
935
|
+
};
|
|
936
|
+
map: TMap;
|
|
937
|
+
onLoad?: (map: TMap) => void;
|
|
938
|
+
scheduler: TileflowFrameScheduler<TFrame>;
|
|
939
|
+
sessionStarter?: TileflowSessionStarter;
|
|
940
|
+
setState: (state: TileflowMapReadinessState) => void;
|
|
941
|
+
subscribe: TileflowMapLifecycleSubscriber<TMap>;
|
|
942
|
+
}): TileflowMapLifecycleAttachment;
|
|
943
|
+
declare function createTileflowTransformRequest<TRequest extends TileflowTransformRequestParameters = TileflowTransformRequestParameters, TResourceType = unknown>(options: {
|
|
944
|
+
always: true;
|
|
945
|
+
asyncAnalyticsTiming?: TileflowAsyncAnalyticsTiming;
|
|
946
|
+
getAnalytics: () => TileflowAnalytics | undefined;
|
|
947
|
+
sessionController?: TileflowSessionController;
|
|
948
|
+
sessionId: string;
|
|
949
|
+
transformRequest?: TileflowUserTransformRequest<TRequest, TResourceType>;
|
|
950
|
+
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
951
|
+
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
952
|
+
declare function createTileflowTransformRequest<TRequest extends TileflowTransformRequestParameters = TileflowTransformRequestParameters, TResourceType = unknown>(options: {
|
|
953
|
+
always?: boolean;
|
|
954
|
+
asyncAnalyticsTiming?: TileflowAsyncAnalyticsTiming;
|
|
955
|
+
getAnalytics: () => TileflowAnalytics | undefined;
|
|
956
|
+
sessionController?: TileflowSessionController;
|
|
957
|
+
sessionId: string;
|
|
958
|
+
transformRequest?: TileflowUserTransformRequest<TRequest, TResourceType>;
|
|
959
|
+
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
960
|
+
}): TileflowTransformRequest<TRequest, TResourceType> | undefined;
|
|
961
|
+
|
|
962
|
+
export { type TileflowAsyncAnalyticsTiming, type TileflowAtmosphereMap, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowSessionSender, type TileflowSessionStarter, type TileflowStyleFontLoadOptions, type TileflowStyleSwitchMap, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowLayerDomainMetadataKey, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, validateTileflowEmphasis };
|