@stadiamaps/ferrostar 0.41.0 → 0.43.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,8 +415,38 @@ 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
+
418
435
  export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceEntryExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } };
419
436
 
437
+ /**
438
+ * Status information that describes whether the user is proceeding according to the route or not.
439
+ *
440
+ * Note that the name is intentionally a bit generic to allow for expansion of other states.
441
+ * For example, we could conceivably add a \"wrong way\" status in the future.
442
+ */
443
+ export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
444
+
445
+ /**
446
+ * Determines if the user has deviated from the expected route.
447
+ */
448
+ export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
449
+
420
450
  /**
421
451
  * The event type.
422
452
  *
@@ -551,39 +581,8 @@ export interface TripProgress {
551
581
  export interface SerializableNavState {
552
582
  tripState: TripState;
553
583
  stepAdvanceCondition: SerializableStepAdvanceCondition;
554
- recordingEvents: NavigationRecordingEvent[] | undefined;
555
- }
556
-
557
- export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
558
-
559
- /**
560
- * Controls how simulated locations deviate from the actual route line.
561
- * This simulates real-world GPS behavior where readings often have systematic bias.
562
- */
563
- export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
564
-
565
- /**
566
- * The current state of the simulation.
567
- */
568
- export interface LocationSimulationState {
569
- current_location: UserLocation;
570
- remaining_locations: GeographicCoordinate[];
571
- bias: LocationBias;
572
584
  }
573
585
 
574
- /**
575
- * Status information that describes whether the user is proceeding according to the route or not.
576
- *
577
- * Note that the name is intentionally a bit generic to allow for expansion of other states.
578
- * For example, we could conceivably add a \"wrong way\" status in the future.
579
- */
580
- export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
581
-
582
- /**
583
- * Determines if the user has deviated from the expected route.
584
- */
585
- export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
586
-
587
586
  /**
588
587
  * JavaScript wrapper for `NavigationController`.
589
588
  * This wrapper is required because `NavigationController` cannot be directly converted to a JavaScript object
@@ -595,7 +594,6 @@ export class NavigationController {
595
594
  getInitialState(location: any): any;
596
595
  advanceToNextStep(state: any): any;
597
596
  updateUserLocation(location: any, state: any): any;
598
- getRecording(events: any): any;
599
597
  }
600
598
  /**
601
599
  * A WebAssembly-compatible wrapper for `NavigationReplay` that exposes its functionality as a JavaScript object.
@@ -612,6 +610,30 @@ export class NavigationReplay {
612
610
  getInitialTimestamp(): any;
613
611
  getInitialRoute(): any;
614
612
  }
613
+ /**
614
+ * JavaScript wrapper for `NavigationSession` (simple version).
615
+ * This wrapper provides basic navigation functionality without observers.
616
+ */
617
+ export class NavigationSession {
618
+ free(): void;
619
+ constructor(route: any, config: any);
620
+ getInitialState(location: any): any;
621
+ advanceToNextStep(state: any): any;
622
+ updateUserLocation(location: any, state: any): any;
623
+ }
624
+ /**
625
+ * JavaScript wrapper for `NavigationSession` with recording capabilities.
626
+ * This version includes a NavigationRecorder observer and provides direct access to recording functionality.
627
+ */
628
+ export class NavigationSessionRecording {
629
+ free(): void;
630
+ constructor(route: any, config: any);
631
+ getInitialState(location: any): any;
632
+ advanceToNextStep(state: any): any;
633
+ updateUserLocation(location: any, state: any): any;
634
+ getRecording(): any;
635
+ getEvents(): any;
636
+ }
615
637
  /**
616
638
  * JavaScript wrapper for `RouteAdapter`.
617
639
  */
package/ferrostar_bg.js CHANGED
@@ -319,17 +319,6 @@ export class NavigationController {
319
319
  }
320
320
  return takeFromExternrefTable0(ret[0]);
321
321
  }
322
- /**
323
- * @param {any} events
324
- * @returns {any}
325
- */
326
- getRecording(events) {
327
- const ret = wasm.navigationcontroller_getRecording(this.__wbg_ptr, events);
328
- if (ret[2]) {
329
- throw takeFromExternrefTable0(ret[1]);
330
- }
331
- return takeFromExternrefTable0(ret[0]);
332
- }
333
322
  }
334
323
 
335
324
  const NavigationReplayFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -419,6 +408,164 @@ export class NavigationReplay {
419
408
  }
420
409
  }
421
410
 
