mobility-toolbox-js 3.0.0-beta.19 → 3.0.0-beta.20

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.
Files changed (55) hide show
  1. package/api/HttpAPI.d.ts +5 -5
  2. package/api/RealtimeAPI.d.ts +204 -171
  3. package/api/RealtimeAPI.js +306 -258
  4. package/api/RoutingAPI.d.ts +4 -4
  5. package/api/StopsAPI.d.ts +4 -4
  6. package/api/WebSocketAPI.d.ts +60 -66
  7. package/api/WebSocketAPI.js +164 -164
  8. package/api/index.js +1 -1
  9. package/common/controls/StopFinderControlCommon.d.ts +11 -11
  10. package/common/controls/StopFinderControlCommon.js +30 -30
  11. package/common/index.d.ts +1 -1
  12. package/common/index.js +1 -1
  13. package/common/mixins/RealtimeLayerMixin.d.ts +149 -155
  14. package/common/mixins/RealtimeLayerMixin.js +395 -395
  15. package/common/styles/realtimeDefaultStyle.js +6 -6
  16. package/common/styles/realtimeHeadingStyle.js +5 -5
  17. package/common/utils/getMapGlCopyrights.d.ts +1 -1
  18. package/common/utils/getMapGlCopyrights.js +3 -3
  19. package/common/utils/getVehiclePosition.d.ts +2 -2
  20. package/common/utils/getVehiclePosition.js +7 -7
  21. package/common/utils/renderTrajectories.js +5 -5
  22. package/common/utils/sortByDelay.js +5 -5
  23. package/maplibre/layers/RealtimeLayer.d.ts +59 -64
  24. package/maplibre/layers/RealtimeLayer.js +8 -8
  25. package/maplibre/utils/getSourceCoordinates.js +5 -5
  26. package/mbt.js +7205 -7031
  27. package/mbt.js.map +4 -4
  28. package/mbt.min.js +25 -25
  29. package/mbt.min.js.map +4 -4
  30. package/ol/controls/RoutingControl.d.ts +81 -87
  31. package/ol/controls/RoutingControl.js +216 -218
  32. package/ol/layers/Layer.d.ts +9 -9
  33. package/ol/layers/MaplibreLayer.d.ts +10 -10
  34. package/ol/layers/MaplibreLayer.js +9 -3
  35. package/ol/layers/MaplibreStyleLayer.d.ts +77 -76
  36. package/ol/layers/MaplibreStyleLayer.js +237 -238
  37. package/ol/layers/RealtimeLayer.d.ts +92 -96
  38. package/ol/layers/RealtimeLayer.js +139 -131
  39. package/ol/mixins/MobilityLayerMixin.d.ts +9 -9
  40. package/ol/mixins/PropertiesLayerMixin.d.ts +33 -36
  41. package/ol/mixins/PropertiesLayerMixin.js +73 -72
  42. package/ol/renderers/MaplibreLayerRenderer.js +3 -3
  43. package/ol/renderers/MaplibreStyleLayerRenderer.d.ts +6 -6
  44. package/ol/renderers/MaplibreStyleLayerRenderer.js +14 -17
  45. package/ol/renderers/RealtimeLayerRenderer.d.ts +6 -6
  46. package/ol/renderers/RealtimeLayerRenderer.js +54 -52
  47. package/ol/utils/getFeatureInfoAtCoordinate.d.ts +1 -1
  48. package/ol/utils/getFeatureInfoAtCoordinate.js +10 -16
  49. package/package.json +6 -5
  50. package/setupTests.js +3 -4
  51. package/types/common.d.ts +53 -49
  52. package/types/index.d.ts +1 -1
  53. package/types/realtime.d.ts +91 -93
  54. package/types/routing.d.ts +60 -60
  55. package/types/stops.d.ts +62 -62
package/types/common.d.ts CHANGED
@@ -2,55 +2,58 @@ import { Feature } from 'ol';
2
2
  import { Coordinate } from 'ol/coordinate';
3
3
  import { ObjectEvent } from 'ol/Object';
4
4
  import { Pixel } from 'ol/pixel';
