@stadiamaps/ferrostar 0.18.0 → 0.20.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
@@ -3,25 +3,28 @@
3
3
  /**
4
4
  * JavaScript wrapper for `location_simulation_from_coordinates`.
5
5
  * @param {any} coordinates
6
- * @param {number | undefined} [resample_distance]
6
+ * @param {number | undefined} resample_distance
7
+ * @param {LocationBias} bias
7
8
  * @returns {any}
8
9
  */
9
- export function locationSimulationFromCoordinates(coordinates: any, resample_distance?: number): any;
10
+ export function locationSimulationFromCoordinates(coordinates: any, resample_distance: number | undefined, bias: LocationBias): any;
10
11
  /**
11
12
  * JavaScript wrapper for `location_simulation_from_route`.
12
13
  * @param {any} route
13
- * @param {number | undefined} [resample_distance]
14
+ * @param {number | undefined} resample_distance
15
+ * @param {LocationBias} bias
14
16
  * @returns {any}
15
17
  */
16
- export function locationSimulationFromRoute(route: any, resample_distance?: number): any;
18
+ export function locationSimulationFromRoute(route: any, resample_distance: number | undefined, bias: LocationBias): any;
17
19
  /**
18
20
  * JavaScript wrapper for `location_simulation_from_polyline`.
19
21
  * @param {string} polyline
20
22
  * @param {number} precision
21
- * @param {number | undefined} [resample_distance]
23
+ * @param {number | undefined} resample_distance
24
+ * @param {LocationBias} bias
22
25
  * @returns {any}
23
26
  */
24
- export function locationSimulationFromPolyline(polyline: string, precision: number, resample_distance?: number): any;
27
+ export function locationSimulationFromPolyline(polyline: string, precision: number, resample_distance: number | undefined, bias: LocationBias): any;
25
28
  /**
26
29
  * JavaScript wrapper for `advance_location_simulation`.
27
30
  * @param {any} state
@@ -31,6 +34,7 @@ export function advanceLocationSimulation(state: any): any;
31
34
  export interface VisualInstruction {
32
35
  primaryContent: VisualInstructionContent;
33
36
  secondaryContent: VisualInstructionContent | undefined;
37
+ subContent: VisualInstructionContent | undefined;
34
38
  triggerDistanceBeforeManeuver: number;
35
39
  }
36
40
 
@@ -39,6 +43,13 @@ export interface VisualInstructionContent {
39
43
  maneuverType: ManeuverType | undefined;
40
44
  maneuverModifier: ManeuverModifier | undefined;
41
45
  roundaboutExitDegrees: number | undefined;
46
+ laneInfo: LaneInfo[] | undefined;
47
+ }
48
+
49
+ export interface LaneInfo {
50
+ active: boolean;
51
+ directions: string[];
52
+ activeDirection: string | undefined;
42
53
  }
43
54
 
44
55
  export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
@@ -106,11 +117,18 @@ export interface GeographicCoordinate {
106
117
  lng: number;
107
118
  }
108
119
 
120
+ export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
121
+
122
+ export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
123
+
109
124
  export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
110
125
 
126
+ export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
127
+
111
128
  export interface LocationSimulationState {
112
129
  current_location: UserLocation;
113
130
  remaining_locations: GeographicCoordinate[];
131
+ bias: LocationBias;
114
132
  }
115
133
 
116
134
  export interface NavigationControllerConfig {
@@ -131,10 +149,6 @@ export interface TripProgress {
131
149
  durationRemaining: number;
132
150
  }
133
151
 
134
- export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
135
-
136
- export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
137
-
138
152
  /**
139
153
  * JavaScript wrapper for `NavigationController`.
140
154
  */
