mobility-toolbox-js 2.0.0-beta.30 → 2.0.0-beta.34

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 (225) hide show
  1. package/api/RealtimeAPI.d.ts +268 -0
  2. package/api/RealtimeAPI.d.ts.map +1 -0
  3. package/api/RealtimeAPI.js +626 -343
  4. package/api/RoutingAPI.d.ts +33 -0
  5. package/api/RoutingAPI.d.ts.map +1 -0
  6. package/api/RoutingAPI.js +65 -15
  7. package/api/StopsAPI.d.ts +36 -0
  8. package/api/StopsAPI.d.ts.map +1 -0
  9. package/api/StopsAPI.js +70 -12
  10. package/api/index.d.ts +5 -0
  11. package/api/index.d.ts.map +1 -0
  12. package/api/index.js +10 -3
  13. package/api/typedefs.d.ts +105 -0
  14. package/api/typedefs.d.ts.map +1 -0
  15. package/api/typedefs.js +72 -0
  16. package/common/api/HttpAPI.d.ts +31 -0
  17. package/common/api/HttpAPI.d.ts.map +1 -0
  18. package/common/api/HttpAPI.js +82 -30
  19. package/common/api/WebSocketAPI.d.ts +95 -0
  20. package/common/api/WebSocketAPI.d.ts.map +1 -0
  21. package/common/api/WebSocketAPI.js +313 -168
  22. package/common/controls/Control.d.ts +74 -0
  23. package/common/controls/Control.d.ts.map +1 -0
  24. package/common/controls/Control.js +167 -78
  25. package/common/index.d.ts +3 -0
  26. package/common/index.d.ts.map +1 -0
  27. package/common/index.js +18 -2
  28. package/common/layers/Layer.d.ts +80 -0
  29. package/common/layers/Layer.d.ts.map +1 -0
  30. package/common/layers/Layer.js +251 -134
  31. package/common/mixins/CopyrightMixin.d.ts +22 -0
  32. package/common/mixins/CopyrightMixin.d.ts.map +1 -0
  33. package/common/mixins/CopyrightMixin.js +70 -22
  34. package/common/mixins/MapboxLayerMixin.d.ts +27 -0
  35. package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
  36. package/common/mixins/MapboxLayerMixin.js +240 -0
  37. package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
  38. package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
  39. package/common/mixins/RealtimeLayerMixin.js +698 -429
  40. package/common/mixins/StopFinderMixin.d.ts +40 -0
  41. package/common/mixins/StopFinderMixin.d.ts.map +1 -0
  42. package/common/mixins/StopFinderMixin.js +195 -107
  43. package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
  44. package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
  45. package/common/mixins/UserInteractionsLayerMixin.js +222 -121
  46. package/common/styles/index.d.ts +5 -0
  47. package/common/styles/index.d.ts.map +1 -0
  48. package/common/styles/index.js +24 -4
  49. package/common/styles/realtimeDefaultStyle.d.ts +15 -0
  50. package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
  51. package/common/styles/realtimeDefaultStyle.js +236 -190
  52. package/common/styles/realtimeDelayStyle.d.ts +11 -0
  53. package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
  54. package/common/styles/realtimeDelayStyle.js +25 -7
  55. package/common/styles/realtimeSimpleStyle.d.ts +3 -0
  56. package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
  57. package/common/styles/realtimeSimpleStyle.js +23 -17
  58. package/common/typedefs.d.ts +50 -0
  59. package/common/typedefs.d.ts.map +1 -0
  60. package/common/typedefs.js +21 -0
  61. package/common/utils/cleanStopTime.d.ts +7 -0
  62. package/common/utils/cleanStopTime.d.ts.map +1 -0
  63. package/common/utils/cleanStopTime.js +28 -17
  64. package/common/utils/compareDepartures.d.ts +9 -0
  65. package/common/utils/compareDepartures.d.ts.map +1 -0
  66. package/common/utils/compareDepartures.js +34 -22
  67. package/common/utils/createCanvas.d.ts +9 -0
  68. package/common/utils/createCanvas.d.ts.map +1 -0
  69. package/common/utils/createCanvas.js +28 -16
  70. package/common/utils/createTrackerFilters.d.ts +12 -0
  71. package/common/utils/createTrackerFilters.d.ts.map +1 -0
  72. package/common/utils/createTrackerFilters.js +75 -54
  73. package/common/utils/getLayersAsFlatArray.d.ts +3 -0
  74. package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
  75. package/common/utils/getLayersAsFlatArray.js +15 -13
  76. package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
  77. package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
  78. package/common/utils/getMapboxMapCopyrights.js +24 -17
  79. package/common/utils/getMapboxRender.d.ts +5 -0
  80. package/common/utils/getMapboxRender.d.ts.map +1 -0
  81. package/common/utils/getMapboxRender.js +77 -0
  82. package/common/utils/getMaplibreRender.d.ts +5 -0
  83. package/common/utils/getMaplibreRender.d.ts.map +1 -0
  84. package/common/utils/getMaplibreRender.js +38 -0
  85. package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
  86. package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
  87. package/common/utils/getRealtimeModeSuffix.js +11 -2
  88. package/common/utils/getUrlWithParams.d.ts +9 -0
  89. package/common/utils/getUrlWithParams.d.ts.map +1 -0
  90. package/common/utils/getUrlWithParams.js +20 -10
  91. package/common/utils/getVehiclePosition.d.ts +14 -0
  92. package/common/utils/getVehiclePosition.d.ts.map +1 -0
  93. package/common/utils/getVehiclePosition.js +63 -39
  94. package/common/utils/index.d.ts +12 -0
  95. package/common/utils/index.d.ts.map +1 -0
  96. package/common/utils/index.js +37 -9
  97. package/common/utils/removeDuplicate.d.ts +10 -0
  98. package/common/utils/removeDuplicate.d.ts.map +1 -0
  99. package/common/utils/removeDuplicate.js +29 -7
  100. package/common/utils/renderTrajectories.d.ts +20 -0
  101. package/common/utils/renderTrajectories.d.ts.map +1 -0
  102. package/common/utils/renderTrajectories.js +111 -78
  103. package/common/utils/sortByDelay.d.ts +3 -0
  104. package/common/utils/sortByDelay.d.ts.map +1 -0
  105. package/common/utils/sortByDelay.js +21 -17
  106. package/common/utils/timeUtils.d.ts +5 -0
  107. package/common/utils/timeUtils.d.ts.map +1 -0
  108. package/common/utils/timeUtils.js +47 -18
  109. package/common/utils/trackerConfig.d.ts +24 -0
  110. package/common/utils/trackerConfig.d.ts.map +1 -0
  111. package/common/utils/trackerConfig.js +171 -118
  112. package/iife.d.ts +3 -0
  113. package/iife.d.ts.map +1 -0
  114. package/iife.js +7 -0
  115. package/index.d.ts +6 -0
  116. package/index.d.ts.map +1 -0
  117. package/index.js +10 -7
  118. package/mapbox/controls/CopyrightControl.d.ts +32 -0
  119. package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
  120. package/mapbox/controls/CopyrightControl.js +72 -28
  121. package/mapbox/controls/index.d.ts +2 -0
  122. package/mapbox/controls/index.d.ts.map +1 -0
  123. package/mapbox/controls/index.js +6 -1
  124. package/mapbox/index.d.ts +5 -0
  125. package/mapbox/index.d.ts.map +1 -0
  126. package/mapbox/index.js +20 -4
  127. package/mapbox/layers/Layer.d.ts +47 -0
  128. package/mapbox/layers/Layer.d.ts.map +1 -0
  129. package/mapbox/layers/Layer.js +137 -54
  130. package/mapbox/layers/RealtimeLayer.d.ts +118 -0
  131. package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
  132. package/mapbox/layers/RealtimeLayer.js +310 -183
  133. package/mapbox/layers/index.d.ts +3 -0
  134. package/mapbox/layers/index.d.ts.map +1 -0
  135. package/mapbox/layers/index.js +7 -2
  136. package/mapbox/utils.d.ts +8 -0
  137. package/mapbox/utils.d.ts.map +1 -0
  138. package/mapbox/utils.js +54 -29
  139. package/mbt.js +2052 -2109
  140. package/mbt.js.map +3 -3
  141. package/mbt.min.js +18 -18
  142. package/mbt.min.js.map +3 -3
  143. package/ol/controls/CopyrightControl.d.ts +31 -0
  144. package/ol/controls/CopyrightControl.d.ts.map +1 -0
  145. package/ol/controls/CopyrightControl.js +89 -41
  146. package/ol/controls/RoutingControl.d.ts +180 -0
  147. package/ol/controls/RoutingControl.d.ts.map +1 -0
  148. package/ol/controls/RoutingControl.js +666 -371
  149. package/ol/controls/StopFinderControl.d.ts +32 -0
  150. package/ol/controls/StopFinderControl.d.ts.map +1 -0
  151. package/ol/controls/StopFinderControl.js +59 -10
  152. package/ol/controls/index.d.ts +4 -0
  153. package/ol/controls/index.d.ts.map +1 -0
  154. package/ol/controls/index.js +9 -3
  155. package/ol/index.d.ts +6 -0
  156. package/ol/index.d.ts.map +1 -0
  157. package/ol/index.js +21 -5
  158. package/ol/layers/Layer.d.ts +49 -0
  159. package/ol/layers/Layer.d.ts.map +1 -0
  160. package/ol/layers/Layer.js +178 -81
  161. package/ol/layers/MapboxLayer.d.ts +42 -0
  162. package/ol/layers/MapboxLayer.d.ts.map +1 -0
  163. package/ol/layers/MapboxLayer.js +131 -198
  164. package/ol/layers/MapboxStyleLayer.d.ts +146 -0
  165. package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
  166. package/ol/layers/MapboxStyleLayer.js +382 -186
  167. package/ol/layers/MaplibreLayer.d.ts +27 -0
  168. package/ol/layers/MaplibreLayer.d.ts.map +1 -0
  169. package/ol/layers/MaplibreLayer.js +67 -138
  170. package/ol/layers/RealtimeLayer.d.ts +119 -0
  171. package/ol/layers/RealtimeLayer.d.ts.map +1 -0
  172. package/ol/layers/RealtimeLayer.js +327 -184
  173. package/ol/layers/RoutingLayer.d.ts +24 -0
  174. package/ol/layers/RoutingLayer.d.ts.map +1 -0
  175. package/ol/layers/RoutingLayer.js +111 -56
  176. package/ol/layers/VectorLayer.d.ts +23 -0
  177. package/ol/layers/VectorLayer.d.ts.map +1 -0
  178. package/ol/layers/VectorLayer.js +71 -21
  179. package/ol/layers/WMSLayer.d.ts +38 -0
  180. package/ol/layers/WMSLayer.d.ts.map +1 -0
  181. package/ol/layers/WMSLayer.js +105 -37
  182. package/ol/layers/index.d.ts +9 -0
  183. package/ol/layers/index.d.ts.map +1 -0
  184. package/ol/layers/index.js +19 -8
  185. package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
  186. package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
  187. package/ol/styles/fullTrajectoryDelayStyle.js +32 -28
  188. package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
  189. package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
  190. package/ol/styles/fullTrajectoryStyle.js +44 -40
  191. package/ol/styles/index.d.ts +3 -0
  192. package/ol/styles/index.d.ts.map +1 -0
  193. package/ol/styles/index.js +7 -2
  194. package/package.json +14 -36
  195. package/setupTests.d.ts +2 -0
  196. package/setupTests.d.ts.map +1 -0
  197. package/setupTests.js +15 -0
  198. package/types/index.d.ts +7 -6
  199. package/types/routing.d.ts +25 -25
  200. package/types/stops.d.ts +19 -19
  201. package/api/RealtimeAPI.test.js +0 -67
  202. package/api/RoutingAPI.test.js +0 -25
  203. package/api/StopsAPI.test.js +0 -22
  204. package/common/api/HttpAPI.test.js +0 -50
  205. package/common/api/WebSocketAPI.test.js +0 -311
  206. package/common/controls/Control.test.js +0 -87
  207. package/common/layers/Layer.test.js +0 -134
  208. package/common/mixins/UserInteractionsLayerMixin.test.js +0 -199
  209. package/common/utils/createTrackerFilters.test.js +0 -79
  210. package/common/utils/getMapboxMapCopyrights.test.js +0 -40
  211. package/common/utils/removeDuplicate.test.js +0 -19
  212. package/common/utils/timeUtils.test.js +0 -10
  213. package/common/utils/trackerConfig.test.js +0 -23
  214. package/mapbox/layers/Layer.test.js +0 -182
  215. package/mapbox/layers/RealtimeLayer.test.js +0 -10
  216. package/ol/controls/CopyrightControl.test.js +0 -165
  217. package/ol/controls/RoutingControl.test.js +0 -146
  218. package/ol/controls/StopFinderControl.test.js +0 -48
  219. package/ol/layers/Layer.test.js +0 -175
  220. package/ol/layers/MapboxLayer.test.js +0 -160
  221. package/ol/layers/MapboxStyleLayer.test.js +0 -226
  222. package/ol/layers/RealtimeLayer.test.js +0 -67
  223. package/ol/layers/RoutingLayer.test.js +0 -39
  224. package/ol/layers/VectorLayer.test.js +0 -76
  225. package/ol/layers/WMSLayer.test.js +0 -57
