@ingissa/navcore-types 1.0.8 → 1.0.9
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/index.d.mts +384 -0
- package/dist/index.d.ts +381 -8
- package/dist/index.js +31 -11
- package/dist/index.mjs +29 -0
- package/package.json +4 -8
- package/dist/builder.d.ts +0 -73
- package/dist/builder.js +0 -7
- package/dist/core.d.ts +0 -149
- package/dist/core.js +0 -4
- package/dist/directions.d.ts +0 -67
- package/dist/directions.js +0 -10
- package/dist/exam.d.ts +0 -46
- package/dist/exam.js +0 -7
- package/dist/renderer.d.ts +0 -43
- package/dist/renderer.js +0 -39
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types used throughout the NavCore SDK.
|
|
3
|
+
*/
|
|
4
|
+
/** [longitude, latitude] — Mapbox/GeoJSON order */
|
|
5
|
+
type Coord = [number, number];
|
|
6
|
+
/** GPS update from the device */
|
|
7
|
+
interface NavGpsUpdate {
|
|
8
|
+
coord: Coord;
|
|
9
|
+
accuracy: number | null;
|
|
10
|
+
bearing: number | null;
|
|
11
|
+
speed: number;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
}
|
|
14
|
+
/** Full navigation engine state snapshot */
|
|
15
|
+
interface NavCoreState {
|
|
16
|
+
snappedCoord: Coord | null;
|
|
17
|
+
ghostCoord: Coord | null;
|
|
18
|
+
rawGpsCoord: Coord | null;
|
|
19
|
+
bearing: number;
|
|
20
|
+
rawGpsBearing: number | null;
|
|
21
|
+
routeIndex: number;
|
|
22
|
+
anchorRouteIndex: number | null;
|
|
23
|
+
distanceToRoute: number;
|
|
24
|
+
corridor: number;
|
|
25
|
+
confidence: number;
|
|
26
|
+
isOffRoute: boolean;
|
|
27
|
+
navFsmState: string;
|
|
28
|
+
progressIndex: number;
|
|
29
|
+
hasArrived: boolean;
|
|
30
|
+
rejoinCandidate: {
|
|
31
|
+
coord: Coord;
|
|
32
|
+
index: number;
|
|
33
|
+
} | null;
|
|
34
|
+
confidenceCone: {
|
|
35
|
+
center: Coord;
|
|
36
|
+
bearing: number;
|
|
37
|
+
angle: number;
|
|
38
|
+
length: number;
|
|
39
|
+
} | null;
|
|
40
|
+
alertState: 'NONE' | 'DEVIATING' | 'RECALCULATING' | 'REJOINING' | 'REJOINED';
|
|
41
|
+
detourMode: 'NONE' | 'FREE' | 'COMMITTED';
|
|
42
|
+
detourCommitProgress: number;
|
|
43
|
+
distanceToNextInstruction: number | null;
|
|
44
|
+
distanceToDestination: number | null;
|
|
45
|
+
nextInstrIdx: number | null;
|
|
46
|
+
nextInstructionIndex: number | null;
|
|
47
|
+
isGpsStale: boolean;
|
|
48
|
+
gpsAgeMs: number;
|
|
49
|
+
currentSpeed: number;
|
|
50
|
+
licenseStatus: NavLicenseInfo | string;
|
|
51
|
+
offRouteState?: string;
|
|
52
|
+
lifecycleState?: string;
|
|
53
|
+
stability?: {
|
|
54
|
+
oscillation: number;
|
|
55
|
+
drift: number;
|
|
56
|
+
jump: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Navigation lifecycle states */
|
|
60
|
+
type NavLifecycleState = 'IDLE' | 'OVERVIEW' | 'APPROACHING_ROUTE' | 'ON_ROUTE' | 'DEVIATING' | 'OFF_ROUTE' | 'REROUTING' | 'REJOINING' | 'REJOINED' | 'FAILED';
|
|
61
|
+
/** License validation status */
|
|
62
|
+
type LicenseStatus = 'VALID' | 'INVALID' | 'EXPIRED' | 'MISSING';
|
|
63
|
+
/** License info returned by the engine */
|
|
64
|
+
interface NavLicenseInfo {
|
|
65
|
+
plan: 'free' | 'pro' | 'ai';
|
|
66
|
+
limitations: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Engine configuration (all optional with defaults) */
|
|
69
|
+
interface NavOptions {
|
|
70
|
+
baseCorridorMeters?: number;
|
|
71
|
+
speedFactor?: number;
|
|
72
|
+
maxCorridorMeters?: number;
|
|
73
|
+
gpsAccuracyFactor?: number;
|
|
74
|
+
offRouteConfirmMs?: number;
|
|
75
|
+
rejoinConfirmMs?: number;
|
|
76
|
+
rejoinCooldownMs?: number;
|
|
77
|
+
startupGraceMs?: number;
|
|
78
|
+
betaCorrection?: number;
|
|
79
|
+
gpsAgeCapSeconds?: number;
|
|
80
|
+
gpsStaleMs?: number;
|
|
81
|
+
drMaxAgeMs?: number;
|
|
82
|
+
detourCommitMs?: number;
|
|
83
|
+
bearingSmoothingAlpha?: number;
|
|
84
|
+
detourBearingThreshold?: number;
|
|
85
|
+
lookAheadSeconds?: number;
|
|
86
|
+
minLookAheadMeters?: number;
|
|
87
|
+
maxLookAheadMeters?: number;
|
|
88
|
+
arrivalThresholdMeters?: number;
|
|
89
|
+
isCircuit?: boolean;
|
|
90
|
+
kalmanQ?: number;
|
|
91
|
+
kalmanRBase?: number;
|
|
92
|
+
licenseKey?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Navigation instruction (turn-by-turn step) */
|
|
95
|
+
interface NavInstruction {
|
|
96
|
+
location: Coord;
|
|
97
|
+
geometryIndex: number;
|
|
98
|
+
text?: string;
|
|
99
|
+
instruction?: string;
|
|
100
|
+
cumulativeOffset?: number;
|
|
101
|
+
}
|
|
102
|
+
/** Deviation event emitted when vehicle goes off-route */
|
|
103
|
+
interface DeviationEvent {
|
|
104
|
+
anchorIndex: number;
|
|
105
|
+
ghostCoord: Coord;
|
|
106
|
+
rejoinTarget: {
|
|
107
|
+
coordinates: Coord;
|
|
108
|
+
index: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Alert event emitted on state changes */
|
|
112
|
+
interface AlertEvent {
|
|
113
|
+
type: NavCoreState['alertState'];
|
|
114
|
+
message: string | null;
|
|
115
|
+
}
|
|
116
|
+
/** Feature key for license gating */
|
|
117
|
+
type FeatureKey = 'advanced_snapping' | 'dead_reckoning' | 'route_offset' | 'progress_tracking' | 'advanced_bearing' | 'compound_deviation' | 'nav_ai';
|
|
118
|
+
/** Route snapping result */
|
|
119
|
+
interface SnapResult {
|
|
120
|
+
idx: number;
|
|
121
|
+
dist: number;
|
|
122
|
+
proj: Coord;
|
|
123
|
+
}
|
|
124
|
+
/** Dead reckoning prediction */
|
|
125
|
+
interface DRPrediction {
|
|
126
|
+
predictedCoord: Coord;
|
|
127
|
+
isActive: boolean;
|
|
128
|
+
ageMs: number;
|
|
129
|
+
}
|
|
130
|
+
/** Dead reckoning anchor point */
|
|
131
|
+
interface DRAnchor {
|
|
132
|
+
coord: Coord;
|
|
133
|
+
idx: number;
|
|
134
|
+
ts: number;
|
|
135
|
+
}
|
|
136
|
+
/** Line style for renderer adapters */
|
|
137
|
+
interface LineStyle {
|
|
138
|
+
color?: string;
|
|
139
|
+
width?: number;
|
|
140
|
+
opacity?: number;
|
|
141
|
+
dashPattern?: number[];
|
|
142
|
+
}
|
|
143
|
+
/** Camera target for renderer adapters */
|
|
144
|
+
interface CameraTarget {
|
|
145
|
+
coord: Coord;
|
|
146
|
+
bearing: number;
|
|
147
|
+
zoom?: number;
|
|
148
|
+
pitch?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* NavCoreRenderer — Adapter contract
|
|
153
|
+
*
|
|
154
|
+
* Any map renderer (Mapbox, MapLibre, Leaflet, or a headless test harness)
|
|
155
|
+
* implements this interface to receive rendering commands from NavCore.
|
|
156
|
+
*
|
|
157
|
+
* NavCore NEVER depends on a specific renderer — adapters depend on core,
|
|
158
|
+
* core never depends on adapters.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
interface NavCoreRenderer {
|
|
162
|
+
/** Update the vehicle marker position and rotation */
|
|
163
|
+
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
164
|
+
/** Draw or update the main route polyline */
|
|
165
|
+
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
166
|
+
/** Draw or clear the detour/reroute polyline */
|
|
167
|
+
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
168
|
+
/** Show or hide the ghost vehicle (on-route projection when off-route) */
|
|
169
|
+
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
170
|
+
/** Set the camera center, bearing, and optional zoom */
|
|
171
|
+
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
172
|
+
/** Animate the camera to a target over durationMs */
|
|
173
|
+
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
174
|
+
/** Teardown — release all map resources */
|
|
175
|
+
destroy(): void;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* HeadlessRenderer — No-op implementation for CI/CD testing.
|
|
179
|
+
* Records all calls for assertion in integration tests.
|
|
180
|
+
*/
|
|
181
|
+
declare class HeadlessRenderer implements NavCoreRenderer {
|
|
182
|
+
readonly calls: Array<{
|
|
183
|
+
method: string;
|
|
184
|
+
args: unknown[];
|
|
185
|
+
}>;
|
|
186
|
+
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
187
|
+
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
188
|
+
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
189
|
+
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
190
|
+
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
191
|
+
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
192
|
+
destroy(): void;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* DirectionsProvider — Data source contract
|
|
197
|
+
*
|
|
198
|
+
* Any directions API (Mapbox, OSRM, Valhalla, or a custom server)
|
|
199
|
+
* implements this interface to provide routing data to NavCore.
|
|
200
|
+
*
|
|
201
|
+
* The provider MUST handle waypoint chunking internally if the
|
|
202
|
+
* underlying API has waypoint limits. NavCore imposes no limit.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
/** Options for route calculation */
|
|
206
|
+
interface RouteOptions {
|
|
207
|
+
/** Driving profile: 'driving' | 'driving-traffic' | 'cycling' | 'walking' */
|
|
208
|
+
profile?: string;
|
|
209
|
+
/** Request alternatives */
|
|
210
|
+
alternatives?: boolean;
|
|
211
|
+
/** Include step-by-step instructions */
|
|
212
|
+
steps?: boolean;
|
|
213
|
+
/** Geometry format: 'geojson' | 'polyline' | 'polyline6' */
|
|
214
|
+
geometries?: string;
|
|
215
|
+
/** Route overview level: 'full' | 'simplified' | 'false' */
|
|
216
|
+
overview?: string;
|
|
217
|
+
/** Language code for instructions (e.g. 'en', 'fr', 'nl') */
|
|
218
|
+
language?: string;
|
|
219
|
+
}
|
|
220
|
+
/** A single route leg between two waypoints */
|
|
221
|
+
interface RouteLeg {
|
|
222
|
+
distance: number;
|
|
223
|
+
duration: number;
|
|
224
|
+
steps?: RouteStep[];
|
|
225
|
+
}
|
|
226
|
+
/** A single step within a leg */
|
|
227
|
+
interface RouteStep {
|
|
228
|
+
distance: number;
|
|
229
|
+
duration: number;
|
|
230
|
+
geometry: Coord[];
|
|
231
|
+
maneuver: {
|
|
232
|
+
type: string;
|
|
233
|
+
modifier?: string;
|
|
234
|
+
location: Coord;
|
|
235
|
+
bearing_before: number;
|
|
236
|
+
bearing_after: number;
|
|
237
|
+
instruction?: string;
|
|
238
|
+
};
|
|
239
|
+
name?: string;
|
|
240
|
+
}
|
|
241
|
+
/** Complete route result from a directions provider */
|
|
242
|
+
interface RouteResult {
|
|
243
|
+
/** Full route geometry */
|
|
244
|
+
geometry: Coord[];
|
|
245
|
+
/** Total distance in metres */
|
|
246
|
+
distance: number;
|
|
247
|
+
/** Total duration in seconds */
|
|
248
|
+
duration: number;
|
|
249
|
+
/** Individual legs */
|
|
250
|
+
legs: RouteLeg[];
|
|
251
|
+
/** Raw provider response (for debugging) */
|
|
252
|
+
raw?: unknown;
|
|
253
|
+
}
|
|
254
|
+
/** The provider interface */
|
|
255
|
+
interface DirectionsProvider {
|
|
256
|
+
/**
|
|
257
|
+
* Calculate a route through the given waypoints.
|
|
258
|
+
* Must handle chunking internally if the provider has waypoint limits.
|
|
259
|
+
*/
|
|
260
|
+
getRoute(waypoints: Coord[], options?: RouteOptions): Promise<RouteResult>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* CustomRouteBuilder — Types for building custom routes
|
|
265
|
+
*
|
|
266
|
+
* Build routes with unlimited waypoints, GPX/GeoJSON import/export,
|
|
267
|
+
* and configurable chunking strategies.
|
|
268
|
+
*/
|
|
269
|
+
|
|
270
|
+
/** Options when adding a waypoint */
|
|
271
|
+
interface WaypointOptions {
|
|
272
|
+
/** Whether this is a silent waypoint (no instruction generated) */
|
|
273
|
+
silent?: boolean;
|
|
274
|
+
/** Optional name/label for the waypoint */
|
|
275
|
+
name?: string;
|
|
276
|
+
}
|
|
277
|
+
/** How to connect waypoints when building */
|
|
278
|
+
interface BuildOptions {
|
|
279
|
+
/** Connection mode between waypoints */
|
|
280
|
+
connectionMode?: 'ROUTED' | 'STRAIGHT' | 'MIXED';
|
|
281
|
+
/** Chunk overlap strategy for multi-segment API calls */
|
|
282
|
+
chunkStrategy?: 'OVERLAP_1' | 'OVERLAP_2';
|
|
283
|
+
/** Maximum waypoints per API call (provider-specific, default 25) */
|
|
284
|
+
maxWaypointsPerChunk?: number;
|
|
285
|
+
}
|
|
286
|
+
/** A waypoint in the custom route */
|
|
287
|
+
interface CustomWaypoint {
|
|
288
|
+
id: string;
|
|
289
|
+
coord: Coord;
|
|
290
|
+
options?: WaypointOptions;
|
|
291
|
+
}
|
|
292
|
+
/** The built custom route */
|
|
293
|
+
interface CustomRoute {
|
|
294
|
+
/** Full stitched geometry */
|
|
295
|
+
geometry: Coord[];
|
|
296
|
+
/** Individual waypoints */
|
|
297
|
+
waypoints: CustomWaypoint[];
|
|
298
|
+
/** Total distance in metres */
|
|
299
|
+
distance: number;
|
|
300
|
+
/** Total duration in seconds */
|
|
301
|
+
duration: number;
|
|
302
|
+
}
|
|
303
|
+
/** GeoJSON FeatureCollection (minimal typing for zero-dep constraint) */
|
|
304
|
+
interface FeatureCollection {
|
|
305
|
+
type: 'FeatureCollection';
|
|
306
|
+
features: Array<{
|
|
307
|
+
type: 'Feature';
|
|
308
|
+
geometry: {
|
|
309
|
+
type: string;
|
|
310
|
+
coordinates: Coord[] | Coord;
|
|
311
|
+
};
|
|
312
|
+
properties: Record<string, unknown>;
|
|
313
|
+
}>;
|
|
314
|
+
}
|
|
315
|
+
/** The builder interface */
|
|
316
|
+
interface CustomRouteBuilderInterface {
|
|
317
|
+
/** Add a waypoint at the end of the route */
|
|
318
|
+
addWaypoint(coord: Coord, options?: WaypointOptions): string;
|
|
319
|
+
/** Insert a waypoint after an existing one */
|
|
320
|
+
insertWaypoint(coord: Coord, afterId: string): string;
|
|
321
|
+
/** Remove a waypoint by ID */
|
|
322
|
+
removeWaypoint(id: string): void;
|
|
323
|
+
/** Move an existing waypoint to a new coordinate */
|
|
324
|
+
moveWaypoint(id: string, newCoord: Coord): void;
|
|
325
|
+
/** Build the route using the configured directions provider */
|
|
326
|
+
build(options?: BuildOptions): Promise<CustomRoute>;
|
|
327
|
+
/** Import waypoints from a GPX string */
|
|
328
|
+
fromGPX(gpxString: string): void;
|
|
329
|
+
/** Import waypoints from a GeoJSON FeatureCollection */
|
|
330
|
+
fromGeoJSON(geojson: FeatureCollection): void;
|
|
331
|
+
/** Export the current route as GeoJSON */
|
|
332
|
+
toGeoJSON(): FeatureCollection;
|
|
333
|
+
/** Export the current route as GPX */
|
|
334
|
+
toGPX(): string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* ExamInstruction — Klaroways-specific extension
|
|
339
|
+
*
|
|
340
|
+
* Extends the base NavInstruction with exam-specific scoring fields,
|
|
341
|
+
* trigger conditions, and mandatory/optional classification.
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
/** Actions the examiner evaluates */
|
|
345
|
+
type ExamAction = 'MIRROR_CHECK' | 'SIGNAL' | 'OBSERVATION' | 'SPEED_REDUCE' | 'BLIND_SPOT_CHECK' | 'YIELD' | 'FULL_STOP' | 'LANE_POSITION';
|
|
346
|
+
/** Condition that must be met for the instruction to trigger */
|
|
347
|
+
interface TriggerCondition {
|
|
348
|
+
minSpeedKmh?: number;
|
|
349
|
+
maxSpeedKmh?: number;
|
|
350
|
+
timeOfDay?: {
|
|
351
|
+
from: string;
|
|
352
|
+
to: string;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/** Exam instruction extending the base navigation instruction */
|
|
356
|
+
interface ExamInstruction extends NavInstruction {
|
|
357
|
+
/** The action being evaluated */
|
|
358
|
+
examAction: ExamAction;
|
|
359
|
+
/** Points awarded/deducted for this instruction */
|
|
360
|
+
pointValue: number;
|
|
361
|
+
/** Whether this instruction is mandatory (failure = immediate fail) */
|
|
362
|
+
mandatory: boolean;
|
|
363
|
+
/** Optional note for the examiner */
|
|
364
|
+
examNote?: string;
|
|
365
|
+
/** Condition gating when this instruction activates */
|
|
366
|
+
triggerCondition?: TriggerCondition;
|
|
367
|
+
/** Multilingual instruction group ID (from Convex backend) */
|
|
368
|
+
instructionGroupId?: string;
|
|
369
|
+
}
|
|
370
|
+
/** Hazard zone definition for exam routes */
|
|
371
|
+
interface ExamHazardZone {
|
|
372
|
+
/** Center coordinate of the hazard zone */
|
|
373
|
+
center: [number, number];
|
|
374
|
+
/** Radius in metres */
|
|
375
|
+
radiusM: number;
|
|
376
|
+
/** Type of hazard */
|
|
377
|
+
type: 'SCHOOL_ZONE' | 'HOSPITAL' | 'PEDESTRIAN_CROSSING' | 'TRAM_TRACKS' | 'RESIDENTIAL';
|
|
378
|
+
/** Required actions within this zone */
|
|
379
|
+
requiredActions: ExamAction[];
|
|
380
|
+
/** Maximum allowed speed in km/h */
|
|
381
|
+
maxSpeedKmh?: number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { type AlertEvent, type BuildOptions, type CameraTarget, type Coord, type CustomRoute, type CustomRouteBuilderInterface, type CustomWaypoint, type DRAnchor, type DRPrediction, type DeviationEvent, type DirectionsProvider, type ExamAction, type ExamHazardZone, type ExamInstruction, type FeatureCollection, type FeatureKey, HeadlessRenderer, type LicenseStatus, type LineStyle, type NavCoreRenderer, type NavCoreState, type NavGpsUpdate, type NavInstruction, type NavLicenseInfo, type NavLifecycleState, type NavOptions, type RouteLeg, type RouteOptions, type RouteResult, type RouteStep, type SnapResult, type TriggerCondition, type WaypointOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,384 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Core types used throughout the NavCore SDK.
|
|
3
|
+
*/
|
|
4
|
+
/** [longitude, latitude] — Mapbox/GeoJSON order */
|
|
5
|
+
type Coord = [number, number];
|
|
6
|
+
/** GPS update from the device */
|
|
7
|
+
interface NavGpsUpdate {
|
|
8
|
+
coord: Coord;
|
|
9
|
+
accuracy: number | null;
|
|
10
|
+
bearing: number | null;
|
|
11
|
+
speed: number;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
}
|
|
14
|
+
/** Full navigation engine state snapshot */
|
|
15
|
+
interface NavCoreState {
|
|
16
|
+
snappedCoord: Coord | null;
|
|
17
|
+
ghostCoord: Coord | null;
|
|
18
|
+
rawGpsCoord: Coord | null;
|
|
19
|
+
bearing: number;
|
|
20
|
+
rawGpsBearing: number | null;
|
|
21
|
+
routeIndex: number;
|
|
22
|
+
anchorRouteIndex: number | null;
|
|
23
|
+
distanceToRoute: number;
|
|
24
|
+
corridor: number;
|
|
25
|
+
confidence: number;
|
|
26
|
+
isOffRoute: boolean;
|
|
27
|
+
navFsmState: string;
|
|
28
|
+
progressIndex: number;
|
|
29
|
+
hasArrived: boolean;
|
|
30
|
+
rejoinCandidate: {
|
|
31
|
+
coord: Coord;
|
|
32
|
+
index: number;
|
|
33
|
+
} | null;
|
|
34
|
+
confidenceCone: {
|
|
35
|
+
center: Coord;
|
|
36
|
+
bearing: number;
|
|
37
|
+
angle: number;
|
|
38
|
+
length: number;
|
|
39
|
+
} | null;
|
|
40
|
+
alertState: 'NONE' | 'DEVIATING' | 'RECALCULATING' | 'REJOINING' | 'REJOINED';
|
|
41
|
+
detourMode: 'NONE' | 'FREE' | 'COMMITTED';
|
|
42
|
+
detourCommitProgress: number;
|
|
43
|
+
distanceToNextInstruction: number | null;
|
|
44
|
+
distanceToDestination: number | null;
|
|
45
|
+
nextInstrIdx: number | null;
|
|
46
|
+
nextInstructionIndex: number | null;
|
|
47
|
+
isGpsStale: boolean;
|
|
48
|
+
gpsAgeMs: number;
|
|
49
|
+
currentSpeed: number;
|
|
50
|
+
licenseStatus: NavLicenseInfo | string;
|
|
51
|
+
offRouteState?: string;
|
|
52
|
+
lifecycleState?: string;
|
|
53
|
+
stability?: {
|
|
54
|
+
oscillation: number;
|
|
55
|
+
drift: number;
|
|
56
|
+
jump: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Navigation lifecycle states */
|
|
60
|
+
type NavLifecycleState = 'IDLE' | 'OVERVIEW' | 'APPROACHING_ROUTE' | 'ON_ROUTE' | 'DEVIATING' | 'OFF_ROUTE' | 'REROUTING' | 'REJOINING' | 'REJOINED' | 'FAILED';
|
|
61
|
+
/** License validation status */
|
|
62
|
+
type LicenseStatus = 'VALID' | 'INVALID' | 'EXPIRED' | 'MISSING';
|
|
63
|
+
/** License info returned by the engine */
|
|
64
|
+
interface NavLicenseInfo {
|
|
65
|
+
plan: 'free' | 'pro' | 'ai';
|
|
66
|
+
limitations: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Engine configuration (all optional with defaults) */
|
|
69
|
+
interface NavOptions {
|
|
70
|
+
baseCorridorMeters?: number;
|
|
71
|
+
speedFactor?: number;
|
|
72
|
+
maxCorridorMeters?: number;
|
|
73
|
+
gpsAccuracyFactor?: number;
|
|
74
|
+
offRouteConfirmMs?: number;
|
|
75
|
+
rejoinConfirmMs?: number;
|
|
76
|
+
rejoinCooldownMs?: number;
|
|
77
|
+
startupGraceMs?: number;
|
|
78
|
+
betaCorrection?: number;
|
|
79
|
+
gpsAgeCapSeconds?: number;
|
|
80
|
+
gpsStaleMs?: number;
|
|
81
|
+
drMaxAgeMs?: number;
|
|
82
|
+
detourCommitMs?: number;
|
|
83
|
+
bearingSmoothingAlpha?: number;
|
|
84
|
+
detourBearingThreshold?: number;
|
|
85
|
+
lookAheadSeconds?: number;
|
|
86
|
+
minLookAheadMeters?: number;
|
|
87
|
+
maxLookAheadMeters?: number;
|
|
88
|
+
arrivalThresholdMeters?: number;
|
|
89
|
+
isCircuit?: boolean;
|
|
90
|
+
kalmanQ?: number;
|
|
91
|
+
kalmanRBase?: number;
|
|
92
|
+
licenseKey?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Navigation instruction (turn-by-turn step) */
|
|
95
|
+
interface NavInstruction {
|
|
96
|
+
location: Coord;
|
|
97
|
+
geometryIndex: number;
|
|
98
|
+
text?: string;
|
|
99
|
+
instruction?: string;
|
|
100
|
+
cumulativeOffset?: number;
|
|
101
|
+
}
|
|
102
|
+
/** Deviation event emitted when vehicle goes off-route */
|
|
103
|
+
interface DeviationEvent {
|
|
104
|
+
anchorIndex: number;
|
|
105
|
+
ghostCoord: Coord;
|
|
106
|
+
rejoinTarget: {
|
|
107
|
+
coordinates: Coord;
|
|
108
|
+
index: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Alert event emitted on state changes */
|
|
112
|
+
interface AlertEvent {
|
|
113
|
+
type: NavCoreState['alertState'];
|
|
114
|
+
message: string | null;
|
|
115
|
+
}
|
|
116
|
+
/** Feature key for license gating */
|
|
117
|
+
type FeatureKey = 'advanced_snapping' | 'dead_reckoning' | 'route_offset' | 'progress_tracking' | 'advanced_bearing' | 'compound_deviation' | 'nav_ai';
|
|
118
|
+
/** Route snapping result */
|
|
119
|
+
interface SnapResult {
|
|
120
|
+
idx: number;
|
|
121
|
+
dist: number;
|
|
122
|
+
proj: Coord;
|
|
123
|
+
}
|
|
124
|
+
/** Dead reckoning prediction */
|
|
125
|
+
interface DRPrediction {
|
|
126
|
+
predictedCoord: Coord;
|
|
127
|
+
isActive: boolean;
|
|
128
|
+
ageMs: number;
|
|
129
|
+
}
|
|
130
|
+
/** Dead reckoning anchor point */
|
|
131
|
+
interface DRAnchor {
|
|
132
|
+
coord: Coord;
|
|
133
|
+
idx: number;
|
|
134
|
+
ts: number;
|
|
135
|
+
}
|
|
136
|
+
/** Line style for renderer adapters */
|
|
137
|
+
interface LineStyle {
|
|
138
|
+
color?: string;
|
|
139
|
+
width?: number;
|
|
140
|
+
opacity?: number;
|
|
141
|
+
dashPattern?: number[];
|
|
142
|
+
}
|
|
143
|
+
/** Camera target for renderer adapters */
|
|
144
|
+
interface CameraTarget {
|
|
145
|
+
coord: Coord;
|
|
146
|
+
bearing: number;
|
|
147
|
+
zoom?: number;
|
|
148
|
+
pitch?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* NavCoreRenderer — Adapter contract
|
|
153
|
+
*
|
|
154
|
+
* Any map renderer (Mapbox, MapLibre, Leaflet, or a headless test harness)
|
|
155
|
+
* implements this interface to receive rendering commands from NavCore.
|
|
156
|
+
*
|
|
157
|
+
* NavCore NEVER depends on a specific renderer — adapters depend on core,
|
|
158
|
+
* core never depends on adapters.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
interface NavCoreRenderer {
|
|
162
|
+
/** Update the vehicle marker position and rotation */
|
|
163
|
+
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
164
|
+
/** Draw or update the main route polyline */
|
|
165
|
+
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
166
|
+
/** Draw or clear the detour/reroute polyline */
|
|
167
|
+
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
168
|
+
/** Show or hide the ghost vehicle (on-route projection when off-route) */
|
|
169
|
+
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
170
|
+
/** Set the camera center, bearing, and optional zoom */
|
|
171
|
+
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
172
|
+
/** Animate the camera to a target over durationMs */
|
|
173
|
+
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
174
|
+
/** Teardown — release all map resources */
|
|
175
|
+
destroy(): void;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* HeadlessRenderer — No-op implementation for CI/CD testing.
|
|
179
|
+
* Records all calls for assertion in integration tests.
|
|
180
|
+
*/
|
|
181
|
+
declare class HeadlessRenderer implements NavCoreRenderer {
|
|
182
|
+
readonly calls: Array<{
|
|
183
|
+
method: string;
|
|
184
|
+
args: unknown[];
|
|
185
|
+
}>;
|
|
186
|
+
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
187
|
+
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
188
|
+
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
189
|
+
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
190
|
+
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
191
|
+
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
192
|
+
destroy(): void;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* DirectionsProvider — Data source contract
|
|
197
|
+
*
|
|
198
|
+
* Any directions API (Mapbox, OSRM, Valhalla, or a custom server)
|
|
199
|
+
* implements this interface to provide routing data to NavCore.
|
|
200
|
+
*
|
|
201
|
+
* The provider MUST handle waypoint chunking internally if the
|
|
202
|
+
* underlying API has waypoint limits. NavCore imposes no limit.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
/** Options for route calculation */
|
|
206
|
+
interface RouteOptions {
|
|
207
|
+
/** Driving profile: 'driving' | 'driving-traffic' | 'cycling' | 'walking' */
|
|
208
|
+
profile?: string;
|
|
209
|
+
/** Request alternatives */
|
|
210
|
+
alternatives?: boolean;
|
|
211
|
+
/** Include step-by-step instructions */
|
|
212
|
+
steps?: boolean;
|
|
213
|
+
/** Geometry format: 'geojson' | 'polyline' | 'polyline6' */
|
|
214
|
+
geometries?: string;
|
|
215
|
+
/** Route overview level: 'full' | 'simplified' | 'false' */
|
|
216
|
+
overview?: string;
|
|
217
|
+
/** Language code for instructions (e.g. 'en', 'fr', 'nl') */
|
|
218
|
+
language?: string;
|
|
219
|
+
}
|
|
220
|
+
/** A single route leg between two waypoints */
|
|
221
|
+
interface RouteLeg {
|
|
222
|
+
distance: number;
|
|
223
|
+
duration: number;
|
|
224
|
+
steps?: RouteStep[];
|
|
225
|
+
}
|
|
226
|
+
/** A single step within a leg */
|
|
227
|
+
interface RouteStep {
|
|
228
|
+
distance: number;
|
|
229
|
+
duration: number;
|
|
230
|
+
geometry: Coord[];
|
|
231
|
+
maneuver: {
|
|
232
|
+
type: string;
|
|
233
|
+
modifier?: string;
|
|
234
|
+
location: Coord;
|
|
235
|
+
bearing_before: number;
|
|
236
|
+
bearing_after: number;
|
|
237
|
+
instruction?: string;
|
|
238
|
+
};
|
|
239
|
+
name?: string;
|
|
240
|
+
}
|
|
241
|
+
/** Complete route result from a directions provider */
|
|
242
|
+
interface RouteResult {
|
|
243
|
+
/** Full route geometry */
|
|
244
|
+
geometry: Coord[];
|
|
245
|
+
/** Total distance in metres */
|
|
246
|
+
distance: number;
|
|
247
|
+
/** Total duration in seconds */
|
|
248
|
+
duration: number;
|
|
249
|
+
/** Individual legs */
|
|
250
|
+
legs: RouteLeg[];
|
|
251
|
+
/** Raw provider response (for debugging) */
|
|
252
|
+
raw?: unknown;
|
|
253
|
+
}
|
|
254
|
+
/** The provider interface */
|
|
255
|
+
interface DirectionsProvider {
|
|
256
|
+
/**
|
|
257
|
+
* Calculate a route through the given waypoints.
|
|
258
|
+
* Must handle chunking internally if the provider has waypoint limits.
|
|
259
|
+
*/
|
|
260
|
+
getRoute(waypoints: Coord[], options?: RouteOptions): Promise<RouteResult>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* CustomRouteBuilder — Types for building custom routes
|
|
265
|
+
*
|
|
266
|
+
* Build routes with unlimited waypoints, GPX/GeoJSON import/export,
|
|
267
|
+
* and configurable chunking strategies.
|
|
268
|
+
*/
|
|
269
|
+
|
|
270
|
+
/** Options when adding a waypoint */
|
|
271
|
+
interface WaypointOptions {
|
|
272
|
+
/** Whether this is a silent waypoint (no instruction generated) */
|
|
273
|
+
silent?: boolean;
|
|
274
|
+
/** Optional name/label for the waypoint */
|
|
275
|
+
name?: string;
|
|
276
|
+
}
|
|
277
|
+
/** How to connect waypoints when building */
|
|
278
|
+
interface BuildOptions {
|
|
279
|
+
/** Connection mode between waypoints */
|
|
280
|
+
connectionMode?: 'ROUTED' | 'STRAIGHT' | 'MIXED';
|
|
281
|
+
/** Chunk overlap strategy for multi-segment API calls */
|
|
282
|
+
chunkStrategy?: 'OVERLAP_1' | 'OVERLAP_2';
|
|
283
|
+
/** Maximum waypoints per API call (provider-specific, default 25) */
|
|
284
|
+
maxWaypointsPerChunk?: number;
|
|
285
|
+
}
|
|
286
|
+
/** A waypoint in the custom route */
|
|
287
|
+
interface CustomWaypoint {
|
|
288
|
+
id: string;
|
|
289
|
+
coord: Coord;
|
|
290
|
+
options?: WaypointOptions;
|
|
291
|
+
}
|
|
292
|
+
/** The built custom route */
|
|
293
|
+
interface CustomRoute {
|
|
294
|
+
/** Full stitched geometry */
|
|
295
|
+
geometry: Coord[];
|
|
296
|
+
/** Individual waypoints */
|
|
297
|
+
waypoints: CustomWaypoint[];
|
|
298
|
+
/** Total distance in metres */
|
|
299
|
+
distance: number;
|
|
300
|
+
/** Total duration in seconds */
|
|
301
|
+
duration: number;
|
|
302
|
+
}
|
|
303
|
+
/** GeoJSON FeatureCollection (minimal typing for zero-dep constraint) */
|
|
304
|
+
interface FeatureCollection {
|
|
305
|
+
type: 'FeatureCollection';
|
|
306
|
+
features: Array<{
|
|
307
|
+
type: 'Feature';
|
|
308
|
+
geometry: {
|
|
309
|
+
type: string;
|
|
310
|
+
coordinates: Coord[] | Coord;
|
|
311
|
+
};
|
|
312
|
+
properties: Record<string, unknown>;
|
|
313
|
+
}>;
|
|
314
|
+
}
|
|
315
|
+
/** The builder interface */
|
|
316
|
+
interface CustomRouteBuilderInterface {
|
|
317
|
+
/** Add a waypoint at the end of the route */
|
|
318
|
+
addWaypoint(coord: Coord, options?: WaypointOptions): string;
|
|
319
|
+
/** Insert a waypoint after an existing one */
|
|
320
|
+
insertWaypoint(coord: Coord, afterId: string): string;
|
|
321
|
+
/** Remove a waypoint by ID */
|
|
322
|
+
removeWaypoint(id: string): void;
|
|
323
|
+
/** Move an existing waypoint to a new coordinate */
|
|
324
|
+
moveWaypoint(id: string, newCoord: Coord): void;
|
|
325
|
+
/** Build the route using the configured directions provider */
|
|
326
|
+
build(options?: BuildOptions): Promise<CustomRoute>;
|
|
327
|
+
/** Import waypoints from a GPX string */
|
|
328
|
+
fromGPX(gpxString: string): void;
|
|
329
|
+
/** Import waypoints from a GeoJSON FeatureCollection */
|
|
330
|
+
fromGeoJSON(geojson: FeatureCollection): void;
|
|
331
|
+
/** Export the current route as GeoJSON */
|
|
332
|
+
toGeoJSON(): FeatureCollection;
|
|
333
|
+
/** Export the current route as GPX */
|
|
334
|
+
toGPX(): string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* ExamInstruction — Klaroways-specific extension
|
|
3
339
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
340
|
+
* Extends the base NavInstruction with exam-specific scoring fields,
|
|
341
|
+
* trigger conditions, and mandatory/optional classification.
|
|
6
342
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
343
|
+
|
|
344
|
+
/** Actions the examiner evaluates */
|
|
345
|
+
type ExamAction = 'MIRROR_CHECK' | 'SIGNAL' | 'OBSERVATION' | 'SPEED_REDUCE' | 'BLIND_SPOT_CHECK' | 'YIELD' | 'FULL_STOP' | 'LANE_POSITION';
|
|
346
|
+
/** Condition that must be met for the instruction to trigger */
|
|
347
|
+
interface TriggerCondition {
|
|
348
|
+
minSpeedKmh?: number;
|
|
349
|
+
maxSpeedKmh?: number;
|
|
350
|
+
timeOfDay?: {
|
|
351
|
+
from: string;
|
|
352
|
+
to: string;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/** Exam instruction extending the base navigation instruction */
|
|
356
|
+
interface ExamInstruction extends NavInstruction {
|
|
357
|
+
/** The action being evaluated */
|
|
358
|
+
examAction: ExamAction;
|
|
359
|
+
/** Points awarded/deducted for this instruction */
|
|
360
|
+
pointValue: number;
|
|
361
|
+
/** Whether this instruction is mandatory (failure = immediate fail) */
|
|
362
|
+
mandatory: boolean;
|
|
363
|
+
/** Optional note for the examiner */
|
|
364
|
+
examNote?: string;
|
|
365
|
+
/** Condition gating when this instruction activates */
|
|
366
|
+
triggerCondition?: TriggerCondition;
|
|
367
|
+
/** Multilingual instruction group ID (from Convex backend) */
|
|
368
|
+
instructionGroupId?: string;
|
|
369
|
+
}
|
|
370
|
+
/** Hazard zone definition for exam routes */
|
|
371
|
+
interface ExamHazardZone {
|
|
372
|
+
/** Center coordinate of the hazard zone */
|
|
373
|
+
center: [number, number];
|
|
374
|
+
/** Radius in metres */
|
|
375
|
+
radiusM: number;
|
|
376
|
+
/** Type of hazard */
|
|
377
|
+
type: 'SCHOOL_ZONE' | 'HOSPITAL' | 'PEDESTRIAN_CROSSING' | 'TRAM_TRACKS' | 'RESIDENTIAL';
|
|
378
|
+
/** Required actions within this zone */
|
|
379
|
+
requiredActions: ExamAction[];
|
|
380
|
+
/** Maximum allowed speed in km/h */
|
|
381
|
+
maxSpeedKmh?: number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { type AlertEvent, type BuildOptions, type CameraTarget, type Coord, type CustomRoute, type CustomRouteBuilderInterface, type CustomWaypoint, type DRAnchor, type DRPrediction, type DeviationEvent, type DirectionsProvider, type ExamAction, type ExamHazardZone, type ExamInstruction, type FeatureCollection, type FeatureKey, HeadlessRenderer, type LicenseStatus, type LineStyle, type NavCoreRenderer, type NavCoreState, type NavGpsUpdate, type NavInstruction, type NavLicenseInfo, type NavLifecycleState, type NavOptions, type RouteLeg, type RouteOptions, type RouteResult, type RouteStep, type SnapResult, type TriggerCondition, type WaypointOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/renderer.ts
|
|
4
|
+
var HeadlessRenderer = class {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.calls = [];
|
|
7
|
+
}
|
|
8
|
+
setVehiclePosition(coord, bearing) {
|
|
9
|
+
this.calls.push({ method: "setVehiclePosition", args: [coord, bearing] });
|
|
10
|
+
}
|
|
11
|
+
setRouteGeometry(coords, style) {
|
|
12
|
+
this.calls.push({ method: "setRouteGeometry", args: [coords, style] });
|
|
13
|
+
}
|
|
14
|
+
setDetourGeometry(coords, style) {
|
|
15
|
+
this.calls.push({ method: "setDetourGeometry", args: [coords, style] });
|
|
16
|
+
}
|
|
17
|
+
setGhostPosition(coord, bearing) {
|
|
18
|
+
this.calls.push({ method: "setGhostPosition", args: [coord, bearing] });
|
|
19
|
+
}
|
|
20
|
+
setCameraTarget(coord, bearing, zoom) {
|
|
21
|
+
this.calls.push({ method: "setCameraTarget", args: [coord, bearing, zoom] });
|
|
22
|
+
}
|
|
23
|
+
animateCamera(target, durationMs) {
|
|
24
|
+
this.calls.push({ method: "animateCamera", args: [target, durationMs] });
|
|
25
|
+
}
|
|
26
|
+
destroy() {
|
|
27
|
+
this.calls.push({ method: "destroy", args: [] });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.HeadlessRenderer = HeadlessRenderer;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/renderer.ts
|
|
2
|
+
var HeadlessRenderer = class {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.calls = [];
|
|
5
|
+
}
|
|
6
|
+
setVehiclePosition(coord, bearing) {
|
|
7
|
+
this.calls.push({ method: "setVehiclePosition", args: [coord, bearing] });
|
|
8
|
+
}
|
|
9
|
+
setRouteGeometry(coords, style) {
|
|
10
|
+
this.calls.push({ method: "setRouteGeometry", args: [coords, style] });
|
|
11
|
+
}
|
|
12
|
+
setDetourGeometry(coords, style) {
|
|
13
|
+
this.calls.push({ method: "setDetourGeometry", args: [coords, style] });
|
|
14
|
+
}
|
|
15
|
+
setGhostPosition(coord, bearing) {
|
|
16
|
+
this.calls.push({ method: "setGhostPosition", args: [coord, bearing] });
|
|
17
|
+
}
|
|
18
|
+
setCameraTarget(coord, bearing, zoom) {
|
|
19
|
+
this.calls.push({ method: "setCameraTarget", args: [coord, bearing, zoom] });
|
|
20
|
+
}
|
|
21
|
+
animateCamera(target, durationMs) {
|
|
22
|
+
this.calls.push({ method: "animateCamera", args: [target, durationMs] });
|
|
23
|
+
}
|
|
24
|
+
destroy() {
|
|
25
|
+
this.calls.push({ method: "destroy", args: [] });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { HeadlessRenderer };
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingissa/navcore-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Shared type definitions for the NavCore SDK ecosystem.",
|
|
5
5
|
"author": "Ingissa <8abnav@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
-
"homepage": "https://navcore.
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/ingissa/navcore-sdk.git"
|
|
11
|
-
},
|
|
7
|
+
"homepage": "https://navcore-web.vercel.app/",
|
|
12
8
|
"main": "dist/index.js",
|
|
13
9
|
"module": "dist/index.mjs",
|
|
14
10
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +27,7 @@
|
|
|
31
27
|
"node": ">=16"
|
|
32
28
|
},
|
|
33
29
|
"scripts": {
|
|
34
|
-
"build": "
|
|
35
|
-
"prepublishOnly": "npm run build"
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"prepublishOnly": "npm run build --prefix ../.. && node ../../scripts/check-release.mjs"
|
|
36
32
|
}
|
|
37
33
|
}
|
package/dist/builder.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CustomRouteBuilder — Types for building custom routes
|
|
3
|
-
*
|
|
4
|
-
* Build routes with unlimited waypoints, GPX/GeoJSON import/export,
|
|
5
|
-
* and configurable chunking strategies.
|
|
6
|
-
*/
|
|
7
|
-
import type { Coord } from './core';
|
|
8
|
-
/** Options when adding a waypoint */
|
|
9
|
-
export interface WaypointOptions {
|
|
10
|
-
/** Whether this is a silent waypoint (no instruction generated) */
|
|
11
|
-
silent?: boolean;
|
|
12
|
-
/** Optional name/label for the waypoint */
|
|
13
|
-
name?: string;
|
|
14
|
-
}
|
|
15
|
-
/** How to connect waypoints when building */
|
|
16
|
-
export interface BuildOptions {
|
|
17
|
-
/** Connection mode between waypoints */
|
|
18
|
-
connectionMode?: 'ROUTED' | 'STRAIGHT' | 'MIXED';
|
|
19
|
-
/** Chunk overlap strategy for multi-segment API calls */
|
|
20
|
-
chunkStrategy?: 'OVERLAP_1' | 'OVERLAP_2';
|
|
21
|
-
/** Maximum waypoints per API call (provider-specific, default 25) */
|
|
22
|
-
maxWaypointsPerChunk?: number;
|
|
23
|
-
}
|
|
24
|
-
/** A waypoint in the custom route */
|
|
25
|
-
export interface CustomWaypoint {
|
|
26
|
-
id: string;
|
|
27
|
-
coord: Coord;
|
|
28
|
-
options?: WaypointOptions;
|
|
29
|
-
}
|
|
30
|
-
/** The built custom route */
|
|
31
|
-
export interface CustomRoute {
|
|
32
|
-
/** Full stitched geometry */
|
|
33
|
-
geometry: Coord[];
|
|
34
|
-
/** Individual waypoints */
|
|
35
|
-
waypoints: CustomWaypoint[];
|
|
36
|
-
/** Total distance in metres */
|
|
37
|
-
distance: number;
|
|
38
|
-
/** Total duration in seconds */
|
|
39
|
-
duration: number;
|
|
40
|
-
}
|
|
41
|
-
/** GeoJSON FeatureCollection (minimal typing for zero-dep constraint) */
|
|
42
|
-
export interface FeatureCollection {
|
|
43
|
-
type: 'FeatureCollection';
|
|
44
|
-
features: Array<{
|
|
45
|
-
type: 'Feature';
|
|
46
|
-
geometry: {
|
|
47
|
-
type: string;
|
|
48
|
-
coordinates: Coord[] | Coord;
|
|
49
|
-
};
|
|
50
|
-
properties: Record<string, unknown>;
|
|
51
|
-
}>;
|
|
52
|
-
}
|
|
53
|
-
/** The builder interface */
|
|
54
|
-
export interface CustomRouteBuilderInterface {
|
|
55
|
-
/** Add a waypoint at the end of the route */
|
|
56
|
-
addWaypoint(coord: Coord, options?: WaypointOptions): string;
|
|
57
|
-
/** Insert a waypoint after an existing one */
|
|
58
|
-
insertWaypoint(coord: Coord, afterId: string): string;
|
|
59
|
-
/** Remove a waypoint by ID */
|
|
60
|
-
removeWaypoint(id: string): void;
|
|
61
|
-
/** Move an existing waypoint to a new coordinate */
|
|
62
|
-
moveWaypoint(id: string, newCoord: Coord): void;
|
|
63
|
-
/** Build the route using the configured directions provider */
|
|
64
|
-
build(options?: BuildOptions): Promise<CustomRoute>;
|
|
65
|
-
/** Import waypoints from a GPX string */
|
|
66
|
-
fromGPX(gpxString: string): void;
|
|
67
|
-
/** Import waypoints from a GeoJSON FeatureCollection */
|
|
68
|
-
fromGeoJSON(geojson: FeatureCollection): void;
|
|
69
|
-
/** Export the current route as GeoJSON */
|
|
70
|
-
toGeoJSON(): FeatureCollection;
|
|
71
|
-
/** Export the current route as GPX */
|
|
72
|
-
toGPX(): string;
|
|
73
|
-
}
|
package/dist/builder.js
DELETED
package/dist/core.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core types used throughout the NavCore SDK.
|
|
3
|
-
*/
|
|
4
|
-
/** [longitude, latitude] — Mapbox/GeoJSON order */
|
|
5
|
-
export type Coord = [number, number];
|
|
6
|
-
/** GPS update from the device */
|
|
7
|
-
export interface NavGpsUpdate {
|
|
8
|
-
coord: Coord;
|
|
9
|
-
accuracy: number | null;
|
|
10
|
-
bearing: number | null;
|
|
11
|
-
speed: number;
|
|
12
|
-
timestamp: number;
|
|
13
|
-
}
|
|
14
|
-
/** Full navigation engine state snapshot */
|
|
15
|
-
export interface NavCoreState {
|
|
16
|
-
snappedCoord: Coord | null;
|
|
17
|
-
ghostCoord: Coord | null;
|
|
18
|
-
rawGpsCoord: Coord | null;
|
|
19
|
-
bearing: number;
|
|
20
|
-
rawGpsBearing: number | null;
|
|
21
|
-
routeIndex: number;
|
|
22
|
-
anchorRouteIndex: number | null;
|
|
23
|
-
distanceToRoute: number;
|
|
24
|
-
corridor: number;
|
|
25
|
-
confidence: number;
|
|
26
|
-
isOffRoute: boolean;
|
|
27
|
-
navFsmState: string;
|
|
28
|
-
progressIndex: number;
|
|
29
|
-
hasArrived: boolean;
|
|
30
|
-
rejoinCandidate: {
|
|
31
|
-
coord: Coord;
|
|
32
|
-
index: number;
|
|
33
|
-
} | null;
|
|
34
|
-
confidenceCone: {
|
|
35
|
-
center: Coord;
|
|
36
|
-
bearing: number;
|
|
37
|
-
angle: number;
|
|
38
|
-
length: number;
|
|
39
|
-
} | null;
|
|
40
|
-
alertState: 'NONE' | 'DEVIATING' | 'RECALCULATING' | 'REJOINING' | 'REJOINED';
|
|
41
|
-
detourMode: 'NONE' | 'FREE' | 'COMMITTED';
|
|
42
|
-
detourCommitProgress: number;
|
|
43
|
-
distanceToNextInstruction: number | null;
|
|
44
|
-
distanceToDestination: number | null;
|
|
45
|
-
nextInstrIdx: number | null;
|
|
46
|
-
nextInstructionIndex: number | null;
|
|
47
|
-
isGpsStale: boolean;
|
|
48
|
-
gpsAgeMs: number;
|
|
49
|
-
currentSpeed: number;
|
|
50
|
-
licenseStatus: NavLicenseInfo | string;
|
|
51
|
-
offRouteState?: string;
|
|
52
|
-
lifecycleState?: string;
|
|
53
|
-
stability?: {
|
|
54
|
-
oscillation: number;
|
|
55
|
-
drift: number;
|
|
56
|
-
jump: number;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/** Navigation lifecycle states */
|
|
60
|
-
export type NavLifecycleState = 'IDLE' | 'OVERVIEW' | 'APPROACHING_ROUTE' | 'ON_ROUTE' | 'DEVIATING' | 'OFF_ROUTE' | 'REROUTING' | 'REJOINING' | 'REJOINED' | 'FAILED';
|
|
61
|
-
/** License validation status */
|
|
62
|
-
export type LicenseStatus = 'VALID' | 'INVALID' | 'EXPIRED' | 'MISSING';
|
|
63
|
-
/** License info returned by the engine */
|
|
64
|
-
export interface NavLicenseInfo {
|
|
65
|
-
plan: 'free' | 'pro' | 'ai';
|
|
66
|
-
limitations: string[];
|
|
67
|
-
}
|
|
68
|
-
/** Engine configuration (all optional with defaults) */
|
|
69
|
-
export interface NavOptions {
|
|
70
|
-
baseCorridorMeters?: number;
|
|
71
|
-
speedFactor?: number;
|
|
72
|
-
maxCorridorMeters?: number;
|
|
73
|
-
gpsAccuracyFactor?: number;
|
|
74
|
-
offRouteConfirmMs?: number;
|
|
75
|
-
rejoinConfirmMs?: number;
|
|
76
|
-
rejoinCooldownMs?: number;
|
|
77
|
-
startupGraceMs?: number;
|
|
78
|
-
betaCorrection?: number;
|
|
79
|
-
gpsAgeCapSeconds?: number;
|
|
80
|
-
gpsStaleMs?: number;
|
|
81
|
-
drMaxAgeMs?: number;
|
|
82
|
-
detourCommitMs?: number;
|
|
83
|
-
bearingSmoothingAlpha?: number;
|
|
84
|
-
detourBearingThreshold?: number;
|
|
85
|
-
lookAheadSeconds?: number;
|
|
86
|
-
minLookAheadMeters?: number;
|
|
87
|
-
maxLookAheadMeters?: number;
|
|
88
|
-
arrivalThresholdMeters?: number;
|
|
89
|
-
isCircuit?: boolean;
|
|
90
|
-
kalmanQ?: number;
|
|
91
|
-
kalmanRBase?: number;
|
|
92
|
-
licenseKey?: string;
|
|
93
|
-
}
|
|
94
|
-
/** Navigation instruction (turn-by-turn step) */
|
|
95
|
-
export interface NavInstruction {
|
|
96
|
-
location: Coord;
|
|
97
|
-
geometryIndex: number;
|
|
98
|
-
text?: string;
|
|
99
|
-
instruction?: string;
|
|
100
|
-
cumulativeOffset?: number;
|
|
101
|
-
}
|
|
102
|
-
/** Deviation event emitted when vehicle goes off-route */
|
|
103
|
-
export interface DeviationEvent {
|
|
104
|
-
anchorIndex: number;
|
|
105
|
-
ghostCoord: Coord;
|
|
106
|
-
rejoinTarget: {
|
|
107
|
-
coordinates: Coord;
|
|
108
|
-
index: number;
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
/** Alert event emitted on state changes */
|
|
112
|
-
export interface AlertEvent {
|
|
113
|
-
type: NavCoreState['alertState'];
|
|
114
|
-
message: string | null;
|
|
115
|
-
}
|
|
116
|
-
/** Feature key for license gating */
|
|
117
|
-
export type FeatureKey = 'advanced_snapping' | 'dead_reckoning' | 'route_offset' | 'progress_tracking' | 'advanced_bearing' | 'compound_deviation' | 'nav_ai';
|
|
118
|
-
/** Route snapping result */
|
|
119
|
-
export interface SnapResult {
|
|
120
|
-
idx: number;
|
|
121
|
-
dist: number;
|
|
122
|
-
proj: Coord;
|
|
123
|
-
}
|
|
124
|
-
/** Dead reckoning prediction */
|
|
125
|
-
export interface DRPrediction {
|
|
126
|
-
predictedCoord: Coord;
|
|
127
|
-
isActive: boolean;
|
|
128
|
-
ageMs: number;
|
|
129
|
-
}
|
|
130
|
-
/** Dead reckoning anchor point */
|
|
131
|
-
export interface DRAnchor {
|
|
132
|
-
coord: Coord;
|
|
133
|
-
idx: number;
|
|
134
|
-
ts: number;
|
|
135
|
-
}
|
|
136
|
-
/** Line style for renderer adapters */
|
|
137
|
-
export interface LineStyle {
|
|
138
|
-
color?: string;
|
|
139
|
-
width?: number;
|
|
140
|
-
opacity?: number;
|
|
141
|
-
dashPattern?: number[];
|
|
142
|
-
}
|
|
143
|
-
/** Camera target for renderer adapters */
|
|
144
|
-
export interface CameraTarget {
|
|
145
|
-
coord: Coord;
|
|
146
|
-
bearing: number;
|
|
147
|
-
zoom?: number;
|
|
148
|
-
pitch?: number;
|
|
149
|
-
}
|
package/dist/core.js
DELETED
package/dist/directions.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DirectionsProvider — Data source contract
|
|
3
|
-
*
|
|
4
|
-
* Any directions API (Mapbox, OSRM, Valhalla, or a custom server)
|
|
5
|
-
* implements this interface to provide routing data to NavCore.
|
|
6
|
-
*
|
|
7
|
-
* The provider MUST handle waypoint chunking internally if the
|
|
8
|
-
* underlying API has waypoint limits. NavCore imposes no limit.
|
|
9
|
-
*/
|
|
10
|
-
import type { Coord } from './core';
|
|
11
|
-
/** Options for route calculation */
|
|
12
|
-
export interface RouteOptions {
|
|
13
|
-
/** Driving profile: 'driving' | 'driving-traffic' | 'cycling' | 'walking' */
|
|
14
|
-
profile?: string;
|
|
15
|
-
/** Request alternatives */
|
|
16
|
-
alternatives?: boolean;
|
|
17
|
-
/** Include step-by-step instructions */
|
|
18
|
-
steps?: boolean;
|
|
19
|
-
/** Geometry format: 'geojson' | 'polyline' | 'polyline6' */
|
|
20
|
-
geometries?: string;
|
|
21
|
-
/** Route overview level: 'full' | 'simplified' | 'false' */
|
|
22
|
-
overview?: string;
|
|
23
|
-
/** Language code for instructions (e.g. 'en', 'fr', 'nl') */
|
|
24
|
-
language?: string;
|
|
25
|
-
}
|
|
26
|
-
/** A single route leg between two waypoints */
|
|
27
|
-
export interface RouteLeg {
|
|
28
|
-
distance: number;
|
|
29
|
-
duration: number;
|
|
30
|
-
steps?: RouteStep[];
|
|
31
|
-
}
|
|
32
|
-
/** A single step within a leg */
|
|
33
|
-
export interface RouteStep {
|
|
34
|
-
distance: number;
|
|
35
|
-
duration: number;
|
|
36
|
-
geometry: Coord[];
|
|
37
|
-
maneuver: {
|
|
38
|
-
type: string;
|
|
39
|
-
modifier?: string;
|
|
40
|
-
location: Coord;
|
|
41
|
-
bearing_before: number;
|
|
42
|
-
bearing_after: number;
|
|
43
|
-
instruction?: string;
|
|
44
|
-
};
|
|
45
|
-
name?: string;
|
|
46
|
-
}
|
|
47
|
-
/** Complete route result from a directions provider */
|
|
48
|
-
export interface RouteResult {
|
|
49
|
-
/** Full route geometry */
|
|
50
|
-
geometry: Coord[];
|
|
51
|
-
/** Total distance in metres */
|
|
52
|
-
distance: number;
|
|
53
|
-
/** Total duration in seconds */
|
|
54
|
-
duration: number;
|
|
55
|
-
/** Individual legs */
|
|
56
|
-
legs: RouteLeg[];
|
|
57
|
-
/** Raw provider response (for debugging) */
|
|
58
|
-
raw?: unknown;
|
|
59
|
-
}
|
|
60
|
-
/** The provider interface */
|
|
61
|
-
export interface DirectionsProvider {
|
|
62
|
-
/**
|
|
63
|
-
* Calculate a route through the given waypoints.
|
|
64
|
-
* Must handle chunking internally if the provider has waypoint limits.
|
|
65
|
-
*/
|
|
66
|
-
getRoute(waypoints: Coord[], options?: RouteOptions): Promise<RouteResult>;
|
|
67
|
-
}
|
package/dist/directions.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DirectionsProvider — Data source contract
|
|
3
|
-
*
|
|
4
|
-
* Any directions API (Mapbox, OSRM, Valhalla, or a custom server)
|
|
5
|
-
* implements this interface to provide routing data to NavCore.
|
|
6
|
-
*
|
|
7
|
-
* The provider MUST handle waypoint chunking internally if the
|
|
8
|
-
* underlying API has waypoint limits. NavCore imposes no limit.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
package/dist/exam.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ExamInstruction — Klaroways-specific extension
|
|
3
|
-
*
|
|
4
|
-
* Extends the base NavInstruction with exam-specific scoring fields,
|
|
5
|
-
* trigger conditions, and mandatory/optional classification.
|
|
6
|
-
*/
|
|
7
|
-
import type { NavInstruction } from './core';
|
|
8
|
-
/** Actions the examiner evaluates */
|
|
9
|
-
export type ExamAction = 'MIRROR_CHECK' | 'SIGNAL' | 'OBSERVATION' | 'SPEED_REDUCE' | 'BLIND_SPOT_CHECK' | 'YIELD' | 'FULL_STOP' | 'LANE_POSITION';
|
|
10
|
-
/** Condition that must be met for the instruction to trigger */
|
|
11
|
-
export interface TriggerCondition {
|
|
12
|
-
minSpeedKmh?: number;
|
|
13
|
-
maxSpeedKmh?: number;
|
|
14
|
-
timeOfDay?: {
|
|
15
|
-
from: string;
|
|
16
|
-
to: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/** Exam instruction extending the base navigation instruction */
|
|
20
|
-
export interface ExamInstruction extends NavInstruction {
|
|
21
|
-
/** The action being evaluated */
|
|
22
|
-
examAction: ExamAction;
|
|
23
|
-
/** Points awarded/deducted for this instruction */
|
|
24
|
-
pointValue: number;
|
|
25
|
-
/** Whether this instruction is mandatory (failure = immediate fail) */
|
|
26
|
-
mandatory: boolean;
|
|
27
|
-
/** Optional note for the examiner */
|
|
28
|
-
examNote?: string;
|
|
29
|
-
/** Condition gating when this instruction activates */
|
|
30
|
-
triggerCondition?: TriggerCondition;
|
|
31
|
-
/** Multilingual instruction group ID (from Convex backend) */
|
|
32
|
-
instructionGroupId?: string;
|
|
33
|
-
}
|
|
34
|
-
/** Hazard zone definition for exam routes */
|
|
35
|
-
export interface ExamHazardZone {
|
|
36
|
-
/** Center coordinate of the hazard zone */
|
|
37
|
-
center: [number, number];
|
|
38
|
-
/** Radius in metres */
|
|
39
|
-
radiusM: number;
|
|
40
|
-
/** Type of hazard */
|
|
41
|
-
type: 'SCHOOL_ZONE' | 'HOSPITAL' | 'PEDESTRIAN_CROSSING' | 'TRAM_TRACKS' | 'RESIDENTIAL';
|
|
42
|
-
/** Required actions within this zone */
|
|
43
|
-
requiredActions: ExamAction[];
|
|
44
|
-
/** Maximum allowed speed in km/h */
|
|
45
|
-
maxSpeedKmh?: number;
|
|
46
|
-
}
|
package/dist/exam.js
DELETED
package/dist/renderer.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NavCoreRenderer — Adapter contract
|
|
3
|
-
*
|
|
4
|
-
* Any map renderer (Mapbox, MapLibre, Leaflet, or a headless test harness)
|
|
5
|
-
* implements this interface to receive rendering commands from NavCore.
|
|
6
|
-
*
|
|
7
|
-
* NavCore NEVER depends on a specific renderer — adapters depend on core,
|
|
8
|
-
* core never depends on adapters.
|
|
9
|
-
*/
|
|
10
|
-
import type { Coord, LineStyle, CameraTarget } from './core';
|
|
11
|
-
export interface NavCoreRenderer {
|
|
12
|
-
/** Update the vehicle marker position and rotation */
|
|
13
|
-
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
14
|
-
/** Draw or update the main route polyline */
|
|
15
|
-
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
16
|
-
/** Draw or clear the detour/reroute polyline */
|
|
17
|
-
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
18
|
-
/** Show or hide the ghost vehicle (on-route projection when off-route) */
|
|
19
|
-
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
20
|
-
/** Set the camera center, bearing, and optional zoom */
|
|
21
|
-
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
22
|
-
/** Animate the camera to a target over durationMs */
|
|
23
|
-
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
24
|
-
/** Teardown — release all map resources */
|
|
25
|
-
destroy(): void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* HeadlessRenderer — No-op implementation for CI/CD testing.
|
|
29
|
-
* Records all calls for assertion in integration tests.
|
|
30
|
-
*/
|
|
31
|
-
export declare class HeadlessRenderer implements NavCoreRenderer {
|
|
32
|
-
readonly calls: Array<{
|
|
33
|
-
method: string;
|
|
34
|
-
args: unknown[];
|
|
35
|
-
}>;
|
|
36
|
-
setVehiclePosition(coord: Coord, bearing: number): void;
|
|
37
|
-
setRouteGeometry(coords: Coord[], style?: LineStyle): void;
|
|
38
|
-
setDetourGeometry(coords: Coord[] | null, style?: LineStyle): void;
|
|
39
|
-
setGhostPosition(coord: Coord | null, bearing: number): void;
|
|
40
|
-
setCameraTarget(coord: Coord, bearing: number, zoom?: number): void;
|
|
41
|
-
animateCamera(target: CameraTarget, durationMs: number): void;
|
|
42
|
-
destroy(): void;
|
|
43
|
-
}
|
package/dist/renderer.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NavCoreRenderer — Adapter contract
|
|
3
|
-
*
|
|
4
|
-
* Any map renderer (Mapbox, MapLibre, Leaflet, or a headless test harness)
|
|
5
|
-
* implements this interface to receive rendering commands from NavCore.
|
|
6
|
-
*
|
|
7
|
-
* NavCore NEVER depends on a specific renderer — adapters depend on core,
|
|
8
|
-
* core never depends on adapters.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* HeadlessRenderer — No-op implementation for CI/CD testing.
|
|
12
|
-
* Records all calls for assertion in integration tests.
|
|
13
|
-
*/
|
|
14
|
-
export class HeadlessRenderer {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.calls = [];
|
|
17
|
-
}
|
|
18
|
-
setVehiclePosition(coord, bearing) {
|
|
19
|
-
this.calls.push({ method: 'setVehiclePosition', args: [coord, bearing] });
|
|
20
|
-
}
|
|
21
|
-
setRouteGeometry(coords, style) {
|
|
22
|
-
this.calls.push({ method: 'setRouteGeometry', args: [coords, style] });
|
|
23
|
-
}
|
|
24
|
-
setDetourGeometry(coords, style) {
|
|
25
|
-
this.calls.push({ method: 'setDetourGeometry', args: [coords, style] });
|
|
26
|
-
}
|
|
27
|
-
setGhostPosition(coord, bearing) {
|
|
28
|
-
this.calls.push({ method: 'setGhostPosition', args: [coord, bearing] });
|
|
29
|
-
}
|
|
30
|
-
setCameraTarget(coord, bearing, zoom) {
|
|
31
|
-
this.calls.push({ method: 'setCameraTarget', args: [coord, bearing, zoom] });
|
|
32
|
-
}
|
|
33
|
-
animateCamera(target, durationMs) {
|
|
34
|
-
this.calls.push({ method: 'animateCamera', args: [target, durationMs] });
|
|
35
|
-
}
|
|
36
|
-
destroy() {
|
|
37
|
-
this.calls.push({ method: 'destroy', args: [] });
|
|
38
|
-
}
|
|
39
|
-
}
|