@stadiamaps/ferrostar 0.48.0 → 0.48.1

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
@@ -1,31 +1,35 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * A geographic coordinate in WGS84.
4
+ * The type of incident that has occurred.
5
5
  */
6
- export interface GeographicCoordinate {
7
- /**
8
- * The latitude (in degrees).
9
- */
10
- lat: number;
11
- /**
12
- * The Longitude (in degrees).
13
- */
14
- lng: number;
15
- }
6
+ export type IncidentType = "accident" | "congestion" | "construction" | "disabled_vehicle" | "lane_restriction" | "mass_transit" | "miscellaneous" | "other_news" | "planned_event" | "road_closure" | "road_hazard" | "weather";
16
7
 
17
8
  /**
18
- * The speed of the user from the location provider.
9
+ * Additional information to further specify a [`ManeuverType`].
19
10
  */
20
- export interface Speed {
11
+ export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
12
+
13
+ /**
14
+ * Information describing the series of steps needed to travel between two or more points.
15
+ *
16
+ * NOTE: This type is unstable and is still under active development and should be
17
+ * considered unstable.
18
+ */
19
+ export interface Route {
20
+ geometry: GeographicCoordinate[];
21
+ bbox: BoundingBox;
21
22
  /**
22
- * The user\'s speed in meters per second.
23
+ * The total route distance, in meters.
23
24
  */
24
- value: number;
25
+ distance: number;
25
26
  /**
26
- * The accuracy of the speed value, measured in meters per second.
27
+ * The ordered list of waypoints to visit, including the starting point.
28
+ * Note that this is distinct from the *geometry* which includes all points visited.
29
+ * A waypoint represents a start/end point for a route leg.
27
30
  */
28
- accuracy: number | undefined;
31
+ waypoints: Waypoint[];
32
+ steps: RouteStep[];
29
33
  }
30
34
 
31
35
  /**
@@ -37,100 +41,6 @@ export interface LaneInfo {
37
41
  activeDirection: string | undefined;
38
42
  }
39
43
 
40
- /**
41
- * The content of a visual instruction.
42
- */
43
- export interface VisualInstructionContent {
44
- /**
45
- * The text to display.
46
- */
47
- text: string;
48
- /**
49
- * A standardized maneuver type (if any).
50
- */
51
- maneuverType: ManeuverType | undefined;
52
- /**
53
- * A standardized maneuver modifier (if any).
54
- */
55
- maneuverModifier: ManeuverModifier | undefined;
56
- /**
57
- * If applicable, the number of degrees you need to go around the roundabout before exiting.
58
- *
59
- * For example, entering and exiting the roundabout in the same direction of travel
60
- * (as if you had gone straight, apart from the detour)
61
- * would be an exit angle of 180 degrees.
62
- */
63
- roundaboutExitDegrees: number | undefined;
64
- /**
65
- * Detailed information about the lanes. This is typically only present in sub-maneuver instructions.
66
- */
67
- laneInfo: LaneInfo[] | undefined;
68
- /**
69
- * The exit number (or similar identifier like \"8B\").
70
- */
71
- exitNumbers: string[];
72
- }
73
-
74
- /**
75
- * An instruction that can be synthesized using a TTS engine to announce an upcoming maneuver.
76
- *
77
- * Note that these do not have any locale information attached.
78
- */
79
- export interface SpokenInstruction {
80
- /**
81
- * Plain-text instruction which can be synthesized with a TTS engine.
82
- */
83
- text: string;
84
- /**
85
- * Speech Synthesis Markup Language, which should be preferred by clients capable of understanding it.
86
- */
87
- ssml: string | undefined;
88
- /**
89
- * How far (in meters) from the upcoming maneuver the instruction should start being spoken.
90
- */
91
- triggerDistanceBeforeManeuver: number;
92
- /**
93
- * A unique identifier for this instruction.
94
- *
95
- * This is provided so that platform-layer integrations can easily disambiguate between distinct utterances,
96
- * which may have the same textual content.
97
- * UUIDs conveniently fill this purpose.
98
- *
99
- * NOTE: While it is possible to deterministically create UUIDs, we do not do so at this time.
100
- * This should be theoretically possible though if someone cares to write up a proposal and a PR.
101
- */
102
- utteranceId: string;
103
- }
104
-
105
- /**
106
- * An instruction for visual display (usually as banners) at a specific point along a [`RouteStep`].
107
- */
108
- export interface VisualInstruction {
109
- /**
110
- * The primary instruction content.
111
- *
112
- * This is usually given more visual weight.
113
- */
114
- primaryContent: VisualInstructionContent;
115
- /**
116
- * Optional secondary instruction content.
117
- */
118
- secondaryContent: VisualInstructionContent | undefined;
119
- /**
120
- * Optional sub-maneuver instruction content.
121
- */
122
- subContent: VisualInstructionContent | undefined;
123
- /**
124
- * How far (in meters) from the upcoming maneuver the instruction should start being displayed
125
- */
126
- triggerDistanceBeforeManeuver: number;
127
- }
128
-
129
- /**
130
- * The lane type blocked by the incident.
131
- */
132
- export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
133
-
134
44
  /**
135
45
  * A maneuver (such as a turn or merge) followed by travel of a certain distance until reaching
136
46
  * the next step.
@@ -193,26 +103,6 @@ export interface RouteStep {
193
103
  roundaboutExitNumber: number | undefined;
194
104
  }
195
105
 
196
- /**
197
- * The type of incident that has occurred.
198
- */
199
- export type IncidentType = "accident" | "congestion" | "construction" | "disabled_vehicle" | "lane_restriction" | "mass_transit" | "miscellaneous" | "other_news" | "planned_event" | "road_closure" | "road_hazard" | "weather";
200
-
201
- /**
202
- * The impact of the incident that has occurred.
203
- */
204
- export type Impact = "unknown" | "critical" | "major" | "minor" | "low";
205
-
206
- /**
207
- * Describes characteristics of the waypoint for routing purposes.
208
- */
209
- export type WaypointKind = "Break" | "Via";
210
-
211
- /**
212
- * Additional information to further specify a [`ManeuverType`].
213
- */
214
- export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
215
-
216
106
  /**
217
107
  * The location of the user that is navigating.
218
108
  *
@@ -234,73 +124,27 @@ export interface UserLocation {
234
124
  }
235
125
 
236
126
  /**
237
- * Details about congestion for an incident.
127
+ * An instruction for visual display (usually as banners) at a specific point along a [`RouteStep`].
238
128
  */
239
- export interface Congestion {
129
+ export interface VisualInstruction {
240
130
  /**
241
- * The level of congestion caused by the incident.
242
- *
243
- * 0 = no congestion
244
- *
245
- * 100 = road closed
131
+ * The primary instruction content.
246
132
  *
247
- * Other values mean no congestion was calculated
133
+ * This is usually given more visual weight.
248
134
  */
249
- value: number;
250
- }
251
-
252
- /**
253
- * A geographic bounding box defined by its corners.
254
- */
255
- export interface BoundingBox {
135
+ primaryContent: VisualInstructionContent;
256
136
  /**
257
- * The southwest corner of the bounding box.
137
+ * Optional secondary instruction content.
258
138
  */
259
- sw: GeographicCoordinate;
139
+ secondaryContent: VisualInstructionContent | undefined;
260
140
  /**
261
- * The northeast corner of the bounding box.
141
+ * Optional sub-maneuver instruction content.
262
142
  */
263
- ne: GeographicCoordinate;
264
- }
265
-
266
- /**
267
- * A waypoint along a route.
268
- *
269
- * Within the context of Ferrostar, a route request consists of exactly one [`UserLocation`]
270
- * and at least one [`Waypoint`]. The route starts from the user\'s location (which may
271
- * contain other useful information like their current course for the [`crate::routing_adapters::RouteRequestGenerator`]
272
- * to use) and proceeds through one or more waypoints.
273
- *
274
- * Waypoints are used during route calculation, are tracked throughout the lifecycle of a trip,
275
- * and are used for recalculating when the user deviates from the expected route.
276
- *
277
- * Note that support for properties beyond basic geographic coordinates varies by routing engine.
278
- */
279
- export interface Waypoint {
280
- coordinate: GeographicCoordinate;
281
- kind: WaypointKind;
143
+ subContent: VisualInstructionContent | undefined;
282
144
  /**
283
- * Optional additional properties that will be passed on to the [`crate::routing_adapters::RouteRequestGenerator`].
284
- *
285
- * Most users should prefer convenience functions like [`Waypoint::new_with_valhalla_properties`]
286
- * (or, on platforms like iOS and Android with `UniFFI` bindings, [`crate::routing_adapters::valhalla::create_waypoint_with_valhalla_properties`]).
287
- *
288
- * # Format guidelines
289
- *
290
- * This MAY be any format agreed upon by both the request generator and response parser.
291
- * However, to promote interoperability, all implementations in the Ferrostar codebase
292
- * MUST use JSON.
293
- *
294
- * We selected JSON is selected not because it is good,
295
- * but because generics (i.e., becoming `Waypoint<T>`, where an example `T` is `ValhallaProperties`)
296
- * would be way too painful, particularly for foreign code.
297
- * Especially JavaScript.
298
- *
299
- * In any case, [`crate::routing_adapters::RouteRequestGenerator`] and [`crate::routing_adapters::RouteResponseParser`]
300
- * implementations SHOULD document their level support for this,
301
- * ideally with an exportable record type.
145
+ * How far (in meters) from the upcoming maneuver the instruction should start being displayed
302
146
  */
303
- properties: number[] | undefined;
147
+ triggerDistanceBeforeManeuver: number;
304
148
  }
305
149
 
306
150
  /**
@@ -355,74 +199,237 @@ export interface Incident {
355
199
  */
356
200
  closed: boolean | undefined;
357
201
  /**
358
- * The index into the [`RouteStep`] geometry where the incident starts.
202
+ * The index into the [`RouteStep`] geometry where the incident starts.
203
+ */
204
+ geometryIndexStart: number;
205
+ /**
206
+ * The index into the [`RouteStep`] geometry where the incident ends.
207
+ */
208
+ geometryIndexEnd: number | undefined;
209
+ /**
210
+ * Optional additional information about the type of incident (free-form text).
211
+ */
212
+ subType: string | undefined;
213
+ /**
214
+ * Optional descriptions about the type of incident (free-form text).
215
+ */
216
+ subTypeDescription: string | undefined;
217
+ /**
218
+ * The ISO 3166-1 alpha-2 code of the country in which the incident occurs.
219
+ */
220
+ iso31661Alpha2: string | undefined;
221
+ /**
222
+ * The ISO 3166-1 alpha-3 code of the country in which the incident occurs.
223
+ */
224
+ iso31661Alpha3: string | undefined;
225
+ /**
226
+ * A list of road names affected by the incident.
227
+ */
228
+ affectedRoadNames: string[];
229
+ /**
230
+ * The bounding box over which the incident occurs.
231
+ */
232
+ bbox: BoundingBox | undefined;
233
+ }
234
+
235
+ /**
236
+ * A geographic bounding box defined by its corners.
237
+ */
238
+ export interface BoundingBox {
239
+ /**
240
+ * The southwest corner of the bounding box.
241
+ */
242
+ sw: GeographicCoordinate;
243
+ /**
244
+ * The northeast corner of the bounding box.
245
+ */
246
+ ne: GeographicCoordinate;
247
+ }
248
+
249
+ /**
250
+ * A geographic coordinate in WGS84.
251
+ */
252
+ export interface GeographicCoordinate {
253
+ /**
254
+ * The latitude (in degrees).
255
+ */
256
+ lat: number;
257
+ /**
258
+ * The Longitude (in degrees).
259
+ */
260
+ lng: number;
261
+ }
262
+
263
+ /**
264
+ * A waypoint along a route.
265
+ *
266
+ * Within the context of Ferrostar, a route request consists of exactly one [`UserLocation`]
267
+ * and at least one [`Waypoint`]. The route starts from the user\'s location (which may
268
+ * contain other useful information like their current course for the [`crate::routing_adapters::RouteRequestGenerator`]
269
+ * to use) and proceeds through one or more waypoints.
270
+ *
271
+ * Waypoints are used during route calculation, are tracked throughout the lifecycle of a trip,
272
+ * and are used for recalculating when the user deviates from the expected route.
273
+ *
274
+ * Note that support for properties beyond basic geographic coordinates varies by routing engine.
275
+ */
276
+ export interface Waypoint {
277
+ coordinate: GeographicCoordinate;
278
+ kind: WaypointKind;
279
+ /**
280
+ * Optional additional properties that will be passed on to the [`crate::routing_adapters::RouteRequestGenerator`].
281
+ *
282
+ * Most users should prefer convenience functions like [`Waypoint::new_with_valhalla_properties`]
283
+ * (or, on platforms like iOS and Android with `UniFFI` bindings, [`crate::routing_adapters::valhalla::create_waypoint_with_valhalla_properties`]).
284
+ *
285
+ * # Format guidelines
286
+ *
287
+ * This MAY be any format agreed upon by both the request generator and response parser.
288
+ * However, to promote interoperability, all implementations in the Ferrostar codebase
289
+ * MUST use JSON.
290
+ *
291
+ * We selected JSON is selected not because it is good,
292
+ * but because generics (i.e., becoming `Waypoint<T>`, where an example `T` is `ValhallaProperties`)
293
+ * would be way too painful, particularly for foreign code.
294
+ * Especially JavaScript.
295
+ *
296
+ * In any case, [`crate::routing_adapters::RouteRequestGenerator`] and [`crate::routing_adapters::RouteResponseParser`]
297
+ * implementations SHOULD document their level support for this,
298
+ * ideally with an exportable record type.
299
+ */
300
+ properties: number[] | undefined;
301
+ }
302
+
303
+ /**
304
+ * An instruction that can be synthesized using a TTS engine to announce an upcoming maneuver.
305
+ *
306
+ * Note that these do not have any locale information attached.
307
+ */
308
+ export interface SpokenInstruction {
309
+ /**
310
+ * Plain-text instruction which can be synthesized with a TTS engine.
359
311
  */
360
- geometryIndexStart: number;
312
+ text: string;
361
313
  /**
362
- * The index into the [`RouteStep`] geometry where the incident ends.
314
+ * Speech Synthesis Markup Language, which should be preferred by clients capable of understanding it.
363
315
  */
364
- geometryIndexEnd: number | undefined;
316
+ ssml: string | undefined;
365
317
  /**
366
- * Optional additional information about the type of incident (free-form text).
318
+ * How far (in meters) from the upcoming maneuver the instruction should start being spoken.
367
319
  */
368
- subType: string | undefined;
320
+ triggerDistanceBeforeManeuver: number;
369
321
  /**
370
- * Optional descriptions about the type of incident (free-form text).
322
+ * A unique identifier for this instruction.
323
+ *
324
+ * This is provided so that platform-layer integrations can easily disambiguate between distinct utterances,
325
+ * which may have the same textual content.
326
+ * UUIDs conveniently fill this purpose.
327
+ *
328
+ * NOTE: While it is possible to deterministically create UUIDs, we do not do so at this time.
329
+ * This should be theoretically possible though if someone cares to write up a proposal and a PR.
371
330
  */
372
- subTypeDescription: string | undefined;
331
+ utteranceId: string;
332
+ }
333
+
334
+ /**
335
+ * The direction in which the user/device is observed to be traveling.
336
+ */
337
+ export interface CourseOverGround {
373
338
  /**
374
- * The ISO 3166-1 alpha-2 code of the country in which the incident occurs.
339
+ * The direction in which the user\'s device is traveling, measured in clockwise degrees from
340
+ * true north (N = 0, E = 90, S = 180, W = 270).
375
341
  */
376
- iso31661Alpha2: string | undefined;
342
+ degrees: number;
377
343
  /**
378
- * The ISO 3166-1 alpha-3 code of the country in which the incident occurs.
344
+ * The accuracy of the course value, measured in degrees.
379
345
  */
380
- iso31661Alpha3: string | undefined;
346
+ accuracy: number | undefined;
347
+ }
348
+
349
+ /**
350
+ * The broad class of maneuver to perform.
351
+ *
352
+ * This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
353
+ */
354
+ export type ManeuverType = "turn" | "new name" | "depart" | "arrive" | "merge" | "on ramp" | "off ramp" | "fork" | "end of road" | "continue" | "roundabout" | "rotary" | "roundabout turn" | "notification" | "exit roundabout" | "exit rotary";
355
+
356
+ /**
357
+ * The speed of the user from the location provider.
358
+ */
359
+ export interface Speed {
381
360
  /**
382
- * A list of road names affected by the incident.
361
+ * The user\'s speed in meters per second.
383
362
  */
384
- affectedRoadNames: string[];
363
+ value: number;
385
364
  /**
386
- * The bounding box over which the incident occurs.
365
+ * The accuracy of the speed value, measured in meters per second.
387
366
  */
388
- bbox: BoundingBox | undefined;
367
+ accuracy: number | undefined;
389
368
  }
390
369
 
391
370
  /**
392
- * Information describing the series of steps needed to travel between two or more points.
393
- *
394
- * NOTE: This type is unstable and is still under active development and should be
395
- * considered unstable.
371
+ * The impact of the incident that has occurred.
396
372
  */
397
- export interface Route {
398
- geometry: GeographicCoordinate[];
399
- bbox: BoundingBox;
400
- /**
401
- * The total route distance, in meters.
402
- */
403
- distance: number;
373
+ export type Impact = "unknown" | "critical" | "major" | "minor" | "low";
374
+
375
+ /**
376
+ * Details about congestion for an incident.
377
+ */
378
+ export interface Congestion {
404
379
  /**
405
- * The ordered list of waypoints to visit, including the starting point.
406
- * Note that this is distinct from the *geometry* which includes all points visited.
407
- * A waypoint represents a start/end point for a route leg.
380
+ * The level of congestion caused by the incident.
381
+ *
382
+ * 0 = no congestion
383
+ *
384
+ * 100 = road closed
385
+ *
386
+ * Other values mean no congestion was calculated
408
387
  */
409
- waypoints: Waypoint[];
410
- steps: RouteStep[];
388
+ value: number;
411
389
  }
412
390
 
413
391
  /**
414
- * The direction in which the user/device is observed to be traveling.
392
+ * The lane type blocked by the incident.
415
393
  */
416
- export interface CourseOverGround {
394
+ export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
395
+
396
+ /**
397
+ * Describes characteristics of the waypoint for routing purposes.
398
+ */
399
+ export type WaypointKind = "Break" | "Via";
400
+
401
+ /**
402
+ * The content of a visual instruction.
403
+ */
404
+ export interface VisualInstructionContent {
417
405
  /**
418
- * The direction in which the user\'s device is traveling, measured in clockwise degrees from
419
- * true north (N = 0, E = 90, S = 180, W = 270).
406
+ * The text to display.
420
407
  */
421
- degrees: number;
408
+ text: string;
422
409
  /**
423
- * The accuracy of the course value, measured in degrees.
410
+ * A standardized maneuver type (if any).
424
411
  */
425
- accuracy: number | undefined;
412
+ maneuverType: ManeuverType | undefined;
413
+ /**
414
+ * A standardized maneuver modifier (if any).
415
+ */
416
+ maneuverModifier: ManeuverModifier | undefined;
417
+ /**
418
+ * If applicable, the number of degrees you need to go around the roundabout before exiting.
419
+ *
420
+ * For example, entering and exiting the roundabout in the same direction of travel
421
+ * (as if you had gone straight, apart from the detour)
422
+ * would be an exit angle of 180 degrees.
423
+ */
424
+ roundaboutExitDegrees: number | undefined;
425
+ /**
426
+ * Detailed information about the lanes. This is typically only present in sub-maneuver instructions.
427
+ */
428
+ laneInfo: LaneInfo[] | undefined;
429
+ /**
430
+ * The exit number (or similar identifier like \"8B\").
431
+ */
432
+ exitNumbers: string[];
426
433
  }
427
434
 
428
435
  /**
@@ -434,25 +441,11 @@ export interface CourseOverGround {
434
441
  */
435
442
  export type DrivingSide = "left" | "right";
436
443
 
437
- /**
438
- * The broad class of maneuver to perform.
439
- *
440
- * This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
441
- */
442
- export type ManeuverType = "turn" | "new name" | "depart" | "arrive" | "merge" | "on ramp" | "off ramp" | "fork" | "end of road" | "continue" | "roundabout" | "rotary" | "roundabout turn" | "notification" | "exit roundabout" | "exit rotary";
443
-
444
444
  /**
445
445
  * Configurations for built-in route providers.
446
446
  */
447
447
  export type WellKnownRouteProvider = { Valhalla: { endpointUrl: string; profile: string; optionsJson?: string | undefined } } | { GraphHopper: { endpointUrl: string; profile: string; locale: string; voiceUnits: GraphHopperVoiceUnits; optionsJson?: string | undefined } };
448
448
 
449
- /**
450
- * The event type.
451
- *
452
- * For full replayability, we record things like rerouting, and not just location updates.
453
- */
454
- export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
455
-
456
449
  /**
457
450
  * An event that occurs during navigation.
458
451
  *
@@ -469,14 +462,19 @@ export interface NavigationRecordingEvent {
469
462
  event_data: NavigationRecordingEventData;
470
463
  }
471
464
 
465
+ /**
466
+ * The event type.
467
+ *
468
+ * For full replayability, we record things like rerouting, and not just location updates.
469
+ */
470
+ export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
471
+
472
472
  /**
473
473
  * Controls how simulated locations deviate from the actual route line.
474
474
  * This simulates real-world GPS behavior where readings often have systematic bias.
475
475
  */
476
476
  export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
477
477
 
478
- export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
479
-
480
478
  /**
481
479
  * The current state of the simulation.
482
480
  */
@@ -486,6 +484,8 @@ export interface LocationSimulationState {
486
484
  bias: LocationBias;
487
485
  }
488
486
 
487
+ export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
488
+
489
489
  /**
490
490
  * A set of optional filters to exclude candidate edges based on their attributes.
491
491
  */
@@ -530,6 +530,13 @@ export interface ValhallaLocationSearchFilter {
530
530
  level?: number;
531
531
  }
532
532
 
533
+ /**
534
+ * A road class in the Valhalla taxonomy.
535
+ *
536
+ * These are ordered from highest (fastest travel speed) to lowest.
537
+ */
538
+ export type ValhallaRoadClass = "motorway" | "trunk" | "primary" | "secondary" | "tertiary" | "unclassified" | "residential" | "service_other";
539
+
533
540
  /**
534
541
  * Waypoint properties supported by Valhalla servers.
535
542
  *
@@ -636,13 +643,6 @@ export interface ValhallaWaypointProperties {
636
643
  allow_uturns: boolean | undefined;
637
644
  }
638
645
 
639
- /**
640
- * A road class in the Valhalla taxonomy.
641
- *
642
- * These are ordered from highest (fastest travel speed) to lowest.
643
- */
644
- export type ValhallaRoadClass = "motorway" | "trunk" | "primary" | "secondary" | "tertiary" | "unclassified" | "residential" | "service_other";
645
-
646
646
  /**
647
647
  * Specifies a preferred side for departing from / arriving at a location.
648
648
  *
@@ -692,25 +692,47 @@ export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep:
692
692
  export type GraphHopperVoiceUnits = "metric" | "imperial";
693
693
 
694
694
  /**
695
- * High-level state describing progress through a route.
695
+ * The state of a navigation session.
696
+ *
697
+ * This is produced by [`NavigationController`](super::NavigationController) methods
698
+ * including [`get_initial_state`](super::NavigationController::get_initial_state)
699
+ * and [`update_user_location`](super::NavigationController::update_user_location).
696
700
  */
697
- export interface TripProgress {
701
+ export type TripState = { Idle: { user_location: UserLocation | undefined } } | { Navigating: { currentStepGeometryIndex: number | undefined; userLocation: UserLocation; snappedUserLocation: UserLocation; remainingSteps: RouteStep[]; remainingWaypoints: Waypoint[]; progress: TripProgress; summary: TripSummary; deviation: RouteDeviation; visualInstruction: VisualInstruction | undefined; spokenInstruction: SpokenInstruction | undefined; annotationJson: string | undefined } } | { Complete: { user_location: UserLocation; summary: TripSummary } };
702
+
703
+ /**
704
+ * Information pertaining to the user\'s full navigation trip. This includes
705
+ * simple stats like total duration and distance.
706
+ */
707
+ export interface TripSummary {
698
708
  /**
699
- * The distance to the next maneuver, in meters.
709
+ * The total raw distance traveled in the trip, in meters.
700
710
  */
701
- distanceToNextManeuver: number;
711
+ distanceTraveled: number;
702
712
  /**
703
- * The total distance remaining in the trip, in meters.
704
- *
705
- * This is the sum of the distance remaining in the current step and the distance remaining in all subsequent steps.
713
+ * The total snapped distance traveled in the trip, in meters.
706
714
  */
707
- distanceRemaining: number;
715
+ snappedDistanceTraveled: number;
708
716
  /**
709
- * The total duration remaining in the trip, in seconds.
717
+ * When the trip was started.
710
718
  */
711
- durationRemaining: number;
719
+ startedAt: Date;
720
+ /**
721
+ * When the trip was completed or canceled.
722
+ */
723
+ endedAt: Date | null;
724
+ }
725
+
726
+ export interface SerializableNavState {
727
+ tripState: TripState;
728
+ stepAdvanceCondition: SerializableStepAdvanceCondition;
712
729
  }
713
730
 
731
+ /**
732
+ * Controls filtering/post-processing of user course by the [`NavigationController`].
733
+ */
734
+ export type CourseFiltering = "SnapToRoute" | "Raw";
735
+
714
736
  export interface SerializableNavigationControllerConfig {
715
737
  /**
716
738
  * Configures when navigation advances to the next waypoint in the route.
@@ -741,15 +763,6 @@ export interface SerializableNavigationControllerConfig {
741
763
  snappedLocationCourseFiltering: CourseFiltering;
742
764
  }
743
765
 
744
- /**
745
- * The state of a navigation session.
746
- *
747
- * This is produced by [`NavigationController`](super::NavigationController) methods
748
- * including [`get_initial_state`](super::NavigationController::get_initial_state)
749
- * and [`update_user_location`](super::NavigationController::update_user_location).
750
- */
751
- export type TripState = { Idle: { user_location: UserLocation | undefined } } | { Navigating: { currentStepGeometryIndex: number | undefined; userLocation: UserLocation; snappedUserLocation: UserLocation; remainingSteps: RouteStep[]; remainingWaypoints: Waypoint[]; progress: TripProgress; summary: TripSummary; deviation: RouteDeviation; visualInstruction: VisualInstruction | undefined; spokenInstruction: SpokenInstruction | undefined; annotationJson: string | undefined } } | { Complete: { user_location: UserLocation; summary: TripSummary } };
752
-
753
766
  /**
754
767
  * Controls when a waypoint should be marked as complete.
755
768
  *
@@ -772,36 +785,23 @@ export type TripState = { Idle: { user_location: UserLocation | undefined } } |
772
785
  export type WaypointAdvanceMode = { WaypointWithinRange: number } | { WaypointAlongAdvancingStep: number };
773
786
 
774
787
  /**
775
- * Information pertaining to the user\'s full navigation trip. This includes
776
- * simple stats like total duration and distance.
788
+ * High-level state describing progress through a route.
777
789
  */
778
- export interface TripSummary {
779
- /**
780
- * The total raw distance traveled in the trip, in meters.
781
- */
782
- distanceTraveled: number;
790
+ export interface TripProgress {
783
791
  /**
784
- * The total snapped distance traveled in the trip, in meters.
792
+ * The distance to the next maneuver, in meters.
785
793
  */
786
- snappedDistanceTraveled: number;
794
+ distanceToNextManeuver: number;
787
795
  /**
788
- * When the trip was started.
796
+ * The total distance remaining in the trip, in meters.
797
+ *
798
+ * This is the sum of the distance remaining in the current step and the distance remaining in all subsequent steps.
789
799
  */
790
- startedAt: Date;
800
+ distanceRemaining: number;
791
801
  /**
792
- * When the trip was completed or canceled.
802
+ * The total duration remaining in the trip, in seconds.
793
803
  */
794
- endedAt: Date | null;
795
- }
796
-
797
- /**
798
- * Controls filtering/post-processing of user course by the [`NavigationController`].
799
- */
800
- export type CourseFiltering = "SnapToRoute" | "Raw";
801
-
802
- export interface SerializableNavState {
803
- tripState: TripState;
804
- stepAdvanceCondition: SerializableStepAdvanceCondition;
804
+ durationRemaining: number;
805
805
  }
806
806
 
807
807
 
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.48.0",
10
+ "version": "0.48.1",
11
11
  "license": "BSD-3-Clause",
12
12
  "repository": {
13
13
  "type": "git",