@@ -0,0 +1,268 @@
1
+ /**
2
+ * Enum for Realtime modes.
3
+ */
4
+ export type RealtimeModes = RealtimeMode;
5
+ export namespace RealtimeModes {
6
+ const RAW: string;
7
+ const TOPOGRAPHIC: string;
8
+ const SCHEMATIC: string;
9
+ }
10
+ export default RealtimeAPI;
11
+ /**
12
+ * Enum for Realtime modes.
13
+ */
14
+ export type RealtimeMode = string;
15
+ /**
16
+ * This class provides convenience methods to access to the [geOps realtime api](https://developer.geops.io/apis/realtime/).
17
+ *
18
+ * @example
19
+ * import { RealtimeAPI } from 'mobility-toolbox-js/api';
20
+ *
21
+ * const api = new RealtimeAPI({
22
+ * url: "yourUrl",
23
+ * apiKey: "yourApiKey"
24
+ * });
25
+ *
26
+ * @example
27
+ * import { RealtimeAPI } from 'mobility-toolbox-js/api';
28
+ *
29
+ * const api = new RealtimeAPI("yourUrl");
30
+ */
31
+ declare class RealtimeAPI {
32
+ /**
33
+ * Constructor
34
+ *
35
+ * @param {Object|string} options A string representing the url of the service or an object containing the url and the apiKey.
36
+ * @param {string} options.url Url to the [geOps realtime api](https://developer.geops.io/apis/realtime/).
37
+ * @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
38
+ * @param {string} [options.prefix=''] Service prefix to specify tenant.
39
+ * @param {string} [options.projection] The epsg code of the projection for features. Default to EPSG:3857.
40
+ * @param {number[4]} [options.bbox=[minX, minY, maxX, maxY, zoom, tenant] The bounding box to receive data from.
41
+ */
42
+ constructor(options?: any | string);
43
+ /** @ignore */
44
+ subscribedStationUic: number;
45
+ /** @ignore */
46
+ departureUpdateTimeout: number;
47
+ /** @ignore */
48
+ maxDepartureAge: number;
49
+ /** @ignore */
50
+ extraGeoms: {};
51
+ /** @ignore */
52
+ prefix: any;
53
+ /**
54
+ * Callback when the websocket is opened and ready.
55
+ * It applies the bbox and the projection.
56
+ */
57
+ onOpen(): void;
58
+ defineProperties(options: any): void;
59
+ open(): void;
60
+ /**
61
+ * Close the websocket connection without reconnection.
62
+ */
63
+ close(): void;
64
+ /**
65
+ * Unsubscribe trajectory and deleted_vehicles channels. To resubscribe you have to set a new BBOX.
66
+ */
67
+ reset(): void;
68
+ /** @ignore */
69
+ pingInterval: NodeJS.Timer;
70
+ /**
71
+ * Callback when the websocket is closed by the server.
72
+ * It auto reconnects after a timeout.
73
+ */
74
+ onClose(): void;
75
+ /** @ignore */
76
+ reconnectTimeout: number;
77
+ /**
78
+ * Subscribe to a channel.
79
+ *
80
+ * @param {string} channel Name of the websocket channel to subscribe.
81
+ * @param {function} onSuccess Callback when the subscription succeeds.
82
+ * @param {function} onError Callback when the subscription fails.
83
+ * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
84
+ * @private
85
+ */
86
+ private subscribe;
87
+ /**
88
+ * Unsubscribe both modes of a channel.
89
+ *
90
+ * @param {string} channel Name of the websocket channel to unsubscribe.
91
+ * @param {string} suffix Suffix to add to the channel name.
92
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
93
+ * @private
94
+ */
95
+ private unsubscribe;
96
+ /**
97
+ * Filter departures and return an array.
98
+ *
99
+ * @param {Object} depObject The object containing departures by id.
100
+ * @param {boolean} [sortByMinArrivalTime=false] If true sort departures by arrival time.
101
+ * @return {Array<departure>} Return departures array.
102
+ * @private
103
+ */
104
+ private filterDepartures;
105
+ /**
106
+ * Subscribe to departures channel of a given station.
107
+ *
108
+ * @param {number} stationId UIC of the station.
109
+ * @param {Boolean} sortByMinArrivalTime Sort by minimum arrival time
110
+ * @param {function(departures:Departure[])} onMessage Function called on each message of the channel.
111
+ */
112
+ subscribeDepartures(stationId: number, sortByMinArrivalTime: boolean, onMessage: (arg0: departures, arg1: Departure[]) => any): void;
113
+ /**
114
+ * Unsubscribe from current departures channel.
115
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
116
+ */
117
+ unsubscribeDepartures(cb: Function): void;
118
+ /**
119
+ * Subscribe to the disruptions channel for tenant.
120
+ *
121
+ * @param {function} onMessage Function called on each message of the channel.
122
+ */
123
+ subscribeDisruptions(onMessage: Function): void;
124
+ /**
125
+ * Unsubscribe disruptions.
126
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
127
+ */
128
+ unsubscribeDisruptions(cb: Function): void;
129
+ /**
130
+ * Return a station with a given uic number and a mode.
131
+ *
132
+ * @param {number} uic UIC of the station.
133
+ * @param {RealtimeMode} mode Realtime mode.
134
+ * @return {Promise<Station>} A station.
135
+ */
136
+ getStation(uic: number, mode: RealtimeMode): Promise<Station>;
137
+ /**
138
+ * Update the model's station list for a given mode and a bbox.
139
+ *
140
+ * @param {RealtimeMode} mode Realtime mode.
141
+ * @return {Promise<Array<Station>>} An array of stations.
142
+ */
143
+ getStations(mode: RealtimeMode): Promise<Array<Station>>;
144
+ /** @ignore */
145
+ stationUpdateTimeout: number;
146
+ /**
147
+ * Subscribe to stations channel.
148
+ * One message pro station.
149
+ *
150
+ * @param {RealtimeMode} mode Realtime mode.
151
+ * @param {function(station: Station)} onMessage Function called on each message of the channel.
152
+ */
153
+ subscribeStations(mode: RealtimeMode, onMessage: (arg0: station, arg1: Station) => any): void;
154
+ /**
155
+ * Unsubscribe to stations channel.
156
+ * @param {function} cb The listener callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribe.
157
+ */
158
+ unsubscribeStations(cb: Function): void;
159
+ /**
160
+ * Subscribe to extra_geoms channel.
161
+ *
162
+ * @param {function(extraGeoms: GeosJSONFeature[])} onMessage Function called on each message of the channel.
163
+ */
164
+ subscribeExtraGeoms(onMessage: (arg0: extraGeoms, arg1: GeosJSONFeature[]) => any): void;
165
+ /**
166
+ * Unsubscribe to extra_geoms channel.
167
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
168
+ */
169
+ unsubscribeExtraGeoms(cb: Function): void;
170
+ /**
171
+ * Subscribe to trajectory channel.
172
+ *
173
+ * @param {RealtimeMode} mode Realtime mode.
174
+ * @param {function(trajectory: RealtimeTrajectory)} onMessage Function called on each message of the channel.
175
+ * @param {boolean} quiet If true, the subscription will not send GET and SUB requests to the websocket.
176
+ */
177
+ subscribeTrajectory(mode: RealtimeMode, onMessage: (arg0: trajectory, arg1: RealtimeTrajectory) => any, quiet?: boolean): void;
178
+ /**
179
+ * Unsubscribe to trajectory channels.
180
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
181
+ */
182
+ unsubscribeTrajectory(cb: Function): void;
183
+ /**
184
+ * Subscribe to deleted_vhicles channel.
185
+ *
186
+ * @param {RealtimeMode} mode Realtime mode.
187
+ * @param {function(response: { content: Vehicle })} onMessage Function called on each message of the channel.
188
+ * @param {boolean} quiet If true, the subscription will not send GET and SUB requests to the websocket.
189
+ */
190
+ subscribeDeletedVehicles(mode: RealtimeMode, onMessage: (arg0: response, arg1: {
191
+ content: Vehicle;
192
+ }) => any, quiet?: boolean): void;
193
+ /**
194
+ * Unsubscribe to deleted_vhicles channels.
195
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
196
+ */
197
+ unsubscribeDeletedVehicles(cb: Function): void;
198
+ /**
199
+ * Get a full trajectory of a vehicule .
200
+ *
201
+ * @param {string} id A vehicle id.
202
+ * @param {RealtimeMode} mode Realtime mode.
203
+ * @param {string} generalizationLevel The generalization level to request. Can be one of 5 (more generalized), 10, 30, 100, undefined (less generalized).
204
+ * @return {Promise<FullTrajectory>} Return a full trajectory.
205
+ */
206
+ getFullTrajectory(id: string, mode: RealtimeMode, generalizationLevel: string): Promise<FullTrajectory>;
207
+ /**
208
+ * Get full trajectories of a vehicules .
209
+ *
210
+ * @param {string[]} ids List of vehicles ids.
211
+ * @param {RealtimeMode} mode Realtime mode.
212
+ * @param {string} generalizationLevel The generalization level to request. Can be one of '', 'gen5', 'gen10', 'gen30', 'gen100'.
213
+ * @return {Promise<Array<FullTrajectory>>} Return an array of full trajectories.
214
+ */
215
+ getFullTrajectories(ids: string[], mode: RealtimeMode, generalizationLevel: string): Promise<Array<FullTrajectory>>;
216
+ /**
217
+ * Subscribe to full_trajectory channel of a given vehicle.
218
+ *
219
+ * @param {string} id A vehicle id.
220
+ * @param {RealtimeMode} mode Realtime mode.
221
+ */
222
+ subscribeFullTrajectory(id: string, mode: RealtimeMode): void;
223
+ /**
224
+ * Unsubscribe from full_trajectory channel
225
+ *
226
+ * @param {string} id A vehicle id.
227
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
228
+ */
229
+ unsubscribeFullTrajectory(id: string, cb: Function): void;
230
+ /**
231
+ * Get the list of stops for this vehicle.
232
+ *
233
+ * @param {string} id A vehicle id.
234
+ * @return {Promise<StopSequence>} Returns a stop sequence object.
235
+ */
236
+ getStopSequence(id: string): Promise<StopSequence>;
237
+ /**
238
+ * Get a list of stops for a list of vehicles.
239
+ *
240
+ * @param {string[]} ids List of vehicles ids.
241
+ * @return {Promise<Array<StopSequence>>} Return an array of stop sequences.
242
+ */
243
+ getStopSequences(ids: string[]): Promise<Array<StopSequence>>;
244
+ /**
245
+ * Subscribe to stopsequence channel of a given vehicle.
246
+ *
247
+ * @param {string} id A vehicle id.
248
+ * @param {function(stopSequence: StopSequence)} onMessage Function called on each message of the channel.
249
+ */
250
+ subscribeStopSequence(id: string, onMessage: (arg0: stopSequence, arg1: StopSequence) => any): void;
251
+ /**
252
+ * Unsubscribe from stopsequence channel
253
+ *
254
+ * @param {string} id A vehicle id.
255
+ * @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
256
+ */
257
+ unsubscribeStopSequence(id: string, cb: Function): void;
258
+ /**
259
+ * Subscribe to healthcheck channel.
260
+ * @param {function} onMessage Callback when the subscribe to healthcheck channel succeeds.
261
+ */
262
+ subscribeHealthCheck(onMessage: Function): void;
263
+ /**
264
+ * Unsubscribe to healthcheck channel.
265
+ */
266
+ unsubscribeHealthCheck(): void;
267
+ }
268
+ //# sourceMappingURL=RealtimeAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealtimeAPI.d.ts","sourceRoot":"","sources":["../../src/api/RealtimeAPI.js"],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