@wovvmap/navigation 0.0.0-stage → 1.2.0

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,24 @@
1
+ import type { EndpointState, RouteGeometryResponse, RoutePlaybackIndexResponse, RouteSourceIdentity, RouteStepPageRequest, RouteStepsResponse, RouteSetSummary, SavedRouteSummary } from '@wovvmap/contracts';
2
+ /** Accepted display reads; live HTTP and saved replay preserve the same page/expiry contract.
3
+ * Hinglish: Sirf ready geometry/steps padhein; graph, cost ya instruction builder yahan nahi. */
4
+ export interface RouteDisplayProvider {
5
+ isCurrent?(): boolean;
6
+ steps?(request: RouteStepPageRequest, source: RouteSourceIdentity, signal: AbortSignal): Promise<RouteStepsResponse>;
7
+ playbackSteps?(setId: string, routeId: string, source: RouteSourceIdentity, signal: AbortSignal): Promise<RoutePlaybackIndexResponse>;
8
+ }
9
+ /** Viewer-owned candidate. Binding adopts state before endpoint observers can issue a newer command.
10
+ * Hinglish: Verify/read/prepare pending ho tab old route bache; final pair aur preview ek saath commit hon. */
11
+ export interface RouteRestoreCandidate {
12
+ readonly savedRoute?: SavedRouteSummary;
13
+ readonly routeSet: RouteSetSummary;
14
+ readonly selectedRouteId: string;
15
+ readonly validUntil: number;
16
+ readonly geometry: readonly RouteGeometryResponse[];
17
+ readonly provider: RouteDisplayProvider;
18
+ check(signal: AbortSignal): Promise<void>;
19
+ bind(adopt: (state: EndpointState) => void): void;
20
+ }
21
+ /** IO adapter loads one explicit saved ID; it cannot choose a fallback or generate another route.
22
+ * Hinglish: Explicit saved ID hi khule; network failure ko chupke saved success na banayein. */
23
+ export type RouteRestoreLoader = (id: string, signal: AbortSignal) => Promise<RouteRestoreCandidate>;
24
+ //# sourceMappingURL=RouteRestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteRestore.d.ts","sourceRoot":"","sources":["../../src/routes/RouteRestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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, type RouteGenerateResponse, type RouteGeometryResponse, type RouteOperations, type RoutePreferences, type RouteSelection, type RouteSourceIdentity, type RouteState, type RouteStepPage, type RouteStepPageRequest, type RouteInstruction, type RouteStepSelection, type RoutePlaybackBinding, type RoutePlaybackOptions, type RoutePlaybackProgress, type RoutePlaybackIndexResponse, type SavedRoutePreviewState, type SavedRouteSummary } from '@wovvmap/contracts';
2
+ import type { RouteDisplayProvider, RouteRestoreLoader } from './RouteRestore.js';
3
+ /** The rendering adapter owns only ready resources and camera/floor readiness, never route solving.
4
+ * Hinglish: Ready GPU data aur camera adapter mein; graph/alternative/instruction math server par hi rahe. */
5
+ export interface RouteRenderHandle {
6
+ playback?(routeId: string): RoutePlaybackBinding;
7
+ hasPlaybackSteps?(routeId: string): boolean;
8
+ setPlaybackSteps?(routeId: string, value: RoutePlaybackIndexResponse): void;
9
+ show(selectedRouteId: string, active: boolean): void;
10
+ focus(routeId: string, signal: AbortSignal, preview?: boolean): Promise<void>;
11
+ dispose(): void;
12
+ focusStep?(routeId: string, step: RouteInstruction, signal: AbortSignal): Promise<void>;
13
+ highlightStep?(routeId: string, step: RouteInstruction | null): void;
14
+ beginStep?(): () => boolean;
15
+ setPathAnimation?(mode: RouteState['config']['pathAnimation']): void;
16
+ }
17
+ export interface RouteServicePorts extends RouteDisplayProvider {
18
+ restore?: RouteRestoreLoader;
19
+ now?(): number;
20
+ progressed?(value: RoutePlaybackProgress | null): void;
21
+ context(): {
22
+ source: RouteSourceIdentity;
23
+ endpoints: EndpointState;
24
+ } | null;
25
+ generate(request: RouteGenerateRequest, signal: AbortSignal): Promise<RouteGenerateResponse>;
26
+ geometry(setId: string, routeId: string, source: RouteSourceIdentity, signal: AbortSignal): Promise<RouteGeometryResponse>;
27
+ prepare(items: readonly RouteGeometryResponse[], signal: AbortSignal): Promise<RouteRenderHandle>;
28
+ changed(state: RouteState): void;
29
+ }
30
+ /** One writable owner per rendering viewer. React and WebView invoke these same transitions.
31
+ * Hinglish: Host/store sirf projection hain; pending work, selection aur activation ka owner yahi hai. */
32
+ export declare class RouteService implements RouteOperations {
33
+ private readonly ports;
34
+ private state;
35
+ private work?;
36
+ private restoreWork?;
37
+ private provider;
38
+ private savedRoute?;
39
+ private render?;
40
+ private acceptedIntent?;
41
+ private expiresAt;
42
+ private expiry?;
43
+ private configurationRequest;
44
+ private destroyed;
45
+ private stepWork?;
46
+ private readonly stepTotals;
47
+ private readonly stepReads;
48
+ private readonly stepArtifacts;
49
+ private readonly playback;
50
+ private playbackWork?;
51
+ constructor(ports: RouteServicePorts);
52
+ getPlaybackProgress(): RoutePlaybackProgress | null;
53
+ beforeCameraChange(): void;
54
+ updateRoutePlaybackOptions(options: RoutePlaybackOptions): RouteState;
55
+ private playbackSelection;
56
+ private play;
57
+ startRoutePlayback(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
58
+ resumeRoutePlayback(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
59
+ replayRoutePlayback(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
60
+ pauseRoutePlayback(selection: RouteSelection, context?: EndpointContext): RouteState;
61
+ stopRoutePlayback(selection: RouteSelection, context?: EndpointContext): RouteState;
62
+ /** Called before an explicit floor replacement, never by a React floor watcher.
63
+ * Hinglish: User floor badle to cursor wahi pause ho; Resume hidden floor jump na kare. */
64
+ beforeFloorChange(): void;
65
+ getRoute(): RouteState;
66
+ /** Compact accepted provenance for saved-route orchestration; no display buffers leave the owner.
67
+ * Hinglish: Preview adoption ke event se pehle saved ID ready ho; late ACK ko lease ID na samjhein. */
68
+ getSavedRouteSummary(): SavedRouteSummary | null;
69
+ /** Storage invalidation retires this approval; a different pending restore keeps its own lease guards.
70
+ * Hinglish: Deleted saved ID ka path mite; naya compatible Restore bina wajah cancel na ho. */
71
+ invalidateSavedRoute(id: string): void;
72
+ /** Explicit manual intent; a superseding selection cancels only the older step/camera work.
73
+ * Hinglish: Start ke baad interactive row se own floor/focus chale; late ACK nayi selection na badle. */
74
+ selectRouteStep(selection: RouteStepSelection, context?: EndpointContext): Promise<RouteState>;
75
+ private manualSelection;
76
+ /** Relative navigation reads the authoritative cursor, never a delayed host projection.
77
+ * Hinglish: Previous sirf instruction inspect karta hai; reverse walking permission/backend policy nahi badalti. */
78
+ nextRouteStep(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
79
+ previousRouteStep(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
80
+ private moveStep;
81
+ /** Finish inspects the full selected route again, without Stop/Clear, a solve or an endpoint write.
82
+ * Hinglish: Same cancellation slot use ho; late Finish nayi row/floor/camera ko overwrite na kare. */
83
+ finishRouteSteps(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
84
+ private cancelStep;
85
+ /** Read bounded display data for the current selection; no graph, buffers or UI store are returned.
86
+ * Hinglish: Direct aur Native isi query ko use karein; same page dedupe ho aur late response reject ho. */
87
+ getRouteSteps(request: RouteStepPageRequest, context?: EndpointContext): Promise<RouteStepPage>;
88
+ private rememberStep;
89
+ private clearStepReads;
90
+ private publish;
91
+ private context;
92
+ private intent;
93
+ private cancel;
94
+ private cancelRestore;
95
+ private retire;
96
+ /** Long approved replay lifetimes may exceed the browser's maximum single timeout.
97
+ * Hinglish: Timer cap ke baad baaki wait re-arm ho; retired timer newer route ko touch na kare. */
98
+ private scheduleExpiry;
99
+ /** Called by existing explicit endpoint/map actions, not React dependency watchers.
100
+ * Hinglish: Changed scope/source purana set retire kare; manual floor/theme route ko na badlein. */
101
+ reconcile(): void;
102
+ configureNavigation(input: NavigationConfigInput): RouteState;
103
+ /** Optional renderer capability, using the same accepted configuration in both transports.
104
+ * Hinglish: Static adapter off mode support kare; moving request silently ignore nahi ho. */
105
+ private applyAnimation;
106
+ /** Internal provider entry; public command registration belongs to the host integration checkpoint.
107
+ * Hinglish: Verified saved data wahi camera/steps/playback use kare; restore kabhi auto Start/Play nahi. */
108
+ restoreSavedRoute(id: string, context?: EndpointContext, abort?: AbortSignal): Promise<SavedRoutePreviewState>;
109
+ generateRoute(preferences?: RoutePreferences, context?: EndpointContext): Promise<RouteState>;
110
+ private selection;
111
+ selectRoute(selection: RouteSelection, context?: EndpointContext): RouteState;
112
+ startRoute(selection: RouteSelection, context?: EndpointContext): Promise<RouteState>;
113
+ stopRoute(context?: EndpointContext): RouteState;
114
+ clearRoute(context?: EndpointContext): RouteState;
115
+ private resetRoute;
116
+ /** A temporary rendering outage retires pending work but never replays Generate on restore.
117
+ * Hinglish: Accepted static path reh sakta hai; pending Generate/Start orphan operation na bane. */
118
+ interrupt(): void;
119
+ destroy(): void;
120
+ }
121
+ //# sourceMappingURL=RouteService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteService.d.ts","sourceRoot":"","sources":["../../src/routes/RouteService.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAE9E;8GAC8G;AAC9G,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAAA;IAChD,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3C,gBAAgB,CAAC,CAAC,OAAO,EA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