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.
- package/api/RealtimeAPI.d.ts +268 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +626 -343
- package/api/RoutingAPI.d.ts +33 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/RoutingAPI.js +65 -15
- package/api/StopsAPI.d.ts +36 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/StopsAPI.js +70 -12
- package/api/index.d.ts +5 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +10 -3
- package/api/typedefs.d.ts +105 -0
- package/api/typedefs.d.ts.map +1 -0
- package/api/typedefs.js +72 -0
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/HttpAPI.js +82 -30
- package/common/api/WebSocketAPI.d.ts +95 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.js +313 -168
- package/common/controls/Control.d.ts +74 -0
- package/common/controls/Control.d.ts.map +1 -0
- package/common/controls/Control.js +167 -78
- package/common/index.d.ts +3 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +18 -2
- package/common/layers/Layer.d.ts +80 -0
- package/common/layers/Layer.d.ts.map +1 -0
- package/common/layers/Layer.js +251 -134
- package/common/mixins/CopyrightMixin.d.ts +22 -0
- package/common/mixins/CopyrightMixin.d.ts.map +1 -0
- package/common/mixins/CopyrightMixin.js +70 -22
- package/common/mixins/MapboxLayerMixin.d.ts +27 -0
- package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
- package/common/mixins/MapboxLayerMixin.js +240 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +698 -429
- package/common/mixins/StopFinderMixin.d.ts +40 -0
- package/common/mixins/StopFinderMixin.d.ts.map +1 -0
- package/common/mixins/StopFinderMixin.js +195 -107
- package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.js +222 -121
- package/common/styles/index.d.ts +5 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/index.js +24 -4
- package/common/styles/realtimeDefaultStyle.d.ts +15 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +236 -190
- package/common/styles/realtimeDelayStyle.d.ts +11 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +25 -7
- package/common/styles/realtimeSimpleStyle.d.ts +3 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +23 -17
- package/common/typedefs.d.ts +50 -0
- package/common/typedefs.d.ts.map +1 -0
- package/common/typedefs.js +21 -0
- package/common/utils/cleanStopTime.d.ts +7 -0
- package/common/utils/cleanStopTime.d.ts.map +1 -0
- package/common/utils/cleanStopTime.js +28 -17
- package/common/utils/compareDepartures.d.ts +9 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/compareDepartures.js +34 -22
- package/common/utils/createCanvas.d.ts +9 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +28 -16
- package/common/utils/createTrackerFilters.d.ts +12 -0
- package/common/utils/createTrackerFilters.d.ts.map +1 -0
- package/common/utils/createTrackerFilters.js +75 -54
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +15 -13
- package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.js +24 -17
- package/common/utils/getMapboxRender.d.ts +5 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +77 -0
- package/common/utils/getMaplibreRender.d.ts +5 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +38 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.js +11 -2
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.js +20 -10
- package/common/utils/getVehiclePosition.d.ts +14 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.js +63 -39
- package/common/utils/index.d.ts +12 -0
- package/common/utils/index.d.ts.map +1 -0
- package/common/utils/index.js +37 -9
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/removeDuplicate.js +29 -7
- package/common/utils/renderTrajectories.d.ts +20 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/renderTrajectories.js +111 -78
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +21 -17
- package/common/utils/timeUtils.d.ts +5 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/timeUtils.js +47 -18
- package/common/utils/trackerConfig.d.ts +24 -0
- package/common/utils/trackerConfig.d.ts.map +1 -0
- package/common/utils/trackerConfig.js +171 -118
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/iife.js +7 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +10 -7
- package/mapbox/controls/CopyrightControl.d.ts +32 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/mapbox/controls/CopyrightControl.js +72 -28
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/controls/index.js +6 -1
- package/mapbox/index.d.ts +5 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/index.js +20 -4
- package/mapbox/layers/Layer.d.ts +47 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/Layer.js +137 -54
- package/mapbox/layers/RealtimeLayer.d.ts +118 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.js +310 -183
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/layers/index.js +7 -2
- package/mapbox/utils.d.ts +8 -0
- package/mapbox/utils.d.ts.map +1 -0
- package/mapbox/utils.js +54 -29
- package/mbt.js +2052 -2109
- package/mbt.js.map +3 -3
- package/mbt.min.js +18 -18
- package/mbt.min.js.map +3 -3
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.js +89 -41
- package/ol/controls/RoutingControl.d.ts +180 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/RoutingControl.js +666 -371
- package/ol/controls/StopFinderControl.d.ts +32 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/ol/controls/StopFinderControl.js +59 -10
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/controls/index.js +9 -3
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/index.js +21 -5
- package/ol/layers/Layer.d.ts +49 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +178 -81
- package/ol/layers/MapboxLayer.d.ts +42 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.js +131 -198
- package/ol/layers/MapboxStyleLayer.d.ts +146 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +382 -186
- package/ol/layers/MaplibreLayer.d.ts +27 -0
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +67 -138
- package/ol/layers/RealtimeLayer.d.ts +119 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +327 -184
- package/ol/layers/RoutingLayer.d.ts +24 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.js +111 -56
- package/ol/layers/VectorLayer.d.ts +23 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.js +71 -21
- package/ol/layers/WMSLayer.d.ts +38 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.js +105 -37
- package/ol/layers/index.d.ts +9 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/layers/index.js +19 -8
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.js +32 -28
- package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.js +44 -40
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/ol/styles/index.js +7 -2
- package/package.json +14 -36
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/setupTests.js +15 -0
- package/types/index.d.ts +7 -6
- package/types/routing.d.ts +25 -25
- package/types/stops.d.ts +19 -19
- package/api/RealtimeAPI.test.js +0 -67
- package/api/RoutingAPI.test.js +0 -25
- package/api/StopsAPI.test.js +0 -22
- package/common/api/HttpAPI.test.js +0 -50
- package/common/api/WebSocketAPI.test.js +0 -311
- package/common/controls/Control.test.js +0 -87
- package/common/layers/Layer.test.js +0 -134
- package/common/mixins/UserInteractionsLayerMixin.test.js +0 -199
- package/common/utils/createTrackerFilters.test.js +0 -79
- package/common/utils/getMapboxMapCopyrights.test.js +0 -40
- package/common/utils/removeDuplicate.test.js +0 -19
- package/common/utils/timeUtils.test.js +0 -10
- package/common/utils/trackerConfig.test.js +0 -23
- package/mapbox/layers/Layer.test.js +0 -182
- package/mapbox/layers/RealtimeLayer.test.js +0 -10
- package/ol/controls/CopyrightControl.test.js +0 -165
- package/ol/controls/RoutingControl.test.js +0 -146
- package/ol/controls/StopFinderControl.test.js +0 -48
- package/ol/layers/Layer.test.js +0 -175
- package/ol/layers/MapboxLayer.test.js +0 -160
- package/ol/layers/MapboxStyleLayer.test.js +0 -226
- package/ol/layers/RealtimeLayer.test.js +0 -67
- package/ol/layers/RoutingLayer.test.js +0 -39
- package/ol/layers/VectorLayer.test.js +0 -76
- 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"],"names":[],"mappings":";;;4BAYU,YAAY;;;;;;;;;;2BAJT,MAAM;AAYnB;;;;;;;;;;;;;;;GAeG;AACH;IACE;;;;;;;;;OASG;IACH,sBAPW,MAAO,MAAM,EA2BvB;IAjBC,cAAc;IACd,6BAAgC;IAEhC,cAAc;IACd,+BAAkC;IAElC,cAAc;IACd,wBAAyB;IAEzB,cAAc;IACd,eAAoB;IAEpB,cAAc;IACd,YAAkC;IAsHpC;;;OAGG;IACH,eAuBC;IA3ID,qCAoFC;IAED,aASC;IAED;;OAEG;IACH,cAEC;IAED;;OAEG;IAEH,cAEC;IAwBG,cAAc;IACd,2BAEuB;IAI3B;;;OAGG;IACH,gBAWC;IANG,cAAc;IACd,yBAGC;IAIL;;;;;;;;OAQG;IACH,kBAEC;IAED;;;;;;;OAOG;IACH,oBAcC;IAED;;;;;;;OAOG;IACH,yBAsDC;IAED;;;;;;OAMG;IACH,+BAJW,MAAM,qEAEc,SAAS,EAAE,gBA+BzC;IAED;;;OAGG;IACH,0CAKC;IAED;;;;OAIG;IACH,gDAIC;IAED;;;OAGG;IACH,2CAEC;IAED;;;;;;OAMG;IACH,gBAJW,MAAM,QACN,YAAY,GACX,QAAQ,OAAO,CAAC,CAiB3B;IAED;;;;;OAKG;IACH,kBAHW,YAAY,GACX,QAAQ,MAAM,OAAO,CAAC,CAAC,CAsBlC;IATO,cAAc;IACd,6BAEM;IAQd;;;;;;OAMG;IACH,wBAHW,YAAY,mCACM,OAAO,gBASnC;IAED;;;OAGG;IACH,wCAGC;IAED;;;;OAIG;IACH,wDAFgC,iBAAiB,gBAoBhD;IAED;;;OAGG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,0BAJW,YAAY,sCACS,kBAAkB,kBACvC,OAAO,QAUjB;IAED;;;OAGG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,+BAJW,YAAY,oCACO;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,kBACvC,OAAO,QAUjB;IAED;;;OAGG;IACH,+CAEC;IAED;;;;;;;OAOG;IACH,sBALW,MAAM,QACN,YAAY,uBACZ,MAAM,GACL,QAAQ,cAAc,CAAC,CAuBlC;IAED;;;;;;;OAOG;IACH,yBALW,MAAM,EAAE,QACR,YAAY,uBACZ,MAAM,GACL,QAAQ,MAAM,cAAc,CAAC,CAAC,CAOzC;IAED;;;;;OAKG;IACH,4BAHW,MAAM,QACN,YAAY,QAgBtB;IAED;;;;;OAKG;IACH,8BAHW,MAAM,sBAKhB;IAED;;;;;OAKG;IACH,oBAHW,MAAM,GACL,QAAQ,YAAY,CAAC,CAyBhC;IAED;;;;;OAKG;IACH,sBAHW,MAAM,EAAE,GACP,QAAQ,MAAM,YAAY,CAAC,CAAC,CAKvC;IAED;;;;;OAKG;IACH,0BAHW,MAAM,wCACiB,YAAY,gBAuB7C;IAED;;;;;OAKG;IACH,4BAHW,MAAM,sBAKhB;IAED;;;OAGG;IACH,gDAGC;IAED;;OAEG;IACH,+BAEC;CACF"}
|