@stadiamaps/ferrostar 0.40.0 → 0.42.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
@@ -430,8 +430,18 @@ export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizo
430
430
 
431
431
  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[] } };
432
432
 
433
- export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } } | { Error: { error_message: string } };
433
+ /**
434
+ * The event type.
435
+ *
436
+ * For full replayability, we record things like rerouting, and not just location updates.
437
+ */
438
+ export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
434
439
 
440
+ /**
441
+ * An event that occurs during navigation.
442
+ *
443
+ * This is used for the optional session recording / telemetry.
444
+ */
435
445
  export interface NavigationRecordingEvent {
436
446
  /**
437
447
  * The timestamp of the event in milliseconds since Jan 1, 1970 UTC.
@@ -576,6 +586,8 @@ export interface LocationSimulationState {
576
586
 
577
587
  /**
578
588
  * JavaScript wrapper for `NavigationController`.
589
+ * This wrapper is required because `NavigationController` cannot be directly converted to a JavaScript object
590
+ * and requires serialization/deserialization of its methods' inputs and outputs.
579
591
  */
580
592
  export class NavigationController {
581
593
  free(): void;
@@ -585,10 +597,18 @@ export class NavigationController {
585
597
  updateUserLocation(location: any, state: any): any;
586
598
  getRecording(events: any): any;
587
599
  }
600
+ /**
601
+ * A WebAssembly-compatible wrapper for `NavigationReplay` that exposes its functionality as a JavaScript object.
602
+ *
603
+ * This wrapper is required because `NavigationReplay` cannot be directly converted to a JavaScript object
604
+ * and requires serialization/deserialization of its methods' inputs and outputs.
605
+ */
588
606
  export class NavigationReplay {
589
607
  free(): void;
590
608
  constructor(json: any);
591
- getNextEvent(current_index: any): any;
609
+ getEventByIndex(current_index: any): any;
610
+ getAllEvents(): any;
611
+ getTotalDuration(): any;
592
612
  getInitialTimestamp(): any;
593
613
  getInitialRoute(): any;
594
614
  }
package/ferrostar_bg.js CHANGED
@@ -255,6 +255,8 @@ const NavigationControllerFinalization = (typeof FinalizationRegistry === 'undef
255
255
  : new FinalizationRegistry(ptr => wasm.__wbg_navigationcontroller_free(ptr >>> 0, 1));
256
256
  /**
257
257
  * JavaScript wrapper for `NavigationController`.
258
+ * This wrapper is required because `NavigationController` cannot be directly converted to a JavaScript object
259
+ * and requires serialization/deserialization of its methods' inputs and outputs.
258
260
  */
259
261
  export class NavigationController {
260
262
 
@@ -333,7 +335,12 @@ export class NavigationController {
333
335
  const NavigationReplayFinalization = (typeof FinalizationRegistry === 'undefined')
334
336
  ? { register: () => {}, unregister: () => {} }
335
337
  : new FinalizationRegistry(ptr => wasm.__wbg_navigationreplay_free(ptr >>> 0, 1));
336
-
338
+ /**
339
+ * A WebAssembly-compatible wrapper for `NavigationReplay` that exposes its functionality as a JavaScript object.
340
+ *
341
+ * This wrapper is required because `NavigationReplay` cannot be directly converted to a JavaScript object
342
+ * and requires serialization/deserialization of its methods' inputs and outputs.
343
+ */
337
344
  export class NavigationReplay {
338
345
 
339
346
  __destroy_into_raw() {
@@ -363,8 +370,28 @@ export class NavigationReplay {
363
370
  * @param {any} current_index
364
371
  * @returns {any}
365
372
  */
366
- getNextEvent(current_index) {
367
- const ret = wasm.navigationreplay_getNextEvent(this.__wbg_ptr, current_index);
373
+ getEventByIndex(current_index) {
374
+ const ret = wasm.navigationreplay_getEventByIndex(this.__wbg_ptr, current_index);
375
+ if (ret[2]) {
376
+ throw takeFromExternrefTable0(ret[1]);
377
+ }
378
+ return takeFromExternrefTable0(ret[0]);
379
+ }
380
+ /**
381
+ * @returns {any}
382
+ */
383
+ getAllEvents() {
384
+ const ret = wasm.navigationreplay_getAllEvents(this.__wbg_ptr);
385
+ if (ret[2]) {
386
+ throw takeFromExternrefTable0(ret[1]);
387
+ }
388
+ return takeFromExternrefTable0(ret[0]);
389
+ }
390
+ /**
391
+ * @returns {any}
392
+ */
393
+ getTotalDuration() {
394
+ const ret = wasm.navigationreplay_getTotalDuration(this.__wbg_ptr);
368
395
  if (ret[2]) {
369
396
  throw takeFromExternrefTable0(ret[1]);
370
397
  }
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.40.0",
10
+ "version": "0.42.0",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",