@wovvmap/ui-headless 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.
- package/README.md +24 -2
- package/dist/HeaderInfoController.d.ts +44 -0
- package/dist/HeaderInfoController.d.ts.map +1 -0
- package/dist/HeaderInfoController.js +112 -0
- package/dist/appearance.d.ts +26 -0
- package/dist/appearance.d.ts.map +1 -0
- package/dist/appearance.js +117 -0
- package/dist/classic/ClassicController.d.ts +124 -0
- package/dist/classic/ClassicController.d.ts.map +1 -0
- package/dist/classic/ClassicController.js +1131 -0
- package/dist/classic/classic.types.d.ts +111 -0
- package/dist/classic/classic.types.d.ts.map +1 -0
- package/dist/classic/classic.types.js +1 -0
- package/dist/classic/index.d.ts +3 -0
- package/dist/classic/index.d.ts.map +1 -0
- package/dist/classic/index.js +2 -0
- package/dist/components.d.ts +253 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +30 -0
- package/dist/directions/DirectionController.d.ts +76 -0
- package/dist/directions/DirectionController.d.ts.map +1 -0
- package/dist/directions/DirectionController.js +467 -0
- package/dist/directions/direction.types.d.ts +81 -0
- package/dist/directions/direction.types.d.ts.map +1 -0
- package/dist/directions/direction.types.js +1 -0
- package/dist/directions/directionPresentation.d.ts +17 -0
- package/dist/directions/directionPresentation.d.ts.map +1 -0
- package/dist/directions/directionPresentation.js +34 -0
- package/dist/flow/DiscoveryFlowController.d.ts +36 -0
- package/dist/flow/DiscoveryFlowController.d.ts.map +1 -0
- package/dist/flow/DiscoveryFlowController.js +162 -0
- package/dist/flow/FlowHistoryController.d.ts +14 -0
- package/dist/flow/FlowHistoryController.d.ts.map +1 -0
- package/dist/flow/FlowHistoryController.js +31 -0
- package/dist/flow/index.d.ts +3 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +2 -0
- package/dist/gallery/PromotionGalleryController.d.ts +32 -0
- package/dist/gallery/PromotionGalleryController.d.ts.map +1 -0
- package/dist/gallery/PromotionGalleryController.js +80 -0
- package/dist/gallery/index.d.ts +2 -0
- package/dist/gallery/index.d.ts.map +1 -0
- package/dist/gallery/index.js +1 -0
- package/dist/headerInfo.d.ts +27 -0
- package/dist/headerInfo.d.ts.map +1 -0
- package/dist/headerInfo.js +70 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/presentation.d.ts +49 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/presentation.js +116 -0
- package/dist/routes/RoutePreviewController.d.ts +61 -0
- package/dist/routes/RoutePreviewController.d.ts.map +1 -0
- package/dist/routes/RoutePreviewController.js +321 -0
- package/dist/routes/playback/RoutePlaybackController.d.ts +26 -0
- package/dist/routes/playback/RoutePlaybackController.d.ts.map +1 -0
- package/dist/routes/playback/RoutePlaybackController.js +115 -0
- package/dist/routes/routePlayback.types.d.ts +38 -0
- package/dist/routes/routePlayback.types.d.ts.map +1 -0
- package/dist/routes/routePlayback.types.js +1 -0
- package/dist/routes/routePreview.types.d.ts +71 -0
- package/dist/routes/routePreview.types.d.ts.map +1 -0
- package/dist/routes/routePreview.types.js +1 -0
- package/dist/routes/routePreviewPresentation.d.ts +8 -0
- package/dist/routes/routePreviewPresentation.d.ts.map +1 -0
- package/dist/routes/routePreviewPresentation.js +26 -0
- package/dist/routes/routeStepIcons.d.ts +15 -0
- package/dist/routes/routeStepIcons.d.ts.map +1 -0
- package/dist/routes/routeStepIcons.js +102 -0
- package/dist/routes/routeStepPresentation.d.ts +5 -0
- package/dist/routes/routeStepPresentation.d.ts.map +1 -0
- package/dist/routes/routeStepPresentation.js +15 -0
- package/dist/routes/routeSteps.types.d.ts +51 -0
- package/dist/routes/routeSteps.types.d.ts.map +1 -0
- package/dist/routes/routeSteps.types.js +1 -0
- package/dist/routes/steps/RouteStepsController.d.ts +49 -0
- package/dist/routes/steps/RouteStepsController.d.ts.map +1 -0
- package/dist/routes/steps/RouteStepsController.js +312 -0
- package/dist/saved-routes/SavedRoutesController.d.ts +76 -0
- package/dist/saved-routes/SavedRoutesController.d.ts.map +1 -0
- package/dist/saved-routes/SavedRoutesController.js +366 -0
- package/dist/storeHours.d.ts +19 -0
- package/dist/storeHours.d.ts.map +1 -0
- package/dist/storeHours.js +155 -0
- package/dist/storeList.d.ts +19 -0
- package/dist/storeList.d.ts.map +1 -0
- package/dist/storeList.js +21 -0
- package/dist/theme.d.ts +42 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +56 -0
- package/package.json +32 -3
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { toViewerCommandError, } from '@wovvmap/contracts';
|
|
2
|
+
/** Explicit list/banner intents read bounded display pages; reads never Generate or move a camera.
|
|
3
|
+
* Hinglish: Dono UI ka same reader ho; band list/banner koi HTTP read na kare. */
|
|
4
|
+
export class RouteStepsController {
|
|
5
|
+
read;
|
|
6
|
+
context;
|
|
7
|
+
selectStep;
|
|
8
|
+
controls;
|
|
9
|
+
activePlaybackStep;
|
|
10
|
+
route = null;
|
|
11
|
+
available = false;
|
|
12
|
+
request = 0;
|
|
13
|
+
pausedRead = false;
|
|
14
|
+
selectionRequest = 0;
|
|
15
|
+
currentVisible = false;
|
|
16
|
+
currentIndex = null;
|
|
17
|
+
listeners = new Set();
|
|
18
|
+
snapshot = {
|
|
19
|
+
enabled: false,
|
|
20
|
+
expanded: false,
|
|
21
|
+
loading: false,
|
|
22
|
+
error: null,
|
|
23
|
+
items: [],
|
|
24
|
+
total: null,
|
|
25
|
+
nextOffset: 0,
|
|
26
|
+
summary: null,
|
|
27
|
+
};
|
|
28
|
+
constructor(read, context, selectStep, controls, activePlaybackStep) {
|
|
29
|
+
this.read = read;
|
|
30
|
+
this.context = context;
|
|
31
|
+
this.selectStep = selectStep;
|
|
32
|
+
this.controls = controls;
|
|
33
|
+
this.activePlaybackStep = activePlaybackStep;
|
|
34
|
+
}
|
|
35
|
+
getSnapshot = () => this.snapshot;
|
|
36
|
+
subscribe = (listener) => {
|
|
37
|
+
this.listeners.add(listener);
|
|
38
|
+
return () => this.listeners.delete(listener);
|
|
39
|
+
};
|
|
40
|
+
/** A mounted instruction banner opts into bounded reads; the accepted route/cursor remain SDK-owned.
|
|
41
|
+
* Hinglish: Banner ka display index sirf page lookup hai; navigation ka dusra store nahi. */
|
|
42
|
+
observeCurrent = (index) => {
|
|
43
|
+
this.currentVisible = true;
|
|
44
|
+
this.currentIndex = index;
|
|
45
|
+
this.sync(this.route, this.available);
|
|
46
|
+
if (this.snapshot.total === null && !this.snapshot.error)
|
|
47
|
+
this.loadMore();
|
|
48
|
+
};
|
|
49
|
+
releaseCurrent = () => {
|
|
50
|
+
this.currentVisible = false;
|
|
51
|
+
this.currentIndex = null;
|
|
52
|
+
if (!this.snapshot.expanded && this.snapshot.loading) {
|
|
53
|
+
++this.request;
|
|
54
|
+
this.pausedRead = true;
|
|
55
|
+
this.update({ loading: false });
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
sync(route, available) {
|
|
59
|
+
const previous = this.route;
|
|
60
|
+
const resumed = available && !this.available;
|
|
61
|
+
const paused = !available && this.available;
|
|
62
|
+
this.available = available;
|
|
63
|
+
this.route = route;
|
|
64
|
+
// A stopped journey leaves manual inspection; a later Start opens the playback surface again.
|
|
65
|
+
// Hinglish: Stop par list collapse ho, cached rows bachein; next Start par old steps mode na khule.
|
|
66
|
+
if (previous?.stage === 'guiding' && route?.stage !== 'guiding' && this.snapshot.expanded)
|
|
67
|
+
this.update({ expanded: false });
|
|
68
|
+
const enabled = !!this.read && !!route?.routeSet && route.config.steps !== 'off';
|
|
69
|
+
const interactive = !!this.selectStep && route?.stage === 'guiding' && route.config.steps === 'interactive';
|
|
70
|
+
const selectedStepIndex = route?.stage === 'guiding' ? (route.selectedStep?.stepIndex ?? null) : null;
|
|
71
|
+
const newlyEnabled = enabled && !this.snapshot.enabled;
|
|
72
|
+
const changed = previous?.routeSet?.routeSetId !== route?.routeSet?.routeSetId ||
|
|
73
|
+
previous?.selectedRouteId !== route?.selectedRouteId;
|
|
74
|
+
const summary = route?.routeSet?.options.find((option) => option.routeId === route.selectedRouteId) ?? null;
|
|
75
|
+
if (changed || (!enabled && this.snapshot.enabled)) {
|
|
76
|
+
++this.request;
|
|
77
|
+
this.pausedRead = false;
|
|
78
|
+
this.update({
|
|
79
|
+
items: [],
|
|
80
|
+
total: null,
|
|
81
|
+
nextOffset: 0,
|
|
82
|
+
loading: false,
|
|
83
|
+
error: null,
|
|
84
|
+
expanded: enabled && this.snapshot.expanded,
|
|
85
|
+
enabled,
|
|
86
|
+
summary,
|
|
87
|
+
offset: 0,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
this.update({ enabled, summary });
|
|
92
|
+
if (changed || !available || !interactive) {
|
|
93
|
+
this.dismissFeedback();
|
|
94
|
+
}
|
|
95
|
+
this.update({ interactive, selectedStepIndex });
|
|
96
|
+
const visibleStepIndex = selectedStepIndex ??
|
|
97
|
+
(route?.stage === 'guiding'
|
|
98
|
+
? (this.currentIndex ?? this.activePlaybackStep?.() ?? (this.currentVisible ? 0 : null))
|
|
99
|
+
: null);
|
|
100
|
+
// An external SDK selection can target an unloaded row: read only its bounded page, not every intervening page.
|
|
101
|
+
// Hinglish: SDK se door wala step select ho to usi page par list aaye; hazaar pages ka loop nahi.
|
|
102
|
+
if (available &&
|
|
103
|
+
visibleStepIndex !== null &&
|
|
104
|
+
(this.snapshot.expanded || this.currentVisible) &&
|
|
105
|
+
(visibleStepIndex < (this.snapshot.offset ?? 0) ||
|
|
106
|
+
visibleStepIndex >= (this.snapshot.offset ?? 0) + this.snapshot.items.length) &&
|
|
107
|
+
!this.snapshot.loading) {
|
|
108
|
+
const offset = Math.floor(visibleStepIndex / 20) * 20;
|
|
109
|
+
if (this.snapshot.offset !== offset || this.snapshot.total !== null) {
|
|
110
|
+
++this.request;
|
|
111
|
+
this.update({ items: [], offset, nextOffset: offset, total: null, error: null });
|
|
112
|
+
this.loadMore();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (paused) {
|
|
116
|
+
++this.request;
|
|
117
|
+
// A resumed next page must not depend on another scroll-end notification for unchanged rows.
|
|
118
|
+
// Hinglish: Same rows ke scroll sentinel se dobara event na aaye tab bhi paused offset resume ho.
|
|
119
|
+
this.pausedRead = this.snapshot.loading;
|
|
120
|
+
this.update({ loading: false });
|
|
121
|
+
}
|
|
122
|
+
if ((changed || resumed || newlyEnabled) &&
|
|
123
|
+
available &&
|
|
124
|
+
enabled &&
|
|
125
|
+
(this.snapshot.expanded || this.currentVisible) &&
|
|
126
|
+
(this.snapshot.total === null || this.pausedRead) &&
|
|
127
|
+
!this.snapshot.error)
|
|
128
|
+
this.loadMore();
|
|
129
|
+
}
|
|
130
|
+
toggle = () => {
|
|
131
|
+
this.setExpanded(!this.snapshot.expanded);
|
|
132
|
+
};
|
|
133
|
+
/** Reuse bounded pages for explicit instruction-review presentation without toggling from render hooks.
|
|
134
|
+
* Hinglish: Review screen wahi paged reader khole; naya store/read loop nahi. */
|
|
135
|
+
setExpanded(expanded) {
|
|
136
|
+
if (!this.snapshot.enabled || expanded === this.snapshot.expanded)
|
|
137
|
+
return;
|
|
138
|
+
this.update({ expanded });
|
|
139
|
+
if (this.snapshot.expanded)
|
|
140
|
+
this.sync(this.route, this.available);
|
|
141
|
+
if (this.snapshot.expanded && (this.snapshot.total === null || this.pausedRead))
|
|
142
|
+
this.loadMore();
|
|
143
|
+
}
|
|
144
|
+
retry = () => {
|
|
145
|
+
this.loadMore();
|
|
146
|
+
};
|
|
147
|
+
/** Explicit Back/Stop/Clear retires unsent step intents before a delayed Native route event.
|
|
148
|
+
* Hinglish: Purana queued focus na bheje; sent work SDK cancel kare, accepted step/camera yahan na badle. */
|
|
149
|
+
dismissFeedback() {
|
|
150
|
+
++this.selectionRequest;
|
|
151
|
+
this.update({ pendingStepIndex: null, pendingControl: null, selectionError: null });
|
|
152
|
+
}
|
|
153
|
+
/** UI feedback only; accepted row selection still comes from the SDK routeChanged event.
|
|
154
|
+
* Hinglish: Click se optimistic selected row nahi; real floor/focus success par SDK event aaye. */
|
|
155
|
+
select = (stepIndex) => {
|
|
156
|
+
const route = this.route;
|
|
157
|
+
if (!this.available ||
|
|
158
|
+
!this.snapshot.interactive ||
|
|
159
|
+
!this.selectStep ||
|
|
160
|
+
!route?.routeSet ||
|
|
161
|
+
!route.selectedRouteId ||
|
|
162
|
+
this.snapshot.pendingStepIndex === stepIndex)
|
|
163
|
+
return;
|
|
164
|
+
const selection = {
|
|
165
|
+
routeSetId: route.routeSet.routeSetId,
|
|
166
|
+
routeId: route.selectedRouteId,
|
|
167
|
+
stepIndex,
|
|
168
|
+
};
|
|
169
|
+
const context = this.context();
|
|
170
|
+
this.runIntent(() => this.selectStep(selection, context), {
|
|
171
|
+
pendingStepIndex: stepIndex,
|
|
172
|
+
pendingControl: null,
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
next = () => {
|
|
176
|
+
if (this.snapshot.canNext)
|
|
177
|
+
this.runControl('next');
|
|
178
|
+
};
|
|
179
|
+
previous = () => {
|
|
180
|
+
if (this.snapshot.canPrevious)
|
|
181
|
+
this.runControl('previous');
|
|
182
|
+
};
|
|
183
|
+
finish = () => {
|
|
184
|
+
if (this.snapshot.canFinish)
|
|
185
|
+
this.runControl('finish');
|
|
186
|
+
};
|
|
187
|
+
/** Relative targets are never calculated from the UI's potentially delayed projection.
|
|
188
|
+
* Hinglish: Shared viewer current step jaanta hai; UI sirf intent aur local feedback bheje. */
|
|
189
|
+
runControl(kind) {
|
|
190
|
+
const route = this.route;
|
|
191
|
+
if (!this.available ||
|
|
192
|
+
!this.snapshot.controls ||
|
|
193
|
+
this.snapshot.pendingControl ||
|
|
194
|
+
this.snapshot.pendingStepIndex != null ||
|
|
195
|
+
!route?.routeSet ||
|
|
196
|
+
!route.selectedRouteId)
|
|
197
|
+
return;
|
|
198
|
+
const action = kind === 'next'
|
|
199
|
+
? this.controls?.nextRouteStep
|
|
200
|
+
: kind === 'previous'
|
|
201
|
+
? this.controls?.previousRouteStep
|
|
202
|
+
: this.controls?.finishRouteSteps;
|
|
203
|
+
if (!action)
|
|
204
|
+
return;
|
|
205
|
+
const selection = { routeSetId: route.routeSet.routeSetId, routeId: route.selectedRouteId };
|
|
206
|
+
const context = this.context();
|
|
207
|
+
this.runIntent(() => action(selection, context), {
|
|
208
|
+
pendingStepIndex: null,
|
|
209
|
+
pendingControl: kind,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
runIntent(action, pending) {
|
|
213
|
+
const request = ++this.selectionRequest;
|
|
214
|
+
this.update({ ...pending, selectionError: null });
|
|
215
|
+
void Promise.resolve()
|
|
216
|
+
.then(() => {
|
|
217
|
+
if (request !== this.selectionRequest || !this.available)
|
|
218
|
+
return;
|
|
219
|
+
return action();
|
|
220
|
+
})
|
|
221
|
+
.catch((error) => {
|
|
222
|
+
if (request !== this.selectionRequest)
|
|
223
|
+
return;
|
|
224
|
+
const failure = toViewerCommandError(error);
|
|
225
|
+
this.update({
|
|
226
|
+
selectionError: failure ? 'Step navigation could not complete. Try again.' : null,
|
|
227
|
+
});
|
|
228
|
+
})
|
|
229
|
+
.finally(() => {
|
|
230
|
+
if (request === this.selectionRequest)
|
|
231
|
+
this.update({ pendingStepIndex: null, pendingControl: null });
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
loadMore = () => {
|
|
235
|
+
const { routeSet, selectedRouteId } = this.route ?? {};
|
|
236
|
+
if (!this.available ||
|
|
237
|
+
!this.snapshot.enabled ||
|
|
238
|
+
(!this.snapshot.expanded && !this.currentVisible) ||
|
|
239
|
+
this.snapshot.loading ||
|
|
240
|
+
this.snapshot.nextOffset === null ||
|
|
241
|
+
!routeSet ||
|
|
242
|
+
!selectedRouteId ||
|
|
243
|
+
!this.read)
|
|
244
|
+
return;
|
|
245
|
+
const request = ++this.request;
|
|
246
|
+
this.pausedRead = false;
|
|
247
|
+
const offset = this.snapshot.nextOffset;
|
|
248
|
+
const selection = {
|
|
249
|
+
routeSetId: routeSet.routeSetId,
|
|
250
|
+
routeId: selectedRouteId,
|
|
251
|
+
offset,
|
|
252
|
+
limit: 20,
|
|
253
|
+
};
|
|
254
|
+
const context = this.context();
|
|
255
|
+
this.update({ loading: true, error: null });
|
|
256
|
+
void Promise.resolve()
|
|
257
|
+
.then(() => {
|
|
258
|
+
if (request !== this.request || !this.available)
|
|
259
|
+
return null;
|
|
260
|
+
return this.read(selection, context);
|
|
261
|
+
})
|
|
262
|
+
.then((page) => {
|
|
263
|
+
if (request !== this.request || !page)
|
|
264
|
+
return;
|
|
265
|
+
if (page.routeSetId !== selection.routeSetId ||
|
|
266
|
+
page.routeId !== selection.routeId ||
|
|
267
|
+
page.offset !== offset)
|
|
268
|
+
throw new Error('These instructions are no longer available.');
|
|
269
|
+
this.update({
|
|
270
|
+
items: offset === (this.snapshot.offset ?? 0)
|
|
271
|
+
? page.items
|
|
272
|
+
: [...this.snapshot.items, ...page.items],
|
|
273
|
+
total: page.total,
|
|
274
|
+
nextOffset: page.nextOffset,
|
|
275
|
+
loading: false,
|
|
276
|
+
});
|
|
277
|
+
})
|
|
278
|
+
.catch((error) => {
|
|
279
|
+
if (request !== this.request)
|
|
280
|
+
return;
|
|
281
|
+
const failure = toViewerCommandError(error);
|
|
282
|
+
this.update({
|
|
283
|
+
loading: false,
|
|
284
|
+
// A current read may be interrupted while the accepted route stays unchanged.
|
|
285
|
+
// Hinglish: Purane request upar ignore hote hain; current cancel par Retry ka rasta dikhe.
|
|
286
|
+
error: failure?.code === 'CANCELLED'
|
|
287
|
+
? 'Instructions were interrupted. Retry to continue.'
|
|
288
|
+
: (failure?.message ?? null),
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
update(patch) {
|
|
293
|
+
const next = { ...this.snapshot, ...patch };
|
|
294
|
+
const controls = !!next.interactive &&
|
|
295
|
+
!!this.controls?.nextRouteStep &&
|
|
296
|
+
!!this.controls.previousRouteStep &&
|
|
297
|
+
!!this.controls.finishRouteSteps;
|
|
298
|
+
const total = next.total ?? 0, index = next.selectedStepIndex ?? -1;
|
|
299
|
+
const last = total > 0 && index === total - 1;
|
|
300
|
+
Object.assign(next, {
|
|
301
|
+
controls,
|
|
302
|
+
isLastStep: last,
|
|
303
|
+
canPrevious: controls && total > 0 && index > 0,
|
|
304
|
+
canNext: controls && total > 0 && index < total - 1,
|
|
305
|
+
canFinish: controls && last,
|
|
306
|
+
});
|
|
307
|
+
if (Object.keys(next).every((key) => Object.is(next[key], this.snapshot[key])))
|
|
308
|
+
return;
|
|
309
|
+
this.snapshot = next;
|
|
310
|
+
this.listeners.forEach((listener) => listener());
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type OfflineRouteState, type SavedRouteSummary, type ViewerTransport } from '@wovvmap/contracts';
|
|
2
|
+
import type { ViewerUIOperations } from '@wovvmap/runtime-core';
|
|
3
|
+
export type SavedRoutesBindings = Pick<ViewerUIOperations, 'prepareOfflineRoute' | 'getSavedRoutes' | 'restoreOfflineRoute' | 'removeOfflineRoute' | 'cancelOfflineRouteOperation' | 'getOfflineRouteState' | 'getRoute' | 'prepareOfflineMap' | 'configureOffline' | 'getOfflineState' | 'cancelOfflineOperation'> & Pick<ViewerTransport, 'on'>;
|
|
4
|
+
type SavedCommands = Omit<SavedRoutesBindings, 'on'>;
|
|
5
|
+
type SavedRoutesSource = {
|
|
6
|
+
[K in keyof SavedCommands]: (...args: Parameters<SavedCommands[K]>) => ReturnType<SavedCommands[K]> | Awaited<ReturnType<SavedCommands[K]>>;
|
|
7
|
+
} & Pick<ViewerTransport, 'on'>;
|
|
8
|
+
/** Normalize sync direct methods and asynchronous WebView operations at one presentation boundary.
|
|
9
|
+
* Hinglish: Har component mein wrappers repeat na hon; actual commands same SDK owner ko jayenge. */
|
|
10
|
+
export declare function createSavedRoutesBindings(source: SavedRoutesSource): SavedRoutesBindings;
|
|
11
|
+
export interface SavedRoutesSnapshot {
|
|
12
|
+
readonly open: boolean;
|
|
13
|
+
readonly loading: boolean;
|
|
14
|
+
readonly busy: boolean;
|
|
15
|
+
readonly enabled: boolean;
|
|
16
|
+
readonly supported: boolean;
|
|
17
|
+
readonly saved: boolean;
|
|
18
|
+
readonly canSave: boolean;
|
|
19
|
+
readonly status: OfflineRouteState['status'];
|
|
20
|
+
readonly items: readonly SavedRouteSummary[];
|
|
21
|
+
readonly error: string | null;
|
|
22
|
+
readonly needsMap: boolean;
|
|
23
|
+
readonly confirmId: string | null;
|
|
24
|
+
}
|
|
25
|
+
/** Presentation queries and disclosure only; accepted routes and durable jobs remain SDK-owned.
|
|
26
|
+
* Hinglish: List/open/confirm UI state yahan; save/restore logic, graph aur geometry SDK mein rahein. */
|
|
27
|
+
export declare class SavedRoutesController {
|
|
28
|
+
private readonly api;
|
|
29
|
+
private readonly restored;
|
|
30
|
+
private listeners;
|
|
31
|
+
private opened;
|
|
32
|
+
private loading;
|
|
33
|
+
private items;
|
|
34
|
+
private error;
|
|
35
|
+
private confirmId;
|
|
36
|
+
private request;
|
|
37
|
+
private pending;
|
|
38
|
+
private stateVersion;
|
|
39
|
+
private routeVersion;
|
|
40
|
+
private mapVersion;
|
|
41
|
+
private expiryTimer?;
|
|
42
|
+
private mapBusy;
|
|
43
|
+
private mapReady;
|
|
44
|
+
private operation;
|
|
45
|
+
private connected;
|
|
46
|
+
private syncRequest;
|
|
47
|
+
private route;
|
|
48
|
+
private state;
|
|
49
|
+
private snapshot;
|
|
50
|
+
constructor(api: SavedRoutesBindings, restored?: () => void);
|
|
51
|
+
getSnapshot: () => SavedRoutesSnapshot;
|
|
52
|
+
subscribe: (listener: () => void) => () => boolean;
|
|
53
|
+
connect: () => () => void;
|
|
54
|
+
private sync;
|
|
55
|
+
open: () => void;
|
|
56
|
+
close: () => void;
|
|
57
|
+
/** Retire list reads on every exit, including successful Restore without cancelling its preview.
|
|
58
|
+
* Hinglish: Close aur restored preview dono par purani list/timer band hon; accepted path na mite. */
|
|
59
|
+
private dismiss;
|
|
60
|
+
refresh: () => Promise<void>;
|
|
61
|
+
save: () => void;
|
|
62
|
+
restore: (id: string) => void;
|
|
63
|
+
confirmRemove: (id: string | null) => void;
|
|
64
|
+
remove: () => void;
|
|
65
|
+
cancel: () => void;
|
|
66
|
+
saveMap: () => void;
|
|
67
|
+
private run;
|
|
68
|
+
private read;
|
|
69
|
+
/** One bounded deadline removes expired rows while a list stays open; no polling or render-time clock.
|
|
70
|
+
* Hinglish: List khuli rahe tab expiry par row hate; har render ya frame mein DB read nahi. */
|
|
71
|
+
private scheduleExpiry;
|
|
72
|
+
private publish;
|
|
73
|
+
}
|
|
74
|
+
export type SavedRoutesActions = Pick<SavedRoutesController, 'open' | 'close' | 'refresh' | 'save' | 'restore' | 'confirmRemove' | 'remove' | 'cancel' | 'saveMap'>;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=SavedRoutesController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SavedRoutesController.d.ts","sourceRoot":"","sources":["../../src/saved-routes/SavedRoutesController.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,kBAAkB,EAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,oBAAoB,GACpB,6BAA6B,GAC7B,sBAAsB,GACtB,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,CAC3B,GACC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;AAC7B,KAAK,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;AACpD,KAAK,i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