@tileflow/core 0.1.0-alpha.20 → 0.1.0-alpha.21

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.
@@ -0,0 +1,195 @@
1
+ import { T as TileflowCaptureScene } from './capture-scene-BK_0J2oR.js';
2
+ import { T as TileflowMap, a as TileflowDataRequirementsV1, b as TileflowSourceRequirementsV1, R as ResolvedTileflowMap, c as TileflowStyleOptions, d as TileflowPreparedMapAssets } from './requirements-BV77ZVhR.js';
3
+ export { e as TileflowDataCompatibilityIssue, f as TileflowDataFieldRequirement, g as TileflowDataFieldType, h as TileflowDataLayerRequirement, i as TileflowObservedDataContractV1, j as collectMapLineage, k as inferTileflowDataRequirements, l as inferTileflowSourceRequirements, v as validateTileflowDataCompatibility } from './requirements-BV77ZVhR.js';
4
+ import { e as TileflowRuntimeManifest } from './runtime-C4MtSzkB.js';
5
+ import { M as MapLibreStyle } from './types-DlUGI6LC.js';
6
+ import { T as TileflowLayerDomain } from './domains-CPSrdTik.js';
7
+ import 'zod';
8
+ import './visual-semantics-DTC-8Hsb.js';
9
+
10
+ declare const tileflowLayerSlots: readonly ["background", "land", "terrain", "hydro", "building-areas", "transport-areas", "transport-tunnel-shadow", "transport-tunnel-casing", "transport-tunnel-fill", "transport-pedestrian-areas", "aeroways", "transport-surface-shadow", "transport-surface-casing", "transport-surface-fill", "transport-bridge-shadow", "transport-bridge-casing", "transport-bridge-fill", "transport-symbols", "boundaries", "buildings", "vegetation", "symbols"];
11
+ type TileflowLayerSlot = (typeof tileflowLayerSlots)[number];
12
+
13
+ /** Version of the build-only style inspection sidecar. */
14
+ declare const tileflowStyleInspectionSchemaVersion: 1;
15
+ type TileflowStyleInspectionEffect = {
16
+ readonly kind: 'add' | 'patch';
17
+ readonly owner: TileflowLayerDomain;
18
+ readonly target: string;
19
+ };
20
+ /** One semantic contribution represented by a compiled physical style layer. */
21
+ type TileflowStyleInspectionContribution = {
22
+ readonly owner: TileflowLayerDomain;
23
+ readonly slot: TileflowLayerSlot;
24
+ readonly target: string;
25
+ /** Ordered module-effect chain applied before physical-layer optimization. */
26
+ readonly effects: readonly TileflowStyleInspectionEffect[];
27
+ };
28
+ type TileflowStyleInspectionLayer = {
29
+ readonly id: string;
30
+ readonly index: number;
31
+ readonly type: string;
32
+ /** Multiple entries are expected when the optimizer combines semantic layers. */
33
+ readonly contributions: readonly TileflowStyleInspectionContribution[];
34
+ };
35
+ /** Build-only cartographic provenance. This object is never embedded in Style JSON. */
36
+ type TileflowStyleInspection = {
37
+ readonly schemaVersion: typeof tileflowStyleInspectionSchemaVersion;
38
+ readonly map: string;
39
+ readonly theme: string;
40
+ readonly layers: readonly TileflowStyleInspectionLayer[];
41
+ };
42
+ type TileflowInspectedStyle = {
43
+ readonly style: MapLibreStyle;
44
+ readonly inspection: TileflowStyleInspection;
45
+ };
46
+
47
+ declare const tileflowMapRevisionSchemaVersion: 1;
48
+ declare const tileflowMapRevisionCanonicalization: "tileflow-canonical-json-v1";
49
+ declare const tileflowMapBuildManifestSchemaVersion: 1;
50
+ declare const tileflowMapBuildManifestFileName: "build-manifest.json";
51
+ /** One effective icon source after ordered directory replacement has completed. */
52
+ type TileflowEffectiveIconSourceIdentity = {
53
+ format: 'jpeg' | 'png' | 'svg' | 'webp';
54
+ id: string;
55
+ kind: 'icon' | 'pattern';
56
+ sha256: string;
57
+ };
58
+ /** One effective local font face actually referenced by the compiled map. */
59
+ type TileflowEffectiveFontSourceIdentity = {
60
+ family: string;
61
+ sha256: string;
62
+ style: 'italic' | 'normal' | 'oblique';
63
+ weight: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
64
+ };
65
+ type TileflowEffectiveMapSourceAssets = {
66
+ fonts: readonly TileflowEffectiveFontSourceIdentity[];
67
+ icons: readonly TileflowEffectiveIconSourceIdentity[];
68
+ };
69
+ type TileflowHashableBuildAsset = {
70
+ contentType: string;
71
+ fileName: string;
72
+ source: string | Uint8Array;
73
+ };
74
+ /** Canonical byte identity used by the immutable asset-set hash. */
75
+ type TileflowBuildAssetIdentity = {
76
+ byteLength: number;
77
+ contentType: string;
78
+ fileName: string;
79
+ sha256: string;
80
+ };
81
+ /** One authoring node in leaf-to-root order, retained only for auditability. */
82
+ type TileflowMapBuildLineageEntry = {
83
+ id: string;
84
+ mapVersion: number;
85
+ };
86
+ type TileflowMapBuildInput = {
87
+ assets: readonly TileflowHashableBuildAsset[];
88
+ lineage: readonly TileflowMapBuildLineageEntry[];
89
+ map: TileflowMap;
90
+ sourceAssets: TileflowEffectiveMapSourceAssets;
91
+ styles: Readonly<Record<string, MapLibreStyle>>;
92
+ };
93
+ type TileflowThemeBuildManifestEntryV1 = {
94
+ colorScheme: 'dark' | 'light';
95
+ dataRequirements: TileflowDataRequirementsV1;
96
+ sourceRequirements: TileflowSourceRequirementsV1;
97
+ styleSha256: string;
98
+ themeId: string;
99
+ themeVersion: number;
100
+ };
101
+ type TileflowMapBuildManifestEntryV1 = {
102
+ assetSetSha256: string;
103
+ defaultTheme: string;
104
+ lineage: readonly TileflowMapBuildLineageEntry[];
105
+ mapRevisionSha256: string;
106
+ mapVersion: number;
107
+ recipe: {
108
+ compiler: 'streets';
109
+ compilerVersion: number;
110
+ };
111
+ sourceAssets: TileflowEffectiveMapSourceAssets;
112
+ systemThemes?: {
113
+ dark: string;
114
+ light: string;
115
+ };
116
+ themes: Record<string, TileflowThemeBuildManifestEntryV1>;
117
+ };
118
+ /**
119
+ * Collect leaf-to-root editorial identities for manifest auditability.
120
+ *
121
+ * This lineage is deliberately not an additional `mapRevisionSha256` input. The resolved effective
122
+ * map already determines that identity, so a fully shadowed ancestor change stays non-material.
123
+ */
124
+ declare function collectTileflowMapBuildLineage(input: TileflowMap): TileflowMapBuildLineageEntry[];
125
+ type TileflowMapBuildProvenanceV1 = {
126
+ lockfile?: {
127
+ format: 'bun' | 'npm' | 'pnpm' | 'yarn';
128
+ sha256: string;
129
+ };
130
+ packages: Readonly<Record<string, string>>;
131
+ schemaVersion: 1;
132
+ };
133
+ type TileflowMapBuildManifestV1 = {
134
+ maps: Record<string, TileflowMapBuildManifestEntryV1>;
135
+ provenance?: TileflowMapBuildProvenanceV1;
136
+ schemaVersion: typeof tileflowMapBuildManifestSchemaVersion;
137
+ };
138
+ /**
139
+ * Create the portable map build identity document.
140
+ *
141
+ * `mapRevisionSha256` identifies the effective cartographic definition and effective source
142
+ * icon/font bytes. Editorial identity, default view, capture scenes, delivery policy, package
143
+ * versions, compiler ABI versions, compiled Style JSON, generated sprite/font outputs, filesystem
144
+ * paths, and a concrete resolution of a floating World selector are outside that hash. They have
145
+ * their own identities or remain tooling/delivery state.
146
+ */
147
+ declare function createTileflowMapBuildManifest(maps: Readonly<Record<string, TileflowMapBuildInput>>, options?: {
148
+ provenance?: TileflowMapBuildProvenanceV1;
149
+ }): Promise<TileflowMapBuildManifestV1>;
150
+ /** Hash a resolved map definition with the versioned, domain-separated revision contract. */
151
+ declare function hashTileflowMapRevision(input: TileflowMap | ResolvedTileflowMap, sourceAssets: TileflowEffectiveMapSourceAssets): Promise<string>;
152
+ /** Hash the exact compiled resources bound to one map, independently from its Style JSON. */
153
+ declare function hashTileflowAssetSet(input: readonly TileflowHashableBuildAsset[]): Promise<string>;
154
+ /**
155
+ * Hash already-verified resource identities with the same v1 contract as byte-backed build assets.
156
+ *
157
+ * Hosted uses this after independently confirming immutable object bytes against their manifests;
158
+ * package or bundle hashes are not substitutes for this per-file identity closure.
159
+ */
160
+ declare function hashTileflowAssetSetIdentities(input: readonly TileflowBuildAssetIdentity[]): Promise<string>;
161
+
162
+ /**
163
+ * Compile the ordinary MapLibre Style and a separate build-only inspection sidecar.
164
+ * The sidecar never enters the Style object or runtime manifest.
165
+ */
166
+ declare function createStyleWithInspection(config: TileflowMap, options?: TileflowStyleOptions): TileflowInspectedStyle;
167
+
168
+ type TileflowCompiledMapMetadata = Pick<ResolvedTileflowMap, 'id' | 'root' | 'version'> & {
169
+ lineage: readonly TileflowMapBuildLineageEntry[];
170
+ };
171
+ /** Multi-map intermediate representation owned by Node build tooling. */
172
+ type TileflowBuildCatalog = {
173
+ maps: Record<string, TileflowMap>;
174
+ mapMetadata?: Record<string, TileflowCompiledMapMetadata>;
175
+ scenes?: Record<string, TileflowCaptureScene>;
176
+ };
177
+ /** Complete compiled style family, addressed first by logical map and then by theme name. */
178
+ type TileflowBuildStyles = Record<string, Record<string, MapLibreStyle>>;
179
+ /** Build-only Style and inspection family with the same map/theme addressing. */
180
+ type TileflowBuildInspectedStyles = Record<string, Record<string, TileflowInspectedStyle>>;
181
+ declare function createStyleFromCatalog<const TCatalog extends TileflowBuildCatalog, const TMapName extends keyof TCatalog['maps'] & string>(catalog: TCatalog, mapName: TMapName, options?: TileflowStyleOptions): MapLibreStyle;
182
+ declare function createStyleFromCatalogWithInspection<const TCatalog extends TileflowBuildCatalog, const TMapName extends keyof TCatalog['maps'] & string>(catalog: TCatalog, mapName: TMapName, options?: TileflowStyleOptions): TileflowInspectedStyle;
183
+ /** Compile every declared theme for every logical map in deterministic key order. */
184
+ declare function createStylesFromCatalog(catalog: TileflowBuildCatalog, options?: Omit<TileflowStyleOptions, 'preparedAssets' | 'theme'> & {
185
+ mapAssets?: Readonly<Record<string, TileflowPreparedMapAssets>>;
186
+ }): TileflowBuildStyles;
187
+ /** Compile every declared theme with a separate inspection sidecar. */
188
+ declare function createStylesFromCatalogWithInspection(catalog: TileflowBuildCatalog, options?: Omit<TileflowStyleOptions, 'preparedAssets' | 'theme'> & {
189
+ mapAssets?: Readonly<Record<string, TileflowPreparedMapAssets>>;
190
+ }): TileflowBuildInspectedStyles;
191
+ declare function createManifest(catalog: TileflowBuildCatalog, options?: {
192
+ styleBaseUrl?: string;
193
+ }): TileflowRuntimeManifest;
194
+
195
+ export { type TileflowBuildAssetIdentity, type TileflowBuildCatalog, type TileflowBuildInspectedStyles, type TileflowBuildStyles, type TileflowCompiledMapMetadata, TileflowDataRequirementsV1, type TileflowEffectiveFontSourceIdentity, type TileflowEffectiveIconSourceIdentity, type TileflowEffectiveMapSourceAssets, type TileflowHashableBuildAsset, type TileflowInspectedStyle, type TileflowMapBuildInput, type TileflowMapBuildLineageEntry, type TileflowMapBuildManifestEntryV1, type TileflowMapBuildManifestV1, type TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets, TileflowSourceRequirementsV1, type TileflowStyleInspection, type TileflowStyleInspectionContribution, type TileflowStyleInspectionEffect, type TileflowStyleInspectionLayer, type TileflowThemeBuildManifestEntryV1, collectTileflowMapBuildLineage, createManifest, createStyleFromCatalog, createStyleFromCatalogWithInspection, createStyleWithInspection, createStylesFromCatalog, createStylesFromCatalogWithInspection, createTileflowMapBuildManifest, hashTileflowAssetSet, hashTileflowAssetSetIdentities, hashTileflowMapRevision, tileflowMapBuildManifestFileName, tileflowMapBuildManifestSchemaVersion, tileflowMapRevisionCanonicalization, tileflowMapRevisionSchemaVersion, tileflowStyleInspectionSchemaVersion };