@stadiamaps/ferrostar 0.37.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ferrostar.d.ts CHANGED
@@ -415,32 +415,23 @@ export interface GeographicCoordinate {
415
415
  lng: number;
416
416
  }
417
417
 
418
- export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
419
-
420
- /**
421
- * Controls how simulated locations deviate from the actual route line.
422
- * This simulates real-world GPS behavior where readings often have systematic bias.
423
- */
424
- export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
425
-
426
- /**
427
- * The current state of the simulation.
428
- */
429
- export interface LocationSimulationState {
430
- current_location: UserLocation;
431
- remaining_locations: GeographicCoordinate[];
432
- bias: LocationBias;
433
- }
434
-
435
- export interface NavigationControllerConfig {
418
+ export interface JsNavigationControllerConfig {
436
419
  /**
437
- * Configures when navigation advances to next waypoint in the route.
420
+ * Configures when navigation advances to the next waypoint in the route.
438
421
  */
439
422
  waypointAdvance: WaypointAdvanceMode;
440
423
  /**
441
424
  * Configures when navigation advances to the next step in the route.
442
425
  */
443
- stepAdvance: StepAdvanceMode;
426
+ stepAdvanceCondition: JsStepAdvanceCondition;
427
+ /**
428
+ * A special advance condition used for the final 2 route steps (last and arrival).
429
+ *
430
+ * This exists because several of our step advance conditions require entry and
431
+ * exit from a step\'s geometry. The end of the route/arrival doesn\'t always accommodate
432
+ * the expected location updates for the core step advance condition.
433
+ */
434
+ arrivalStepAdvanceCondition: JsStepAdvanceCondition;
444
435
  /**
445
436
  * Configures when the user is deemed to be off course.
446
437
  *
@@ -475,17 +466,6 @@ export interface NavigationControllerConfig {
475
466
  */
476
467
  export type WaypointAdvanceMode = { WaypointWithinRange: number };
477
468
 
478
- /**
479
- * Special conditions which alter the normal step advance logic,
480
- */
481
- export type SpecialAdvanceConditions = { AdvanceAtDistanceFromEnd: number } | { MinimumDistanceFromCurrentStepLine: number };
482
-
483
- /**
484
- * The step advance mode describes when the current maneuver has been successfully completed,
485
- * and we should advance to the next step.
486
- */
487
- export type StepAdvanceMode = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { RelativeLineStringDistance: { minimumHorizontalAccuracy: number; specialAdvanceConditions: SpecialAdvanceConditions | undefined } };
488
-
489
469
  /**
490
470
  * Controls filtering/post-processing of user course by the [`NavigationController`].
491
471
  */
@@ -543,6 +523,11 @@ export interface TripProgress {
543
523
  durationRemaining: number;
544
524
  }
545
525
 
526
+ export interface JsNavState {
527
+ tripState: TripState;
528
+ stepAdvanceCondition: JsStepAdvanceCondition;
529
+ }
530
+
546
531
  /**
547
532
  * Status information that describes whether the user is proceeding according to the route or not.
548
533
  *
@@ -556,6 +541,25 @@ export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLin
556
541
  */
557
542
  export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
558
543
 
544
+ export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
545
+
546
+ /**
547
+ * Controls how simulated locations deviate from the actual route line.
548
+ * This simulates real-world GPS behavior where readings often have systematic bias.
549
+ */
550
+ export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
551
+
552
+ /**
553
+ * The current state of the simulation.
554
+ */
555
+ export interface LocationSimulationState {
556
+ current_location: UserLocation;
557
+ remaining_locations: GeographicCoordinate[];
558
+ bias: LocationBias;
559
+ }
560
+
561
+ export type JsStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceEntryExit: { minimumHorizontalAccuracy: number; distanceToEndOfStep: number; distanceAfterEndStep: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: JsStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: JsStepAdvanceCondition[] } };
562
+
559
563
  /**
560
564
  * JavaScript wrapper for `NavigationController`.
561
565
  */
package/ferrostar_bg.js CHANGED
@@ -185,6 +185,13 @@ function takeFromExternrefTable0(idx) {
185
185
  wasm.__externref_table_dealloc(idx);
186
186
  return value;
187
187
  }
188
+
189
+ function passArray8ToWasm0(arg, malloc) {
190
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
191
+ getUint8ArrayMemory0().set(arg, ptr / 1);
192
+ WASM_VECTOR_LEN = arg.length;
193
+ return ptr;
194
+ }
188
195
  /**
189
196
  * JavaScript wrapper for `location_simulation_from_coordinates`.
190
197
  * @param {any} coordinates
@@ -243,13 +250,6 @@ export function advanceLocationSimulation(state) {
243
250
  return ret;
244
251
  }
245
252
 
246
- function passArray8ToWasm0(arg, malloc) {
247
- const ptr = malloc(arg.length * 1, 1) >>> 0;
248
- getUint8ArrayMemory0().set(arg, ptr / 1);
249
- WASM_VECTOR_LEN = arg.length;
250
- return ptr;
251
- }
252
-
253
253
  const NavigationControllerFinalization = (typeof FinalizationRegistry === 'undefined')
254
254
  ? { register: () => {}, unregister: () => {} }
255
255
  : new FinalizationRegistry(ptr => wasm.__wbg_navigationcontroller_free(ptr >>> 0, 1));
package/ferrostar_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "Luke Seelenbinder <luke@stadiamaps.com>"
8
8
  ],
9
9
  "description": "The core of modern turn-by-turn navigation.",
10
- "version": "0.37.0",
10
+ "version": "0.39.0",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",