@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/dist/browser.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- import { T as TileflowAnalytics, a as TileflowStyleFontFace, b as TileflowRuntimeStyle, c as TileflowSessionController, d as TileflowRuntimeColorScheme } from './runtime-C4MtSzkB.js';
2
- import { M as MapLibreStyle } from './types-DlUGI6LC.js';
3
- import 'zod';
4
-
5
- type TileflowFairUseNoticeState = 'GRACE' | 'CLAIM_REQUIRED';
1
+ type TileflowFairUseNoticeState = 'GRACE' | 'MANAGED_REQUIRED';
6
2
  type TileflowFairUseNotice = Readonly<{
7
3
  action: string;
8
4
  helpUrl: string;
@@ -36,6 +32,67 @@ declare function registerTileflowWorldRequestBridge(input: {
36
32
  declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
37
33
  declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
38
34
 
35
+ type TileflowColor = `#${string}`;
36
+ type MapLibreSprite = string | Array<{
37
+ id: string;
38
+ url: string;
39
+ }>;
40
+ type TileflowProjection = 'globe' | 'mercator';
41
+ type TileflowLight = {
42
+ anchor?: 'map' | 'viewport';
43
+ color?: TileflowColor;
44
+ intensity?: number;
45
+ position?: readonly [number, number, number];
46
+ };
47
+ type MapLibreStyle = {
48
+ version: 8;
49
+ name: string;
50
+ glyphs?: string;
51
+ light?: TileflowLight;
52
+ projection?: {
53
+ type: TileflowProjection;
54
+ };
55
+ sprite?: MapLibreSprite;
56
+ sources: Record<string, Record<string, unknown>>;
57
+ layers: Array<Record<string, unknown>>;
58
+ terrain?: Record<string, unknown>;
59
+ metadata?: Record<string, unknown>;
60
+ };
61
+
62
+ type TileflowRuntimeColorScheme = 'dark' | 'light';
63
+
64
+ type TileflowAnalytics = {
65
+ apiUrl?: string;
66
+ endpoint?: string;
67
+ enabled?: boolean;
68
+ mapId?: string;
69
+ metadata?: Record<string, unknown>;
70
+ projectId?: string;
71
+ sdkVersion?: string;
72
+ source?: string;
73
+ styleId?: string;
74
+ surfaceId?: string;
75
+ };
76
+ type TileflowSessionController = {
77
+ readonly sessionId: string;
78
+ resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
79
+ };
80
+ type TileflowRuntimeStyle = {
81
+ analytics?: TileflowAnalytics;
82
+ colorScheme?: TileflowRuntimeColorScheme;
83
+ /** An explicit empty array means the manifest declares that no web fonts are required. */
84
+ fontFaces?: TileflowStyleFontFace[];
85
+ revision?: string;
86
+ style: MapLibreStyle | string;
87
+ theme?: string;
88
+ };
89
+ type TileflowStyleFontFace = {
90
+ family: string;
91
+ source: string;
92
+ style?: 'italic' | 'normal' | 'oblique';
93
+ weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
94
+ };
95
+
39
96
  declare const tileflowMaplibreContourVersion: "0.1.0";
40
97
  type TileflowContourProtocolRequest = Readonly<{
41
98
  url: string;
@@ -56,6 +113,25 @@ type TileflowContourProtocolRegistrationOptions = {
56
113
  /** Registers the one self-contained protocol emitted by every compiled contour source. */
57
114
  declare function registerTileflowContourProtocol(registry: TileflowContourProtocolRegistry, options?: TileflowContourProtocolRegistrationOptions): void;
58
115
 
116
+ type TileflowPmtilesProtocolHandler = (request: Readonly<{
117
+ type?: string;
118
+ url: string;
119
+ }>, abortController: AbortController) => Promise<Readonly<{
120
+ cacheControl?: string;
121
+ data: unknown;
122
+ expires?: string;
123
+ }>>;
124
+ type TileflowPmtilesProtocolRegistry = Readonly<{
125
+ addProtocol: (name: string, handler: TileflowPmtilesProtocolHandler) => void;
126
+ }>;
127
+ type TileflowPmtilesProtocolRegistrationOptions = Readonly<{
128
+ maximumDirectoryDepth?: number;
129
+ }>;
130
+ declare const tileflowPmtilesMaximumDirectoryDepth: 32;
131
+ declare const tileflowPmtilesProtocol: "tileflow-pmtiles";
132
+ /** Register only Tileflow's managed PMTiles namespace. Third-party `pmtiles://` remains untouched. */
133
+ declare function registerTileflowPmtilesProtocol(registry: TileflowPmtilesProtocolRegistry, options?: TileflowPmtilesProtocolRegistrationOptions): void;
134
+
59
135
  type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
60
136
  /** Read the browser preference without persisting or mutating user state. */
61
137
  declare function getTileflowSystemColorScheme(): TileflowRuntimeColorScheme;
@@ -130,11 +206,6 @@ type TileflowComposedRequest<TRequest extends TileflowTransformRequestParameters
130
206
  type TileflowTransformRequest<TRequest extends TileflowTransformRequestParameters, TResourceType> = (url: string, resourceType?: TResourceType) => Promise<TileflowComposedRequest<TRequest>> | TileflowComposedRequest<TRequest> | undefined;
131
207
  type TileflowUserTransformRequest<TRequest extends TileflowTransformRequestParameters, TResourceType> = (url: string, resourceType?: TResourceType) => Promise<TRequest> | TRequest | undefined;
132
208
  type TileflowAsyncAnalyticsTiming = 'request' | 'resolution';
133
- type TileflowMarkerController<TMap, TDefinition, TMarker> = {
134
- clear: () => void;
135
- dispose: () => void;
136
- replace: (map: TMap, definitions: readonly TDefinition[]) => void;
137
- };
138
209
  declare function createTileflowSessionStarter(options: {
139
210
  getSessionId?: () => string;
140
211
  sessionId: string;
@@ -171,10 +242,5 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
171
242
  transformRequest?: TileflowUserTransformRequest<TRequest, TResourceType>;
172
243
  worldRequestBridge?: TileflowWorldRequestBridge;
173
244
  }): TileflowTransformRequest<TRequest, TResourceType> | undefined;
174
- declare function createTileflowMarkerController<TMap, TDefinition, TMarker>(options: {
175
- attach: (marker: TMarker, map: TMap, definition: TDefinition) => void;
176
- create: (definition: TDefinition) => TMarker;
177
- remove: (marker: TMarker) => void;
178
- }): TileflowMarkerController<TMap, TDefinition, TMarker>;
179
245
 
180
- export { type TileflowAsyncAnalyticsTiming, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowMarkerController, type TileflowSessionSender, type TileflowSessionStarter, type TileflowStyleFontLoadOptions, type TileflowStyleSwitchMap, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowMarkerController, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowMaplibreContourVersion };
246
+ export { type TileflowAsyncAnalyticsTiming, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, 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 TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol };