@ingissa/navcore-core 1.0.3 → 1.0.4
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 +136 -279
- package/dist/{NavCore.d-BuXR5DO7.d.mts → NavCore-DzTPBxIc.d.mts} +2 -5
- package/dist/{NavCore.d-BuXR5DO7.d.ts → NavCore-DzTPBxIc.d.ts} +2 -5
- package/dist/core.d.mts +52 -32
- package/dist/core.d.ts +52 -32
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/pro.d.mts +1 -1
- package/dist/pro.d.ts +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,279 +1,136 @@
|
|
|
1
|
-
# @ingissa/navcore-core
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[](https://www.typescriptlang.org/)
|
|
8
|
-
[![
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
import {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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)
|
|
1
|
+
# @ingissa/navcore-core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic TypeScript navigation engine for browser, React Native,
|
|
4
|
+
Node.js, and CI environments.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@ingissa/navcore-core)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://navcore-web.vercel.app/pricing)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @ingissa/navcore-core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { NavCore, OSRMDirectionsProvider } from '@ingissa/navcore-core';
|
|
20
|
+
|
|
21
|
+
const provider = new OSRMDirectionsProvider({
|
|
22
|
+
baseUrl: 'http://router.project-osrm.org',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const route = await provider.getRoute([
|
|
26
|
+
[2.3522, 48.8566],
|
|
27
|
+
[2.3400, 48.8700],
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
const engine = new NavCore({
|
|
31
|
+
licenseKey: process.env.NAVCORE_LICENSE_KEY,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
engine.setRoute(route.geometry);
|
|
35
|
+
engine.startNavigation();
|
|
36
|
+
|
|
37
|
+
const state = engine.update({
|
|
38
|
+
coord: [2.3522, 48.8566],
|
|
39
|
+
accuracy: 8,
|
|
40
|
+
bearing: 90,
|
|
41
|
+
speed: 9,
|
|
42
|
+
timestamp: Date.now(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log(state.snappedCoord, state.distanceToDestination);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## What Is Included
|
|
49
|
+
|
|
50
|
+
Core runtime behavior works without a licence key:
|
|
51
|
+
|
|
52
|
+
| Area | APIs |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Geo utilities | `haversineDistance`, `getBearingBetweenPoints`, cumulative distance helpers |
|
|
55
|
+
| GPS smoothing | `KalmanFilter2D` |
|
|
56
|
+
| Route snapping | `RouteSnapper` |
|
|
57
|
+
| Route building | `CustomRouteBuilder` |
|
|
58
|
+
| Directions | `OSRMDirectionsProvider`, `ValhallaDirectionsProvider`, `OpenRouteServiceProvider` |
|
|
59
|
+
| Renderer contract | `MapRendererAdapter` types |
|
|
60
|
+
| Licence status | `LicenseManager` |
|
|
61
|
+
|
|
62
|
+
Pro behavior unlocks with a signed licence key:
|
|
63
|
+
|
|
64
|
+
| Area | APIs |
|
|
65
|
+
|---|---|
|
|
66
|
+
| Advanced route matching | `ParallelRoadResolver`, bearing and inertia scoring |
|
|
67
|
+
| Deviation handling | `DeviationDetector`, `OffRouteFSM`, `NavigationFSM` |
|
|
68
|
+
| Dead reckoning | `DeadReckoningEngine` |
|
|
69
|
+
| Turn guidance | `InstructionEditor`, voice trigger helpers |
|
|
70
|
+
| Driver UX | `ETAEngine`, `GeofencingEngine` |
|
|
71
|
+
|
|
72
|
+
Get a licence key:
|
|
73
|
+
|
|
74
|
+
https://navcore-web.vercel.app/pricing
|
|
75
|
+
|
|
76
|
+
## Direction Providers
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import {
|
|
80
|
+
OSRMDirectionsProvider,
|
|
81
|
+
ValhallaDirectionsProvider,
|
|
82
|
+
OpenRouteServiceProvider,
|
|
83
|
+
} from '@ingissa/navcore-core';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
All providers implement:
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
interface DirectionsProvider {
|
|
90
|
+
getRoute(
|
|
91
|
+
waypoints: Coordinate[],
|
|
92
|
+
options?: DirectionsOptions
|
|
93
|
+
): Promise<DirectionsResult>;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Provider options include:
|
|
98
|
+
|
|
99
|
+
| Option | Purpose |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `profile` | Driving, cycling, or walking route mode |
|
|
102
|
+
| `steps` | Include maneuver data |
|
|
103
|
+
| `language` | Instruction language when supported |
|
|
104
|
+
| `fetchFn` | Custom fetch implementation for tests or runtimes |
|
|
105
|
+
| `timeoutMs` | Abort slow requests |
|
|
106
|
+
|
|
107
|
+
## Public Subpaths
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Full engine and all public APIs
|
|
111
|
+
import { NavCore } from '@ingissa/navcore-core';
|
|
112
|
+
|
|
113
|
+
// Core-oriented subpath
|
|
114
|
+
import { RouteSnapper } from '@ingissa/navcore-core/core';
|
|
115
|
+
|
|
116
|
+
// Pro-oriented subpath
|
|
117
|
+
import { DeadReckoningEngine } from '@ingissa/navcore-core/pro';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Licence Model
|
|
121
|
+
|
|
122
|
+
`@ingissa/navcore-core` is published publicly on npm and uses a commercial
|
|
123
|
+
licence model.
|
|
124
|
+
|
|
125
|
+
| Condition | Result |
|
|
126
|
+
|---|---|
|
|
127
|
+
| No licence key | Core behavior works with Core fallbacks. |
|
|
128
|
+
| Valid licence key | Pro features unlock according to the signed key. |
|
|
129
|
+
| Expired or invalid key | Pro features are blocked and status is reported. |
|
|
130
|
+
| Development key | Accepted only in local development/test environments. |
|
|
131
|
+
|
|
132
|
+
Pricing and licence keys:
|
|
133
|
+
|
|
134
|
+
https://navcore-web.vercel.app/pricing
|
|
135
|
+
|
|
136
|
+
Copyright Ingissa. All rights reserved.
|
|
@@ -371,11 +371,8 @@ declare class NavCore {
|
|
|
371
371
|
private readonly options;
|
|
372
372
|
private listeners;
|
|
373
373
|
constructor(options?: NavCoreOptions);
|
|
374
|
-
/**
|
|
375
|
-
|
|
376
|
-
* Emits a one-time console warning when a Pro feature is blocked.
|
|
377
|
-
*/
|
|
378
|
-
private has;
|
|
374
|
+
/** Internal license check for automatic fallbacks that should not warn Core users every tick. */
|
|
375
|
+
private canUse;
|
|
379
376
|
/** Load route geometry and instructions */
|
|
380
377
|
setRoute(route: Coordinate[], instructions?: NavInstruction[]): void;
|
|
381
378
|
/** Start navigation */
|
|
@@ -371,11 +371,8 @@ declare class NavCore {
|
|
|
371
371
|
private readonly options;
|
|
372
372
|
private listeners;
|
|
373
373
|
constructor(options?: NavCoreOptions);
|
|
374
|
-
/**
|
|
375
|
-
|
|
376
|
-
* Emits a one-time console warning when a Pro feature is blocked.
|
|
377
|
-
*/
|
|
378
|
-
private has;
|
|
374
|
+
/** Internal license check for automatic fallbacks that should not warn Core users every tick. */
|
|
375
|
+
private canUse;
|
|
379
376
|
/** Load route geometry and instructions */
|
|
380
377
|
setRoute(route: Coordinate[], instructions?: NavInstruction[]): void;
|
|
381
378
|
/** Start navigation */
|
package/dist/core.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Coordinate, g as NavCoreState } from './NavCore
|
|
2
|
-
export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore
|
|
1
|
+
import { C as Coordinate, g as NavCoreState } from './NavCore-DzTPBxIc.mjs';
|
|
2
|
+
export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore-DzTPBxIc.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Bearing and angular math utilities.
|
|
@@ -281,6 +281,10 @@ interface OSRMConfig {
|
|
|
281
281
|
profile?: 'driving' | 'cycling' | 'walking';
|
|
282
282
|
/** Max waypoints per API request (OSRM supports unlimited, but chunking keeps requests fast) */
|
|
283
283
|
maxWaypointsPerChunk?: number;
|
|
284
|
+
/** Optional fetch implementation for tests, React Native, or custom runtimes */
|
|
285
|
+
fetchFn?: typeof fetch;
|
|
286
|
+
/** Request timeout in milliseconds. Set to 0 to disable. */
|
|
287
|
+
timeoutMs?: number;
|
|
284
288
|
}
|
|
285
289
|
declare class OSRMDirectionsProvider implements DirectionsProvider {
|
|
286
290
|
private readonly config;
|
|
@@ -288,6 +292,7 @@ declare class OSRMDirectionsProvider implements DirectionsProvider {
|
|
|
288
292
|
getRoute(waypoints: Coordinate[], options?: DirectionsOptions): Promise<DirectionsResult>;
|
|
289
293
|
private fetchRoute;
|
|
290
294
|
private fetchChunked;
|
|
295
|
+
private fetchWithTimeout;
|
|
291
296
|
}
|
|
292
297
|
|
|
293
298
|
/**
|
|
@@ -310,6 +315,10 @@ interface ValhallaConfig {
|
|
|
310
315
|
apiKey?: string;
|
|
311
316
|
/** Max waypoints per chunk (default: 50) */
|
|
312
317
|
maxWaypointsPerChunk?: number;
|
|
318
|
+
/** Optional fetch implementation for tests, React Native, or custom runtimes */
|
|
319
|
+
fetchFn?: typeof fetch;
|
|
320
|
+
/** Request timeout in milliseconds. Set to 0 to disable. */
|
|
321
|
+
timeoutMs?: number;
|
|
313
322
|
}
|
|
314
323
|
declare class ValhallaDirectionsProvider implements DirectionsProvider {
|
|
315
324
|
private readonly config;
|
|
@@ -319,7 +328,11 @@ declare class ValhallaDirectionsProvider implements DirectionsProvider {
|
|
|
319
328
|
private fetchRoute;
|
|
320
329
|
/** Decode Valhalla's encoded polyline6 format */
|
|
321
330
|
private decodePolyline;
|
|
331
|
+
private stitchGeometry;
|
|
332
|
+
private sameCoordinate;
|
|
333
|
+
private shapeIndex;
|
|
322
334
|
private fetchChunked;
|
|
335
|
+
private fetchWithTimeout;
|
|
323
336
|
}
|
|
324
337
|
|
|
325
338
|
/**
|
|
@@ -341,6 +354,10 @@ interface ORSConfig {
|
|
|
341
354
|
baseUrl?: string;
|
|
342
355
|
/** Max waypoints per request (ORS limit: 50) */
|
|
343
356
|
maxWaypointsPerChunk?: number;
|
|
357
|
+
/** Optional fetch implementation for tests, React Native, or custom runtimes */
|
|
358
|
+
fetchFn?: typeof fetch;
|
|
359
|
+
/** Request timeout in milliseconds. Set to 0 to disable. */
|
|
360
|
+
timeoutMs?: number;
|
|
344
361
|
}
|
|
345
362
|
declare class OpenRouteServiceProvider implements DirectionsProvider {
|
|
346
363
|
private readonly config;
|
|
@@ -349,6 +366,9 @@ declare class OpenRouteServiceProvider implements DirectionsProvider {
|
|
|
349
366
|
private profileFromOptions;
|
|
350
367
|
private fetchRoute;
|
|
351
368
|
private fetchChunked;
|
|
369
|
+
private stepRange;
|
|
370
|
+
private bearingFromGeometry;
|
|
371
|
+
private fetchWithTimeout;
|
|
352
372
|
}
|
|
353
373
|
|
|
354
374
|
/**
|
|
@@ -454,35 +474,35 @@ declare const MIN_LOOK_AHEAD_METERS = 20;
|
|
|
454
474
|
declare const MAX_LOOK_AHEAD_METERS = 100;
|
|
455
475
|
declare const ARRIVAL_THRESHOLD_METERS = 30;
|
|
456
476
|
|
|
457
|
-
declare const
|
|
458
|
-
declare const
|
|
459
|
-
declare const
|
|
460
|
-
declare const
|
|
461
|
-
declare const
|
|
462
|
-
declare const
|
|
463
|
-
declare const
|
|
464
|
-
declare const
|
|
465
|
-
declare const
|
|
466
|
-
declare const
|
|
467
|
-
declare const
|
|
468
|
-
declare const
|
|
469
|
-
declare const
|
|
470
|
-
declare const
|
|
471
|
-
declare const
|
|
472
|
-
declare const
|
|
473
|
-
declare const
|
|
474
|
-
declare const
|
|
475
|
-
declare const
|
|
476
|
-
declare const
|
|
477
|
-
declare const
|
|
478
|
-
declare const
|
|
479
|
-
declare const
|
|
480
|
-
declare const
|
|
481
|
-
declare const
|
|
482
|
-
declare const
|
|
483
|
-
declare const
|
|
484
|
-
declare namespace
|
|
485
|
-
export {
|
|
477
|
+
declare const constants_ARRIVAL_THRESHOLD_METERS: typeof ARRIVAL_THRESHOLD_METERS;
|
|
478
|
+
declare const constants_BASE_CORRIDOR_METERS: typeof BASE_CORRIDOR_METERS;
|
|
479
|
+
declare const constants_BEARING_ALIGNMENT_THRESHOLD: typeof BEARING_ALIGNMENT_THRESHOLD;
|
|
480
|
+
declare const constants_BEARING_MIN_SPEED_MPS: typeof BEARING_MIN_SPEED_MPS;
|
|
481
|
+
declare const constants_BEARING_MISMATCH_PENALTY: typeof BEARING_MISMATCH_PENALTY;
|
|
482
|
+
declare const constants_BEARING_MISMATCH_THRESHOLD: typeof BEARING_MISMATCH_THRESHOLD;
|
|
483
|
+
declare const constants_BEARING_SMOOTHING_ALPHA: typeof BEARING_SMOOTHING_ALPHA;
|
|
484
|
+
declare const constants_BETA_CORRECTION: typeof BETA_CORRECTION;
|
|
485
|
+
declare const constants_DETOUR_COMMIT_MS: typeof DETOUR_COMMIT_MS;
|
|
486
|
+
declare const constants_DR_MAX_AGE_MS: typeof DR_MAX_AGE_MS;
|
|
487
|
+
declare const constants_GPS_ACCURACY_FACTOR: typeof GPS_ACCURACY_FACTOR;
|
|
488
|
+
declare const constants_GPS_AGE_CAP_SECONDS: typeof GPS_AGE_CAP_SECONDS;
|
|
489
|
+
declare const constants_GPS_STALE_MS: typeof GPS_STALE_MS;
|
|
490
|
+
declare const constants_INERTIA_PENALTY: typeof INERTIA_PENALTY;
|
|
491
|
+
declare const constants_INERTIA_SEGMENT_DIST: typeof INERTIA_SEGMENT_DIST;
|
|
492
|
+
declare const constants_LOOK_AHEAD_SECONDS: typeof LOOK_AHEAD_SECONDS;
|
|
493
|
+
declare const constants_MANEUVER_TRIGGER_DIST: typeof MANEUVER_TRIGGER_DIST;
|
|
494
|
+
declare const constants_MAX_CORRIDOR_METERS: typeof MAX_CORRIDOR_METERS;
|
|
495
|
+
declare const constants_MAX_LOOK_AHEAD_METERS: typeof MAX_LOOK_AHEAD_METERS;
|
|
496
|
+
declare const constants_MAX_SNAP_DISTANCE: typeof MAX_SNAP_DISTANCE;
|
|
497
|
+
declare const constants_MIN_LOOK_AHEAD_METERS: typeof MIN_LOOK_AHEAD_METERS;
|
|
498
|
+
declare const constants_OFF_ROUTE_CONFIRM_MS: typeof OFF_ROUTE_CONFIRM_MS;
|
|
499
|
+
declare const constants_REJOIN_CONFIRM_MS: typeof REJOIN_CONFIRM_MS;
|
|
500
|
+
declare const constants_REJOIN_COOLDOWN_MS: typeof REJOIN_COOLDOWN_MS;
|
|
501
|
+
declare const constants_SNAP_WINDOW_SIZE: typeof SNAP_WINDOW_SIZE;
|
|
502
|
+
declare const constants_SPEED_CORRIDOR_FACTOR: typeof SPEED_CORRIDOR_FACTOR;
|
|
503
|
+
declare const constants_STARTUP_GRACE_MS: typeof STARTUP_GRACE_MS;
|
|
504
|
+
declare namespace constants {
|
|
505
|
+
export { constants_ARRIVAL_THRESHOLD_METERS as ARRIVAL_THRESHOLD_METERS, constants_BASE_CORRIDOR_METERS as BASE_CORRIDOR_METERS, constants_BEARING_ALIGNMENT_THRESHOLD as BEARING_ALIGNMENT_THRESHOLD, constants_BEARING_MIN_SPEED_MPS as BEARING_MIN_SPEED_MPS, constants_BEARING_MISMATCH_PENALTY as BEARING_MISMATCH_PENALTY, constants_BEARING_MISMATCH_THRESHOLD as BEARING_MISMATCH_THRESHOLD, constants_BEARING_SMOOTHING_ALPHA as BEARING_SMOOTHING_ALPHA, constants_BETA_CORRECTION as BETA_CORRECTION, constants_DETOUR_COMMIT_MS as DETOUR_COMMIT_MS, constants_DR_MAX_AGE_MS as DR_MAX_AGE_MS, constants_GPS_ACCURACY_FACTOR as GPS_ACCURACY_FACTOR, constants_GPS_AGE_CAP_SECONDS as GPS_AGE_CAP_SECONDS, constants_GPS_STALE_MS as GPS_STALE_MS, constants_INERTIA_PENALTY as INERTIA_PENALTY, constants_INERTIA_SEGMENT_DIST as INERTIA_SEGMENT_DIST, constants_LOOK_AHEAD_SECONDS as LOOK_AHEAD_SECONDS, constants_MANEUVER_TRIGGER_DIST as MANEUVER_TRIGGER_DIST, constants_MAX_CORRIDOR_METERS as MAX_CORRIDOR_METERS, constants_MAX_LOOK_AHEAD_METERS as MAX_LOOK_AHEAD_METERS, constants_MAX_SNAP_DISTANCE as MAX_SNAP_DISTANCE, constants_MIN_LOOK_AHEAD_METERS as MIN_LOOK_AHEAD_METERS, constants_OFF_ROUTE_CONFIRM_MS as OFF_ROUTE_CONFIRM_MS, constants_REJOIN_CONFIRM_MS as REJOIN_CONFIRM_MS, constants_REJOIN_COOLDOWN_MS as REJOIN_COOLDOWN_MS, constants_SNAP_WINDOW_SIZE as SNAP_WINDOW_SIZE, constants_SPEED_CORRIDOR_FACTOR as SPEED_CORRIDOR_FACTOR, constants_STARTUP_GRACE_MS as STARTUP_GRACE_MS };
|
|
486
506
|
}
|
|
487
507
|
|
|
488
|
-
export { type BuildOptions, type CameraOptions,
|
|
508
|
+
export { type BuildOptions, type CameraOptions, constants as Constants, Coordinate, CustomRouteBuilder, type CustomWaypoint, type DirectionsLeg, type DirectionsManeuver, type DirectionsOptions, type DirectionsProvider, type DirectionsResult, type DirectionsStep, type Kalman2DState, KalmanFilter2D, type MapRendererAdapter, type ORSConfig, type ORSProfile, type OSRMConfig, OSRMDirectionsProvider, OpenRouteServiceProvider, RouteSnapper, type RouteStyle, type SnapResult, type SnapperOptions, type ValhallaConfig, type ValhallaCostingModel, ValhallaDirectionsProvider, type VehicleStyle, type WaypointOptions, buildForwardCumulativeDistances, buildReverseCumulativeDistances, getBearingBetweenPoints, interpolatePoint, kalmanUpdate2D, normalizeAngle, projectPointOnSegment };
|