5
- import type { RealtimeMot, RealtimeTrainId } from './realtime';
5
+
6
+ import { RealtimeTrajectory } from '../api/typedefs';
7
+ import CommonLayer, {
8
+ LayerCommonOptions,
9
+ } from '../ol/mixins/PropertiesLayerMixin';
10
+
6
11
  import type {
7
12
  CopyrightControl as MbCopyrightControl,
8
- RealtimeLayer as MbRealtimeLayer,
9
13
  layer as MbLayer,
14
+ RealtimeLayer as MbRealtimeLayer,
10
15
  } from '../maplibre';
11
16
  import type {
12
- CopyrightControl as OlCopyrightControl,
13
17
  MapboxLayer,
14
18
  MaplibreLayer,
15
- RealtimeLayer as OlRealtimeLayer,
19
+ CopyrightControl as OlCopyrightControl,
16
20
  layer as OlLayer,
21
+ RealtimeLayer as OlRealtimeLayer,
17
22
  } from '../ol';
18
- import { RealtimeTrajectory } from '../api/typedefs';
19
- import CommonLayer, {
20
- LayerCommonOptions,
21
- } from '../ol/mixins/PropertiesLayerMixin';
23
+
24
+ import type { RealtimeMot, RealtimeTrainId } from './realtime';
25
+
22
26
  import type { RoutingParameters } from '.';
23
27
 
24
- export type StyleCache = { [key: string]: AnyCanvas };
28
+ export type StyleCache = Record<string, AnyCanvas>;
25
29
 
26
- export type ViewState = {
27
- time?: number;
30
+ export interface ViewState {
28
31
  center?: number[];
29
32
  extent?: number[];
30
- size?: number[];
31
- rotation?: number;
33
+ pixelRatio?: number;
32
34
  resolution?: number;
35
+ rotation?: number;
36
+ size?: number[];
37
+ time?: number;
33
38
  zoom?: number;
34
- pixelRatio?: number;
35
- };
39
+ }
36
40
 
37
- export type RealtimeStyleOptions = {
38
- hoverVehicleId?: RealtimeTrainId;
39
- selectedVehicleId?: RealtimeTrainId;
40
- useDelayStyle?: boolean;
41
- delayOutlineColor?: string;
41
+ export interface RealtimeStyleOptions {
42
42
  delayDisplay?: number;
43
- noInterpolate?: boolean;
43
+ delayOutlineColor?: string;
44
44
  filter?: FilterFunction;
45
- getRadius?: (type: RealtimeMot, z: number) => number;
46
45
  getBgColor?: (type: RealtimeMot) => string;
47
46
  getDelayColor?: (
48
- delay: number | null,
47
+ delay: null | number,
49
48
  cancelled?: boolean,
50
49
  isDelayText?: boolean,
51
50
  ) => string;
52
51
  getDelayFont?: (fontSize: number, text?: string) => string;
53
- getDelayText?: (delay: number | null, cancelled?: boolean) => string;
52
+ getDelayText?: (delay: null | number, cancelled?: boolean) => string;
53
+ getMaxRadiusForStrokeAndDelay?: () => number;
54
+ getMaxRadiusForText?: () => number;
55
+ getRadius?: (type: RealtimeMot, z: number) => number;
56
+ getScreenPixel?: (pixel: Pixel, viewState: ViewState) => Pixel;
54
57
  getText?: (text?: string) => string;
55
58
  getTextColor?: (type: RealtimeMot) => string;
56
59
  getTextFont?: (fontSize: number, text?: string) => string;
@@ -61,14 +64,13 @@ export type RealtimeStyleOptions = {
61
64
  fontSize: number,
62
65
  getFont: (fontSize: number, text?: string) => string,
63
66
  ) => number;
64
- getMaxRadiusForText?: () => number;
65
- getMaxRadiusForStrokeAndDelay?: () => number;
66
- getScreenPixel?: (pixel: Pixel, viewState: ViewState) => Pixel;
67
- };
67
+ hoverVehicleId?: RealtimeTrainId;
68
+ noInterpolate?: boolean;
69
+ selectedVehicleId?: RealtimeTrainId;
70
+ useDelayStyle?: boolean;
71
+ }
68
72
 
