@stadiamaps/ferrostar 0.19.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
@@ -114,11 +117,18 @@ export interface GeographicCoordinate {
114
117
  lng: number;
115
118
  }
116
119
 
120
+ export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
121
+
122
+ export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
123
+
117
124
  export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
118
125
 
126
+ export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
127
+
119
128
  export interface LocationSimulationState {
120
129
  current_location: UserLocation;
121
130
  remaining_locations: GeographicCoordinate[];
131
+ bias: LocationBias;
122
132
  }
123
133
 
124
134
  export interface NavigationControllerConfig {
@@ -139,10 +149,6 @@ export interface TripProgress {
139
149
  durationRemaining: number;
140
150
  }
141
151
 
142
- export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
143
-
144
- export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
145
-
146
152
  /**
147
153
  * JavaScript wrapper for `NavigationController`.
148
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);
@@ -536,28 +539,28 @@ export function __wbindgen_is_object(arg0) {
536
539
  return ret;
537
540
  };
538
541
 
539
- export function __wbindgen_string_new(arg0, arg1) {
540
- const ret = getStringFromWasm0(arg0, arg1);
541
- return addHeapObject(ret);
542
- };
543
-
544
542
  export function __wbindgen_error_new(arg0, arg1) {
545
543
  const ret = new Error(getStringFromWasm0(arg0, arg1));
546
544
  return addHeapObject(ret);
547
545
  };
548
546
 
547
+ export function __wbindgen_as_number(arg0) {
548
+ const ret = +getObject(arg0);
549
+ return ret;
550
+ };
551
+
549
552
  export function __wbindgen_object_clone_ref(arg0) {
550
553
  const ret = getObject(arg0);
551
554
  return addHeapObject(ret);
552
555
  };
553
556
 
554
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
555
- const ret = getObject(arg0) == getObject(arg1);
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
 
@@ -626,6 +629,14 @@ export function __wbg_randomFillSync_5c9c955aa56b6049() { return handleError(fun
626
629
  getObject(arg0).randomFillSync(takeObject(arg1));
627
630
  }, arguments) };
628
631
 
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
+ };
639
+
629
640
  export function __wbg_get_3baa728f9d58d3f6(arg0, arg1) {
630
641
  const ret = getObject(arg0)[arg1 >>> 0];
631
642
  return addHeapObject(ret);
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.19.0",
10
+ "version": "0.20.0",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",