package/ferrostar_bg.js CHANGED
@@ -191,13 +191,14 @@ function debugString(val) {
191
191
  /**
192
192
  * JavaScript wrapper for `location_simulation_from_coordinates`.
193
193
  * @param {any} coordinates
194
- * @param {number | undefined} [resample_distance]
194
+ * @param {number | undefined} resample_distance
195
+ * @param {LocationBias} bias
195
196
  * @returns {any}
196
197
  */
197
- export function locationSimulationFromCoordinates(coordinates, resample_distance) {
198
+ export function locationSimulationFromCoordinates(coordinates, resample_distance, bias) {
198
199
  try {
199
200
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
200
- wasm.locationSimulationFromCoordinates(retptr, addHeapObject(coordinates), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
201
+ wasm.locationSimulationFromCoordinates(retptr, addHeapObject(coordinates), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance, addHeapObject(bias));
201
202
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
202
203
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
203
204
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -213,13 +214,14 @@ export function locationSimulationFromCoordinates(coordinates, resample_distance
213
214
  /**
214
215
  * JavaScript wrapper for `location_simulation_from_route`.
215
216
  * @param {any} route
216
- * @param {number | undefined} [resample_distance]
217
+ * @param {number | undefined} resample_distance
218
+ * @param {LocationBias} bias
217
219
  * @returns {any}
218
220
  */
219
- export function locationSimulationFromRoute(route, resample_distance) {
221
+ export function locationSimulationFromRoute(route, resample_distance, bias) {
220
222
  try {
221
223
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
222
- wasm.locationSimulationFromRoute(retptr, addHeapObject(route), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
224
+ wasm.locationSimulationFromRoute(retptr, addHeapObject(route), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance, addHeapObject(bias));
223
225
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
224
226
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
225
227
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -236,15 +238,16 @@ export function locationSimulationFromRoute(route, resample_distance) {
236
238
  * JavaScript wrapper for `location_simulation_from_polyline`.
237
239
  * @param {string} polyline
238
240
  * @param {number} precision
239
- * @param {number | undefined} [resample_distance]
241
+ * @param {number | undefined} resample_distance
242
+ * @param {LocationBias} bias
240
243
  * @returns {any}
241
244
  */
242
- export function locationSimulationFromPolyline(polyline, precision, resample_distance) {
245
+ export function locationSimulationFromPolyline(polyline, precision, resample_distance, bias) {
243
246
  try {
244
247
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
245
248
  const ptr0 = passStringToWasm0(polyline, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
246
249
  const len0 = WASM_VECTOR_LEN;
247
- wasm.locationSimulationFromPolyline(retptr, ptr0, len0, precision, !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
250
+ wasm.locationSimulationFromPolyline(retptr, ptr0, len0, precision, !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance, addHeapObject(bias));
248
251
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
249
252
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
250
253
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -510,6 +513,12 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
510
513
  return ret;
511
514
  };
512
515
 
516
+ export function __wbindgen_boolean_get(arg0) {
517
+ const v = getObject(arg0);
518
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
519
+ return ret;
520
+ };
521
+
513
522
  export function __wbindgen_is_string(arg0) {
514
523
  const ret = typeof(getObject(arg0)) === 'string';
515
524
  return ret;
@@ -535,9 +544,9 @@ export function __wbindgen_error_new(arg0, arg1) {
535
544
  return addHeapObject(ret);
536
545
  };
537
546
 
538
- export function __wbindgen_string_new(arg0, arg1) {
539
- const ret = getStringFromWasm0(arg0, arg1);
540
- return addHeapObject(ret);
547
+ export function __wbindgen_as_number(arg0) {
548
+ const ret = +getObject(arg0);
549
+ return ret;
541
550
  };
542
551
 
543
552
  export function __wbindgen_object_clone_ref(arg0) {
@@ -545,19 +554,13 @@ export function __wbindgen_object_clone_ref(arg0) {
545
554
  return addHeapObject(ret);
546
555
  };
547
556
 
548
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
549
- const ret = getObject(arg0) == getObject(arg1);
550
- return ret;
551
- };
552
-
553
- export function __wbindgen_boolean_get(arg0) {
554
- const v = getObject(arg0);
555
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
556
- return ret;
557
+ export function __wbindgen_string_new(arg0, arg1) {
558
+ const ret = getStringFromWasm0(arg0, arg1);
559
+ return addHeapObject(ret);
557
560
  };
558
561
 
559
- export function __wbindgen_as_number(arg0) {
560
- const ret = +getObject(arg0);
562
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
563
+ const ret = getObject(arg0) == getObject(arg1);
561
564
  return ret;
562
565
  };
563
566
 
@@ -618,13 +621,21 @@ export function __wbg_msCrypto_eb05e62b530a1508(arg0) {
618
621
  return addHeapObject(ret);
619
622
  };
620
623
 
624
+ export function __wbg_getRandomValues_3aa56aa6edec874c() { return handleError(function (arg0, arg1) {
625
+ getObject(arg0).getRandomValues(getObject(arg1));
626
+ }, arguments) };
627
+
621
628
  export function __wbg_randomFillSync_5c9c955aa56b6049() { return handleError(function (arg0, arg1) {
622
629
  getObject(arg0).randomFillSync(takeObject(arg1));
623
630
  }, arguments) };
624
631
 
625
- export function __wbg_getRandomValues_3aa56aa6edec874c() { return handleError(function (arg0, arg1) {
626
- getObject(arg0).getRandomValues(getObject(arg1));
627
- }, arguments) };
632
+ export function __wbg_String_88810dfeb4021902(arg0, arg1) {
633
+ const ret = String(getObject(arg1));
634
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
635
+ const len1 = WASM_VECTOR_LEN;
636
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
637
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
638
+ };
628
639
 
629
640
  export function __wbg_get_3baa728f9d58d3f6(arg0, arg1) {
630
641
  const ret = getObject(arg0)[arg1 >>> 0];
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.18.0",
10
+ "version": "0.20.0",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",