@stadiamaps/ferrostar 0.46.1 → 0.47.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 +259 -239
- package/ferrostar_bg.js +1 -1
- package/ferrostar_bg.wasm +0 -0
- package/package.json +1 -1
package/ferrostar.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Details about congestion for an incident.
|
|
5
|
-
*/
|
|
6
|
-
export interface Congestion {
|
|
7
|
-
/**
|
|
8
|
-
* The level of congestion caused by the incident.
|
|
9
|
-
*
|
|
10
|
-
* 0 = no congestion
|
|
11
|
-
*
|
|
12
|
-
* 100 = road closed
|
|
13
|
-
*
|
|
14
|
-
* Other values mean no congestion was calculated
|
|
15
|
-
*/
|
|
16
|
-
value: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
3
|
/**
|
|
20
4
|
* The location of the user that is navigating.
|
|
21
5
|
*
|
|
@@ -37,101 +21,36 @@ export interface UserLocation {
|
|
|
37
21
|
}
|
|
38
22
|
|
|
39
23
|
/**
|
|
40
|
-
* The
|
|
41
|
-
*/
|
|
42
|
-
export interface CourseOverGround {
|
|
43
|
-
/**
|
|
44
|
-
* The direction in which the user\'s device is traveling, measured in clockwise degrees from
|
|
45
|
-
* true north (N = 0, E = 90, S = 180, W = 270).
|
|
46
|
-
*/
|
|
47
|
-
degrees: number;
|
|
48
|
-
/**
|
|
49
|
-
* The accuracy of the course value, measured in degrees.
|
|
50
|
-
*/
|
|
51
|
-
accuracy: number | undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* An instruction that can be synthesized using a TTS engine to announce an upcoming maneuver.
|
|
56
|
-
*
|
|
57
|
-
* Note that these do not have any locale information attached.
|
|
24
|
+
* The type of incident that has occurred.
|
|
58
25
|
*/
|
|
59
|
-
export
|
|
60
|
-
/**
|
|
61
|
-
* Plain-text instruction which can be synthesized with a TTS engine.
|
|
62
|
-
*/
|
|
63
|
-
text: string;
|
|
64
|
-
/**
|
|
65
|
-
* Speech Synthesis Markup Language, which should be preferred by clients capable of understanding it.
|
|
66
|
-
*/
|
|
67
|
-
ssml: string | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* How far (in meters) from the upcoming maneuver the instruction should start being spoken.
|
|
70
|
-
*/
|
|
71
|
-
triggerDistanceBeforeManeuver: number;
|
|
72
|
-
/**
|
|
73
|
-
* A unique identifier for this instruction.
|
|
74
|
-
*
|
|
75
|
-
* This is provided so that platform-layer integrations can easily disambiguate between distinct utterances,
|
|
76
|
-
* which may have the same textual content.
|
|
77
|
-
* UUIDs conveniently fill this purpose.
|
|
78
|
-
*
|
|
79
|
-
* NOTE: While it is possible to deterministically create UUIDs, we do not do so at this time.
|
|
80
|
-
* This should be theoretically possible though if someone cares to write up a proposal and a PR.
|
|
81
|
-
*/
|
|
82
|
-
utteranceId: string;
|
|
83
|
-
}
|
|
26
|
+
export type IncidentType = "accident" | "congestion" | "construction" | "disabled_vehicle" | "lane_restriction" | "mass_transit" | "miscellaneous" | "other_news" | "planned_event" | "road_closure" | "road_hazard" | "weather";
|
|
84
27
|
|
|
85
28
|
/**
|
|
86
|
-
*
|
|
29
|
+
* A geographic coordinate in WGS84.
|
|
87
30
|
*/
|
|
88
|
-
export interface
|
|
89
|
-
/**
|
|
90
|
-
* The primary instruction content.
|
|
91
|
-
*
|
|
92
|
-
* This is usually given more visual weight.
|
|
93
|
-
*/
|
|
94
|
-
primaryContent: VisualInstructionContent;
|
|
95
|
-
/**
|
|
96
|
-
* Optional secondary instruction content.
|
|
97
|
-
*/
|
|
98
|
-
secondaryContent: VisualInstructionContent | undefined;
|
|
31
|
+
export interface GeographicCoordinate {
|
|
99
32
|
/**
|
|
100
|
-
*
|
|
33
|
+
* The latitude (in degrees).
|
|
101
34
|
*/
|
|
102
|
-
|
|
35
|
+
lat: number;
|
|
103
36
|
/**
|
|
104
|
-
*
|
|
37
|
+
* The Longitude (in degrees).
|
|
105
38
|
*/
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The content of a visual instruction.
|
|
111
|
-
*/
|
|
112
|
-
export interface LaneInfo {
|
|
113
|
-
active: boolean;
|
|
114
|
-
directions: string[];
|
|
115
|
-
activeDirection: string | undefined;
|
|
39
|
+
lng: number;
|
|
116
40
|
}
|
|
117
41
|
|
|
118
42
|
/**
|
|
119
|
-
*
|
|
120
|
-
*/
|
|
121
|
-
export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The speed of the user from the location provider.
|
|
43
|
+
* A geographic bounding box defined by its corners.
|
|
125
44
|
*/
|
|
126
|
-
export interface
|
|
45
|
+
export interface BoundingBox {
|
|
127
46
|
/**
|
|
128
|
-
* The
|
|
47
|
+
* The southwest corner of the bounding box.
|
|
129
48
|
*/
|
|
130
|
-
|
|
49
|
+
sw: GeographicCoordinate;
|
|
131
50
|
/**
|
|
132
|
-
* The
|
|
51
|
+
* The northeast corner of the bounding box.
|
|
133
52
|
*/
|
|
134
|
-
|
|
53
|
+
ne: GeographicCoordinate;
|
|
135
54
|
}
|
|
136
55
|
|
|
137
56
|
/**
|
|
@@ -220,33 +139,35 @@ export interface Incident {
|
|
|
220
139
|
}
|
|
221
140
|
|
|
222
141
|
/**
|
|
223
|
-
*
|
|
142
|
+
* Which side of the road traffic drives on.
|
|
143
|
+
*
|
|
144
|
+
* This is needed by consumers like Android Auto to determine whether
|
|
145
|
+
* a roundabout should be rendered as clockwise (right-hand traffic)
|
|
146
|
+
* or counterclockwise (left-hand traffic).
|
|
224
147
|
*/
|
|
225
|
-
export
|
|
148
|
+
export type DrivingSide = "left" | "right";
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The direction in which the user/device is observed to be traveling.
|
|
152
|
+
*/
|
|
153
|
+
export interface CourseOverGround {
|
|
226
154
|
/**
|
|
227
|
-
* The
|
|
155
|
+
* The direction in which the user\'s device is traveling, measured in clockwise degrees from
|
|
156
|
+
* true north (N = 0, E = 90, S = 180, W = 270).
|
|
228
157
|
*/
|
|
229
|
-
|
|
158
|
+
degrees: number;
|
|
230
159
|
/**
|
|
231
|
-
* The
|
|
160
|
+
* The accuracy of the course value, measured in degrees.
|
|
232
161
|
*/
|
|
233
|
-
|
|
162
|
+
accuracy: number | undefined;
|
|
234
163
|
}
|
|
235
164
|
|
|
236
165
|
/**
|
|
237
|
-
* The
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Additional information to further specify a [`ManeuverType`].
|
|
243
|
-
*/
|
|
244
|
-
export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* The impact of the incident that has occurred.
|
|
166
|
+
* The broad class of maneuver to perform.
|
|
167
|
+
*
|
|
168
|
+
* This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
|
|
248
169
|
*/
|
|
249
|
-
export type
|
|
170
|
+
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";
|
|
250
171
|
|
|
251
172
|
/**
|
|
252
173
|
* A waypoint along a route.
|
|
@@ -288,6 +209,37 @@ export interface Waypoint {
|
|
|
288
209
|
properties: number[] | undefined;
|
|
289
210
|
}
|
|
290
211
|
|
|
212
|
+
/**
|
|
213
|
+
* An instruction that can be synthesized using a TTS engine to announce an upcoming maneuver.
|
|
214
|
+
*
|
|
215
|
+
* Note that these do not have any locale information attached.
|
|
216
|
+
*/
|
|
217
|
+
export interface SpokenInstruction {
|
|
218
|
+
/**
|
|
219
|
+
* Plain-text instruction which can be synthesized with a TTS engine.
|
|
220
|
+
*/
|
|
221
|
+
text: string;
|
|
222
|
+
/**
|
|
223
|
+
* Speech Synthesis Markup Language, which should be preferred by clients capable of understanding it.
|
|
224
|
+
*/
|
|
225
|
+
ssml: string | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* How far (in meters) from the upcoming maneuver the instruction should start being spoken.
|
|
228
|
+
*/
|
|
229
|
+
triggerDistanceBeforeManeuver: number;
|
|
230
|
+
/**
|
|
231
|
+
* A unique identifier for this instruction.
|
|
232
|
+
*
|
|
233
|
+
* This is provided so that platform-layer integrations can easily disambiguate between distinct utterances,
|
|
234
|
+
* which may have the same textual content.
|
|
235
|
+
* UUIDs conveniently fill this purpose.
|
|
236
|
+
*
|
|
237
|
+
* NOTE: While it is possible to deterministically create UUIDs, we do not do so at this time.
|
|
238
|
+
* This should be theoretically possible though if someone cares to write up a proposal and a PR.
|
|
239
|
+
*/
|
|
240
|
+
utteranceId: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
291
243
|
/**
|
|
292
244
|
* The content of a visual instruction.
|
|
293
245
|
*/
|
|
@@ -322,11 +274,6 @@ export interface VisualInstructionContent {
|
|
|
322
274
|
exitNumbers: string[];
|
|
323
275
|
}
|
|
324
276
|
|
|
325
|
-
/**
|
|
326
|
-
* Describes characteristics of the waypoint for routing purposes.
|
|
327
|
-
*/
|
|
328
|
-
export type WaypointKind = "Break" | "Via";
|
|
329
|
-
|
|
330
277
|
/**
|
|
331
278
|
* A maneuver (such as a turn or merge) followed by travel of a certain distance until reaching
|
|
332
279
|
* the next step.
|
|
@@ -376,14 +323,61 @@ export interface RouteStep {
|
|
|
376
323
|
* A list of incidents that occur along the step.
|
|
377
324
|
*/
|
|
378
325
|
incidents: Incident[];
|
|
326
|
+
/**
|
|
327
|
+
* Which side of the road traffic drives on for this step.
|
|
328
|
+
*
|
|
329
|
+
* This is relevant for roundabouts: left-hand traffic (e.g. UK) uses clockwise roundabouts,
|
|
330
|
+
* while right-hand traffic uses counterclockwise roundabouts.
|
|
331
|
+
*/
|
|
332
|
+
drivingSide: DrivingSide | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* The exit number when entering a roundabout (1 = first exit, 2 = second, etc.).
|
|
335
|
+
*/
|
|
336
|
+
roundaboutExitNumber: number | undefined;
|
|
379
337
|
}
|
|
380
338
|
|
|
381
339
|
/**
|
|
382
|
-
* The
|
|
383
|
-
*
|
|
384
|
-
* This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
|
|
340
|
+
* The content of a visual instruction.
|
|
385
341
|
*/
|
|
386
|
-
export
|
|
342
|
+
export interface LaneInfo {
|
|
343
|
+
active: boolean;
|
|
344
|
+
directions: string[];
|
|
345
|
+
activeDirection: string | undefined;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* The impact of the incident that has occurred.
|
|
350
|
+
*/
|
|
351
|
+
export type Impact = "unknown" | "critical" | "major" | "minor" | "low";
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* An instruction for visual display (usually as banners) at a specific point along a [`RouteStep`].
|
|
355
|
+
*/
|
|
356
|
+
export interface VisualInstruction {
|
|
357
|
+
/**
|
|
358
|
+
* The primary instruction content.
|
|
359
|
+
*
|
|
360
|
+
* This is usually given more visual weight.
|
|
361
|
+
*/
|
|
362
|
+
primaryContent: VisualInstructionContent;
|
|
363
|
+
/**
|
|
364
|
+
* Optional secondary instruction content.
|
|
365
|
+
*/
|
|
366
|
+
secondaryContent: VisualInstructionContent | undefined;
|
|
367
|
+
/**
|
|
368
|
+
* Optional sub-maneuver instruction content.
|
|
369
|
+
*/
|
|
370
|
+
subContent: VisualInstructionContent | undefined;
|
|
371
|
+
/**
|
|
372
|
+
* How far (in meters) from the upcoming maneuver the instruction should start being displayed
|
|
373
|
+
*/
|
|
374
|
+
triggerDistanceBeforeManeuver: number;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Additional information to further specify a [`ManeuverType`].
|
|
379
|
+
*/
|
|
380
|
+
export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
|
|
387
381
|
|
|
388
382
|
/**
|
|
389
383
|
* Information describing the series of steps needed to travel between two or more points.
|
|
@@ -408,98 +402,49 @@ export interface Route {
|
|
|
408
402
|
}
|
|
409
403
|
|
|
410
404
|
/**
|
|
411
|
-
*
|
|
412
|
-
*/
|
|
413
|
-
export interface BoundingBox {
|
|
414
|
-
/**
|
|
415
|
-
* The southwest corner of the bounding box.
|
|
416
|
-
*/
|
|
417
|
-
sw: GeographicCoordinate;
|
|
418
|
-
/**
|
|
419
|
-
* The northeast corner of the bounding box.
|
|
420
|
-
*/
|
|
421
|
-
ne: GeographicCoordinate;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* The current state of the simulation.
|
|
426
|
-
*/
|
|
427
|
-
export interface LocationSimulationState {
|
|
428
|
-
current_location: UserLocation;
|
|
429
|
-
remaining_locations: GeographicCoordinate[];
|
|
430
|
-
bias: LocationBias;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Controls how simulated locations deviate from the actual route line.
|
|
437
|
-
* This simulates real-world GPS behavior where readings often have systematic bias.
|
|
438
|
-
*/
|
|
439
|
-
export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Configurations for built-in route providers.
|
|
405
|
+
* The lane type blocked by the incident.
|
|
443
406
|
*/
|
|
444
|
-
export type
|
|
407
|
+
export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
|
|
445
408
|
|
|
446
409
|
/**
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
* This is used for the optional session recording / telemetry.
|
|
410
|
+
* The speed of the user from the location provider.
|
|
450
411
|
*/
|
|
451
|
-
export interface
|
|
412
|
+
export interface Speed {
|
|
452
413
|
/**
|
|
453
|
-
* The
|
|
414
|
+
* The user\'s speed in meters per second.
|
|
454
415
|
*/
|
|
455
|
-
|
|
416
|
+
value: number;
|
|
456
417
|
/**
|
|
457
|
-
*
|
|
418
|
+
* The accuracy of the speed value, measured in meters per second.
|
|
458
419
|
*/
|
|
459
|
-
|
|
420
|
+
accuracy: number | undefined;
|
|
460
421
|
}
|
|
461
422
|
|
|
462
423
|
/**
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* For full replayability, we record things like rerouting, and not just location updates.
|
|
466
|
-
*/
|
|
467
|
-
export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Waypoint properties parsed from an OSRM-compatible server response.
|
|
471
|
-
*
|
|
472
|
-
* NOTE: Some servers (such as Valhalla) may support additional parameters at request time
|
|
473
|
-
* which are _not_ echoed back in the response time.
|
|
474
|
-
* This is unfortunate; PRs upstream would likely be welcomed!
|
|
475
|
-
* Similarly, if your server is OSRM-compatible and returns additional attributes,
|
|
476
|
-
* feel free to open a PR to include these as optional properties.
|
|
424
|
+
* Details about congestion for an incident.
|
|
477
425
|
*/
|
|
478
|
-
export interface
|
|
479
|
-
/**
|
|
480
|
-
* The name of the street that the waypoint snapped to.
|
|
481
|
-
*/
|
|
482
|
-
name: string | undefined;
|
|
426
|
+
export interface Congestion {
|
|
483
427
|
/**
|
|
484
|
-
* The
|
|
428
|
+
* The level of congestion caused by the incident.
|
|
429
|
+
*
|
|
430
|
+
* 0 = no congestion
|
|
431
|
+
*
|
|
432
|
+
* 100 = road closed
|
|
433
|
+
*
|
|
434
|
+
* Other values mean no congestion was calculated
|
|
485
435
|
*/
|
|
486
|
-
|
|
436
|
+
value: number;
|
|
487
437
|
}
|
|
488
438
|
|
|
489
439
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* Note that the name is intentionally a bit generic to allow for expansion of other states.
|
|
493
|
-
* For example, we could conceivably add a \"wrong way\" status in the future.
|
|
440
|
+
* Describes characteristics of the waypoint for routing purposes.
|
|
494
441
|
*/
|
|
495
|
-
export type
|
|
442
|
+
export type WaypointKind = "Break" | "Via";
|
|
496
443
|
|
|
497
444
|
/**
|
|
498
|
-
*
|
|
445
|
+
* Configurations for built-in route providers.
|
|
499
446
|
*/
|
|
500
|
-
export type
|
|
501
|
-
|
|
502
|
-
export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number; calculateWhileOffRoute: boolean } } | { DistanceEntryExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { DistanceEntryAndSnappedExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } };
|
|
447
|
+
export type WellKnownRouteProvider = { Valhalla: { endpointUrl: string; profile: string; optionsJson?: string | undefined } } | { GraphHopper: { endpointUrl: string; profile: string; locale: string; voiceUnits: GraphHopperVoiceUnits; optionsJson?: string | undefined } };
|
|
503
448
|
|
|
504
449
|
export type GraphHopperVoiceUnits = "metric" | "imperial";
|
|
505
450
|
|
|
@@ -533,26 +478,38 @@ export interface TripProgress {
|
|
|
533
478
|
}
|
|
534
479
|
|
|
535
480
|
/**
|
|
536
|
-
*
|
|
537
|
-
* simple stats like total duration and distance.
|
|
481
|
+
* Controls filtering/post-processing of user course by the [`NavigationController`].
|
|
538
482
|
*/
|
|
539
|
-
export
|
|
483
|
+
export type CourseFiltering = "SnapToRoute" | "Raw";
|
|
484
|
+
|
|
485
|
+
export interface SerializableNavigationControllerConfig {
|
|
540
486
|
/**
|
|
541
|
-
*
|
|
487
|
+
* Configures when navigation advances to the next waypoint in the route.
|
|
542
488
|
*/
|
|
543
|
-
|
|
489
|
+
waypointAdvance: WaypointAdvanceMode;
|
|
544
490
|
/**
|
|
545
|
-
*
|
|
491
|
+
* Configures when navigation advances to the next step in the route.
|
|
546
492
|
*/
|
|
547
|
-
|
|
493
|
+
stepAdvanceCondition: SerializableStepAdvanceCondition;
|
|
548
494
|
/**
|
|
549
|
-
*
|
|
495
|
+
* A special advance condition used for the final 2 route steps (last and arrival).
|
|
496
|
+
*
|
|
497
|
+
* This exists because several of our step advance conditions require entry and
|
|
498
|
+
* exit from a step\'s geometry. The end of the route/arrival doesn\'t always accommodate
|
|
499
|
+
* the expected location updates for the core step advance condition.
|
|
550
500
|
*/
|
|
551
|
-
|
|
501
|
+
arrivalStepAdvanceCondition: SerializableStepAdvanceCondition;
|
|
552
502
|
/**
|
|
553
|
-
*
|
|
503
|
+
* Configures when the user is deemed to be off course.
|
|
504
|
+
*
|
|
505
|
+
* NOTE: This is distinct from the action that is taken.
|
|
506
|
+
* It is only the determination that the user has deviated from the expected route.
|
|
554
507
|
*/
|
|
555
|
-
|
|
508
|
+
routeDeviationTracking: RouteDeviationTracking;
|
|
509
|
+
/**
|
|
510
|
+
* Configures how the heading component of the snapped location is reported in [`TripState`].
|
|
511
|
+
*/
|
|
512
|
+
snappedLocationCourseFiltering: CourseFiltering;
|
|
556
513
|
}
|
|
557
514
|
|
|
558
515
|
/**
|
|
@@ -576,46 +533,62 @@ export interface TripSummary {
|
|
|
576
533
|
*/
|
|
577
534
|
export type WaypointAdvanceMode = { WaypointWithinRange: number } | { WaypointAlongAdvancingStep: number };
|
|
578
535
|
|
|
579
|
-
export interface
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
536
|
+
export interface SerializableNavState {
|
|
537
|
+
tripState: TripState;
|
|
538
|
+
stepAdvanceCondition: SerializableStepAdvanceCondition;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Information pertaining to the user\'s full navigation trip. This includes
|
|
543
|
+
* simple stats like total duration and distance.
|
|
544
|
+
*/
|
|
545
|
+
export interface TripSummary {
|
|
584
546
|
/**
|
|
585
|
-
*
|
|
547
|
+
* The total raw distance traveled in the trip, in meters.
|
|
586
548
|
*/
|
|
587
|
-
|
|
549
|
+
distanceTraveled: number;
|
|
588
550
|
/**
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
* This exists because several of our step advance conditions require entry and
|
|
592
|
-
* exit from a step\'s geometry. The end of the route/arrival doesn\'t always accommodate
|
|
593
|
-
* the expected location updates for the core step advance condition.
|
|
551
|
+
* The total snapped distance traveled in the trip, in meters.
|
|
594
552
|
*/
|
|
595
|
-
|
|
553
|
+
snappedDistanceTraveled: number;
|
|
596
554
|
/**
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* NOTE: This is distinct from the action that is taken.
|
|
600
|
-
* It is only the determination that the user has deviated from the expected route.
|
|
555
|
+
* When the trip was started.
|
|
601
556
|
*/
|
|
602
|
-
|
|
557
|
+
startedAt: Date;
|
|
603
558
|
/**
|
|
604
|
-
*
|
|
559
|
+
* When the trip was completed or canceled.
|
|
605
560
|
*/
|
|
606
|
-
|
|
561
|
+
endedAt: Date | null;
|
|
607
562
|
}
|
|
608
563
|
|
|
609
564
|
/**
|
|
610
|
-
* Controls
|
|
565
|
+
* Controls how simulated locations deviate from the actual route line.
|
|
566
|
+
* This simulates real-world GPS behavior where readings often have systematic bias.
|
|
611
567
|
*/
|
|
612
|
-
export type
|
|
568
|
+
export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
|
|
613
569
|
|
|
614
|
-
export
|
|
615
|
-
|
|
616
|
-
|
|
570
|
+
export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* The current state of the simulation.
|
|
574
|
+
*/
|
|
575
|
+
export interface LocationSimulationState {
|
|
576
|
+
current_location: UserLocation;
|
|
577
|
+
remaining_locations: GeographicCoordinate[];
|
|
578
|
+
bias: LocationBias;
|
|
617
579
|
}
|
|
618
580
|
|
|
581
|
+
/**
|
|
582
|
+
* Specifies a preferred side for departing from / arriving at a location.
|
|
583
|
+
*
|
|
584
|
+
* Examples:
|
|
585
|
+
* - Germany drives on the right side of the road. A value of `same` will only allow leaving
|
|
586
|
+
* or arriving at a location such that it is on your right.
|
|
587
|
+
* - Australia drives on the left side of the road. Passing a value of `same` will only allow
|
|
588
|
+
* leaving or arriving at a location such that it is on your left.
|
|
589
|
+
*/
|
|
590
|
+
export type ValhallaWaypointPreferredSide = "same" | "opposite" | "either";
|
|
591
|
+
|
|
619
592
|
/**
|
|
620
593
|
* Waypoint properties supported by Valhalla servers.
|
|
621
594
|
*
|
|
@@ -714,6 +687,13 @@ export interface ValhallaWaypointProperties {
|
|
|
714
687
|
search_filter: ValhallaLocationSearchFilter | undefined;
|
|
715
688
|
}
|
|
716
689
|
|
|
690
|
+
/**
|
|
691
|
+
* A road class in the Valhalla taxonomy.
|
|
692
|
+
*
|
|
693
|
+
* These are ordered from highest (fastest travel speed) to lowest.
|
|
694
|
+
*/
|
|
695
|
+
export type ValhallaRoadClass = "motorway" | "trunk" | "primary" | "secondary" | "tertiary" | "unclassified" | "residential" | "service_other";
|
|
696
|
+
|
|
717
697
|
/**
|
|
718
698
|
* A set of optional filters to exclude candidate edges based on their attributes.
|
|
719
699
|
*/
|
|
@@ -759,22 +739,62 @@ export interface ValhallaLocationSearchFilter {
|
|
|
759
739
|
}
|
|
760
740
|
|
|
761
741
|
/**
|
|
762
|
-
*
|
|
742
|
+
* The event type.
|
|
763
743
|
*
|
|
764
|
-
*
|
|
765
|
-
* - Germany drives on the right side of the road. A value of `same` will only allow leaving
|
|
766
|
-
* or arriving at a location such that it is on your right.
|
|
767
|
-
* - Australia drives on the left side of the road. Passing a value of `same` will only allow
|
|
768
|
-
* leaving or arriving at a location such that it is on your left.
|
|
744
|
+
* For full replayability, we record things like rerouting, and not just location updates.
|
|
769
745
|
*/
|
|
770
|
-
export type
|
|
746
|
+
export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
|
|
771
747
|
|
|
772
748
|
/**
|
|
773
|
-
*
|
|
749
|
+
* An event that occurs during navigation.
|
|
774
750
|
*
|
|
775
|
-
*
|
|
751
|
+
* This is used for the optional session recording / telemetry.
|
|
776
752
|
*/
|
|
777
|
-
export
|
|
753
|
+
export interface NavigationRecordingEvent {
|
|
754
|
+
/**
|
|
755
|
+
* The timestamp of the event in milliseconds since Jan 1, 1970 UTC.
|
|
756
|
+
*/
|
|
757
|
+
timestamp: number;
|
|
758
|
+
/**
|
|
759
|
+
* Data associated with the event.
|
|
760
|
+
*/
|
|
761
|
+
event_data: NavigationRecordingEventData;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Waypoint properties parsed from an OSRM-compatible server response.
|
|
766
|
+
*
|
|
767
|
+
* NOTE: Some servers (such as Valhalla) may support additional parameters at request time
|
|
768
|
+
* which are _not_ echoed back in the response time.
|
|
769
|
+
* This is unfortunate; PRs upstream would likely be welcomed!
|
|
770
|
+
* Similarly, if your server is OSRM-compatible and returns additional attributes,
|
|
771
|
+
* feel free to open a PR to include these as optional properties.
|
|
772
|
+
*/
|
|
773
|
+
export interface OsrmWaypointProperties {
|
|
774
|
+
/**
|
|
775
|
+
* The name of the street that the waypoint snapped to.
|
|
776
|
+
*/
|
|
777
|
+
name: string | undefined;
|
|
778
|
+
/**
|
|
779
|
+
* The distance (in meters) between the snapped point and the input coordinate.
|
|
780
|
+
*/
|
|
781
|
+
distance: number | undefined;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Status information that describes whether the user is proceeding according to the route or not.
|
|
786
|
+
*
|
|
787
|
+
* Note that the name is intentionally a bit generic to allow for expansion of other states.
|
|
788
|
+
* For example, we could conceivably add a \"wrong way\" status in the future.
|
|
789
|
+
*/
|
|
790
|
+
export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Determines if the user has deviated from the expected route.
|
|
794
|
+
*/
|
|
795
|
+
export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
|
|
796
|
+
|
|
797
|
+
export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number; calculateWhileOffRoute: boolean } } | { DistanceEntryExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { DistanceEntryAndSnappedExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } };
|
|
778
798
|
|
|
779
799
|
|
|
780
800
|
export class NavigationController {
|
package/ferrostar_bg.js
CHANGED
|
@@ -745,7 +745,7 @@ export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(fu
|
|
|
745
745
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
746
746
|
}, arguments) };
|
|
747
747
|
|
|
748
|
-
export function
|
|
748
|
+
export function __wbg_getRandomValues_9c5c1b115e142bb8() { return handleError(function (arg0, arg1) {
|
|
749
749
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
750
750
|
}, arguments) };
|
|
751
751
|
|
package/ferrostar_bg.wasm
CHANGED
|
Binary file
|