mobility-toolbox-js 3.0.0-beta.3 → 3.0.0-beta.31

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 (125) hide show
  1. package/api/HttpAPI.d.ts +20 -0
  2. package/api/HttpAPI.js +0 -11
  3. package/api/RealtimeAPI.d.ts +404 -0
  4. package/api/RealtimeAPI.js +342 -276
  5. package/api/RoutingAPI.d.ts +47 -0
  6. package/api/RoutingAPI.js +17 -7
  7. package/api/StopsAPI.d.ts +44 -0
  8. package/api/StopsAPI.js +17 -11
  9. package/api/WebSocketAPI.d.ts +147 -0
  10. package/api/WebSocketAPI.js +164 -164
  11. package/api/index.d.ts +3 -0
  12. package/api/index.js +1 -1
  13. package/api/typedefs.d.ts +76 -0
  14. package/api/typedefs.js +27 -42
  15. package/common/controls/StopFinderControlCommon.d.ts +53 -0
  16. package/common/controls/StopFinderControlCommon.js +31 -31
  17. package/common/index.d.ts +2 -0
  18. package/common/index.js +1 -1
  19. package/common/mixins/RealtimeLayerMixin.d.ts +267 -0
  20. package/common/mixins/RealtimeLayerMixin.js +401 -393
  21. package/common/styles/index.d.ts +4 -0
  22. package/common/styles/realtimeDefaultStyle.d.ts +36 -0
  23. package/common/styles/realtimeDefaultStyle.js +6 -6
  24. package/common/styles/realtimeDelayStyle.d.ts +12 -0
  25. package/common/styles/realtimeHeadingStyle.d.ts +12 -0
  26. package/common/styles/realtimeHeadingStyle.js +5 -5
  27. package/common/styles/realtimeSimpleStyle.d.ts +4 -0
  28. package/common/typedefs.d.ts +219 -0
  29. package/common/typedefs.js +7 -1
  30. package/common/utils/compareDepartures.d.ts +10 -0
  31. package/common/utils/compareDepartures.js +2 -2
  32. package/common/utils/constants.d.ts +5 -0
  33. package/common/utils/createCanvas.d.ts +10 -0
  34. package/common/utils/createDefaultCopyrightElt.d.ts +5 -0
  35. package/common/utils/createDefaultStopFinderElt.d.ts +5 -0
  36. package/common/utils/createRealtimeFilters.d.ts +12 -0
  37. package/common/utils/debounceDeparturesMessages.d.ts +12 -0
  38. package/common/utils/debounceWebsocketMessages.d.ts +11 -0
  39. package/common/utils/getLayersAsFlatArray.d.ts +3 -0
  40. package/common/utils/getLayersAsFlatArray.js +5 -1
  41. package/common/utils/getMapGlCopyrights.d.ts +17 -0
  42. package/common/utils/getMapGlCopyrights.js +3 -3
  43. package/common/utils/getRealtimeModeSuffix.d.ts +10 -0
  44. package/common/utils/getRealtimeModeSuffix.js +1 -0
  45. package/common/utils/getUrlWithParams.d.ts +8 -0
  46. package/common/utils/getVehiclePosition.d.ts +17 -0
  47. package/common/utils/getVehiclePosition.js +9 -3
  48. package/common/utils/index.d.ts +16 -0
  49. package/common/utils/realtimeConfig.d.ts +64 -0
  50. package/common/utils/removeDuplicate.d.ts +9 -0
  51. package/common/utils/renderTrajectories.d.ts +16 -0
  52. package/common/utils/renderTrajectories.js +6 -6
  53. package/common/utils/sortAndFilterDepartures.d.ts +15 -0
  54. package/common/utils/sortAndFilterDepartures.js +1 -1
  55. package/common/utils/sortByDelay.d.ts +3 -0
  56. package/common/utils/sortByDelay.js +5 -1
  57. package/common/utils/timeUtils.d.ts +23 -0
  58. package/common/utils/toMercatorExtent.d.ts +5 -0
  59. package/iife.d.ts +2 -0
  60. package/index.d.ts +9 -0
  61. package/maplibre/controls/CopyrightControl.d.ts +35 -0
  62. package/maplibre/controls/index.d.ts +1 -0
  63. package/maplibre/index.d.ts +5 -0
  64. package/maplibre/layers/Layer.d.ts +28 -0
  65. package/maplibre/layers/Layer.js +1 -1
  66. package/maplibre/layers/RealtimeLayer.d.ts +181 -0
  67. package/maplibre/layers/RealtimeLayer.js +29 -5
  68. package/maplibre/layers/index.d.ts +2 -0
  69. package/maplibre/utils/getMercatorResolution.d.ts +7 -0
  70. package/maplibre/utils/getSourceCoordinates.d.ts +7 -0
  71. package/maplibre/utils/getSourceCoordinates.js +5 -5
  72. package/maplibre/utils/index.d.ts +2 -0
  73. package/mbt.js +39819 -32088
  74. package/mbt.js.map +4 -4
  75. package/mbt.min.js +61 -58
  76. package/mbt.min.js.map +4 -4
  77. package/ol/controls/CopyrightControl.d.ts +31 -0
  78. package/ol/controls/CopyrightControl.js +18 -8
  79. package/ol/controls/RoutingControl.d.ts +202 -0
  80. package/ol/controls/RoutingControl.js +220 -219
  81. package/ol/controls/StopFinderControl.d.ts +37 -0
  82. package/ol/controls/StopFinderControl.js +5 -2
  83. package/ol/controls/index.d.ts +3 -0
  84. package/ol/index.d.ts +7 -0
  85. package/ol/index.js +1 -0
  86. package/ol/layers/Layer.d.ts +103 -0
  87. package/ol/layers/Layer.js +38 -0
  88. package/ol/layers/MaplibreLayer.d.ts +164 -0
  89. package/ol/layers/MaplibreLayer.js +115 -27
  90. package/ol/layers/MaplibreStyleLayer.d.ts +237 -0
  91. package/ol/layers/MaplibreStyleLayer.js +315 -265
  92. package/ol/layers/RealtimeLayer.d.ts +283 -0
  93. package/ol/layers/RealtimeLayer.js +143 -128
  94. package/ol/layers/VectorLayer.d.ts +18 -0
  95. package/ol/layers/VectorLayer.js +32 -0
  96. package/ol/layers/index.d.ts +5 -0
  97. package/ol/layers/index.js +3 -0
  98. package/ol/mixins/MobilityLayerMixin.d.ts +96 -0
  99. package/ol/mixins/MobilityLayerMixin.js +1 -4
  100. package/ol/mixins/PropertiesLayerMixin.d.ts +136 -0
  101. package/ol/mixins/PropertiesLayerMixin.js +122 -140
  102. package/ol/mixins/index.d.ts +1 -0
  103. package/ol/mixins/index.js +2 -0
  104. package/ol/renderers/MaplibreLayerRenderer.d.ts +0 -0
  105. package/ol/renderers/MaplibreLayerRenderer.js +142 -114
  106. package/ol/renderers/MaplibreStyleLayerRenderer.d.ts +20 -0
  107. package/ol/renderers/MaplibreStyleLayerRenderer.js +20 -23
  108. package/ol/renderers/RealtimeLayerRenderer.d.ts +22 -0
  109. package/ol/renderers/RealtimeLayerRenderer.js +58 -53
  110. package/ol/styles/fullTrajectoryDelayStyle.d.ts +6 -0
  111. package/ol/styles/fullTrajectoryStyle.d.ts +5 -0
  112. package/ol/styles/index.d.ts +3 -0
  113. package/ol/styles/routingStyle.d.ts +4 -0
  114. package/ol/utils/getFeatureInfoAtCoordinate.d.ts +8 -0
  115. package/ol/utils/getFeatureInfoAtCoordinate.js +12 -18
  116. package/ol/utils/index.d.ts +1 -0
  117. package/package.json +31 -31
  118. package/setupTests.d.ts +1 -0
  119. package/setupTests.js +3 -4
  120. package/types/common.d.ts +55 -48
  121. package/types/index.d.ts +1 -1
  122. package/types/realtime.d.ts +91 -93
  123. package/types/routing.d.ts +60 -60
  124. package/types/stops.d.ts +62 -62
  125. package/ol/layers/MapGlLayer.js +0 -142
