@tileflow/core 0.1.0-alpha.16 → 0.1.0-alpha.18
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/README.md +34 -2
- package/dist/browser.d.ts +77 -0
- package/dist/browser.js +337 -0
- package/dist/index.d.ts +3 -654
- package/dist/index.js +248 -6
- package/dist/runtime-Bg--GMWM.d.ts +680 -0
- package/package.json +8 -3
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const tileflowCaptureSceneSchemaVersion: 1;
|
|
4
|
+
declare const tileflowCaptureSceneLimits: Readonly<{
|
|
5
|
+
applicationPathLength: 2048;
|
|
6
|
+
boundsPadding: {
|
|
7
|
+
maximum: number;
|
|
8
|
+
minimum: number;
|
|
9
|
+
};
|
|
10
|
+
captureIdLength: 64;
|
|
11
|
+
maximumPhysicalPixels: 16777216;
|
|
12
|
+
pitch: {
|
|
13
|
+
maximum: number;
|
|
14
|
+
minimum: number;
|
|
15
|
+
};
|
|
16
|
+
selectorLength: 256;
|
|
17
|
+
viewport: {
|
|
18
|
+
maximum: number;
|
|
19
|
+
minimum: number;
|
|
20
|
+
};
|
|
21
|
+
zoom: {
|
|
22
|
+
maximum: number;
|
|
23
|
+
minimum: number;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
declare const tileflowCaptureCenterCameraSchema: z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"center">;
|
|
28
|
+
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
29
|
+
zoom: z.ZodNumber;
|
|
30
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
declare const tileflowCaptureBoundsCameraSchema: z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"bounds">;
|
|
35
|
+
bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
36
|
+
padding: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
declare const tileflowCaptureCameraSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
type: z.ZodLiteral<"center">;
|
|
42
|
+
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
43
|
+
zoom: z.ZodNumber;
|
|
44
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"bounds">;
|
|
48
|
+
bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
49
|
+
padding: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strict>], "type">;
|
|
53
|
+
declare const tileflowCaptureViewportSchema: z.ZodObject<{
|
|
54
|
+
width: z.ZodNumber;
|
|
55
|
+
height: z.ZodNumber;
|
|
56
|
+
dpr: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
declare const tileflowCaptureIdSchema: z.ZodString;
|
|
59
|
+
declare const tileflowCaptureSceneNameSchema: z.ZodString;
|
|
60
|
+
declare const tileflowCaptureMapTargetSchema: z.ZodObject<{
|
|
61
|
+
kind: z.ZodLiteral<"map">;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
declare const tileflowCaptureApplicationTargetSchema: z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"application">;
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
captureId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
68
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
map: "map";
|
|
70
|
+
viewport: "viewport";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
declare const tileflowCaptureTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"map">;
|
|
75
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<"application">;
|
|
77
|
+
path: z.ZodString;
|
|
78
|
+
captureId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
80
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
map: "map";
|
|
82
|
+
viewport: "viewport";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strict>], "kind">;
|
|
85
|
+
declare const tileflowCaptureSceneSchema: z.ZodObject<{
|
|
86
|
+
map: z.ZodString;
|
|
87
|
+
camera: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"center">;
|
|
89
|
+
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
90
|
+
zoom: z.ZodNumber;
|
|
91
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"bounds">;
|
|
95
|
+
bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
96
|
+
padding: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
bearing: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
pitch: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
}, z.core.$strict>], "type">;
|
|
100
|
+
viewport: z.ZodObject<{
|
|
101
|
+
width: z.ZodNumber;
|
|
102
|
+
height: z.ZodNumber;
|
|
103
|
+
dpr: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"map">;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"application">;
|
|
109
|
+
path: z.ZodString;
|
|
110
|
+
captureId: z.ZodOptional<z.ZodString>;
|
|
111
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
112
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
map: "map";
|
|
114
|
+
viewport: "viewport";
|
|
115
|
+
}>>;
|
|
116
|
+
}, z.core.$strict>], "kind">>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
type TileflowCaptureCenterCamera = z.infer<typeof tileflowCaptureCenterCameraSchema>;
|
|
119
|
+
type TileflowCaptureBoundsCamera = z.infer<typeof tileflowCaptureBoundsCameraSchema>;
|
|
120
|
+
type TileflowCaptureCamera = z.infer<typeof tileflowCaptureCameraSchema>;
|
|
121
|
+
type TileflowCaptureViewport = z.infer<typeof tileflowCaptureViewportSchema>;
|
|
122
|
+
type TileflowCaptureMapTarget = z.infer<typeof tileflowCaptureMapTargetSchema>;
|
|
123
|
+
type TileflowCaptureApplicationTarget = z.infer<typeof tileflowCaptureApplicationTargetSchema>;
|
|
124
|
+
type TileflowCaptureTarget = z.infer<typeof tileflowCaptureTargetSchema>;
|
|
125
|
+
type TileflowCaptureScene = z.infer<typeof tileflowCaptureSceneSchema>;
|
|
126
|
+
type NormalizedTileflowCaptureScene = {
|
|
127
|
+
map: string;
|
|
128
|
+
camera: {
|
|
129
|
+
type: 'center';
|
|
130
|
+
center: [number, number];
|
|
131
|
+
zoom: number;
|
|
132
|
+
bearing: number;
|
|
133
|
+
pitch: number;
|
|
134
|
+
} | {
|
|
135
|
+
type: 'bounds';
|
|
136
|
+
bounds: [number, number, number, number];
|
|
137
|
+
padding: number;
|
|
138
|
+
bearing: number;
|
|
139
|
+
pitch: number;
|
|
140
|
+
};
|
|
141
|
+
viewport: {
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
dpr: 1 | 2;
|
|
145
|
+
};
|
|
146
|
+
target: {
|
|
147
|
+
kind: 'map';
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'application';
|
|
150
|
+
path: string;
|
|
151
|
+
captureId?: string;
|
|
152
|
+
selector?: string;
|
|
153
|
+
frame: 'map' | 'viewport';
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
declare function normalizeTileflowCaptureScene(input: TileflowCaptureScene): NormalizedTileflowCaptureScene;
|
|
157
|
+
declare function normalizeTileflowCaptureId(value: string | undefined): string | undefined;
|
|
158
|
+
|
|
159
|
+
type TileflowDensity = 'clean' | 'balanced' | 'dense';
|
|
160
|
+
type TileflowRoads = 'hidden' | 'soft' | 'standard' | 'detailed';
|
|
161
|
+
type TileflowLabels = 'none' | 'essential' | 'balanced' | 'full';
|
|
162
|
+
type TileflowPoi = 'none' | 'minimal' | 'balanced' | 'full';
|
|
163
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
164
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
165
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
166
|
+
type TileflowPoiCategory = 'food' | 'coffee' | 'culture' | 'transit' | 'shopping' | 'lodging' | 'health' | 'education' | 'services' | (string & {});
|
|
167
|
+
type TileflowPoiIcons = boolean | 'essential' | 'full';
|
|
168
|
+
type TileflowPoiLabels = 'none' | 'minimal' | 'balanced' | 'full';
|
|
169
|
+
type TileflowPoiDensity = 'sparse' | 'balanced' | 'dense';
|
|
170
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
171
|
+
type TileflowPoiClassMapping = Record<string, readonly string[]>;
|
|
172
|
+
type TileflowTheme = 'standard' | 'light' | 'dark' | 'minimal' | 'osm-bright-2';
|
|
173
|
+
type TileflowBuildings = 'hidden' | 'flat' | '3d';
|
|
174
|
+
type TileflowTerrainMode = 'none' | 'hillshade' | '3d';
|
|
175
|
+
type TileflowTerrainEncoding = 'mapbox' | 'terrarium';
|
|
176
|
+
type TileflowRenderer = 'auto' | 'osm-bright' | 'generated';
|
|
177
|
+
type TileflowThemeName = string;
|
|
178
|
+
type TileflowThemeMode = 'light' | 'dark';
|
|
179
|
+
type TileflowColor = `#${string}`;
|
|
180
|
+
type TileflowBaseColors = {
|
|
181
|
+
background: TileflowColor;
|
|
182
|
+
land: TileflowColor;
|
|
183
|
+
water: TileflowColor;
|
|
184
|
+
park: TileflowColor;
|
|
185
|
+
building: TileflowColor;
|
|
186
|
+
road: TileflowColor;
|
|
187
|
+
roadMajor: TileflowColor;
|
|
188
|
+
boundary: TileflowColor;
|
|
189
|
+
text: TileflowColor;
|
|
190
|
+
textMuted: TileflowColor;
|
|
191
|
+
textHalo: TileflowColor;
|
|
192
|
+
};
|
|
193
|
+
type LegacyTileflowColorAliases = {
|
|
194
|
+
accent?: TileflowColor;
|
|
195
|
+
canvas?: TileflowColor;
|
|
196
|
+
background?: TileflowColor;
|
|
197
|
+
greenspace?: TileflowColor;
|
|
198
|
+
nature?: TileflowColor;
|
|
199
|
+
park?: TileflowColor;
|
|
200
|
+
roadCasing?: TileflowColor;
|
|
201
|
+
};
|
|
202
|
+
type TileflowRoadColorConfig = {
|
|
203
|
+
bridge?: TileflowColor;
|
|
204
|
+
casing?: TileflowColor;
|
|
205
|
+
ferry?: TileflowColor;
|
|
206
|
+
minor?: TileflowColor;
|
|
207
|
+
motorway?: TileflowColor;
|
|
208
|
+
path?: TileflowColor;
|
|
209
|
+
primary?: TileflowColor;
|
|
210
|
+
rail?: TileflowColor;
|
|
211
|
+
secondary?: TileflowColor;
|
|
212
|
+
trunk?: TileflowColor;
|
|
213
|
+
tunnel?: TileflowColor;
|
|
214
|
+
};
|
|
215
|
+
type TileflowLabelColorConfig = {
|
|
216
|
+
country?: TileflowColor;
|
|
217
|
+
halo?: TileflowColor;
|
|
218
|
+
muted?: TileflowColor;
|
|
219
|
+
neighborhood?: TileflowColor;
|
|
220
|
+
poi?: TileflowColor;
|
|
221
|
+
primary?: TileflowColor;
|
|
222
|
+
road?: TileflowColor;
|
|
223
|
+
settlement?: TileflowColor;
|
|
224
|
+
water?: TileflowColor;
|
|
225
|
+
};
|
|
226
|
+
type TileflowPoiColorConfig = {
|
|
227
|
+
coffee?: TileflowColor;
|
|
228
|
+
culture?: TileflowColor;
|
|
229
|
+
education?: TileflowColor;
|
|
230
|
+
food?: TileflowColor;
|
|
231
|
+
halo?: TileflowColor;
|
|
232
|
+
health?: TileflowColor;
|
|
233
|
+
icon?: TileflowColor;
|
|
234
|
+
label?: TileflowColor;
|
|
235
|
+
lodging?: TileflowColor;
|
|
236
|
+
services?: TileflowColor;
|
|
237
|
+
shopping?: TileflowColor;
|
|
238
|
+
transit?: TileflowColor;
|
|
239
|
+
};
|
|
240
|
+
type TileflowLanduseColorConfig = {
|
|
241
|
+
cemetery?: TileflowColor;
|
|
242
|
+
civic?: TileflowColor;
|
|
243
|
+
commercial?: TileflowColor;
|
|
244
|
+
industrial?: TileflowColor;
|
|
245
|
+
residential?: TileflowColor;
|
|
246
|
+
};
|
|
247
|
+
type TileflowLandcoverColorConfig = {
|
|
248
|
+
grass?: TileflowColor;
|
|
249
|
+
ice?: TileflowColor;
|
|
250
|
+
park?: TileflowColor;
|
|
251
|
+
protected?: TileflowColor;
|
|
252
|
+
sand?: TileflowColor;
|
|
253
|
+
wood?: TileflowColor;
|
|
254
|
+
};
|
|
255
|
+
type TileflowHydroColorConfig = {
|
|
256
|
+
ferry?: TileflowColor;
|
|
257
|
+
label?: TileflowColor;
|
|
258
|
+
water?: TileflowColor;
|
|
259
|
+
waterway?: TileflowColor;
|
|
260
|
+
};
|
|
261
|
+
type TileflowBuildingColorConfig = {
|
|
262
|
+
extrusion?: TileflowColor;
|
|
263
|
+
fill?: TileflowColor;
|
|
264
|
+
highRise?: TileflowColor;
|
|
265
|
+
highRiseOutline?: TileflowColor;
|
|
266
|
+
lowRise?: TileflowColor;
|
|
267
|
+
lowRiseOutline?: TileflowColor;
|
|
268
|
+
outline?: TileflowColor;
|
|
269
|
+
};
|
|
270
|
+
type TileflowBuildingStyleConfig = {
|
|
271
|
+
fillOpacity?: number;
|
|
272
|
+
heightThreshold?: number;
|
|
273
|
+
outlineOpacity?: number;
|
|
274
|
+
outlineWidth?: number;
|
|
275
|
+
};
|
|
276
|
+
type TileflowBoundaryColorConfig = {
|
|
277
|
+
admin?: TileflowColor;
|
|
278
|
+
disputed?: TileflowColor;
|
|
279
|
+
major?: TileflowColor;
|
|
280
|
+
maritime?: TileflowColor;
|
|
281
|
+
};
|
|
282
|
+
type TileflowAdvancedColorConfig = {
|
|
283
|
+
boundaries?: TileflowBoundaryColorConfig;
|
|
284
|
+
buildings?: TileflowBuildingColorConfig;
|
|
285
|
+
hydro?: TileflowHydroColorConfig;
|
|
286
|
+
labels?: TileflowLabelColorConfig;
|
|
287
|
+
landcover?: TileflowLandcoverColorConfig;
|
|
288
|
+
landuse?: TileflowLanduseColorConfig;
|
|
289
|
+
poi?: TileflowPoiColorConfig;
|
|
290
|
+
roads?: TileflowRoadColorConfig;
|
|
291
|
+
};
|
|
292
|
+
type TileflowThemeModulesConfig = TileflowAdvancedColorConfig;
|
|
293
|
+
type TileflowColorConfig = Partial<TileflowBaseColors> & LegacyTileflowColorAliases & TileflowAdvancedColorConfig;
|
|
294
|
+
type TileflowColors = {
|
|
295
|
+
[K in keyof TileflowBaseColors]: string;
|
|
296
|
+
} & {
|
|
297
|
+
canvas: string;
|
|
298
|
+
greenspace: string;
|
|
299
|
+
nature: string;
|
|
300
|
+
};
|
|
301
|
+
type TileflowFontWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
302
|
+
declare const tileflowHostedNotoSansWeights: readonly ["regular", "bold"];
|
|
303
|
+
type TileflowHostedNotoSansWeight = (typeof tileflowHostedNotoSansWeights)[number];
|
|
304
|
+
type TileflowTypographyStyle = {
|
|
305
|
+
font?: string;
|
|
306
|
+
fontFamily?: string;
|
|
307
|
+
weight?: TileflowFontWeight;
|
|
308
|
+
};
|
|
309
|
+
type TileflowTypographyDomain = 'places' | 'roads' | 'water' | 'poi';
|
|
310
|
+
type TileflowTypography = TileflowTypographyStyle & {
|
|
311
|
+
places?: TileflowTypographyStyle;
|
|
312
|
+
roads?: TileflowTypographyStyle;
|
|
313
|
+
water?: TileflowTypographyStyle;
|
|
314
|
+
poi?: TileflowTypographyStyle;
|
|
315
|
+
};
|
|
316
|
+
type ResolvedTileflowTypography = Required<TileflowTypographyStyle> & {
|
|
317
|
+
places: Required<TileflowTypographyStyle>;
|
|
318
|
+
roads: Required<TileflowTypographyStyle>;
|
|
319
|
+
water: Required<TileflowTypographyStyle>;
|
|
320
|
+
poi: Required<TileflowTypographyStyle>;
|
|
321
|
+
};
|
|
322
|
+
type TileflowFonts = {
|
|
323
|
+
body?: string;
|
|
324
|
+
labels?: string;
|
|
325
|
+
};
|
|
326
|
+
type TileflowThemeConfig = {
|
|
327
|
+
colors?: TileflowColorConfig;
|
|
328
|
+
extends?: string;
|
|
329
|
+
fonts?: TileflowFonts;
|
|
330
|
+
layers?: Record<string, TileflowStyleLayerOverride>;
|
|
331
|
+
mode?: TileflowThemeMode;
|
|
332
|
+
modules?: TileflowThemeModulesConfig;
|
|
333
|
+
typography?: TileflowTypography;
|
|
334
|
+
};
|
|
335
|
+
type TileflowSourceLayers = {
|
|
336
|
+
landcover?: string;
|
|
337
|
+
landuse?: string;
|
|
338
|
+
park?: string;
|
|
339
|
+
water?: string;
|
|
340
|
+
waterName?: string;
|
|
341
|
+
waterway?: string;
|
|
342
|
+
road?: string;
|
|
343
|
+
roadName?: string;
|
|
344
|
+
building?: string;
|
|
345
|
+
boundary?: string;
|
|
346
|
+
place?: string;
|
|
347
|
+
poi?: string;
|
|
348
|
+
};
|
|
349
|
+
type TileflowTiles = {
|
|
350
|
+
sourceId?: string;
|
|
351
|
+
tileset?: string;
|
|
352
|
+
url?: string;
|
|
353
|
+
attribution?: string;
|
|
354
|
+
sourceLayers?: TileflowSourceLayers;
|
|
355
|
+
version?: string;
|
|
356
|
+
};
|
|
357
|
+
type TileflowTerrainConfig = {
|
|
358
|
+
attribution?: string;
|
|
359
|
+
encoding?: TileflowTerrainEncoding;
|
|
360
|
+
exaggeration?: number;
|
|
361
|
+
mode?: TileflowTerrainMode;
|
|
362
|
+
sourceId?: string;
|
|
363
|
+
tileset?: string;
|
|
364
|
+
url?: string;
|
|
365
|
+
};
|
|
366
|
+
type TileflowTerrain = TileflowTerrainMode | TileflowTerrainConfig;
|
|
367
|
+
type TileflowViewConfig = {
|
|
368
|
+
bearing?: number;
|
|
369
|
+
center?: readonly [number, number];
|
|
370
|
+
zoom?: number;
|
|
371
|
+
};
|
|
372
|
+
type TileflowOsmBasemapConfig = {
|
|
373
|
+
type: 'osm';
|
|
374
|
+
attribution?: string;
|
|
375
|
+
glyphs?: string;
|
|
376
|
+
sourceId?: string;
|
|
377
|
+
sourceLayers?: TileflowSourceLayers;
|
|
378
|
+
sprite?: string;
|
|
379
|
+
tileset?: string;
|
|
380
|
+
url?: string;
|
|
381
|
+
version?: string;
|
|
382
|
+
};
|
|
383
|
+
type TileflowBasemapConfig = TileflowOsmBasemapConfig;
|
|
384
|
+
type TileflowOsmBasemapOptions = Omit<TileflowOsmBasemapConfig, 'type'>;
|
|
385
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
386
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'path';
|
|
387
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
388
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
389
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
390
|
+
type TileflowRoadExtras = {
|
|
391
|
+
ferry?: boolean;
|
|
392
|
+
paths?: boolean;
|
|
393
|
+
rail?: boolean;
|
|
394
|
+
};
|
|
395
|
+
type TileflowRoadsModuleConfig = {
|
|
396
|
+
type: 'roads';
|
|
397
|
+
detail?: TileflowRoadDetail;
|
|
398
|
+
extras?: TileflowRoadExtras;
|
|
399
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
400
|
+
oneWayMarkers?: boolean;
|
|
401
|
+
outline?: TileflowRoadOutline;
|
|
402
|
+
weight?: TileflowRoadWeight;
|
|
403
|
+
widthScale?: Partial<Record<TileflowRoadClass, number>>;
|
|
404
|
+
};
|
|
405
|
+
type TileflowRoadsModuleOptions = Omit<TileflowRoadsModuleConfig, 'type'>;
|
|
406
|
+
type TileflowLabelsModuleConfig = {
|
|
407
|
+
type: 'labels';
|
|
408
|
+
language?: TileflowLabelLanguage;
|
|
409
|
+
places?: TileflowLabelDetail;
|
|
410
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
411
|
+
roads?: TileflowRoadLabelDetail;
|
|
412
|
+
water?: TileflowLabelDetail;
|
|
413
|
+
};
|
|
414
|
+
type TileflowLabelsModuleOptions = Omit<TileflowLabelsModuleConfig, 'type'>;
|
|
415
|
+
type TileflowPoiModuleConfig = {
|
|
416
|
+
type: 'poi';
|
|
417
|
+
categories?: readonly TileflowPoiCategory[];
|
|
418
|
+
classMapping?: TileflowPoiClassMapping;
|
|
419
|
+
color?: TileflowPoiColorMode;
|
|
420
|
+
density?: TileflowPoiDensity;
|
|
421
|
+
icons?: TileflowPoiIcons;
|
|
422
|
+
labels?: TileflowPoiLabels;
|
|
423
|
+
minZoom?: number;
|
|
424
|
+
placement?: {
|
|
425
|
+
coupleIconAndLabel?: boolean;
|
|
426
|
+
iconPadding?: number;
|
|
427
|
+
textPadding?: number;
|
|
428
|
+
};
|
|
429
|
+
preset?: TileflowPoi;
|
|
430
|
+
};
|
|
431
|
+
type TileflowPoiModuleOptions = Omit<TileflowPoiModuleConfig, 'type'>;
|
|
432
|
+
type TileflowIconSetConfig = {
|
|
433
|
+
extends?: string;
|
|
434
|
+
mapping?: Record<string, string>;
|
|
435
|
+
source?: string;
|
|
436
|
+
sprite?: string;
|
|
437
|
+
};
|
|
438
|
+
type TileflowIconSet = string | TileflowIconSetConfig;
|
|
439
|
+
type TileflowProjectIconSets = Record<string, TileflowIconSet>;
|
|
440
|
+
type MapLibreSprite = string | Array<{
|
|
441
|
+
id: string;
|
|
442
|
+
url: string;
|
|
443
|
+
}>;
|
|
444
|
+
type TileflowStyleLayerOverride = Record<string, unknown> & {
|
|
445
|
+
before?: string;
|
|
446
|
+
filter?: unknown;
|
|
447
|
+
layout?: Record<string, unknown>;
|
|
448
|
+
maxzoom?: number;
|
|
449
|
+
metadata?: Record<string, unknown>;
|
|
450
|
+
minzoom?: number;
|
|
451
|
+
paint?: Record<string, unknown>;
|
|
452
|
+
source?: string;
|
|
453
|
+
'source-layer'?: string;
|
|
454
|
+
type?: string;
|
|
455
|
+
};
|
|
456
|
+
type TileflowStyleOverrideModuleConfig = {
|
|
457
|
+
type: 'styleOverride';
|
|
458
|
+
layers?: Record<string, TileflowStyleLayerOverride>;
|
|
459
|
+
removeLayers?: string[];
|
|
460
|
+
};
|
|
461
|
+
type TileflowStyleOverrideOptions = Omit<TileflowStyleOverrideModuleConfig, 'type'>;
|
|
462
|
+
type TileflowModuleConfig = TileflowLabelsModuleConfig | TileflowPoiModuleConfig | TileflowRoadsModuleConfig | TileflowStyleOverrideModuleConfig;
|
|
463
|
+
type TileflowConfig = {
|
|
464
|
+
basemap?: TileflowBasemapConfig;
|
|
465
|
+
name?: string;
|
|
466
|
+
tileset?: string;
|
|
467
|
+
theme?: TileflowTheme | string | TileflowThemeConfig;
|
|
468
|
+
modules?: readonly TileflowModuleConfig[];
|
|
469
|
+
layers?: Record<string, TileflowStyleLayerOverride>;
|
|
470
|
+
colors?: TileflowColorConfig;
|
|
471
|
+
typography?: TileflowTypography;
|
|
472
|
+
density?: TileflowDensity;
|
|
473
|
+
roads?: TileflowRoads;
|
|
474
|
+
labels?: TileflowLabels;
|
|
475
|
+
poi?: TileflowPoi;
|
|
476
|
+
buildings?: TileflowBuildings;
|
|
477
|
+
buildingStyle?: TileflowBuildingStyleConfig;
|
|
478
|
+
terrain?: TileflowTerrain;
|
|
479
|
+
renderer?: TileflowRenderer;
|
|
480
|
+
glyphs?: string;
|
|
481
|
+
icons?: TileflowIconSet;
|
|
482
|
+
sprite?: string;
|
|
483
|
+
tiles?: TileflowTiles;
|
|
484
|
+
view?: TileflowViewConfig;
|
|
485
|
+
/**
|
|
486
|
+
* Domains allowed to load this map in production (e.g. "example.com" or
|
|
487
|
+
* "*.example.com"). When set, tile and session requests from other
|
|
488
|
+
* websites are rejected. Local development (localhost, private network
|
|
489
|
+
* addresses) is always allowed. Leave unset to allow any domain.
|
|
490
|
+
*/
|
|
491
|
+
allowedOrigins?: string[];
|
|
492
|
+
};
|
|
493
|
+
type TileflowMapConfig = TileflowConfig;
|
|
494
|
+
type TileflowTilesetConfig = {
|
|
495
|
+
id?: string;
|
|
496
|
+
name?: string;
|
|
497
|
+
attribution?: string;
|
|
498
|
+
sourceLayers?: TileflowSourceLayers;
|
|
499
|
+
version?: string;
|
|
500
|
+
};
|
|
501
|
+
type TileflowProjectThemes = Record<TileflowThemeName, TileflowThemeConfig>;
|
|
502
|
+
type TileflowProjectConfig = {
|
|
503
|
+
icons?: TileflowProjectIconSets;
|
|
504
|
+
scenes?: Record<string, TileflowCaptureScene>;
|
|
505
|
+
themes?: TileflowProjectThemes;
|
|
506
|
+
tilesets?: Record<string, TileflowTilesetConfig>;
|
|
507
|
+
maps: Record<string, TileflowMapConfig>;
|
|
508
|
+
};
|
|
509
|
+
type TileflowStyleOptions = {
|
|
510
|
+
iconSets?: TileflowProjectIconSets;
|
|
511
|
+
themes?: TileflowProjectThemes;
|
|
512
|
+
tileBaseUrl?: string;
|
|
513
|
+
tileset?: string;
|
|
514
|
+
};
|
|
515
|
+
type TileflowManifest = {
|
|
516
|
+
version: 1;
|
|
517
|
+
tileBaseUrl: string;
|
|
518
|
+
styles: Record<string, string>;
|
|
519
|
+
maps: Record<string, string>;
|
|
520
|
+
};
|
|
521
|
+
type MapLibreStyle = {
|
|
522
|
+
version: 8;
|
|
523
|
+
name: string;
|
|
524
|
+
glyphs?: string;
|
|
525
|
+
sprite?: MapLibreSprite;
|
|
526
|
+
sources: Record<string, Record<string, unknown>>;
|
|
527
|
+
layers: Array<Record<string, unknown>>;
|
|
528
|
+
terrain?: Record<string, unknown>;
|
|
529
|
+
metadata?: Record<string, unknown>;
|
|
530
|
+
};
|
|
531
|
+
type ValidationMessage = {
|
|
532
|
+
level: 'error' | 'warning';
|
|
533
|
+
path: string;
|
|
534
|
+
message: string;
|
|
535
|
+
};
|
|
536
|
+
type ValidationResult = {
|
|
537
|
+
valid: boolean;
|
|
538
|
+
messages: ValidationMessage[];
|
|
539
|
+
};
|
|
540
|
+
declare function createStyle(input?: TileflowConfig, options?: TileflowStyleOptions): MapLibreStyle;
|
|
541
|
+
declare function createStyleFromProject<const TProject extends TileflowProjectConfig, const TMapName extends keyof TProject['maps'] & string>(projectConfig: TProject, mapName: TMapName, options?: TileflowStyleOptions): MapLibreStyle;
|
|
542
|
+
declare function createManifest(projectConfig: TileflowProjectConfig, options?: {
|
|
543
|
+
styleBaseUrl?: string;
|
|
544
|
+
tileBaseUrl?: string;
|
|
545
|
+
}): TileflowManifest;
|
|
546
|
+
declare function getDefaultColors(): TileflowColors;
|
|
547
|
+
|
|
548
|
+
declare const defaultTileflowManifestUrl = "/tileflow/manifest.json";
|
|
549
|
+
declare const defaultTileflowStyleBaseUrl = "http://localhost:3333";
|
|
550
|
+
type TileflowAnalytics = {
|
|
551
|
+
apiUrl?: string;
|
|
552
|
+
endpoint?: string;
|
|
553
|
+
enabled?: boolean;
|
|
554
|
+
mapId?: string;
|
|
555
|
+
metadata?: Record<string, unknown>;
|
|
556
|
+
projectId?: string;
|
|
557
|
+
sdkVersion?: string;
|
|
558
|
+
source?: string;
|
|
559
|
+
styleId?: string;
|
|
560
|
+
};
|
|
561
|
+
type TileflowSessionGrantResponse = {
|
|
562
|
+
billingEnabled?: false;
|
|
563
|
+
disposition?: 'ordinary' | 'unbilled_fail_open';
|
|
564
|
+
expiresAt?: string;
|
|
565
|
+
grant?: string;
|
|
566
|
+
meterMode?: 'disabled' | 'shadow' | 'enforced';
|
|
567
|
+
ok: boolean;
|
|
568
|
+
resourceOrigins?: string[];
|
|
569
|
+
sessionId: string;
|
|
570
|
+
usageMode?: 'session';
|
|
571
|
+
code?: string;
|
|
572
|
+
retryWithNewSession?: boolean;
|
|
573
|
+
};
|
|
574
|
+
type TileflowSessionController = {
|
|
575
|
+
readonly sessionId: string;
|
|
576
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
577
|
+
};
|
|
578
|
+
type TileflowMapMarker = {
|
|
579
|
+
id: string;
|
|
580
|
+
coordinates: [number, number];
|
|
581
|
+
color?: string;
|
|
582
|
+
label?: string;
|
|
583
|
+
};
|
|
584
|
+
type TileflowMapMode = 'interactive' | 'image';
|
|
585
|
+
type TileflowMapModeOptions = {
|
|
586
|
+
imageUrl?: string;
|
|
587
|
+
mode?: TileflowMapMode;
|
|
588
|
+
preferLocalDev?: boolean;
|
|
589
|
+
};
|
|
590
|
+
type TileflowRuntimeManifestMapEntry = string | {
|
|
591
|
+
apiUrl?: string;
|
|
592
|
+
environment?: string;
|
|
593
|
+
mapId?: string;
|
|
594
|
+
styleId?: string;
|
|
595
|
+
styleUrl?: string;
|
|
596
|
+
tilesetId?: string;
|
|
597
|
+
url?: string;
|
|
598
|
+
};
|
|
599
|
+
type TileflowRuntimeManifest = {
|
|
600
|
+
apiUrl?: string;
|
|
601
|
+
maps?: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
602
|
+
styles?: Record<string, string>;
|
|
603
|
+
tileBaseUrl?: string;
|
|
604
|
+
version?: number;
|
|
605
|
+
};
|
|
606
|
+
type TileflowRuntimeManifestMap = {
|
|
607
|
+
apiUrl?: string;
|
|
608
|
+
mapId?: string;
|
|
609
|
+
styleId?: string;
|
|
610
|
+
styleUrl?: string;
|
|
611
|
+
};
|
|
612
|
+
type TileflowRuntimeStyle = {
|
|
613
|
+
analytics?: TileflowAnalytics;
|
|
614
|
+
style: MapLibreStyle | string;
|
|
615
|
+
};
|
|
616
|
+
type TileflowRuntimeStyleOptions = {
|
|
617
|
+
config?: TileflowConfig;
|
|
618
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
619
|
+
map?: string;
|
|
620
|
+
preferLocalDev?: boolean;
|
|
621
|
+
style?: MapLibreStyle;
|
|
622
|
+
styleBaseUrl?: string;
|
|
623
|
+
styleUrl?: string;
|
|
624
|
+
themes?: TileflowProjectThemes;
|
|
625
|
+
tileBaseUrl?: string;
|
|
626
|
+
};
|
|
627
|
+
type TileflowManifestLoadOptions = {
|
|
628
|
+
config?: unknown;
|
|
629
|
+
imageMode?: boolean;
|
|
630
|
+
imageUrl?: string;
|
|
631
|
+
map?: string;
|
|
632
|
+
style?: unknown;
|
|
633
|
+
styleBaseUrl?: string;
|
|
634
|
+
styleUrl?: string;
|
|
635
|
+
};
|
|
636
|
+
declare function shouldLoadTileflowManifest(options: TileflowManifestLoadOptions): boolean;
|
|
637
|
+
declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
|
|
638
|
+
declare function resolveTileflowStyleUrl(mapName: string, styleBaseUrl?: string): string;
|
|
639
|
+
declare function getDefaultTileflowStyleBaseUrl(): string;
|
|
640
|
+
declare function normalizeTileflowUrl(value: string): string;
|
|
641
|
+
declare function createTileflowSessionId(): string;
|
|
642
|
+
declare function createTileflowSessionController(input: {
|
|
643
|
+
fetch?: typeof fetch;
|
|
644
|
+
grantTimeoutMs?: number;
|
|
645
|
+
now?: () => Date;
|
|
646
|
+
sessionIdFactory?: () => string;
|
|
647
|
+
source: string;
|
|
648
|
+
}): TileflowSessionController;
|
|
649
|
+
declare function resolveTileflowAnalyticsRequestUrl(url: string, analytics: TileflowAnalytics | undefined, sessionId: string): string | undefined;
|
|
650
|
+
declare function startTileflowSession(analytics: TileflowAnalytics | undefined, input: {
|
|
651
|
+
mapId?: string;
|
|
652
|
+
sessionId: string;
|
|
653
|
+
source: string;
|
|
654
|
+
styleId?: string;
|
|
655
|
+
}): void;
|
|
656
|
+
declare function getTileflowAnalyticsApiUrl(analytics: TileflowAnalytics): string;
|
|
657
|
+
declare function mergeTileflowAnalytics(userAnalytics: TileflowAnalytics | undefined, runtimeAnalytics: TileflowAnalytics | undefined): TileflowAnalytics | undefined;
|
|
658
|
+
declare function isTileflowLocalDevHost(): boolean;
|
|
659
|
+
declare function resolveTileflowMapMode(options: TileflowMapModeOptions): TileflowMapMode;
|
|
660
|
+
declare function loadTileflowManifest(url: string): Promise<TileflowRuntimeManifest | null>;
|
|
661
|
+
declare function resolveTileflowManifestMap(manifest: TileflowRuntimeManifest, mapName: string): TileflowRuntimeManifestMap | null;
|
|
662
|
+
declare function resolveTileflowStaticImageUrl(input: {
|
|
663
|
+
center: [number, number];
|
|
664
|
+
imageSize: {
|
|
665
|
+
height: number;
|
|
666
|
+
width: number;
|
|
667
|
+
} | null;
|
|
668
|
+
manifestMap: TileflowRuntimeManifestMap | null;
|
|
669
|
+
zoom: number;
|
|
670
|
+
}): string | undefined;
|
|
671
|
+
declare function normalizeTileflowStaticImageSize(input: {
|
|
672
|
+
height: number;
|
|
673
|
+
width: number;
|
|
674
|
+
}): {
|
|
675
|
+
height: number;
|
|
676
|
+
width: number;
|
|
677
|
+
};
|
|
678
|
+
declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
|
|
679
|
+
|
|
680
|
+
export { type TileflowMapMarker as $, type TileflowCaptureScene as A, type TileflowCaptureTarget as B, type TileflowCaptureViewport as C, type TileflowColor as D, type TileflowColorConfig as E, type TileflowColors as F, type TileflowDensity as G, type TileflowFontWeight as H, type TileflowFonts as I, type TileflowHostedNotoSansWeight as J, type TileflowHydroColorConfig as K, type TileflowIconSet as L, type MapLibreSprite as M, type NormalizedTileflowCaptureScene as N, type TileflowIconSetConfig as O, type TileflowLabelColorConfig as P, type TileflowLabelDetail as Q, type ResolvedTileflowTypography as R, type TileflowLabelLanguage as S, type TileflowAnalytics as T, type TileflowLabels as U, type ValidationResult as V, type TileflowLandcoverColorConfig as W, type TileflowLanduseColorConfig as X, type TileflowManifest as Y, type TileflowManifestLoadOptions as Z, type TileflowMapConfig as _, type TileflowSessionController as a, normalizeTileflowCaptureScene as a$, type TileflowMapMode as a0, type TileflowMapModeOptions as a1, type TileflowModuleConfig as a2, type TileflowPoi as a3, type TileflowPoiCategory as a4, type TileflowPoiClassMapping as a5, type TileflowPoiColorConfig as a6, type TileflowPoiColorMode as a7, type TileflowPoiDensity as a8, type TileflowPoiIcons as a9, type TileflowTheme as aA, type TileflowThemeConfig as aB, type TileflowThemeMode as aC, type TileflowThemeModulesConfig as aD, type TileflowThemeName as aE, type TileflowTiles as aF, type TileflowTilesetConfig as aG, type TileflowTypography as aH, type TileflowTypographyDomain as aI, type TileflowTypographyStyle as aJ, type TileflowViewConfig as aK, type ValidationMessage as aL, createManifest as aM, createStyle as aN, createStyleFromProject as aO, createTileflowSessionController as aP, createTileflowSessionId as aQ, defaultTileflowManifestUrl as aR, defaultTileflowStyleBaseUrl as aS, getDefaultColors as aT, getDefaultTileflowStyleBaseUrl as aU, getTileflowAnalyticsApiUrl as aV, inferTileflowAnalyticsFromStyleUrl as aW, isTileflowLocalDevHost as aX, loadTileflowManifest as aY, mergeTileflowAnalytics as aZ, normalizeTileflowCaptureId as a_, type TileflowPoiLabels as aa, type TileflowProjectIconSets as ab, type TileflowProjectThemes as ac, type TileflowRenderer as ad, type TileflowRoadClass as ae, type TileflowRoadColorConfig as af, type TileflowRoadDetail as ag, type TileflowRoadExtras as ah, type TileflowRoadHierarchy as ai, type TileflowRoadLabelDetail as aj, type TileflowRoadOutline as ak, type TileflowRoadWeight as al, type TileflowRoads as am, type TileflowRuntimeManifest as an, type TileflowRuntimeManifestMap as ao, type TileflowRuntimeManifestMapEntry as ap, type TileflowRuntimeStyle as aq, type TileflowRuntimeStyleOptions as ar, type TileflowSessionGrantResponse as as, type TileflowSourceLayers as at, type TileflowStyleLayerOverride as au, type TileflowStyleOptions as av, type TileflowTerrain as aw, type TileflowTerrainConfig as ax, type TileflowTerrainEncoding as ay, type TileflowTerrainMode as az, type TileflowConfig as b, normalizeTileflowStaticImageSize as b0, normalizeTileflowUrl as b1, resolveTileflowAnalyticsRequestUrl as b2, resolveTileflowManifestMap as b3, resolveTileflowMapMode as b4, resolveTileflowRuntimeStyle as b5, resolveTileflowStaticImageUrl as b6, resolveTileflowStyleUrl as b7, shouldLoadTileflowManifest as b8, startTileflowSession as b9, tileflowCaptureApplicationTargetSchema as ba, tileflowCaptureBoundsCameraSchema as bb, tileflowCaptureCameraSchema as bc, tileflowCaptureCenterCameraSchema as bd, tileflowCaptureIdSchema as be, tileflowCaptureMapTargetSchema as bf, tileflowCaptureSceneLimits as bg, tileflowCaptureSceneNameSchema as bh, tileflowCaptureSceneSchema as bi, tileflowCaptureSceneSchemaVersion as bj, tileflowCaptureTargetSchema as bk, tileflowCaptureViewportSchema as bl, tileflowHostedNotoSansWeights as bm, type TileflowProjectConfig as c, type TileflowOsmBasemapOptions as d, type TileflowOsmBasemapConfig as e, type TileflowRoadsModuleOptions as f, type TileflowRoadsModuleConfig as g, type TileflowLabelsModuleOptions as h, type TileflowLabelsModuleConfig as i, type TileflowPoiModuleOptions as j, type TileflowPoiModuleConfig as k, type TileflowStyleOverrideOptions as l, type TileflowStyleOverrideModuleConfig as m, type MapLibreStyle as n, type TileflowAdvancedColorConfig as o, type TileflowBaseColors as p, type TileflowBasemapConfig as q, type TileflowBoundaryColorConfig as r, type TileflowBuildingColorConfig as s, type TileflowBuildingStyleConfig as t, type TileflowBuildings as u, type TileflowCaptureApplicationTarget as v, type TileflowCaptureBoundsCamera as w, type TileflowCaptureCamera as x, type TileflowCaptureCenterCamera as y, type TileflowCaptureMapTarget as z };
|