69
- export type RealtimeTrajectories = {
70
- [key: RealtimeTrainId]: RealtimeTrajectory;
71
- };
73
+ export type RealtimeTrajectories = Record<RealtimeTrainId, RealtimeTrajectory>;
72
74
 
73
75
  export type RealtimeStyleFunction = (
74
76
  trajectory: RealtimeTrajectory,
@@ -76,32 +78,34 @@ export type RealtimeStyleFunction = (
76
78
  options: RealtimeStyleOptions,
77
79
  ) => AnyCanvas | null;
78
80
 
79
- export type RealtimeRenderState = {
81
+ export interface RealtimeRenderState {
80
82
  center?: Coordinate;
81
- zoom?: number;
82
- rotation?: number;
83
83
  renderedTrajectories?: RealtimeTrajectory[];
84
- };
84
+ rotation?: number;
85
+ zoom?: number;
86
+ }
85
87
 
86
- export type AnyMap = OlMap | MaplibreMap | MapboxMap;
87
- export type AnyLayer = OlLayer | MbLayer;
88
+ export type AnyMap = MapboxMap | MaplibreMap | OlMap;
89
+ export type AnyLayer = MbLayer | OlLayer;
88
90
  export type AnyOlLayer = OlLayer;
89
91
  export type AnyMapboxLayer = MapboxLayer | MaplibreLayer;
90
92
  export type AnyRealtimeLayer = MbRealtimeLayer | OlRealtimeLayer;
91
93
  export type AnyCopyrightControl = MbCopyrightControl | OlCopyrightControl;
92
- export type AnyMapGlMap = maplibregl.Map | maplibregl.Map;
93
- export type AnyMapGlMapOptions = maplibregl.MapOptions | maplibregl.MapOptions;
94
+ export type AnyMapGlMap = maplibregl.Map;
95
+ export type AnyMapGlMapOptions = maplibregl.MapOptions;
94
96
  export type AnyCanvas = HTMLCanvasElement | OffscreenCanvas;
95
97
  export type AnyCanvasContext =
96
98
  | CanvasRenderingContext2D
97
- | OffscreenCanvasRenderingContext2D;
99
+ | null
100
+ | OffscreenCanvasRenderingContext2D
101
+ | undefined;
98
102
  export type GConstructor<T extends CommonLayer> = new (options?: any) => T;
99
103
  export type CommonLayerClass = GConstructor<CommonLayer>;
100
104
  export type GConstructor2<T extends OlLayer> = new (options?: any) => T;
101
105
  export type OlLayerClass = GConstructor<AnyOlLayer>;
102
106
  export type AnyLayerClass = GConstructor<AnyLayer>;
103
107
 
104
- type GConstructor3<T = {}> = new (...args: any[]) => T;
108
+ type GConstructor3<T = object> = new (...args: any[]) => T;
105
109
  export type AnyLayerable = GConstructor3<Omit<AnyLayer, keyof string>>;
106
110
 
107
111
  export type AnyMapboxLayerClass = GConstructor<AnyMapboxLayer>;
@@ -109,16 +113,16 @@ export type AnyRealtimeLayerClass = GConstructor<AnyRealtimeLayer>;
109
113
  export type AnyMapGlMapClass = GConstructor<AnyMapGlMap>;
110
114
  export type AnyCopyrightControlClass = GConstructor<AnyCopyrightControl>;
111
115
 
112
- export type LayerGetFeatureInfoResponse = {
113
- layer: Layer;
114
- features: Feature[];
116
+ export interface LayerGetFeatureInfoResponse {
115
117
  coordinate: Coordinate;
116
- };
118
+ features: Feature[];
119
+ layer: Layer;
120
+ }
117
121
 
118
- export type LayerGetFeatureInfoOptions = {
119
- resolution: number;
122
+ export interface LayerGetFeatureInfoOptions {
120
123
  nb?: number;
121
- };
124
+ resolution: number;
125
+ }
122
126
 
123
127
  export type UserInteractionCallback = (
124
128
  features: Feature[],
@@ -129,4 +133,4 @@ export type UserInteractionCallback = (
129
133
 
130
134
  export type RoutingGraph = [RoutingParameters.graph, number, number];
131
135
  export type RoutingMot = RoutingParameters.mot;
132
- export type RoutingViaPoint = string | Coordinate;
136
+ export type RoutingViaPoint = Coordinate | string;
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Paths as Routing } from './routing';
2
2
  import { Paths as Stops } from './stops';
3
3
 
4
- export * from './realtime';
5
4
  export * from './common';
5
+ export * from './realtime';
6
6
 
7
7
  export type RoutingParameters = Routing['/']['get']['parameters']['query'];
8
8
  export type RoutingResponse = Routing['/']['get']['responses']['200']['schema'];
@@ -1,8 +1,8 @@
1
1
  import { Feature, FeatureCollection, Point } from 'geojson';
2
2
 
3
- export declare type RealtimeMode = 'topographic' | 'schematic' | 'raw';
3
+ export declare type RealtimeMode = 'raw' | 'schematic' | 'topographic';
4
4
 
5
- export declare type RealtimeChannelModeSuffix = '' | '_schematic';
5
+ export declare type RealtimeChannelModeSuffix = '_schematic' | '';
6
6
 
7
7
  export type RealtimeTrainId = string;
8
8
 
@@ -10,38 +10,38 @@ export type RealtimeStationId = number;
10
10
 
11
11
  export type RealtimeService =
12
12
  | 'redis_websocket_api'
13
- | 'tralis_stations'
14
13
  | 'tralis_fzo'
15
- | 'tralis_worker'
16
- | 'tralis_vdv'
17
- | 'tralis_newsticker'
18
14
  | 'tralis_geofox'
15
+ | 'tralis_newsticker'
16
+ | 'tralis_stations'
17
+ | 'tralis_vdv'
18
+ | 'tralis_worker'
19
19
  | string;
20
20
 
21
- export type RealtimeTenant = 'sbb' | 'sbh' | 'sbm' | '' | string;
21
+ export type RealtimeTenant = '' | 'sbb' | 'sbh' | 'sbm' | string;
22
22
 
23
23
  export type RealtimeElevatorState = 'ALL_OPERABLE' | string;
24
24
 
25
- export type RealtimeStopState = 'LEAVING' | 'BOARDING' | string;
25
+ export type RealtimeStopState = 'BOARDING' | 'LEAVING' | string;
26
26
 
27
27
  export type RealtimeTrajectoryState =
28
- | 'HIDDEN'
29
28
  | 'BOARDING'
30
- | 'STOP_CANCELLED'
31
- | 'JOURNEY_CANCELLED';
29
+ | 'HIDDEN'
30
+ | 'JOURNEY_CANCELLED'
31
+ | 'STOP_CANCELLED';
32
32
 
33
- export type RealtimeGeneralizationLevel = 5 | 10 | 30 | 100;
33
+ export type RealtimeGeneralizationLevel = 10 | 100 | 30 | 5;
34
34
 
35
35
  export type RealtimeMot =
36
- | 'tram'
37
- | 'subway'
38
- | 'rail'
39
36
  | 'bus'
40
- | 'ferry'
41
37
  | 'cablecar'
42
- | 'gondola'
38
+ | 'coach'
39
+ | 'ferry'
43
40
  | 'funicular'
44
- | 'coach';
41
+ | 'gondola'
42
+ | 'rail'
43
+ | 'subway'
44
+ | 'tram';
45
45
 
46
46
  /**
47
47
  * @type RealtimeBbox
@@ -60,56 +60,56 @@ export type RealtimeBbox = (number | string)[];
60
60
  export type RealtimeBuffer = [number, number];
61
61
 
62
62
  export type RealtimeChannelName =
63
- | 'websocket'
64
63
  | 'buffer'
65
- | 'line'
66
64
  | 'extra_geoms'
67
65
  | 'healthcheck'
68
- | `timetable_${RealtimeStationId}`
69
- | `trajectory${RealtimeChannelModeSuffix}`
66
+ | 'line'
67
+ | 'websocket'
70
68
  | `deleted_vehicles${RealtimeChannelModeSuffix}`
69
+ | `full_trajectory${RealtimeChannelModeSuffix}_${RealtimeTenant}_${RealtimeTrainId}`
71
70
  | `stopsequence_${RealtimeTenant}_${RealtimeTrainId}`
72
- | `full_trajectory${RealtimeChannelModeSuffix}_${RealtimeTenant}_${RealtimeTrainId}`;
71
+ | `timetable_${RealtimeStationId}`
72
+ | `trajectory${RealtimeChannelModeSuffix}`;
73
73
 
74
74
  export interface RealtimeTrajectoryProperties {
75
75
  // Tralis and trafimage
76
76
  bounds: [number, number, number, number];
77
- delay: number | null;
77
+ delay: null | number;
78
+ // Tralis
79
+ event?: string;
80
+ event_delay?: number;
78
81
  event_timestamp: number;
82
+ event_timestamp?: number;
79
83
  gen_level?: RealtimeGeneralizationLevel;
80
84
  gen_range: [number, number];
81
85
  has_journey: boolean;
82
86
  has_realtime: boolean;
83
87
  has_realtime_journey: boolean;
84
88
  line?: RealtimeLine;
85
- operator_provides_realtime_journey: 'unknown' | 'yes' | 'no';
89
+ name?: string; // deprecated, name is an old property, use line.name instead.
90
+ operator?: string; // deprecated, operator is an old property, use tenant instead.
91
+ operator_provides_realtime_journey: 'no' | 'unknown' | 'yes';
92
+ original_line?: RealtimeLine;
93
+ original_rake?: string;
94
+ original_train_number?: number;
95
+ position_correction?: number;
86
96
  rake?: string;
97
+ raw_coordinates?: [number, number];
98
+
87
99
  raw_time?: string;
100
+ ride_state?: string;
101
+
88
102
  route_identifier: string;
103
+ routeIdentifier?: string;
89
104
  state: RealtimeTrajectoryState;
90
105
  tenant: string;
91
- time_intervals?: Array<Array<number>>;
106
+ time_intervals?: number[][];
92
107
  time_since_update?: string;
93
108
  timestamp: number;
94
109
  train_id?: RealtimeTrainId;
95
110
  train_number?: number;
96
- type: RealtimeMots;
97
-
98
- operator?: string; // deprecated, operator is an old property, use tenant instead.
99
- name?: string; // deprecated, name is an old property, use line.name instead.
100
-
101
- // Tralis
102
- event?: string;
103
- event_delay?: number;
104
- event_timestamp?: number;
105
- original_line?: RealtimeLine;
106
- original_rake?: string;
107
- original_train_number?: number;
108
- position_correction?: number;
109
- raw_coordinates?: [number, number];
110
- ride_state?: string;
111
- routeIdentifier?: string;
112
111
  transmitting_vehicle?: string;
112
+ type: RealtimeMots;
113
113
  }
114
114
 
115
115
  export interface RealtimeTrajectory extends Feature {
@@ -174,7 +174,7 @@ export interface RealtimeStopSequence {
174
174
  }
175
175
 
176
176
  export interface RealtimeExtraGeomProperties {
177
- ref: string | number;
177
+ ref: number | string;
178
178
  }
179
179
 
180
180
  export interface RealtimeExtraGeom extends Feature {
@@ -182,40 +182,38 @@ export interface RealtimeExtraGeom extends Feature {
182
182
  }
183
183
 
184
184
  export interface RealtimeExtraGeomDeleted {
185
- type: 'Deleted';
186
185
  properties: RealtimeExtraGeomProperties;
186
+ type: 'Deleted';
187
187
  }
188
188
 
189
- export type RealtimeExtraGeoms = {
190
- [index: string]: Feature[];
191
- };
189
+ export type RealtimeExtraGeoms = Record<string, Feature[]>;
192
190
 
193
191
  export interface RealtimeLine {
194
- id: number;
195
192
  color: string;
196
- stroke: string;
193
+ id: number;
197
194
  name: string;
195
+ stroke: string;
198
196
  text_color: string;
199
197
  }
200
198
 
201
199
  export interface RealtimeTransfer {
202
- mot: RealtimeMot;
203
200
  lines: string[];
201
+ mot: RealtimeMot;
204
202
  }
205
203
 
206
204
  export interface RealtimeStationproperties extends Feature {
207
- transfers: RealtimeTransfer[];
208
205
  elevatorOutOfOrder: boolean;
209
- elevatorState: RealtimeElevatorState;
210
206
  elevators: object;
211
- uic: RealtimeStationId;
212
- name: string;
213
- networkLines: RealtimeLine[];
214
- hasElevator: boolean;
215
- hasZOB: boolean;
207
+ elevatorState: RealtimeElevatorState;
216
208
  hasAccessibility: boolean;
217
209
  hasAirport: boolean;
210
+ hasElevator: boolean;
211
+ hasZOB: boolean;
212
+ name: string;
213
+ networkLines: RealtimeLine[];
218
214
  tenant: RealtimeTenant;
215
+ transfers: RealtimeTransfer[];
216
+ uic: RealtimeStationId;
219
217
  }
220
218
 
221
219
  export interface RealtimeStation extends Feature {
@@ -224,30 +222,30 @@ export interface RealtimeStation extends Feature {
224
222
  }
225
223
 
226
224
  export interface RealtimeDeparture {
227
- to: string[];
228
- time: number;
229
- no_stop_between: boolean;
230
- new_to: boolean;
225
+ at_station_ds100: string;
226
+ call_id: number;
227
+ created_at: string;
228
+ formation: any;
229
+ fzo_estimated_time: number;
231
230
  has_fzo: boolean;
231
+ line: RealtimeLine;
232
+ min_arrival_time: number;
233
+ new_to: boolean;
232
234
  next_stoppoints: string[];
235
+ no_stop_between: boolean;
236
+ no_stop_till: any;
233
237
  platform: string;
234
- created_at: string;
235
- at_station_ds100: string;
236
- train_number: number;
237
238
  ris_aimed_time: number;
238
- updated_at: number;
239
- min_arrival_time: number;
240
239
  ris_estimated_time: number;
241
- train_id: RealtimeTrainId;
242
- fzo_estimated_time: number;
243
- train_type: number;
244
- call_id: number;
245
- line: RealtimeLine;
246
240
  state: string; /// (BOARDING|STOP_CANCELLED|JOURNEY_CANCELLED|HIDDEN)/
247
- formation: any;
248
- no_stop_till: any;
249
- timestamp: number; // This property seems to never exists
241
+ time: number;
250
242
  timediff: number; // This property seems to alawy been 0
243
+ timestamp: number; // This property seems to never exists
244
+ to: string[];
245
+ train_id: RealtimeTrainId;
246
+ train_number: number;
247
+ train_type: number;
248
+ updated_at: number;
251
249
  }
252
250
 
253
251
  export interface RealtimeDepartureExtended extends RealtimeDeparture {
@@ -269,68 +267,68 @@ export interface RealtimeNews {
269
267
  export interface RealtimeHealth {
270
268
  heathly: boolean;
271
269
  service: RealtimeService;
272
- tenant: string | null;
270
+ tenant: null | string;
273
271
  }
274
272
 
275
273
  export interface RealtimeExtraGeomsResponse {
276
- source: `extra_geoms`;
277
- timestamp: number;
278
274
  client_reference: null;
279
275
  content: RealtimeExtraGeom | RealtimeExtraGeomDeleted;
276
+ source: `extra_geoms`;
277
+ timestamp: number;
280
278
  }
281
279
 
282
280
  export interface RealtimeStationResponse {
283
- source: `station_${RealtimeStationId}`;
284
- timestamp: number;
285
281
  client_reference: null;
286
282
  content: RealtimeNews;
283
+ source: `station_${RealtimeStationId}`;
284
+ timestamp: number;
287
285
  }
288
286
 
289
287
  export interface RealtimeNewsTickerResponse {
290
- source: `${RealtimeTenant}_newsticker`;
291
- timestamp: number;
292
288
  client_reference: null;
293
289
  content: RealtimeNews;
290
+ source: `${RealtimeTenant}_newsticker`;
291
+ timestamp: number;
294
292
  }
295
293
 
296
294
  export interface RealtimeTimetableResponse {
297
- source: `timetable_${RealtimeStationId}`;
298
- timestamp: number;
299
295
  client_reference: null;
300
296
  content: RealtimeDeparture;
297
+ source: `timetable_${RealtimeStationId}`;
298
+ timestamp: number;
301
299
  }
302
300
 
303
301
  export interface RealtimeTrajectoryResponse {
304
- source: `trajectory${RealtimeChannelModeSuffix}`;
305
- timestamp: number;
306
302
  client_reference: '';
307
303
  content: RealtimeTrajectory;
304
+ source: `trajectory${RealtimeChannelModeSuffix}`;
305
+ timestamp: number;
308
306
  }
309
307
 
310
308
  export interface RealtimeStopSequenceResponse {
309
+ client_reference: '';
310
+ content: RealtimeStopSequence[];
311
311
  source: `stopsequence_${RealtimeTenant}_${RealtimeTrainId}`;
312
312
  timestamp: number;
313
- client_reference: '';
314
- content: Array<RealtimeStopSequence>;
315
313
  }
316
314
 
317
315
  export interface RealtimeBufferResponse {
318
- source: 'buffer';
319
- timestamp: number;
320
316
  client_reference: '';
321
317
  content: RealtimeTrajectoryResponse[];
318
+ source: 'buffer';
319
+ timestamp: number;
322
320
  }
323
321
 
324
322
  export interface RealtimeDeletedVehiclesResponse {
325
- source: `deleted_vehicles${RealtimeChannelModeSuffix}`;
326
- timestamp: number;
327
323
  client_reference: null;
328
324
  content: string;
325
+ source: `deleted_vehicles${RealtimeChannelModeSuffix}`;
326
+ timestamp: number;
329
327
  }
330
328
 
331
329
  export interface RealtimeHealthCheckResponse {
332
- source: 'healthcheck';
333
- timestamp: number;
334
330
  client_reference: null;
335
331
  content: RealtimeHealth;
332
+ source: 'healthcheck';
333
+ timestamp: number;
336
334
  }
@@ -9,6 +9,58 @@ export interface Paths {
9
9
  get: {
10
10
  parameters: {
11
11
  query: {
12
+ /**
13
+ * Whether to use beelines (line strings with 2 points) between
14
+ * mutually unreachable hops as a fallback for "Route not found"
15
+ * errors. "true", "on", "yes", "y", "1" will enable the
16
+ * fallback. Default: enabled
17
+ */
18
+ 'beeline-fallback'?: string;
19
+ /**
20
+ * Distance punishment factor for edge snapping of coordinates (see
21
+ * "Note on coordinates" at the top). Large: prefer close edge. Small:
22
+ * prefer short total route. Negative value: like worst edge
23
+ * category. Default: -1.0
24
+ */
25
+ 'coord-punish'?: number;
26
+ /**
27
+ * Search radius for candidate edges during snapping of coordinates
28
+ * (see "Note on coordinates" at the top) Default: -1.0
29
+ */
30
+ 'coord-radius'?: number;
31
+ /** Only for mot=rail. Default is a detailed network based on OpenStreetMap. gen1 to gen4 provide rail networks with increasing levels of generalization */
32
+ graph?: 'gen1' | 'gen2' | 'gen3' | 'gen4';
33
+ /**
34
+ * Whether to include intermediate hops (stations/stops) found on the
35
+ * route to the response. "true", "on", "yes", "y", "1" will enable
36
+ * intermediate hops. Default: disabled
37
+ */
38
+ hops?: string;
39
+ /** A line name that should be preferred */
40
+ line?: string;
41
+ /** Name of origin of the preferred line */
42
+ 'line-from'?: string;
43
+ /** Name of destination of the preferred line */
44
+ 'line-to'?: string;
45
+ /**
46
+ * Maximum allowed ratio of hops to skip if not found. Only non-start
47
+ * and non-end hops are counted in ratio numerator and denominator.
48
+ */
49
+ 'max-skip-hop-ratio'?: number;
50
+ /** Mode of transport */
51
+ mot:
52
+ | 'bus'
53
+ | 'car'
54
+ | 'coach'
55
+ | 'ferry'
56
+ | 'foot'
57
+ | 'funicular'
58
+ | 'gondola'
59
+ | 'rail'
60
+ | 'subway'
61
+ | 'tram';
62
+ /** Douglas-Peucker distance parameter for simplification. Default 0.5 in Mercator units */
63
+ simplify?: number;
12
64
  /**
13
65
  * A pipe separated list of hops. A hop describes a station with either
14
66
  * - a name or abbreviation
@@ -52,58 +104,6 @@ export interface Paths {
52
104
  * - `freiburg|basel%20sbb|bern` - from Freiburg (Breisgau) Hbf via Basel SBB to Bern
53
105
  */
54
106
  via: string;
55
- /** Mode of transport */
56
- mot:
57
- | 'rail'
58
- | 'bus'
59
- | 'coach'
60
- | 'foot'
61
- | 'tram'
62
- | 'subway'
63
- | 'gondola'
64
- | 'funicular'
65
- | 'ferry'
66
- | 'car';
67
- /** Only for mot=rail. Default is a detailed network based on OpenStreetMap. gen1 to gen4 provide rail networks with increasing levels of generalization */
68
- graph?: 'gen1' | 'gen2' | 'gen3' | 'gen4';
69
- /** A line name that should be preferred */
70
- line?: string;
71
- /** Name of origin of the preferred line */
72
- 'line-from'?: string;
73
- /** Name of destination of the preferred line */
74
- 'line-to'?: string;
75
- /** Douglas-Peucker distance parameter for simplification. Default 0.5 in Mercator units */
76
- simplify?: number;
77
- /**
78
- * Maximum allowed ratio of hops to skip if not found. Only non-start
79
- * and non-end hops are counted in ratio numerator and denominator.
80
- */
81
- 'max-skip-hop-ratio'?: number;
82
- /**
83
- * Whether to include intermediate hops (stations/stops) found on the
84
- * route to the response. "true", "on", "yes", "y", "1" will enable
85
- * intermediate hops. Default: disabled
86
- */
87
- hops?: string;
88
- /**
89
- * Whether to use beelines (line strings with 2 points) between
90
- * mutually unreachable hops as a fallback for "Route not found"
91
- * errors. "true", "on", "yes", "y", "1" will enable the
92
- * fallback. Default: enabled
93
- */
94
- 'beeline-fallback'?: string;
95
- /**
96
- * Search radius for candidate edges during snapping of coordinates
97
- * (see "Note on coordinates" at the top) Default: -1.0
98
- */
99
- 'coord-radius'?: number;
100
- /**
101
- * Distance punishment factor for edge snapping of coordinates (see
102
- * "Note on coordinates" at the top). Large: prefer close edge. Small:
103
- * prefer short total route. Negative value: like worst edge
104
- * category. Default: -1.0
105
- */
106
- 'coord-punish'?: number;
107
107
  /**
108
108
  * Whether to output OSM way ids in Feature properties.
109
109
  * "true", "on", "yes", "y", "1" will enable output. Default: disabled
@@ -147,14 +147,14 @@ export interface Paths {
147
147
  * @example
148
148
  */
149
149
  id?: string;
150
- /** @example Freiburg Littenweiler */
151
- name?: string;
152
- /** @example 1 */
153
- platform?: string;
154
150
  /** @description Latitude of the stop, in WGS84 */
155
151
  latitude?: number;
156
152
  /** @description Latitude of the stop, in WGS84 */
157
153
  longitude?: number;
154
+ /** @example Freiburg Littenweiler */
155
+ name?: string;
156
+ /** @example 1 */
157
+ platform?: string;
158
158
  };
159
159
  station_to?: {
160
160
  /**
@@ -162,14 +162,14 @@ export interface Paths {
162
162
  * @example 8004158
163
163
  */
164
164
  id?: string;
165
- /** @example Muenchen Pasing */
166
- name?: string;
167
- /** @example 4 */
168
- platform?: string;
169
165
  /** @description Latitude of the stop, in WGS84 */
170
166
  latitude?: number;
171
167
  /** @description Latitude of the stop, in WGS84 */
172
168
  longitude?: number;
169
+ /** @example Muenchen Pasing */
170
+ name?: string;
171
+ /** @example 4 */
172
+ platform?: string;
173
173
  };
174
174
  /** @enum {string} */
175
175
  type?: 'Feature';