@@ -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';
package/types/stops.d.ts CHANGED
@@ -9,35 +9,35 @@ export interface Paths {
9
9
  get: {
10
10
  parameters: {
11
11
  query: {
12
- /** Control how many matches will be returned */
13
- limit?: number;
14
- /** Anything you'd like to search for */
15
- q: string;
16
12
  /**
17
- * comma seperated list, order chooses which agency will be preferred
18
- * as ident_source (for id and code fields)
13
+ * left,bottom,right,up coordinates in WGS84 wherein the
14
+ * station should lie
19
15
  */
20
- prefagencies?: 'sbb' | 'db';
16
+ bbox?: string;
17
+ /** which field to look up, default: all of them */
18
+ field?: 'coords' | 'id' | 'name';
19
+ /** Control how many matches will be returned */
20
+ limit?: number;
21
21
  /**
22
22
  * comma seperated list of mot's which should be available
23
23
  * at the stop
24
24
  */
25
25
  mots?:
26
26
  | 'bus'
27
+ | 'cable_car'
27
28
  | 'ferry'
29
+ | 'funicular'
28
30
  | 'gondola'
29
- | 'tram'
30
31
  | 'rail'
31
- | 'funicular'
32
- | 'cable_car'
33
- | 'subway';
32
+ | 'subway'
33
+ | 'tram';
34
34
  /**
35
- * left,bottom,right,up coordinates in WGS84 wherein the
36
- * station should lie
35
+ * comma seperated list, order chooses which agency will be preferred
36
+ * as ident_source (for id and code fields)
37
37
  */
38
- bbox?: string;
39
- /** which field to look up, default: all of them */
40
- field?: 'id' | 'name' | 'coords';
38
+ prefagencies?: 'db' | 'sbb';
39
+ /** Anything you'd like to search for */
40
+ q: string;
41
41
  /**
42
42
  * Coordinates in WGS84 (in lat,lon order) used to rank stops close to
43
43
  * this position higher
@@ -49,81 +49,81 @@ export interface Paths {
49
49
  /** stop(s) */
50
50
  200: {
51
51
  schema: {
52
- /** @enum {string} */
53
- type?: 'FeatureCollection';
54
52
  features?: {
55
- /** @enum {string} */
56
- type?: 'Feature';
53
+ /** @description the coordinates of the stop */
54
+ geometry?: {
55
+ /**
56
+ * @example [
57
+ * 7.439119,
58
+ * 46.94882
59
+ * ]
60
+ */
61
+ coordinates?: number[];
62
+ /** @enum {string} */
63
+ type?: 'Point';
64
+ };
57
65
  properties?: {
58
- /** @description internal ID */
59
- uid?: string;
60
66
  /**
61
- * @description name of the stop
62
- * @example Bern
67
+ * @description Abbreviation code from the transport agency (e.g. DS100 for Deutsche Bahn)
68
+ *
69
+ * @example BN
63
70
  */
64
- name?: string;
71
+ code?: string;
65
72
  /**
66
73
  * @description 2 letter country code where the station is located
67
74
  * @example CH
68
75
  */
69
76
  country_code?: string;
70
77
  /**
71
- * @description how well the result matches your query, 0
72
- * means best
78
+ * @description uic number
79
+ * @example 8507000
73
80
  */
74
- rank?: number;
81
+ id?: string;
75
82
  /**
76
- * @description array of translations of the stopname
77
- * @default []
83
+ * @description source agency for id and code (see below)
84
+ * @example sbb
78
85
  */
79
- translated_names?: {
80
- value?: string;
81
- /** @enum {string} */
82
- language?: 'de' | 'en' | 'fr' | 'it';
83
- }[];
86
+ ident_source?: string;
87
+ /** @description ifopt identifier, if available */
88
+ ifopt?: string;
84
89
  /** @description Means of transport that are available at this station */
85
90
  mot?: {
86
91
  bus?: boolean;
92
+ cable_car?: boolean;
87
93
  ferry?: boolean;
94
+ funicular?: boolean;
88
95
  gondola?: boolean;
89
- tram?: boolean;
90
96
  rail?: boolean;
91
- funicular?: boolean;
92
- cable_car?: boolean;
93
97
  subway?: boolean;
98
+ tram?: boolean;
94
99
  };
95
100
  /**
96
- * @description source agency for id and code (see below)
97
- * @example sbb
98
- */
99
- ident_source?: string;
100
- /**
101
- * @description uic number
102
- * @example 8507000
101
+ * @description name of the stop
102
+ * @example Bern
103
103
  */
104
- id?: string;
104
+ name?: string;
105
105
  /**
106
- * @description Abbreviation code from the transport agency (e.g. DS100 for Deutsche Bahn)
107
- *
108
- * @example BN
106
+ * @description how well the result matches your query, 0
107
+ * means best
109
108
  */
110
- code?: string;
111
- /** @description ifopt identifier, if available */
112
- ifopt?: string;
113
- };
114
- /** @description the coordinates of the stop */
115
- geometry?: {
116
- /** @enum {string} */
117
- type?: 'Point';
109
+ rank?: number;
118
110
  /**
119
- * @example [
120
- * 7.439119,
121
- * 46.94882
122
- * ]
111
+ * @description array of translations of the stopname
112
+ * @default []
123
113
  */
124
- coordinates?: number[];
114
+ translated_names?: {
115
+ /** @enum {string} */
116
+ language?: 'de' | 'en' | 'fr' | 'it';
117
+ value?: string;
118
+ }[];
119
+ /** @description internal ID */
120
+ uid?: string;
125
121
  };
122
+ /** @enum {string} */
123
+ type?: 'Feature';
126
124
  }[];
125
+ /** @enum {string} */
126
+ type?: 'FeatureCollection';
127
127
  };
128
128
  };
129
129
  /** limit parameter too high */