@tileflow/core 0.1.0-alpha.26 → 0.1.0-alpha.27
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 +43 -3
- package/THIRD_PARTY_NOTICES.md +84 -0
- package/dist/build.d.ts +417 -6
- package/dist/build.js +12095 -2197
- package/dist/{capture-scene-BK_0J2oR.d.ts → capture-scene-D6soWztE.d.ts} +1 -1
- package/dist/capture.d.ts +2 -2
- package/dist/capture.js +107 -37
- package/dist/{icon-composition-BssSKOKF.d.ts → icon-composition-C2bVldOJ.d.ts} +89 -7
- package/dist/index.d.ts +156 -27
- package/dist/index.js +5217 -4678
- package/dist/{manifest-B5GKVMFE.d.ts → manifest-types-BdGjIYy-.d.ts} +2 -11
- package/dist/manifest.d.ts +9 -2
- package/dist/manifest.js +316 -193
- package/dist/native-profile.d.ts +187 -0
- package/dist/native-profile.js +9316 -0
- package/dist/native.d.ts +196 -5
- package/dist/native.js +4813 -95
- package/dist/runtime.d.ts +1 -2
- package/dist/runtime.js +338 -221
- package/docs/authoring-model.md +5 -4
- package/docs/data-is-separate-from-design.md +8 -8
- package/docs/hosted-session-authorization.md +11 -2
- package/docs/native-artifact-profile.md +145 -0
- package/docs/native-resource-urls.md +257 -7
- package/docs/public-api-and-browser-subpath.md +14 -8
- package/package.json +10 -4
package/dist/native.d.ts
CHANGED
|
@@ -20,12 +20,203 @@ declare class TileflowNativeUrlError extends TypeError {
|
|
|
20
20
|
readonly field: TileflowNativeUrlField;
|
|
21
21
|
constructor(code: TileflowNativeUrlErrorCode, field: TileflowNativeUrlField);
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
/** Resolve an explicit manifest URL with the private WHATWG parser, not the ambient URL. */
|
|
24
25
|
declare function resolveTileflowNativeManifestUrl(value: unknown, options?: TileflowNativeNetworkOptions): string;
|
|
26
|
+
/** Resolve a resource against its owner without fetching it or authorizing requests. */
|
|
27
|
+
declare function resolveTileflowNativeResourceUrl(value: unknown, options: TileflowNativeResourceUrlOptions): string;
|
|
28
|
+
|
|
29
|
+
type TileflowViewConfig = {
|
|
30
|
+
bearing?: number;
|
|
31
|
+
center?: readonly [number, number];
|
|
32
|
+
pitch?: number;
|
|
33
|
+
zoom?: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** Runtime-ready logical map with all relative theme resources already resolved. */
|
|
37
|
+
type TileflowRuntimeManifestMap = TileflowRuntimeManifestMapEntry & {
|
|
38
|
+
apiUrl?: string;
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
type TileflowResolvedRuntimeTheme = TileflowRuntimeManifestTheme & {
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
type TileflowStyleFontFace = {
|
|
45
|
+
family: string;
|
|
46
|
+
source: string;
|
|
47
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
48
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The first and only public multi-theme runtime manifest contract. */
|
|
52
|
+
declare const tileflowRuntimeManifestVersion: 1;
|
|
53
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
54
|
+
type TileflowRuntimeManifestTheme = {
|
|
55
|
+
colorScheme: TileflowRuntimeColorScheme;
|
|
56
|
+
/** Complete font closure for this compiled theme. */
|
|
57
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
58
|
+
/** Content or deployment revision used for cache identity and receipts. */
|
|
59
|
+
revision?: string;
|
|
60
|
+
/** Hosted style identity, when different from the logical map identity. */
|
|
61
|
+
styleId?: string;
|
|
62
|
+
styleUrl: string;
|
|
63
|
+
};
|
|
64
|
+
type TileflowRuntimeSystemThemes = {
|
|
65
|
+
dark: string;
|
|
66
|
+
light: string;
|
|
67
|
+
};
|
|
68
|
+
type TileflowRuntimeManifestMapEntry = {
|
|
69
|
+
apiUrl?: string;
|
|
70
|
+
defaultTheme: string;
|
|
71
|
+
environment?: string;
|
|
72
|
+
mapId?: string;
|
|
73
|
+
systemThemes?: TileflowRuntimeSystemThemes;
|
|
74
|
+
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
75
|
+
usageMode?: 'session';
|
|
76
|
+
view?: TileflowViewConfig;
|
|
77
|
+
worldGeneration?: 'v1';
|
|
78
|
+
};
|
|
25
79
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
80
|
+
* One logical map catalog for local and Hosted delivery.
|
|
81
|
+
*
|
|
82
|
+
* Delivery-specific fields are optional metadata on a map. The wire shape never forks into
|
|
83
|
+
* self-hosted and Hosted variants, so every runtime follows the same theme resolution path.
|
|
28
84
|
*/
|
|
29
|
-
|
|
85
|
+
type TileflowRuntimeManifest = {
|
|
86
|
+
apiUrl?: string;
|
|
87
|
+
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
88
|
+
version: typeof tileflowRuntimeManifestVersion;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** The adapter must honor the requested read bound, without first buffering an unbounded body. */
|
|
92
|
+
type TileflowNativeManifestReader = {
|
|
93
|
+
read(maximumBytes: number): Promise<{
|
|
94
|
+
done: true;
|
|
95
|
+
value?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
done: false;
|
|
98
|
+
value: Uint8Array;
|
|
99
|
+
}>;
|
|
100
|
+
cancel(): void | Promise<void>;
|
|
101
|
+
};
|
|
102
|
+
type TileflowNativeManifestResponse = {
|
|
103
|
+
/** Absolute final URL after redirects approved by the acquisition adapter. */
|
|
104
|
+
url: string;
|
|
105
|
+
status: number;
|
|
106
|
+
reader: TileflowNativeManifestReader;
|
|
107
|
+
};
|
|
108
|
+
/** Cancellation must be available immediately, including before response headers arrive. */
|
|
109
|
+
type TileflowNativeManifestOperation = {
|
|
110
|
+
response: Promise<TileflowNativeManifestResponse>;
|
|
111
|
+
cancel(): void | Promise<void>;
|
|
112
|
+
};
|
|
113
|
+
type TileflowNativeManifestAcquire = (url: string, options: Readonly<{
|
|
114
|
+
maximumBytes: number;
|
|
115
|
+
}>) => TileflowNativeManifestOperation;
|
|
116
|
+
/** No AbortController/EventTarget construction or reason inspection is required by Core. */
|
|
117
|
+
type TileflowNativeAbortSignal = {
|
|
118
|
+
readonly aborted: boolean;
|
|
119
|
+
addEventListener(type: 'abort', listener: () => void, options?: {
|
|
120
|
+
once?: boolean;
|
|
121
|
+
}): void;
|
|
122
|
+
removeEventListener(type: 'abort', listener: () => void): void;
|
|
123
|
+
};
|
|
124
|
+
type TileflowNativeManifestLoadOptions = TileflowNativeNetworkOptions & {
|
|
125
|
+
acquire: TileflowNativeManifestAcquire;
|
|
126
|
+
signal?: TileflowNativeAbortSignal;
|
|
127
|
+
};
|
|
128
|
+
/** A published Tileflow map with an explicit manifest URL. Does not create a renderer. */
|
|
129
|
+
type TileflowNativeSource = {
|
|
130
|
+
map: string;
|
|
131
|
+
manifestUrl: string;
|
|
132
|
+
/** Exact HTTP origin permitted by this development source. HTTPS remains allowed. */
|
|
133
|
+
developmentOrigin?: string;
|
|
134
|
+
};
|
|
135
|
+
type TileflowNativeSourceOptions = {
|
|
136
|
+
theme?: string;
|
|
137
|
+
/** Required only for theme="system"; no ambient appearance access. */
|
|
138
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
139
|
+
signal?: TileflowNativeAbortSignal;
|
|
140
|
+
};
|
|
141
|
+
type Immutable<T> = T extends object ? {
|
|
142
|
+
readonly [K in keyof T]: Immutable<T[K]>;
|
|
143
|
+
} : T;
|
|
144
|
+
type TileflowNativeManifestResult = {
|
|
145
|
+
readonly manifestUrl: string;
|
|
146
|
+
readonly manifest: Immutable<TileflowRuntimeManifest>;
|
|
147
|
+
};
|
|
148
|
+
type TileflowNativeSourceState = {
|
|
149
|
+
readonly status: 'loading';
|
|
150
|
+
readonly generation: number;
|
|
151
|
+
} | ({
|
|
152
|
+
readonly status: 'ready';
|
|
153
|
+
readonly generation: number;
|
|
154
|
+
readonly source: Readonly<TileflowNativeSource>;
|
|
155
|
+
readonly map: Immutable<TileflowRuntimeManifestMap>;
|
|
156
|
+
readonly theme: Immutable<TileflowResolvedRuntimeTheme>;
|
|
157
|
+
} & TileflowNativeManifestResult) | {
|
|
158
|
+
readonly status: 'error';
|
|
159
|
+
readonly generation: number;
|
|
160
|
+
readonly error: TileflowNativeSourceError;
|
|
161
|
+
};
|
|
162
|
+
type TileflowNativeSourceController = {
|
|
163
|
+
/** Undefined until the first replacement. Disposed controllers retain their last snapshot. */
|
|
164
|
+
readonly state: TileflowNativeSourceState | undefined;
|
|
165
|
+
replace(source: TileflowNativeSource, options?: TileflowNativeSourceOptions): Promise<void>;
|
|
166
|
+
subscribe(listener: (state: TileflowNativeSourceState) => void): () => void;
|
|
167
|
+
dispose(): void;
|
|
168
|
+
};
|
|
169
|
+
declare const messages: {
|
|
170
|
+
readonly NATIVE_SOURCE_INVALID: "Expected a valid native source or renderer-neutral view.";
|
|
171
|
+
readonly NATIVE_SOURCE_ABORTED: "The source operation was cancelled.";
|
|
172
|
+
readonly NATIVE_SOURCE_DISPOSED: "The source controller has been disposed.";
|
|
173
|
+
readonly NATIVE_MANIFEST_URL_INVALID: "Expected a safe absolute manifest URL and an exact development origin.";
|
|
174
|
+
readonly NATIVE_MANIFEST_REQUEST_FAILED: "Manifest acquisition failed.";
|
|
175
|
+
readonly NATIVE_MANIFEST_RESPONSE_INVALID: "Expected a bounded byte reader and an explicit final response URL.";
|
|
176
|
+
readonly NATIVE_MANIFEST_ACCESS_DENIED: "Manifest access was denied.";
|
|
177
|
+
readonly NATIVE_MANIFEST_NOT_FOUND: "The manifest was not found.";
|
|
178
|
+
readonly NATIVE_MANIFEST_TOO_LARGE: "The manifest exceeds the 1 MiB limit.";
|
|
179
|
+
readonly NATIVE_MANIFEST_UTF8_INVALID: "The manifest body is not valid UTF-8.";
|
|
180
|
+
readonly NATIVE_MANIFEST_JSON_INVALID: "The manifest body is not valid JSON.";
|
|
181
|
+
readonly NATIVE_MANIFEST_INVALID: "The manifest does not satisfy the version-1 runtime contract.";
|
|
182
|
+
readonly NATIVE_MANIFEST_RESOURCE_INVALID: "A manifest resource URL is outside the native URL policy.";
|
|
183
|
+
readonly NATIVE_MAP_NOT_FOUND: "The requested map is not declared by the manifest.";
|
|
184
|
+
readonly NATIVE_THEME_INVALID: "Expected a declared concrete theme or an explicitly supplied system color scheme.";
|
|
185
|
+
};
|
|
186
|
+
type TileflowNativeSourceErrorCode = keyof typeof messages;
|
|
187
|
+
type TileflowNativeSourceErrorField = 'source' | 'signal' | 'manifestUrl' | 'response' | 'body' | 'map' | 'theme' | 'view';
|
|
188
|
+
/** Contains no body, URL, remote cause, parser details, or AbortSignal.reason. */
|
|
189
|
+
declare class TileflowNativeSourceError extends Error {
|
|
190
|
+
readonly code: TileflowNativeSourceErrorCode;
|
|
191
|
+
readonly field: TileflowNativeSourceErrorField;
|
|
192
|
+
readonly kind: 'terminal' | 'cancelled';
|
|
193
|
+
constructor(code: TileflowNativeSourceErrorCode, field: TileflowNativeSourceErrorField);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare const tileflowNativeManifestLimits: Readonly<{
|
|
197
|
+
maximumBytes: number;
|
|
198
|
+
maximumChunkBytes: number;
|
|
199
|
+
maximumDepth: 64;
|
|
200
|
+
}>;
|
|
201
|
+
/** Acquire only the manifest. There is no default network client, cache, retry or session. */
|
|
202
|
+
declare function loadTileflowNativeManifest(manifestUrl: string, options: TileflowNativeManifestLoadOptions): Promise<TileflowNativeManifestResult>;
|
|
203
|
+
|
|
204
|
+
/** A renderer-neutral lifecycle for an explicitly located Tileflow manifest. */
|
|
205
|
+
declare function createTileflowNativeSourceController(options: {
|
|
206
|
+
acquire: TileflowNativeManifestAcquire;
|
|
207
|
+
}): TileflowNativeSourceController;
|
|
208
|
+
|
|
209
|
+
type TileflowNativeInitialView = Readonly<Required<TileflowViewConfig>>;
|
|
210
|
+
/** Inputs are views, not renderer props. Validate all supplied levels before applying precedence. */
|
|
211
|
+
type TileflowNativeInitialViewOptions = {
|
|
212
|
+
/** Highest precedence, supplied explicitly by the application. */
|
|
213
|
+
view?: TileflowViewConfig;
|
|
214
|
+
/** View values extracted by an adapter from its renderer options. */
|
|
215
|
+
mapOptionsView?: TileflowViewConfig;
|
|
216
|
+
/** The selected manifest map's view, when present. */
|
|
217
|
+
manifestView?: TileflowViewConfig;
|
|
218
|
+
};
|
|
219
|
+
/** Resolve once or repeatedly without changing source generations, themes or acquisition. */
|
|
220
|
+
declare function resolveTileflowNativeInitialView(options?: TileflowNativeInitialViewOptions): TileflowNativeInitialView;
|
|
30
221
|
|
|
31
|
-
export { type TileflowNativeNetworkOptions, type TileflowNativeResourceUrlOptions, TileflowNativeUrlError, type TileflowNativeUrlErrorCode, type TileflowNativeUrlField, resolveTileflowNativeManifestUrl, resolveTileflowNativeResourceUrl, tileflowNativeUrlLimits };
|
|
222
|
+
export { type TileflowNativeAbortSignal, type TileflowNativeInitialView, type TileflowNativeInitialViewOptions, type TileflowNativeManifestAcquire, type TileflowNativeManifestLoadOptions, type TileflowNativeManifestOperation, type TileflowNativeManifestReader, type TileflowNativeManifestResponse, type TileflowNativeManifestResult, type TileflowNativeNetworkOptions, type TileflowNativeResourceUrlOptions, type TileflowNativeSource, type TileflowNativeSourceController, TileflowNativeSourceError, type TileflowNativeSourceErrorCode, type TileflowNativeSourceErrorField, type TileflowNativeSourceOptions, type TileflowNativeSourceState, TileflowNativeUrlError, type TileflowNativeUrlErrorCode, type TileflowNativeUrlField, createTileflowNativeSourceController, loadTileflowNativeManifest, resolveTileflowNativeInitialView, resolveTileflowNativeManifestUrl, resolveTileflowNativeResourceUrl, tileflowNativeManifestLimits, tileflowNativeUrlLimits };
|