@tileflow/core 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +201 -72
- package/THIRD_PARTY_NOTICES.md +60 -2
- package/dist/browser.d.ts +82 -16
- package/dist/browser.js +1234 -267
- package/dist/build.d.ts +19 -56
- package/dist/build.js +10915 -8333
- package/dist/config-reference.json +31882 -0
- package/dist/index.d.ts +476 -13
- package/dist/index.js +12409 -8832
- package/dist/{types-DlUGI6LC.d.ts → manifest-B5GKVMFE.d.ts} +252 -20
- package/dist/manifest.d.ts +1 -2
- package/dist/manifest.js +18 -2
- package/dist/map-BHL_0Mkx.d.ts +1145 -0
- package/dist/runtime.d.ts +1 -2
- package/dist/runtime.js +60 -5
- package/package.json +5 -8
- package/dist/domains-CPSrdTik.d.ts +0 -4
- package/dist/recipe.d.ts +0 -66
- package/dist/recipe.js +0 -577
- package/dist/requirements-BV77ZVhR.d.ts +0 -491
- package/dist/runtime-C4MtSzkB.d.ts +0 -223
- package/dist/visual-semantics-DTC-8Hsb.d.ts +0 -479
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
declare const expressionBrand: unique symbol;
|
|
2
|
-
declare const filterBrand: unique symbol;
|
|
3
4
|
declare const themeValueBrand: unique symbol;
|
|
4
5
|
declare const zoomBrand: unique symbol;
|
|
5
|
-
|
|
6
|
+
declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
|
|
7
|
+
type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
|
|
6
8
|
type TileflowThemeTokenPrimitive = {
|
|
7
9
|
color: string;
|
|
8
10
|
font: string;
|
|
@@ -64,30 +66,28 @@ declare const color: {
|
|
|
64
66
|
type TileflowExpression<T> = {
|
|
65
67
|
readonly kind: 'expression';
|
|
66
68
|
readonly value: readonly unknown[];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type TileflowFilterExpression = {
|
|
70
|
-
readonly kind: 'filter';
|
|
71
|
-
readonly value: readonly unknown[];
|
|
72
|
-
readonly [filterBrand]?: true;
|
|
69
|
+
/** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
|
|
70
|
+
readonly [expressionBrand]: T;
|
|
73
71
|
};
|
|
74
72
|
type TileflowZoomInterpolation = 'linear' | 'exponential';
|
|
75
|
-
type
|
|
76
|
-
readonly base?: number;
|
|
77
|
-
readonly interpolation: TileflowZoomInterpolation | 'step';
|
|
73
|
+
type TileflowZoomValueCommon<T> = {
|
|
78
74
|
readonly kind: 'zoom';
|
|
79
75
|
readonly stops: readonly (readonly [number, T])[];
|
|
80
76
|
readonly [zoomBrand]?: T;
|
|
81
77
|
};
|
|
78
|
+
type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
|
|
79
|
+
readonly base: number;
|
|
80
|
+
readonly interpolation: 'exponential';
|
|
81
|
+
} | {
|
|
82
|
+
readonly base?: never;
|
|
83
|
+
readonly interpolation: 'linear' | 'step';
|
|
84
|
+
});
|
|
82
85
|
type TileflowStyleValue<T> = TileflowExpression<T> | TileflowThemeValue<T> | TileflowZoomValue<TileflowThemeValue<T>>;
|
|
83
86
|
declare const zoom: {
|
|
84
87
|
exponential<T>(base: number, stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
85
88
|
linear<T>(stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
86
89
|
step<T>(stops: readonly (readonly [number, T])[]): TileflowZoomValue<T>;
|
|
87
90
|
};
|
|
88
|
-
declare function expression<T>(value: readonly unknown[]): TileflowExpression<T>;
|
|
89
|
-
declare function filter(value: readonly unknown[]): TileflowFilterExpression;
|
|
90
|
-
declare function toMapLibreStyleValue<T>(value: TileflowStyleValue<T>): T | unknown[];
|
|
91
91
|
|
|
92
92
|
/** A color literal, semantic color token, color operation, expression, or zoom ramp. */
|
|
93
93
|
type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
|
|
@@ -121,6 +121,7 @@ type TileflowLineCap = 'butt' | 'round' | 'square';
|
|
|
121
121
|
type TileflowLineJoin = 'bevel' | 'miter' | 'round';
|
|
122
122
|
type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
|
|
123
123
|
type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
|
|
124
|
+
type TileflowPriorityOrder = 'higher-first' | 'lower-first';
|
|
124
125
|
type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
|
|
125
126
|
type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
|
|
126
127
|
type TileflowIconAnchor = TileflowTextAnchor;
|
|
@@ -143,6 +144,8 @@ type TileflowFillPaint = {
|
|
|
143
144
|
color?: TileflowColorStyleValue;
|
|
144
145
|
opacity?: TileflowNumberStyleValue;
|
|
145
146
|
pattern?: TileflowImageStyleValue;
|
|
147
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
148
|
+
translateAnchor?: 'map' | 'viewport';
|
|
146
149
|
};
|
|
147
150
|
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
148
151
|
type TileflowLinePaint = {
|
|
@@ -153,6 +156,8 @@ type TileflowLinePaint = {
|
|
|
153
156
|
offset?: TileflowNumberStyleValue;
|
|
154
157
|
opacity?: TileflowNumberStyleValue;
|
|
155
158
|
pattern?: TileflowImageStyleValue;
|
|
159
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
160
|
+
translateAnchor?: 'map' | 'viewport';
|
|
156
161
|
width?: TileflowNumberStyleValue;
|
|
157
162
|
};
|
|
158
163
|
type TileflowLineLayout = {
|
|
@@ -238,6 +243,8 @@ type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLa
|
|
|
238
243
|
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
239
244
|
placement?: TileflowSymbolPlacement;
|
|
240
245
|
priority?: TileflowStructuralStyleValue<number>;
|
|
246
|
+
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
247
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
241
248
|
spacing?: TileflowNumberStyleValue;
|
|
242
249
|
zOrder?: TileflowSymbolZOrder;
|
|
243
250
|
};
|
|
@@ -247,10 +254,15 @@ type TileflowCirclePaint = {
|
|
|
247
254
|
opacity?: TileflowNumberStyleValue;
|
|
248
255
|
pitchAlignment?: 'map' | 'viewport';
|
|
249
256
|
pitchScale?: 'map' | 'viewport';
|
|
257
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
258
|
+
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
259
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
250
260
|
radius?: TileflowNumberStyleValue;
|
|
251
261
|
strokeColor?: TileflowColorStyleValue;
|
|
252
262
|
strokeOpacity?: TileflowNumberStyleValue;
|
|
253
263
|
strokeWidth?: TileflowNumberStyleValue;
|
|
264
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
265
|
+
translateAnchor?: 'map' | 'viewport';
|
|
254
266
|
};
|
|
255
267
|
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
256
268
|
type TileflowExtrusionPaint = {
|
|
@@ -276,9 +288,12 @@ type TileflowLineStackStyle = {
|
|
|
276
288
|
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
277
289
|
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
278
290
|
icon?: TileflowIconStyle;
|
|
279
|
-
marker?: TileflowCircleStyle;
|
|
280
291
|
text?: TileflowTextStyle;
|
|
281
292
|
};
|
|
293
|
+
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
294
|
+
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
295
|
+
marker?: TileflowCircleStyle;
|
|
296
|
+
};
|
|
282
297
|
|
|
283
298
|
type TileflowColor = `#${string}`;
|
|
284
299
|
type TileflowTypographyStyle = {
|
|
@@ -408,7 +423,6 @@ type TileflowRoadsModuleConfig = {
|
|
|
408
423
|
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
409
424
|
crossings?: TileflowRoadCrossingStyle;
|
|
410
425
|
detail?: TileflowRoadDetail;
|
|
411
|
-
enabled?: boolean;
|
|
412
426
|
extras?: TileflowRoadExtras;
|
|
413
427
|
hierarchy?: TileflowRoadHierarchy;
|
|
414
428
|
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
@@ -431,6 +445,7 @@ type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
|
431
445
|
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
432
446
|
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
433
447
|
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
448
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
434
449
|
type TileflowRoadShieldStyles = {
|
|
435
450
|
default?: TileflowSymbolStyle;
|
|
436
451
|
detail?: TileflowSymbolStyle;
|
|
@@ -453,7 +468,7 @@ type TileflowLabelStyles = {
|
|
|
453
468
|
type TileflowLabelsModuleConfig = {
|
|
454
469
|
type: 'labels';
|
|
455
470
|
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
456
|
-
|
|
471
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
457
472
|
junctions?: boolean;
|
|
458
473
|
language?: TileflowLabelLanguage;
|
|
459
474
|
places?: TileflowLabelDetail;
|
|
@@ -469,13 +484,15 @@ declare const tileflowPoiCategories: readonly ["arts-entertainment", "education"
|
|
|
469
484
|
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
470
485
|
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
471
486
|
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
472
|
-
type TileflowPoiCategoryStyle = Omit<
|
|
487
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
|
|
488
|
+
/** Optional category-local cap within the module's canonical density tiers. */
|
|
489
|
+
density?: TileflowPoiDensity;
|
|
490
|
+
};
|
|
473
491
|
type TileflowPoiModuleConfig = {
|
|
474
492
|
type: 'poi';
|
|
475
493
|
categories?: readonly TileflowPoiCategory[];
|
|
476
494
|
color?: TileflowPoiColorMode;
|
|
477
495
|
density?: TileflowPoiDensity;
|
|
478
|
-
enabled?: boolean;
|
|
479
496
|
icons?: boolean;
|
|
480
497
|
labels?: boolean;
|
|
481
498
|
minZoom?: number;
|
|
@@ -522,4 +539,219 @@ type ValidationResult = {
|
|
|
522
539
|
messages: ValidationMessage[];
|
|
523
540
|
};
|
|
524
541
|
|
|
525
|
-
|
|
542
|
+
declare const defaultTileflowManifestUrl = "/tileflow/manifest.json";
|
|
543
|
+
declare const defaultTileflowRuntimeView: Readonly<{
|
|
544
|
+
bearing: 0;
|
|
545
|
+
center: readonly [number, number];
|
|
546
|
+
pitch: 0;
|
|
547
|
+
zoom: 2;
|
|
548
|
+
}>;
|
|
549
|
+
type TileflowAnalytics = {
|
|
550
|
+
apiUrl?: string;
|
|
551
|
+
endpoint?: string;
|
|
552
|
+
enabled?: boolean;
|
|
553
|
+
mapId?: string;
|
|
554
|
+
metadata?: Record<string, unknown>;
|
|
555
|
+
projectId?: string;
|
|
556
|
+
sdkVersion?: string;
|
|
557
|
+
source?: string;
|
|
558
|
+
styleId?: string;
|
|
559
|
+
surfaceId?: string;
|
|
560
|
+
};
|
|
561
|
+
declare function normalizeTileflowSurfaceId(value: unknown): string;
|
|
562
|
+
type TileflowSessionGrantResponse = {
|
|
563
|
+
billingEnabled?: false;
|
|
564
|
+
disposition?: 'ordinary' | 'unbilled_fail_open';
|
|
565
|
+
expiresAt?: string;
|
|
566
|
+
grant?: string;
|
|
567
|
+
meterMode?: 'disabled' | 'shadow' | 'enforced';
|
|
568
|
+
ok: boolean;
|
|
569
|
+
resourceOrigins?: string[];
|
|
570
|
+
sessionId: string;
|
|
571
|
+
usageMode?: 'session';
|
|
572
|
+
code?: string;
|
|
573
|
+
retryWithNewSession?: boolean;
|
|
574
|
+
};
|
|
575
|
+
type TileflowSessionController = {
|
|
576
|
+
readonly sessionId: string;
|
|
577
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
578
|
+
};
|
|
579
|
+
type TileflowMapMode = 'interactive' | 'image';
|
|
580
|
+
type TileflowMapModeOptions = {
|
|
581
|
+
mode?: TileflowMapMode;
|
|
582
|
+
};
|
|
583
|
+
/** Runtime-ready logical map with all relative theme resources already resolved. */
|
|
584
|
+
type TileflowRuntimeManifestMap = TileflowRuntimeManifestMapEntry & {
|
|
585
|
+
apiUrl?: string;
|
|
586
|
+
name: string;
|
|
587
|
+
};
|
|
588
|
+
/** `system` is a selector and therefore reserved as a published theme name. */
|
|
589
|
+
type TileflowThemeSelection = string | 'system';
|
|
590
|
+
type TileflowResolvedRuntimeTheme = TileflowRuntimeManifestTheme & {
|
|
591
|
+
name: string;
|
|
592
|
+
};
|
|
593
|
+
type TileflowRuntimeStyle = {
|
|
594
|
+
analytics?: TileflowAnalytics;
|
|
595
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
596
|
+
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
597
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
598
|
+
revision?: string;
|
|
599
|
+
style: MapLibreStyle | string;
|
|
600
|
+
theme?: string;
|
|
601
|
+
};
|
|
602
|
+
declare const tileflowStyleFontFacesMetadataKey: "tileflow:fontFaces";
|
|
603
|
+
declare const tileflowStyleFontFaceLimits: Readonly<{
|
|
604
|
+
maximumCount: 16;
|
|
605
|
+
maximumSourceLength: 2048;
|
|
606
|
+
}>;
|
|
607
|
+
type TileflowStyleFontFace = {
|
|
608
|
+
family: string;
|
|
609
|
+
source: string;
|
|
610
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
611
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
612
|
+
};
|
|
613
|
+
/** Browser input is either one published Tileflow map or one direct MapLibre style. */
|
|
614
|
+
type TileflowRuntimeSource = {
|
|
615
|
+
kind: 'tileflow';
|
|
616
|
+
manifestUrl?: string;
|
|
617
|
+
map: string;
|
|
618
|
+
} | {
|
|
619
|
+
kind: 'maplibre';
|
|
620
|
+
style: MapLibreStyle | string;
|
|
621
|
+
};
|
|
622
|
+
type TileflowRuntimeStyleOptions = {
|
|
623
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
624
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
625
|
+
source: TileflowRuntimeSource;
|
|
626
|
+
theme?: TileflowThemeSelection;
|
|
627
|
+
};
|
|
628
|
+
type TileflowRuntimeSourceValidation = {
|
|
629
|
+
ok: true;
|
|
630
|
+
} | {
|
|
631
|
+
code: 'invalid-source' | 'missing-source';
|
|
632
|
+
error: string;
|
|
633
|
+
ok: false;
|
|
634
|
+
};
|
|
635
|
+
type TileflowManifestLoadOptions = {
|
|
636
|
+
source: TileflowRuntimeSource;
|
|
637
|
+
};
|
|
638
|
+
type TileflowManifestFetchOptions = {
|
|
639
|
+
/** Successful manifests are shared for this duration. Set to 0 to bypass the cache. */
|
|
640
|
+
cacheTtlMs?: number;
|
|
641
|
+
fetch?: typeof globalThis.fetch;
|
|
642
|
+
signal?: AbortSignal;
|
|
643
|
+
/** Hard request timeout in milliseconds. Defaults to 10 seconds and is capped at 60 seconds. */
|
|
644
|
+
timeoutMs?: number;
|
|
645
|
+
};
|
|
646
|
+
type TileflowRuntimeViewOptions = TileflowViewConfig & {
|
|
647
|
+
fallback?: TileflowViewConfig;
|
|
648
|
+
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
649
|
+
};
|
|
650
|
+
type TileflowRuntimeCenterLike = readonly [number, number] | {
|
|
651
|
+
lat: number;
|
|
652
|
+
lng: number;
|
|
653
|
+
} | {
|
|
654
|
+
lat: number;
|
|
655
|
+
lon: number;
|
|
656
|
+
};
|
|
657
|
+
declare function shouldLoadTileflowManifest(options: TileflowManifestLoadOptions): boolean;
|
|
658
|
+
declare function validateTileflowRuntimeSource(source: unknown): TileflowRuntimeSourceValidation;
|
|
659
|
+
/** Validate the only runtime selection grammar: one concrete portable name or `system`. */
|
|
660
|
+
declare function validateTileflowThemeSelection(value: unknown): value is TileflowThemeSelection;
|
|
661
|
+
declare function assertValidTileflowRuntimeSource(source: unknown): asserts source is TileflowRuntimeSource;
|
|
662
|
+
declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
|
|
663
|
+
/** Resolve one concrete published theme without consulting ambient browser state. */
|
|
664
|
+
declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme): TileflowResolvedRuntimeTheme;
|
|
665
|
+
/** Strictly reads Tileflow-owned web-font metadata from a compiled MapLibre style. */
|
|
666
|
+
declare function getTileflowStyleFontFaces(style: Pick<MapLibreStyle, 'metadata'>): TileflowStyleFontFace[];
|
|
667
|
+
declare function normalizeTileflowUrl(value: string): string;
|
|
668
|
+
declare function createTileflowSessionId(): string;
|
|
669
|
+
declare function createTileflowSessionController(input: {
|
|
670
|
+
fetch?: typeof fetch;
|
|
671
|
+
grantTimeoutMs?: number;
|
|
672
|
+
now?: () => Date;
|
|
673
|
+
sessionIdFactory?: () => string;
|
|
674
|
+
source: string;
|
|
675
|
+
}): TileflowSessionController;
|
|
676
|
+
declare function resolveTileflowAnalyticsRequestUrl(url: string, analytics: TileflowAnalytics | undefined, sessionId: string): string | undefined;
|
|
677
|
+
declare function startTileflowSession(analytics: TileflowAnalytics | undefined, input: {
|
|
678
|
+
mapId?: string;
|
|
679
|
+
sessionId: string;
|
|
680
|
+
source: string;
|
|
681
|
+
styleId?: string;
|
|
682
|
+
}): void;
|
|
683
|
+
declare function getTileflowAnalyticsApiUrl(analytics: TileflowAnalytics): string;
|
|
684
|
+
declare function mergeTileflowAnalytics(userAnalytics: TileflowAnalytics | undefined, runtimeAnalytics: TileflowAnalytics | undefined): TileflowAnalytics | undefined;
|
|
685
|
+
declare function resolveTileflowMapMode(options: TileflowMapModeOptions): TileflowMapMode;
|
|
686
|
+
declare function resolveTileflowRuntimeView(options: TileflowRuntimeViewOptions): TileflowViewConfig;
|
|
687
|
+
declare function normalizeTileflowRuntimeCenter(center: TileflowRuntimeCenterLike | undefined, fallback?: readonly [number, number]): [number, number];
|
|
688
|
+
declare function loadTileflowManifest(url: string, options?: TileflowManifestFetchOptions): Promise<TileflowRuntimeManifest | null>;
|
|
689
|
+
declare function clearTileflowManifestCache(url?: string): void;
|
|
690
|
+
declare function resolveTileflowManifestMap(manifest: TileflowRuntimeManifest, mapName: string): TileflowRuntimeManifestMap | null;
|
|
691
|
+
declare function resolveTileflowStaticImageUrl(input: {
|
|
692
|
+
center: [number, number];
|
|
693
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
694
|
+
imageSize: {
|
|
695
|
+
height: number;
|
|
696
|
+
width: number;
|
|
697
|
+
} | null;
|
|
698
|
+
manifestMap: TileflowRuntimeManifestMap | null;
|
|
699
|
+
theme?: TileflowThemeSelection;
|
|
700
|
+
zoom: number;
|
|
701
|
+
}): string | undefined;
|
|
702
|
+
declare function normalizeTileflowStaticImageSize(input: {
|
|
703
|
+
height: number;
|
|
704
|
+
width: number;
|
|
705
|
+
}): {
|
|
706
|
+
height: number;
|
|
707
|
+
width: number;
|
|
708
|
+
};
|
|
709
|
+
declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
|
|
710
|
+
|
|
711
|
+
/** The first and only public multi-theme runtime manifest contract. */
|
|
712
|
+
declare const tileflowRuntimeManifestVersion: 1;
|
|
713
|
+
declare const tileflowRuntimeManifestLimits: Readonly<{
|
|
714
|
+
maximumBytes: number;
|
|
715
|
+
}>;
|
|
716
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
717
|
+
type TileflowRuntimeManifestTheme = {
|
|
718
|
+
colorScheme: TileflowRuntimeColorScheme;
|
|
719
|
+
/** Complete font closure for this compiled theme. */
|
|
720
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
721
|
+
/** Content or deployment revision used for cache identity and receipts. */
|
|
722
|
+
revision?: string;
|
|
723
|
+
/** Hosted style identity, when different from the logical map identity. */
|
|
724
|
+
styleId?: string;
|
|
725
|
+
styleUrl: string;
|
|
726
|
+
};
|
|
727
|
+
type TileflowRuntimeSystemThemes = {
|
|
728
|
+
dark: string;
|
|
729
|
+
light: string;
|
|
730
|
+
};
|
|
731
|
+
type TileflowRuntimeManifestMapEntry = {
|
|
732
|
+
apiUrl?: string;
|
|
733
|
+
defaultTheme: string;
|
|
734
|
+
environment?: string;
|
|
735
|
+
mapId?: string;
|
|
736
|
+
systemThemes?: TileflowRuntimeSystemThemes;
|
|
737
|
+
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
738
|
+
usageMode?: 'session';
|
|
739
|
+
view?: TileflowViewConfig;
|
|
740
|
+
worldGeneration?: 'v1';
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* One logical map catalog for local and Hosted delivery.
|
|
744
|
+
*
|
|
745
|
+
* Delivery-specific fields are optional metadata on a map. The wire shape never forks into
|
|
746
|
+
* self-hosted and Hosted variants, so every runtime follows the same theme resolution path.
|
|
747
|
+
*/
|
|
748
|
+
type TileflowRuntimeManifest = {
|
|
749
|
+
apiUrl?: string;
|
|
750
|
+
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
751
|
+
version: typeof tileflowRuntimeManifestVersion;
|
|
752
|
+
};
|
|
753
|
+
declare const tileflowRuntimeManifestSchema: z.ZodType<TileflowRuntimeManifest>;
|
|
754
|
+
declare function parseTileflowRuntimeManifest(input: unknown): TileflowRuntimeManifest;
|
|
755
|
+
declare function safeParseTileflowRuntimeManifest(input: unknown): z.ZodSafeParseResult<TileflowRuntimeManifest>;
|
|
756
|
+
|
|
757
|
+
export { type TileflowNumberInsetsStyleValue as $, type TileflowFillPaint as A, type TileflowIconAnchor as B, type TileflowIconLayout as C, type TileflowIconPaint as D, type TileflowIconStyle as E, type TileflowIconTextFit as F, type TileflowImageStyleValue as G, type TileflowLabelDetail as H, type TileflowLabelLanguage as I, type TileflowLabelStyles as J, type TileflowLayerRange as K, type TileflowLight as L, type MapLibreStyle as M, type TileflowLineCap as N, type TileflowLineHatchStyle as O, type TileflowLineJoin as P, type TileflowLineLayout as Q, type TileflowLinePaint as R, type TileflowLineStackStyle as S, type TileflowRuntimeManifest as T, type TileflowManifestFetchOptions as U, type ValidationMessage as V, type TileflowManifestLoadOptions as W, type TileflowMapMode as X, type TileflowMapModeOptions as Y, type TileflowMarkerSymbolStyle as Z, type TileflowMountainBikeScale as _, type TileflowExpression as a, type TileflowTextPaint as a$, type TileflowNumberStyleValue as a0, type TileflowPlaceLabelClass as a1, type TileflowPoiCategory as a2, type TileflowPoiCategoryStyle as a3, type TileflowPoiColorMode as a4, type TileflowPoiDensity as a5, type TileflowPriorityOrder as a6, type TileflowProjection as a7, type TileflowResolvedRuntimeTheme as a8, type TileflowRoadAreaStyle as a9, type TileflowRuntimeSource as aA, type TileflowRuntimeSourceValidation as aB, type TileflowRuntimeStyle as aC, type TileflowRuntimeStyleOptions as aD, type TileflowRuntimeSystemThemes as aE, type TileflowRuntimeViewOptions as aF, type TileflowSessionController as aG, type TileflowSessionGrantResponse as aH, type TileflowStringStyleValue as aI, type TileflowStructuralStyleValue as aJ, type TileflowStyleFontFace as aK, type TileflowStyleValue as aL, type TileflowSymbolPlacement as aM, type TileflowSymbolPlacementStyle as aN, type TileflowSymbolZOrder as aO, type TileflowTerrain as aP, type TileflowTerrainConfig as aQ, type TileflowTerrainContourLabelStyle as aR, type TileflowTerrainContourLineStyle as aS, type TileflowTerrainContoursConfig as aT, type TileflowTerrainEncoding as aU, type TileflowTerrainHillshadeStyle as aV, type TileflowTerrainLayerRange as aW, type TileflowTerrainMode as aX, type TileflowTextAnchor as aY, type TileflowTextJustify as aZ, type TileflowTextLayout as a_, type TileflowRoadClass as aa, type TileflowRoadClassStyle as ab, type TileflowRoadCrossingStyle as ac, type TileflowRoadDetail as ad, type TileflowRoadExtras as ae, type TileflowRoadHierarchy as af, type TileflowRoadLabelDetail as ag, type TileflowRoadLayerStyle as ah, type TileflowRoadModifier as ai, type TileflowRoadOutline as aj, type TileflowRoadRestriction as ak, type TileflowRoadRoundaboutStyle as al, type TileflowRoadServiceType as am, type TileflowRoadShieldDetail as an, type TileflowRoadShieldStyles as ao, type TileflowRoadSidewalkStyle as ap, type TileflowRoadStructure as aq, type TileflowRoadTreatmentLayerStyle as ar, type TileflowRoadTreatmentLineStyle as as, type TileflowRoadTreatmentStyle as at, type TileflowRoadWeight as au, type TileflowRuntimeCenterLike as av, type TileflowRuntimeColorScheme as aw, type TileflowRuntimeManifestMap as ax, type TileflowRuntimeManifestMapEntry as ay, type TileflowRuntimeManifestTheme as az, type TileflowFixedValue as b, type TileflowTextStyle as b0, type TileflowThemeColorAlpha as b1, type TileflowThemeColorMix as b2, type TileflowThemeColorValue as b3, type TileflowThemeFontValue as b4, type TileflowThemeImageValue as b5, type TileflowThemeNumberValue as b6, type TileflowThemeSelection as b7, type TileflowThemeTokenCategory as b8, type TileflowThemeValue as b9, resolveTileflowRuntimeTheme as bA, resolveTileflowRuntimeView as bB, resolveTileflowStaticImageUrl as bC, safeParseTileflowRuntimeManifest as bD, shouldLoadTileflowManifest as bE, startTileflowSession as bF, tileflowPoiCategories as bG, tileflowRuntimeManifestLimits as bH, tileflowRuntimeManifestSchema as bI, tileflowRuntimeManifestVersion as bJ, tileflowStyleFontFaceLimits as bK, tileflowStyleFontFacesMetadataKey as bL, tileflowThemeTokenCategories as bM, token as bN, validateTileflowRuntimeSource as bO, validateTileflowThemeSelection as bP, zoom as bQ, type TileflowTypographyStyle as bR, type ResolvedTileflowTypography as bS, normalizeTileflowSurfaceId as bT, type TileflowViewConfig as ba, type TileflowWaterLabelClass as bb, type TileflowZoomInterpolation as bc, type TileflowZoomValue as bd, type ValidationResult as be, assertValidTileflowRuntimeSource as bf, clearTileflowManifestCache as bg, color as bh, createTileflowSessionController as bi, createTileflowSessionId as bj, defaultTileflowManifestUrl as bk, defaultTileflowRuntimeView as bl, fixed as bm, getTileflowAnalyticsApiUrl as bn, getTileflowStyleFontFaces as bo, inferTileflowAnalyticsFromStyleUrl as bp, loadTileflowManifest as bq, mergeTileflowAnalytics as br, normalizeTileflowRuntimeCenter as bs, normalizeTileflowStaticImageSize as bt, normalizeTileflowUrl as bu, parseTileflowRuntimeManifest as bv, resolveTileflowAnalyticsRequestUrl as bw, resolveTileflowManifestMap as bx, resolveTileflowMapMode as by, resolveTileflowRuntimeStyle as bz, type TileflowThemeTokenReference as c, type TileflowThemeColorOperation as d, type TileflowBackgroundStyle as e, type TileflowCircleStyle as f, type TileflowExtrusionStyle as g, type TileflowFillStyle as h, type TileflowLineStyle as i, type TileflowSymbolStyle as j, type TileflowRoadsModuleOptions as k, type TileflowRoadsModuleConfig as l, type TileflowLabelsModuleOptions as m, type TileflowLabelsModuleConfig as n, type TileflowPoiModuleOptions as o, type TileflowPoiModuleConfig as p, type MapLibreSprite as q, type TileflowAerodromeCodeDetail as r, type TileflowAlignment as s, type TileflowAnalytics as t, type TileflowAreaStyle as u, type TileflowBackgroundPaint as v, type TileflowCirclePaint as w, type TileflowColor as x, type TileflowColorStyleValue as y, type TileflowExtrusionPaint as z };
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export {
|
|
3
|
-
import './types-DlUGI6LC.js';
|
|
2
|
+
export { aw as TileflowRuntimeColorScheme, T as TileflowRuntimeManifest, ay as TileflowRuntimeManifestMapEntry, az as TileflowRuntimeManifestTheme, aE as TileflowRuntimeSystemThemes, bv as parseTileflowRuntimeManifest, bD as safeParseTileflowRuntimeManifest, bH as tileflowRuntimeManifestLimits, bI as tileflowRuntimeManifestSchema, bJ as tileflowRuntimeManifestVersion } from './manifest-B5GKVMFE.js';
|
package/dist/manifest.js
CHANGED
|
@@ -26,6 +26,17 @@ var tileflowThemeNameSchema = tileflowPortableIdSchema.refine(
|
|
|
26
26
|
"Expected a concrete theme name; system is browser-only"
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
+
// src/themes/model.ts
|
|
30
|
+
var tileflowThemeLimits = Object.freeze({ maxThemes: 64 });
|
|
31
|
+
var themeTypographyStyleKeys = ["fallbacks", "font", "letterSpacing", "transform"];
|
|
32
|
+
var themeTypographyKeys = [
|
|
33
|
+
...themeTypographyStyleKeys,
|
|
34
|
+
"places",
|
|
35
|
+
"poi",
|
|
36
|
+
"roads",
|
|
37
|
+
"water"
|
|
38
|
+
];
|
|
39
|
+
|
|
29
40
|
// src/manifest.ts
|
|
30
41
|
var tileflowRuntimeManifestVersion = 1;
|
|
31
42
|
var tileflowRuntimeManifestLimits = Object.freeze({ maximumBytes: 1024 * 1024 });
|
|
@@ -71,8 +82,13 @@ var manifestMapSchema = z2.object({
|
|
|
71
82
|
if (names.length === 0) {
|
|
72
83
|
context.addIssue({ code: "custom", message: "Expected at least one theme", path: ["themes"] });
|
|
73
84
|
}
|
|
74
|
-
if (names.length >
|
|
75
|
-
context.addIssue({
|
|
85
|
+
if (names.length > tileflowThemeLimits.maxThemes) {
|
|
86
|
+
context.addIssue({
|
|
87
|
+
code: "too_big",
|
|
88
|
+
maximum: tileflowThemeLimits.maxThemes,
|
|
89
|
+
origin: "object",
|
|
90
|
+
path: ["themes"]
|
|
91
|
+
});
|
|
76
92
|
}
|
|
77
93
|
if (!Object.hasOwn(entry.themes, entry.defaultTheme)) {
|
|
78
94
|
context.addIssue({
|