411
+ const NavigationSessionFinalization = (typeof FinalizationRegistry === 'undefined')
412
+ ? { register: () => {}, unregister: () => {} }
413
+ : new FinalizationRegistry(ptr => wasm.__wbg_navigationsession_free(ptr >>> 0, 1));
414
+ /**
415
+ * JavaScript wrapper for `NavigationSession` (simple version).
416
+ * This wrapper provides basic navigation functionality without observers.
417
+ */
418
+ export class NavigationSession {
419
+
420
+ __destroy_into_raw() {
421
+ const ptr = this.__wbg_ptr;
422
+ this.__wbg_ptr = 0;
423
+ NavigationSessionFinalization.unregister(this);
424
+ return ptr;
425
+ }
426
+
427
+ free() {
428
+ const ptr = this.__destroy_into_raw();
429
+ wasm.__wbg_navigationsession_free(ptr, 0);
430
+ }
431
+ /**
432
+ * @param {any} route
433
+ * @param {any} config
434
+ */
435
+ constructor(route, config) {
436
+ const ret = wasm.navigationsession_new(route, config);
437
+ if (ret[2]) {
438
+ throw takeFromExternrefTable0(ret[1]);
439
+ }
440
+ this.__wbg_ptr = ret[0] >>> 0;
441
+ NavigationSessionFinalization.register(this, this.__wbg_ptr, this);
442
+ return this;
443
+ }
444
+ /**
445
+ * @param {any} location
446
+ * @returns {any}
447
+ */
448
+ getInitialState(location) {
449
+ const ret = wasm.navigationsession_getInitialState(this.__wbg_ptr, location);
450
+ if (ret[2]) {
451
+ throw takeFromExternrefTable0(ret[1]);
452
+ }
453
+ return takeFromExternrefTable0(ret[0]);
454
+ }
455
+ /**
456
+ * @param {any} state
457
+ * @returns {any}
458
+ */
459
+ advanceToNextStep(state) {
460
+ const ret = wasm.navigationsession_advanceToNextStep(this.__wbg_ptr, state);
461
+ if (ret[2]) {
462
+ throw takeFromExternrefTable0(ret[1]);
463
+ }
464
+ return takeFromExternrefTable0(ret[0]);
465
+ }
466
+ /**
467
+ * @param {any} location
468
+ * @param {any} state
469
+ * @returns {any}
470
+ */
471
+ updateUserLocation(location, state) {
472
+ const ret = wasm.navigationsession_updateUserLocation(this.__wbg_ptr, location, state);
473
+ if (ret[2]) {
474
+ throw takeFromExternrefTable0(ret[1]);
475
+ }
476
+ return takeFromExternrefTable0(ret[0]);
477
+ }
478
+ }
479
+
480
+ const NavigationSessionRecordingFinalization = (typeof FinalizationRegistry === 'undefined')
481
+ ? { register: () => {}, unregister: () => {} }
482
+ : new FinalizationRegistry(ptr => wasm.__wbg_navigationsessionrecording_free(ptr >>> 0, 1));
483
+ /**
484
+ * JavaScript wrapper for `NavigationSession` with recording capabilities.
485
+ * This version includes a NavigationRecorder observer and provides direct access to recording functionality.
486
+ */
487
+ export class NavigationSessionRecording {
488
+
489
+ __destroy_into_raw() {
490
+ const ptr = this.__wbg_ptr;
491
+ this.__wbg_ptr = 0;
492
+ NavigationSessionRecordingFinalization.unregister(this);
493
+ return ptr;
494
+ }
495
+
496
+ free() {
497
+ const ptr = this.__destroy_into_raw();
498
+ wasm.__wbg_navigationsessionrecording_free(ptr, 0);
499
+ }
500
+ /**
501
+ * @param {any} route
502
+ * @param {any} config
503
+ */
504
+ constructor(route, config) {
505
+ const ret = wasm.navigationsessionrecording_new(route, config);
506
+ if (ret[2]) {
507
+ throw takeFromExternrefTable0(ret[1]);
508
+ }
509
+ this.__wbg_ptr = ret[0] >>> 0;
510
+ NavigationSessionRecordingFinalization.register(this, this.__wbg_ptr, this);
511
+ return this;
512
+ }
513
+ /**
514
+ * @param {any} location
515
+ * @returns {any}
516
+ */
517
+ getInitialState(location) {
518
+ const ret = wasm.navigationsessionrecording_getInitialState(this.__wbg_ptr, location);
519
+ if (ret[2]) {
520
+ throw takeFromExternrefTable0(ret[1]);
521
+ }
522
+ return takeFromExternrefTable0(ret[0]);
523
+ }
524
+ /**
525
+ * @param {any} state
526
+ * @returns {any}
527
+ */
528
+ advanceToNextStep(state) {
529
+ const ret = wasm.navigationsessionrecording_advanceToNextStep(this.__wbg_ptr, state);
530
+ if (ret[2]) {
531
+ throw takeFromExternrefTable0(ret[1]);
532
+ }
533
+ return takeFromExternrefTable0(ret[0]);
534
+ }
535
+ /**
536
+ * @param {any} location
537
+ * @param {any} state
538
+ * @returns {any}
539
+ */
540
+ updateUserLocation(location, state) {
541
+ const ret = wasm.navigationsessionrecording_updateUserLocation(this.__wbg_ptr, location, state);
542
+ if (ret[2]) {
543
+ throw takeFromExternrefTable0(ret[1]);
544
+ }
545
+ return takeFromExternrefTable0(ret[0]);
546
+ }
547
+ /**
548
+ * @returns {any}
549
+ */
550
+ getRecording() {
551
+ const ret = wasm.navigationsessionrecording_getRecording(this.__wbg_ptr);
552
+ if (ret[2]) {
553
+ throw takeFromExternrefTable0(ret[1]);
554
+ }
555
+ return takeFromExternrefTable0(ret[0]);
556
+ }
557
+ /**
558
+ * @returns {any}
559
+ */
560
+ getEvents() {
561
+ const ret = wasm.navigationsessionrecording_getEvents(this.__wbg_ptr);
562
+ if (ret[2]) {
563
+ throw takeFromExternrefTable0(ret[1]);
564
+ }
565
+ return takeFromExternrefTable0(ret[0]);
566
+ }
567
+ }
568
+
422
569
  const RouteAdapterFinalization = (typeof FinalizationRegistry === 'undefined')
423
570
  ? { register: () => {}, unregister: () => {} }
424
571
  : new FinalizationRegistry(ptr => wasm.__wbg_routeadapter_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.41.0",
10
+ "version": "0.43.0",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",