@ingissa/navcore-types 1.0.8 → 1.0.10
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/LICENSE +3 -3
- package/README.md +80 -0
- 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 +33 -37
- 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/LICENSE
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Copyright (c) 2026 Abdelnasser Aitabi. All rights reserved.
|
|
2
|
-
|
|
3
|
-
No license is granted except by separate written agreement.
|
|
1
|
+
Copyright (c) 2026 Abdelnasser Aitabi. All rights reserved.
|
|
2
|
+
|
|
3
|
+
No license is granted except by separate written agreement.
|
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @ingissa/navcore-types
|
|
2
|
+
|
|
3
|
+
[Official Website](https://navcore-web.vercel.app/)
|
|
4
|
+
|
|
5
|
+
> Shared TypeScript definitions and interfaces for the NavCore SDK ecosystem.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@ingissa/navcore-types)
|
|
8
|
+

|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
`@ingissa/navcore-types` defines the shared domain models, lifecycle states, event maps, and coordinate abstractions used across `@ingissa/navcore-core`, `@ingissa/navcore-mapbox`, `@ingissa/navcore-react-native`, and `@ingissa/navcore-simulator`.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -D @ingissa/navcore-types
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
*(Note: `@ingissa/navcore-core` re-exports the required types for convenience; installing `@ingissa/navcore-types` directly is useful for decoupled domain modules and testing harnesses).*
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Key Exported Contracts
|
|
30
|
+
|
|
31
|
+
| Symbol | Kind | Description |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `Coord` / `Coordinate` | Type | Two-element coordinate tuple `[longitude, latitude]` |
|
|
34
|
+
| `NavCoreState` | Interface | Immutable snapshot returned by `engine.update()` and `engine.getState()` |
|
|
35
|
+
| `NavGpsUpdate` | Interface | Input payload fed into `engine.update(gps)` |
|
|
36
|
+
| `NavInstruction` | Interface | Normalized turn-by-turn maneuver instruction |
|
|
37
|
+
| `DirectionsProvider` | Interface | Contract implemented by routing backends (`getRoute`) |
|
|
38
|
+
| `RoutePlan` | Interface | Normalized route geometry and associated maneuver points |
|
|
39
|
+
| `NavLifecycleState` | Type | Lifecycle machine state (`IDLE`, `OVERVIEW`, `APPROACHING_ROUTE`, `ON_ROUTE`) |
|
|
40
|
+
| `LicenseStatus` | Type | Status of license verification (`VALID`, `INVALID`, `EXPIRED`, `MISSING`) |
|
|
41
|
+
| `FeatureKey` | Type | Feature entitlement identifier strings |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Usage Example
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import type {
|
|
49
|
+
Coord,
|
|
50
|
+
NavCoreState,
|
|
51
|
+
NavGpsUpdate,
|
|
52
|
+
DirectionsProvider,
|
|
53
|
+
RouteResult,
|
|
54
|
+
} from '@ingissa/navcore-types';
|
|
55
|
+
|
|
56
|
+
export class CustomRouter implements DirectionsProvider {
|
|
57
|
+
async getRoute(waypoints: Coord[]): Promise<RouteResult> {
|
|
58
|
+
// Custom routing calculation
|
|
59
|
+
return {
|
|
60
|
+
geometry: waypoints,
|
|
61
|
+
distance: 1200,
|
|
62
|
+
duration: 180,
|
|
63
|
+
legs: [],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Documentation
|
|
72
|
+
|
|
73
|
+
- [API Reference](../../docs/api-reference/navcore-types.md)
|
|
74
|
+
- [Official Website](https://navcore-web.vercel.app/)
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Licensing
|
|
79
|
+
|
|
80
|
+
Proprietary software. Copyright (c) 2026 Abdelnasser Aitabi. All rights reserved. No license is granted except by separate written agreement.
|
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 };
|