@ingissa/navcore-core 1.0.4 → 1.0.5
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 +279 -136
- package/dist/{NavCore-DzTPBxIc.d.mts → NavCore-qf5_0qsR.d.mts} +50 -47
- package/dist/{NavCore-DzTPBxIc.d.ts → NavCore-qf5_0qsR.d.ts} +50 -47
- package/dist/core.d.mts +7 -23
- package/dist/core.d.ts +7 -23
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/index.d.mts +2 -65
- package/dist/index.d.ts +2 -65
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/index.pro-C5J1xlzt.d.ts +535 -0
- package/dist/index.pro-Cg6394f_.d.mts +535 -0
- package/dist/pro.d.mts +2 -488
- package/dist/pro.d.ts +2 -488
- package/dist/pro.js +1 -1
- package/dist/pro.mjs +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,136 +1,279 @@
|
|
|
1
|
-
# @ingissa/navcore-core
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[](https://www.typescriptlang.org/)
|
|
8
|
-
[](https://www.npmjs.com/package/@ingissa/navcore-core)
|
|
6
|
+
[]()
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://www.npmjs.com/package/@ingissa/navcore-core)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why NavCore?
|
|
13
|
+
|
|
14
|
+
| Feature | NavCore | Mapbox Nav SDK | Google Maps |
|
|
15
|
+
|---|---|---|---|
|
|
16
|
+
| **Framework** | Any (pure TS) | React Native only | Platform-locked |
|
|
17
|
+
| **Runtime deps** | 0 | 50+ | N/A |
|
|
18
|
+
| **Map renderer** | BYO (adapter) | Mapbox GL only | Google Maps only |
|
|
19
|
+
| **Directions** | BYO (adapter) | Mapbox API only | Google API only |
|
|
20
|
+
| **Off-route detection** | Built-in FSM | Basic | Basic |
|
|
21
|
+
| **U-turn protection** | ✅ Bearing penalty | ❌ | ❌ |
|
|
22
|
+
| **Parallel road resolver** | ✅ Built-in | ❌ | ❌ |
|
|
23
|
+
| **Dead reckoning** | ✅ Built-in | ❌ | ❌ |
|
|
24
|
+
| **Geofencing** | ✅ Built-in | ❌ | Paid API |
|
|
25
|
+
| **ETA** | ✅ Offline | API only | API only |
|
|
26
|
+
| **Voice triggers** | ✅ Built-in | SDK only | ❌ |
|
|
27
|
+
| **Headless testing** | ✅ Full pipeline | ❌ | ❌ |
|
|
28
|
+
| **Custom routes** | ✅ GPX/GeoJSON/Builder | ❌ | ❌ |
|
|
29
|
+
| **License** | Core MIT / Pro commercial | Commercial | Commercial |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Tier Model
|
|
34
|
+
|
|
35
|
+
NavCore uses a two-tier model controlled by a signed license key:
|
|
36
|
+
|
|
37
|
+
| Tier | Import | License | Includes |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| **Core** | `@ingissa/navcore-core/core` | MIT — free forever | Geo utils, Kalman filter, route snapping, directions adapters, route builder |
|
|
40
|
+
| **Pro** | `@ingissa/navcore-core/pro` | Commercial key required | Dead reckoning, advanced bearing, deviation detection, FSMs, voice, ETA, geofencing |
|
|
41
|
+
| **Engine** | `@ingissa/navcore-core` | Gated internally at runtime | Full `NavCore` orchestrator (license key unlocks Pro features) |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install @ingissa/navcore-core
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### Core tier (no license needed)
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { NavCore } from '@ingissa/navcore-core';
|
|
59
|
+
import { OSRMDirectionsProvider } from '@ingissa/navcore-core/core';
|
|
60
|
+
|
|
61
|
+
// 1. Get a route from your self-hosted OSRM (free)
|
|
62
|
+
const provider = new OSRMDirectionsProvider({ baseUrl: 'http://router.project-osrm.org' });
|
|
63
|
+
const route = await provider.getRoute([[2.3522, 48.8566], [2.3400, 48.8700]]);
|
|
64
|
+
|
|
65
|
+
// 2. Create engine (Core features work without a key)
|
|
66
|
+
const engine = new NavCore();
|
|
67
|
+
engine.setRoute(route.geometry);
|
|
68
|
+
engine.startNavigation();
|
|
69
|
+
|
|
70
|
+
// 3. Feed GPS updates
|
|
71
|
+
engine.on('arrival', () => console.log('Arrived!'));
|
|
72
|
+
|
|
73
|
+
navigator.geolocation.watchPosition(({ coords }) => {
|
|
74
|
+
const state = engine.update({
|
|
75
|
+
coord: [coords.longitude, coords.latitude],
|
|
76
|
+
accuracy: coords.accuracy,
|
|
77
|
+
bearing: coords.heading,
|
|
78
|
+
speed: coords.speed ?? 0,
|
|
79
|
+
timestamp: Date.now(),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
console.log('Distance remaining:', state.distanceToDestination, 'm');
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Pro tier (with license key)
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { NavCore } from '@ingissa/navcore-core';
|
|
90
|
+
|
|
91
|
+
// Pro features unlock automatically with a valid key
|
|
92
|
+
const engine = new NavCore({ licenseKey: 'your-signed-license-key' });
|
|
93
|
+
engine.setRoute(routeCoords, instructions);
|
|
94
|
+
engine.startNavigation();
|
|
95
|
+
|
|
96
|
+
engine.on('instruction', (instr) => speak(instr.text)); // voice cues (PRO)
|
|
97
|
+
engine.on('deviation', ({ anchorIndex }) => recalculate(anchorIndex));
|
|
98
|
+
engine.on('arrival', () => console.log('Arrived!'));
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Using subpath imports directly
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// Free MIT tier
|
|
105
|
+
import { KalmanFilter2D } from '@ingissa/navcore-core/core';
|
|
106
|
+
import { OSRMDirectionsProvider } from '@ingissa/navcore-core/core';
|
|
107
|
+
import { CustomRouteBuilder } from '@ingissa/navcore-core/core';
|
|
108
|
+
|
|
109
|
+
// Commercial Pro tier
|
|
110
|
+
import { DeadReckoningEngine } from '@ingissa/navcore-core/pro';
|
|
111
|
+
import { VoiceTriggerEngine } from '@ingissa/navcore-core/pro';
|
|
112
|
+
import { ETAEngine } from '@ingissa/navcore-core/pro';
|
|
113
|
+
import { GeofencingEngine } from '@ingissa/navcore-core/pro';
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Directions Providers (built-in, no extra install)
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import {
|
|
122
|
+
OSRMDirectionsProvider, // Self-hosted OSRM (recommended, free)
|
|
123
|
+
ValhallaDirectionsProvider, // Self-hosted Valhalla (free)
|
|
124
|
+
OpenRouteServiceProvider, // openrouteservice.org (free tier)
|
|
125
|
+
} from '@ingissa/navcore-core/core';
|
|
126
|
+
|
|
127
|
+
// OSRM
|
|
128
|
+
const osrm = new OSRMDirectionsProvider({ baseUrl: 'http://router.project-osrm.org' });
|
|
129
|
+
const route = await osrm.getRoute([[lng1, lat1], [lng2, lat2]]);
|
|
130
|
+
|
|
131
|
+
// Valhalla
|
|
132
|
+
const valhalla = new ValhallaDirectionsProvider({ baseUrl: 'https://valhalla1.openstreetmap.de' });
|
|
133
|
+
const route = await valhalla.getRoute([[lng1, lat1], [lng2, lat2]], { costing: 'auto' });
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Renderer Adapters (separate packages)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npm install @ingissa/navcore-maplibre # Web + MapLibre GL
|
|
142
|
+
npm install @ingissa/navcore-leaflet # Web + Leaflet.js
|
|
143
|
+
npm install @ingissa/navcore-google-maps # Google Maps JS API
|
|
144
|
+
npm install @ingissa/navcore-mapbox # React Native + @rnmapbox/maps
|
|
145
|
+
npm install @ingissa/navcore-react-native # React Native bindings
|
|
146
|
+
npm install @ingissa/navcore-headless # Node.js / CI testing
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
> ⚠️ Renderer adapter packages require a commercial license. [Get yours at Not yet available]()
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Feature Reference
|
|
154
|
+
|
|
155
|
+
### CORE — free, MIT
|
|
156
|
+
|
|
157
|
+
| Feature | API |
|
|
158
|
+
|---|---|
|
|
159
|
+
| GPS smoothing | `KalmanFilter2D` |
|
|
160
|
+
| Route snapping | `RouteSnapper` |
|
|
161
|
+
| Haversine & bearing | `haversineDistance`, `getBearingBetweenPoints` |
|
|
162
|
+
| Cumulative distances | `buildForwardCumulativeDistances` |
|
|
163
|
+
| Route builder | `CustomRouteBuilder` |
|
|
164
|
+
| Directions — OSRM | `OSRMDirectionsProvider` |
|
|
165
|
+
| Directions — Valhalla | `ValhallaDirectionsProvider` |
|
|
166
|
+
| Directions — ORS | `OpenRouteServiceProvider` |
|
|
167
|
+
| Renderer interface | `MapRendererAdapter` |
|
|
168
|
+
| License verification | `LicenseManager` |
|
|
169
|
+
|
|
170
|
+
### PRO — commercial license required
|
|
171
|
+
|
|
172
|
+
| Feature | API | FEATURES key |
|
|
173
|
+
|---|---|---|
|
|
174
|
+
| Advanced snapping (bearing + inertia) | `RouteSnapper` options | `ADVANCED_SNAPPING` |
|
|
175
|
+
| Parallel road resolver | `ParallelRoadResolver` | `PARALLEL_ROAD_RESOLUTION` |
|
|
176
|
+
| Dead reckoning | `DeadReckoningEngine` | `DEAD_RECKONING` |
|
|
177
|
+
| Compound deviation detection | `DeviationDetector` | `COMPOUND_DEVIATION` |
|
|
178
|
+
| Advanced bearing engine | `BearingEngine` | `ADVANCED_BEARING` |
|
|
179
|
+
| Progress anti-regression | `ProgressTracker` | `PROGRESS_TRACKING` |
|
|
180
|
+
| Route offset predictor | `RouteOffsetPredictor` | `ROUTE_OFFSET` |
|
|
181
|
+
| Navigation lifecycle FSM | `NavigationFSM` | — |
|
|
182
|
+
| Off-route FSM | `OffRouteFSM` | — |
|
|
183
|
+
| Instruction editor | `InstructionEditor` | — |
|
|
184
|
+
| Voice trigger engine | `VoiceTriggerEngine` | `VOICE_TRIGGERS` |
|
|
185
|
+
| ETA engine (offline) | `ETAEngine` | `ETA` |
|
|
186
|
+
| Geofencing engine | `GeofencingEngine` | `GEOFENCING` |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## License Gate Behaviour
|
|
191
|
+
|
|
192
|
+
| Condition | Result |
|
|
193
|
+
|---|---|
|
|
194
|
+
| No `licenseKey` | Core features work; Pro features blocked with `console.warn` |
|
|
195
|
+
| Valid Pro key | All features unlocked; `🔑 [NavCore] License validation complete. Plan: pro` logged |
|
|
196
|
+
| `isDev: true` | All features bypassed (development mode) |
|
|
197
|
+
| Expired / tampered key | Pro features blocked; status: `EXPIRED` / `INVALID` |
|
|
198
|
+
|
|
199
|
+
License keys are verified **offline** using ECDSA P-256 — no network calls, no tracking.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## NavCore Engine API
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
const engine = new NavCore(options?: NavCoreOptions);
|
|
207
|
+
|
|
208
|
+
// Setup
|
|
209
|
+
engine.setRoute(coords: Coordinate[], instructions?: NavInstruction[]);
|
|
210
|
+
engine.startNavigation();
|
|
211
|
+
|
|
212
|
+
// GPS update (returns state snapshot)
|
|
213
|
+
const state: NavCoreState = engine.update(gpsUpdate: NavGpsUpdate);
|
|
214
|
+
|
|
215
|
+
// Render tick (call at ~60fps between GPS updates)
|
|
216
|
+
engine.tick(nowMs: number);
|
|
217
|
+
|
|
218
|
+
// Events
|
|
219
|
+
engine.on('instruction', (instr: NavInstruction) => void);
|
|
220
|
+
engine.on('deviation', ({ anchorIndex, ghostCoord }) => void);
|
|
221
|
+
engine.on('arrival', () => void);
|
|
222
|
+
engine.on('routeLoaded', ({ routeLength }) => void);
|
|
223
|
+
engine.off(event, handler);
|
|
224
|
+
|
|
225
|
+
// State & introspection
|
|
226
|
+
engine.getState(): NavCoreState;
|
|
227
|
+
engine.getLicenseManager(): LicenseManager;
|
|
228
|
+
engine.getRoute(): ReadonlyArray<Coordinate>;
|
|
229
|
+
engine.destroy();
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### NavCoreState
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
interface NavCoreState {
|
|
236
|
+
snappedCoord: Coordinate | null; // GPS-snapped position on route
|
|
237
|
+
rawGpsCoord: Coordinate | null; // Raw GPS position
|
|
238
|
+
bearing: number; // Smoothed heading (degrees)
|
|
239
|
+
routeIndex: number; // Current segment index
|
|
240
|
+
distanceToRoute: number; // Distance from route (metres)
|
|
241
|
+
corridor: number; // Dynamic off-route threshold (metres)
|
|
242
|
+
isOffRoute: boolean; // True when deviation confirmed
|
|
243
|
+
hasArrived: boolean;
|
|
244
|
+
distanceToDestination: number | null; // Remaining distance (metres)
|
|
245
|
+
distanceToNextInstruction: number | null; // Distance to next turn
|
|
246
|
+
nextInstructionIndex: number | null;
|
|
247
|
+
currentSpeed: number; // m/s
|
|
248
|
+
isGpsStale: boolean;
|
|
249
|
+
gpsAgeMs: number;
|
|
250
|
+
licenseStatus: string; // 'VALID' | 'INVALID' | 'EXPIRED' | 'MISSING'
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Documentation
|
|
257
|
+
|
|
258
|
+
| Guide | Link |
|
|
259
|
+
|---|---|
|
|
260
|
+
| Architecture | [docs/architecture.md](./docs/architecture.md) |
|
|
261
|
+
| Getting Started | [docs/getting-started.md](./docs/getting-started.md) |
|
|
262
|
+
| Directions Providers | [docs/directions-providers.md](./docs/directions-providers.md) |
|
|
263
|
+
| Renderer Adapters | [docs/renderer-adapters.md](./docs/renderer-adapters.md) |
|
|
264
|
+
| API Reference | [docs/api-reference.md](./docs/api-reference.md) |
|
|
265
|
+
| Custom Routes | [docs/custom-routes.md](./docs/custom-routes.md) |
|
|
266
|
+
| Instructions & Voice | [docs/instructions.md](./docs/instructions.md) |
|
|
267
|
+
| Pro Features | [docs/p3-features.md](./docs/p3-features.md) |
|
|
268
|
+
| Testing Guide | [docs/testing.md](./docs/testing.md) |
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
- **Core engine** (`@ingissa/navcore-core`): [MIT](./LICENSE) for open-source projects
|
|
275
|
+
- **Pro features & adapters**: Commercial license required — [Not yet available]()
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
© Ingissa · [8abnav@gmail.com](mailto:8abnav@gmail.com)
|
|
@@ -34,7 +34,7 @@ interface InstructionResult {
|
|
|
34
34
|
/**
|
|
35
35
|
* Resolve which instruction is next and whether it should trigger now.
|
|
36
36
|
*/
|
|
37
|
-
declare function resolveNextInstruction(currentGeometryIdx: number, instructions: NavInstruction[], currentInstrIdx: number, route: Coordinate[], currentCoord: Coordinate, vehicleBearing: number | null, vehicleDistance: number, speed?: number): InstructionResult;
|
|
37
|
+
declare function resolveNextInstruction(currentGeometryIdx: number, instructions: NavInstruction[], currentInstrIdx: number, route: Coordinate[], currentCoord: Coordinate, vehicleBearing: number | null, vehicleDistance: number, speed?: number, isCircuit?: boolean): InstructionResult;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Module 9a: NavigationFSM
|
|
@@ -151,12 +151,8 @@ declare class OffRouteFSM {
|
|
|
151
151
|
/**
|
|
152
152
|
* Feature flag constants for SDK consumers.
|
|
153
153
|
*
|
|
154
|
-
* CORE features: available to all users
|
|
155
|
-
*
|
|
156
|
-
* progress tracking, and route offset prediction are all free.
|
|
157
|
-
*
|
|
158
|
-
* PRO features: require a valid commercial license key.
|
|
159
|
-
* Each PRO engine checks the license at runtime and gracefully degrades.
|
|
154
|
+
* CORE features: available to all users (MIT license).
|
|
155
|
+
* PRO features: require a valid commercial license key.
|
|
160
156
|
*/
|
|
161
157
|
declare const FEATURES: {
|
|
162
158
|
/**
|
|
@@ -165,45 +161,43 @@ declare const FEATURES: {
|
|
|
165
161
|
*/
|
|
166
162
|
readonly GPS_SMOOTHING: "gps_smoothing";
|
|
167
163
|
/**
|
|
168
|
-
* Basic route snapping (nearest-point projection)
|
|
169
|
-
*
|
|
170
|
-
* Both basic and advanced snapping quality are available in the free tier.
|
|
164
|
+
* Basic route snapping (nearest-point projection).
|
|
165
|
+
* Snaps GPS position to the closest route segment.
|
|
171
166
|
*/
|
|
172
167
|
readonly BASIC_SNAPPING: "basic_snapping";
|
|
173
168
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* Used unconditionally inside NavCore — available in the free tier.
|
|
169
|
+
* Advanced route snapping with bearing penalty + inertia.
|
|
170
|
+
* Prevents incorrect snaps on parallel roads and U-turns.
|
|
177
171
|
*/
|
|
178
|
-
readonly
|
|
172
|
+
readonly ADVANCED_SNAPPING: "advanced_snapping";
|
|
173
|
+
/**
|
|
174
|
+
* Dead reckoning: continues navigation during GPS signal loss.
|
|
175
|
+
* Predicts position based on last known speed and bearing.
|
|
176
|
+
*/
|
|
177
|
+
readonly DEAD_RECKONING: "dead_reckoning";
|
|
179
178
|
/**
|
|
180
179
|
* Smooth route offset predictor for jitter-free map rendering.
|
|
181
180
|
* Advances render position at frame rate between GPS fixes.
|
|
182
|
-
* Used unconditionally inside NavCore — available in the free tier.
|
|
183
181
|
*/
|
|
184
182
|
readonly ROUTE_OFFSET: "route_offset";
|
|
185
183
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* DeadReckoningEngine.predict() is a no-op without a Pro license.
|
|
184
|
+
* Progress anti-regression: prevents route index from jumping backward.
|
|
185
|
+
* Essential for circuit routes and motorway slip roads.
|
|
189
186
|
*/
|
|
190
|
-
readonly
|
|
187
|
+
readonly PROGRESS_TRACKING: "progress_tracking";
|
|
191
188
|
/**
|
|
192
189
|
* Advanced bearing engine with look-ahead and speed-adaptive alpha.
|
|
193
190
|
* Produces stable heading for smooth map camera rotation.
|
|
194
|
-
* Gated inside NavCore.update() via this.has(FEATURES.ADVANCED_BEARING).
|
|
195
191
|
*/
|
|
196
192
|
readonly ADVANCED_BEARING: "advanced_bearing";
|
|
197
193
|
/**
|
|
198
194
|
* Compound deviation detection: combines distance, bearing, and speed signals.
|
|
199
195
|
* Eliminates false off-route triggers in tunnels and urban canyons.
|
|
200
|
-
* DeviationDetector.evaluate() returns a neutral signal without a Pro license.
|
|
201
196
|
*/
|
|
202
197
|
readonly COMPOUND_DEVIATION: "compound_deviation";
|
|
203
198
|
/**
|
|
204
199
|
* Parallel road disambiguation + U-turn snap protection.
|
|
205
200
|
* Prevents snapping to the wrong carriageway when bearing mismatches route direction.
|
|
206
|
-
* ParallelRoadResolver falls back to pure distance sorting without a Pro license.
|
|
207
201
|
*/
|
|
208
202
|
readonly PARALLEL_ROAD_RESOLUTION: "parallel_road_resolution";
|
|
209
203
|
/**
|
|
@@ -213,17 +207,14 @@ declare const FEATURES: {
|
|
|
213
207
|
readonly U_TURN_PROTECTION: "u_turn_protection";
|
|
214
208
|
/**
|
|
215
209
|
* Timed voice instruction cues with deduplication and priority levels.
|
|
216
|
-
* VoiceTriggerEngine.update() returns null without a Pro license.
|
|
217
210
|
*/
|
|
218
211
|
readonly VOICE_TRIGGERS: "voice_triggers";
|
|
219
212
|
/**
|
|
220
213
|
* Local ETA computation using rolling speed average — zero API calls.
|
|
221
|
-
* ETAEngine.update() returns isReliable=false without a Pro license.
|
|
222
214
|
*/
|
|
223
215
|
readonly ETA: "eta";
|
|
224
216
|
/**
|
|
225
217
|
* Circular and polygon geofencing with enter/exit/dwell events.
|
|
226
|
-
* GeofencingEngine.update() returns [] without a Pro license.
|
|
227
218
|
*/
|
|
228
219
|
readonly GEOFENCING: "geofencing";
|
|
229
220
|
/**
|
|
@@ -256,25 +247,9 @@ declare class LicenseManager {
|
|
|
256
247
|
private payload;
|
|
257
248
|
private enabledFeatures;
|
|
258
249
|
private warnedFeatures;
|
|
259
|
-
private
|
|
260
|
-
static getActive(): LicenseManager | null;
|
|
261
|
-
/**
|
|
262
|
-
* Clear the active manager reference.
|
|
263
|
-
* Intended for test teardown only — not for production use.
|
|
264
|
-
*/
|
|
265
|
-
static clearActive(): void;
|
|
266
|
-
/**
|
|
267
|
-
* Promote this instance to the global active manager.
|
|
268
|
-
*
|
|
269
|
-
* Security rule: A VALID license context cannot be overwritten by an
|
|
270
|
-
* INVALID / MISSING / EXPIRED one. Once a valid license is registered,
|
|
271
|
-
* it holds the slot until explicitly cleared or replaced by another
|
|
272
|
-
* valid license.
|
|
273
|
-
*/
|
|
274
|
-
private promoteToActive;
|
|
250
|
+
private isDev;
|
|
275
251
|
private static PUBLIC_KEY_SPKI;
|
|
276
|
-
constructor(licenseKey?: string);
|
|
277
|
-
private tryValidateSync;
|
|
252
|
+
constructor(licenseKey?: string, isDev?: boolean);
|
|
278
253
|
validate(key: string): Promise<LicenseStatus>;
|
|
279
254
|
private extractFeatures;
|
|
280
255
|
hasFeature(feature: FeatureKey): boolean;
|
|
@@ -311,6 +286,7 @@ interface NavGpsUpdate {
|
|
|
311
286
|
}
|
|
312
287
|
interface NavCoreOptions {
|
|
313
288
|
licenseKey?: string;
|
|
289
|
+
isDev?: boolean;
|
|
314
290
|
isCircuit?: boolean;
|
|
315
291
|
kalmanQ?: number;
|
|
316
292
|
kalmanRBase?: number;
|
|
@@ -321,24 +297,47 @@ interface NavCoreOptions {
|
|
|
321
297
|
}
|
|
322
298
|
interface NavCoreState {
|
|
323
299
|
snappedCoord: Coordinate | null;
|
|
300
|
+
ghostCoord: Coordinate | null;
|
|
324
301
|
rawGpsCoord: Coordinate | null;
|
|
325
302
|
bearing: number;
|
|
326
303
|
rawGpsBearing: number | null;
|
|
327
304
|
routeIndex: number;
|
|
305
|
+
anchorRouteIndex: number | null;
|
|
328
306
|
distanceToRoute: number;
|
|
329
307
|
corridor: number;
|
|
308
|
+
confidence: number;
|
|
330
309
|
isOffRoute: boolean;
|
|
310
|
+
navFsmState: string;
|
|
331
311
|
progressIndex: number;
|
|
332
312
|
hasArrived: boolean;
|
|
333
|
-
|
|
334
|
-
|
|
313
|
+
rejoinCandidate: {
|
|
314
|
+
coord: Coordinate;
|
|
315
|
+
index: number;
|
|
316
|
+
} | null;
|
|
317
|
+
confidenceCone: {
|
|
318
|
+
center: Coordinate;
|
|
319
|
+
bearing: number;
|
|
320
|
+
angle: number;
|
|
321
|
+
length: number;
|
|
322
|
+
} | null;
|
|
323
|
+
alertState: 'NONE' | 'DEVIATING' | 'RECALCULATING' | 'REJOINING' | 'REJOINED';
|
|
324
|
+
detourMode: 'NONE' | 'FREE' | 'COMMITTED';
|
|
325
|
+
detourCommitProgress: number;
|
|
335
326
|
distanceToDestination: number | null;
|
|
336
327
|
distanceToNextInstruction: number | null;
|
|
328
|
+
nextInstrIdx: number | null;
|
|
337
329
|
nextInstructionIndex: number | null;
|
|
338
330
|
currentSpeed: number;
|
|
339
331
|
isGpsStale: boolean;
|
|
340
332
|
gpsAgeMs: number;
|
|
341
333
|
licenseStatus: string;
|
|
334
|
+
offRouteState: string;
|
|
335
|
+
lifecycleState: string;
|
|
336
|
+
stability?: {
|
|
337
|
+
oscillation: number;
|
|
338
|
+
drift: number;
|
|
339
|
+
jump: number;
|
|
340
|
+
};
|
|
342
341
|
}
|
|
343
342
|
type EventHandler = (...args: unknown[]) => void;
|
|
344
343
|
declare class NavCore {
|
|
@@ -354,6 +353,7 @@ declare class NavCore {
|
|
|
354
353
|
private forwardCum;
|
|
355
354
|
private reverseCum;
|
|
356
355
|
private snappedCoord;
|
|
356
|
+
private ghostCoord;
|
|
357
357
|
private rawGpsCoord;
|
|
358
358
|
private bearing;
|
|
359
359
|
private rawGpsBearing;
|
|
@@ -371,8 +371,11 @@ declare class NavCore {
|
|
|
371
371
|
private readonly options;
|
|
372
372
|
private listeners;
|
|
373
373
|
constructor(options?: NavCoreOptions);
|
|
374
|
-
/**
|
|
375
|
-
|
|
374
|
+
/**
|
|
375
|
+
* Returns true if the feature is unlocked (dev mode OR valid license).
|
|
376
|
+
* Emits a one-time console warning when a Pro feature is blocked.
|
|
377
|
+
*/
|
|
378
|
+
private has;
|
|
376
379
|
/** Load route geometry and instructions */
|
|
377
380
|
setRoute(route: Coordinate[], instructions?: NavInstruction[]): void;
|
|
378
381
|
/** Start navigation */
|