mobility-toolbox-js 2.0.0-beta.32 → 2.0.0-beta.33
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/RoutingAPI.d.ts +33 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/StopsAPI.d.ts +36 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/index.d.ts +5 -0
- package/api/index.d.ts.map +1 -0
- package/api/typedefs.d.ts +105 -0
- package/api/typedefs.d.ts.map +1 -0
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.d.ts +95 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/controls/Control.d.ts +74 -0
- package/common/controls/Control.d.ts.map +1 -0
- package/common/{index.js → index.d.ts} +1 -0
- package/common/index.d.ts.map +1 -0
- package/common/layers/Layer.d.ts +80 -0
- package/common/layers/Layer.d.ts.map +1 -0
- package/common/mixins/CopyrightMixin.d.ts +22 -0
- package/common/mixins/CopyrightMixin.d.ts.map +1 -0
- package/common/mixins/MapboxLayerMixin.d.ts +27 -0
- package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/StopFinderMixin.d.ts +40 -0
- package/common/mixins/StopFinderMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/styles/{index.js → index.d.ts} +1 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.d.ts +15 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.d.ts +11 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.d.ts +3 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/typedefs.d.ts +50 -0
- package/common/typedefs.d.ts.map +1 -0
- package/common/utils/cleanStopTime.d.ts +7 -0
- package/common/utils/cleanStopTime.d.ts.map +1 -0
- package/common/utils/compareDepartures.d.ts +9 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/createCanvas.d.ts +9 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createTrackerFilters.d.ts +12 -0
- package/common/utils/createTrackerFilters.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxRender.d.ts +5 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.d.ts +5 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.d.ts +14 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/{index.js → index.d.ts} +3 -0
- package/common/utils/index.d.ts.map +1 -0
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/renderTrajectories.d.ts +20 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/timeUtils.d.ts +5 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/trackerConfig.d.ts +24 -0
- package/common/utils/trackerConfig.d.ts.map +1 -0
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/mapbox/controls/CopyrightControl.d.ts +32 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/mapbox/controls/{index.js → index.d.ts} +1 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/{index.js → index.d.ts} +1 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/layers/Layer.d.ts +47 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.d.ts +118 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/{index.js → index.d.ts} +1 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/utils.d.ts +8 -0
- package/mapbox/utils.d.ts.map +1 -0
- package/mbt.js +2049 -2106
- 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/RoutingControl.d.ts +180 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/StopFinderControl.d.ts +32 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/ol/controls/{index.js → index.d.ts} +1 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/{index.js → index.d.ts} +1 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/layers/Layer.d.ts +49 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.d.ts +42 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.d.ts +146 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.d.ts +27 -0
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.d.ts +119 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.d.ts +24 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.d.ts +23 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.d.ts +38 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/{index.js → index.d.ts} +1 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/{index.js → index.d.ts} +1 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/package.json +14 -36
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -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.js +0 -357
- package/api/RealtimeAPI.test.js +0 -67
- package/api/RoutingAPI.js +0 -15
- package/api/RoutingAPI.test.js +0 -25
- package/api/StopsAPI.js +0 -12
- package/api/StopsAPI.test.js +0 -22
- package/api/index.js +0 -3
- package/api/typedefs.js +0 -0
- package/common/api/HttpAPI.js +0 -32
- package/common/api/HttpAPI.test.js +0 -50
- package/common/api/WebSocketAPI.js +0 -175
- package/common/api/WebSocketAPI.test.js +0 -311
- package/common/controls/Control.js +0 -81
- package/common/controls/Control.test.js +0 -87
- package/common/layers/Layer.js +0 -140
- package/common/layers/Layer.test.js +0 -134
- package/common/mixins/CopyrightMixin.js +0 -24
- package/common/mixins/RealtimeLayerMixin.js +0 -436
- package/common/mixins/StopFinderMixin.js +0 -110
- package/common/mixins/UserInteractionsLayerMixin.js +0 -124
- package/common/mixins/UserInteractionsLayerMixin.test.js +0 -199
- package/common/styles/realtimeDefaultStyle.js +0 -202
- package/common/styles/realtimeDelayStyle.js +0 -8
- package/common/styles/realtimeSimpleStyle.js +0 -18
- package/common/typedefs.js +0 -0
- package/common/utils/cleanStopTime.js +0 -19
- package/common/utils/compareDepartures.js +0 -25
- package/common/utils/createCanvas.js +0 -17
- package/common/utils/createTrackerFilters.js +0 -56
- package/common/utils/createTrackerFilters.test.js +0 -79
- package/common/utils/getLayersAsFlatArray.js +0 -14
- package/common/utils/getMapboxMapCopyrights.js +0 -19
- package/common/utils/getMapboxMapCopyrights.test.js +0 -40
- package/common/utils/getRealtimeModeSuffix.js +0 -2
- package/common/utils/getUrlWithParams.js +0 -11
- package/common/utils/getVehiclePosition.js +0 -42
- package/common/utils/removeDuplicate.js +0 -8
- package/common/utils/removeDuplicate.test.js +0 -19
- package/common/utils/renderTrajectories.js +0 -86
- package/common/utils/sortByDelay.js +0 -18
- package/common/utils/timeUtils.js +0 -20
- package/common/utils/timeUtils.test.js +0 -10
- package/common/utils/trackerConfig.js +0 -129
- package/common/utils/trackerConfig.test.js +0 -23
- package/index.js +0 -8
- package/mapbox/controls/CopyrightControl.js +0 -29
- package/mapbox/layers/Layer.js +0 -56
- package/mapbox/layers/Layer.test.js +0 -182
- package/mapbox/layers/RealtimeLayer.js +0 -185
- package/mapbox/layers/RealtimeLayer.test.js +0 -10
- package/mapbox/utils.js +0 -32
- package/ol/controls/CopyrightControl.js +0 -42
- package/ol/controls/CopyrightControl.test.js +0 -165
- package/ol/controls/RoutingControl.js +0 -388
- package/ol/controls/RoutingControl.test.js +0 -146
- package/ol/controls/StopFinderControl.js +0 -10
- package/ol/controls/StopFinderControl.test.js +0 -48
- package/ol/layers/Layer.js +0 -83
- package/ol/layers/Layer.test.js +0 -175
- package/ol/layers/MapboxLayer.js +0 -204
- package/ol/layers/MapboxLayer.test.js +0 -160
- package/ol/layers/MapboxStyleLayer.js +0 -187
- package/ol/layers/MapboxStyleLayer.test.js +0 -226
- package/ol/layers/MaplibreLayer.js +0 -140
- package/ol/layers/RealtimeLayer.js +0 -187
- package/ol/layers/RealtimeLayer.test.js +0 -67
- package/ol/layers/RoutingLayer.js +0 -61
- package/ol/layers/RoutingLayer.test.js +0 -39
- package/ol/layers/VectorLayer.js +0 -22
- package/ol/layers/VectorLayer.test.js +0 -76
- package/ol/layers/WMSLayer.js +0 -38
- package/ol/layers/WMSLayer.test.js +0 -57
- package/ol/styles/fullTrajectoryDelayStyle.js +0 -31
- package/ol/styles/fullTrajectoryStyle.js +0 -42
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default RoutingLayer;
|
|
2
|
+
/**
|
|
3
|
+
* A class use to display vector data.
|
|
4
|
+
*
|
|
5
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
6
|
+
* @extends {Layer}
|
|
7
|
+
*/
|
|
8
|
+
declare class RoutingLayer extends Layer {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor.
|
|
11
|
+
* @param {Object} [options]
|
|
12
|
+
* @param {ol/style/Style~StyleLike} [options.style] Style to be used for routes, uses (ol/StyleLike) [https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html#~StyleLike] instances
|
|
13
|
+
*/
|
|
14
|
+
constructor(options?: any);
|
|
15
|
+
olLayer: any;
|
|
16
|
+
/**
|
|
17
|
+
* Create a copy of the RoutingLayer.
|
|
18
|
+
* @param {Object} newOptions Options to override
|
|
19
|
+
* @return {RoutingLayer} A RoutingLayer
|
|
20
|
+
*/
|
|
21
|
+
clone(newOptions: any): RoutingLayer;
|
|
22
|
+
}
|
|
23
|
+
import Layer from "./Layer";
|
|
24
|
+
//# sourceMappingURL=RoutingLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutingLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RoutingLayer.js"],"names":[],"mappings":";AA8DA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,2BASC;IANC,aAKI;IAGN;;;;OAIG;IACH,wBAFY,YAAY,CAIvB;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default VectorLayer;
|
|
2
|
+
/**
|
|
3
|
+
* A class use to display vector data.
|
|
4
|
+
*
|
|
5
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
6
|
+
* @extends {Layer}
|
|
7
|
+
*/
|
|
8
|
+
declare class VectorLayer extends Layer {
|
|
9
|
+
/**
|
|
10
|
+
* Request feature information for a given coordinate.
|
|
11
|
+
* @param {ol/coordinate~Coordinate} coordinate the coordinate to request the information at.
|
|
12
|
+
* @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
|
|
13
|
+
*/
|
|
14
|
+
getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a copy of the VectorLayer.
|
|
17
|
+
* @param {Object} newOptions Options to override
|
|
18
|
+
* @return {VectorLayer} A VectorLayer
|
|
19
|
+
*/
|
|
20
|
+
clone(newOptions: any): VectorLayer;
|
|
21
|
+
}
|
|
22
|
+
import Layer from "./Layer";
|
|
23
|
+
//# sourceMappingURL=VectorLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/VectorLayer.js"],"names":[],"mappings":";AAEA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAkB/B;IAED;;;;OAIG;IACH,wBAFY,WAAW,CAItB;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export default WMSLayer;
|
|
2
|
+
/**
|
|
3
|
+
* Class use to display a WMS layer.
|
|
4
|
+
*
|
|
5
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
6
|
+
* @extends {Layer}
|
|
7
|
+
*/
|
|
8
|
+
declare class WMSLayer extends Layer {
|
|
9
|
+
/**
|
|
10
|
+
* @override
|
|
11
|
+
*/
|
|
12
|
+
constructor(options?: {});
|
|
13
|
+
/** @ignore */
|
|
14
|
+
abortController: AbortController;
|
|
15
|
+
/** @ignore */
|
|
16
|
+
format: GeoJSON;
|
|
17
|
+
/**
|
|
18
|
+
* Get features infos' Url.
|
|
19
|
+
* @param {ol/coordinate~Coordinate} coord
|
|
20
|
+
* @return {ol/layer/Layer~Layer}
|
|
21
|
+
*/
|
|
22
|
+
getFeatureInfoUrl(coord: any): ol;
|
|
23
|
+
/**
|
|
24
|
+
* Request feature information for a given coordinate.
|
|
25
|
+
* @param {ol/coordinate~Coordinate} coordinate to request the information at.
|
|
26
|
+
* @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
|
|
27
|
+
*/
|
|
28
|
+
getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a copy of the WMSLayer.
|
|
31
|
+
* @param {Object} newOptions Options to override
|
|
32
|
+
* @return {WMSLayer} A WMSLayer
|
|
33
|
+
*/
|
|
34
|
+
clone(newOptions: any): WMSLayer;
|
|
35
|
+
}
|
|
36
|
+
import Layer from "./Layer";
|
|
37
|
+
import GeoJSON from "ol/format/GeoJSON";
|
|
38
|
+
//# sourceMappingURL=WMSLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WMSLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/WMSLayer.js"],"names":[],"mappings":";AAGA;;;;;GAKG;AACH;IACE;;OAEG;IACH,0BAOC;IAJC,cAAc;IACd,iCAA4C;IAC5C,cAAc;IACd,gBAA2B;IAG7B;;;;OAIG;IACH,kCAaC;IAED;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAsB/B;IAED;;;;OAIG;IACH,wBAFY,QAAQ,CAInB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullTrajectoryDelayStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryDelayStyle.js"],"names":[],"mappings":";AAgCA,qDAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullTrajectoryStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryStyle.js"],"names":[],"mappings":";AAiBA,2FAgCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/index.js"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "mobility-toolbox-js",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
|
|
5
|
-
"version": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.33",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|
|
@@ -33,7 +33,12 @@
|
|
|
33
33
|
"@babel/preset-react": "7.16.7",
|
|
34
34
|
"@commitlint/cli": "17.0.2",
|
|
35
35
|
"@commitlint/config-conventional": "17.0.2",
|
|
36
|
+
"@types/arcgis-js-api": "^4.24.0",
|
|
37
|
+
"@types/arcgis-rest-api": "^10.4.5",
|
|
36
38
|
"@types/geojson": "^7946.0.8",
|
|
39
|
+
"@types/topojson": "^3.2.3",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
41
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
37
42
|
"autoprefixer": "9.7.6",
|
|
38
43
|
"cypress": "9.4.1",
|
|
39
44
|
"deepmerge": "4.2.2",
|
|
@@ -43,8 +48,10 @@
|
|
|
43
48
|
"esdoc-ecmascript-proposal-plugin": "1.0.0",
|
|
44
49
|
"esdoc-publish-html-plugin": "1.1.2",
|
|
45
50
|
"esdoc-standard-plugin": "1.0.0",
|
|
51
|
+
"esdoc-typescript-plugin": "^1.0.1",
|
|
46
52
|
"eslint": "8.8.0",
|
|
47
53
|
"eslint-config-airbnb": "19.0.4",
|
|
54
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
48
55
|
"eslint-config-prettier": "8.3.0",
|
|
49
56
|
"eslint-plugin-cypress": "2.12.1",
|
|
50
57
|
"eslint-plugin-import": "2.25.4",
|
|
@@ -76,11 +83,12 @@
|
|
|
76
83
|
"stylelint": "14.3.0",
|
|
77
84
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
78
85
|
"stylelint-config-standard": "24.0.0",
|
|
79
|
-
"stylelint-scss": "4.1.0"
|
|
86
|
+
"stylelint-scss": "4.1.0",
|
|
87
|
+
"typescript": "^4.7.4"
|
|
80
88
|
},
|
|
81
89
|
"scripts": {
|
|
82
90
|
"apidoc": "esdoc && cp apidoc/index.json doc/src/components/Esdoc",
|
|
83
|
-
"build": "rm -rf build && yarn esbuild && cp README.md build/ && cp package.json build/ && cp -R src/types build/",
|
|
91
|
+
"build": "rm -rf build && yarn tsc && yarn esbuild:iife && cp README.md build/ && cp package.json build/ && cp -R src/types build/",
|
|
84
92
|
"coverage": "yarn test --watchAll=false --coverage --coverageDirectory=coverage",
|
|
85
93
|
"cy:open": "cypress open",
|
|
86
94
|
"cy:test": "start-server-and-test dev http://localhost:3000 'cypress run --browser chrome'",
|
|
@@ -91,7 +99,7 @@
|
|
|
91
99
|
"dev:examples": "cd doc && yarn dev",
|
|
92
100
|
"doc": "yarn apidoc && cd doc && yarn install --frozen-lockfile && yarn build",
|
|
93
101
|
"esbuild": "yarn esbuild:all && yarn esbuild:iife",
|
|
94
|
-
"esbuild:all": "esbuild src/index.js src/**/*.js src/**/**/*.js --target=chrome100 --outdir=build/ --loader:.js=jsx",
|
|
102
|
+
"esbuild:all": "esbuild src/index.js src/**/*.js src/**/*.ts src/**/**/*.js src/**/**/*.ts --target=chrome100 --outdir=build/ --loader:.js=jsx",
|
|
95
103
|
"esbuild:iife": "yarn esbuild:iife:unminify && yarn esbuild:iife:minify",
|
|
96
104
|
"esbuild:iife:base": "esbuild src/iife.js --bundle --sourcemap --target=chrome100",
|
|
97
105
|
"esbuild:iife:minify": "yarn esbuild:iife:base --minify --outfile=build/mbt.min.js",
|
|
@@ -100,7 +108,7 @@
|
|
|
100
108
|
"lib": "REACT_APP_LIB_MODE=1 webpack --mode production",
|
|
101
109
|
"lib:dev": "REACT_APP_LIB_MODE=1 webpack --mode development",
|
|
102
110
|
"link2": "cmdToAdd=$(node ./scripts/read-pkg-json.js add) && $cmdToAdd && yarn build && cmdToRemove=$(node ./scripts/read-pkg-json.js remove) && $cmdToRemove && cd build && yarn link",
|
|
103
|
-
"lint": "eslint
|
|
111
|
+
"lint": "eslint src/**/*.js src/**/*.ts && stylelint src/**/*.css src/**/*.scss --allow-empty-input",
|
|
104
112
|
"publish:beta": "HUSKY=0 yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run build && cd build && HUSKY=0 yarn publish --tag beta && git push --tags ",
|
|
105
113
|
"publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
|
|
106
114
|
"publish:public:dryrun": "yarn release --dry-run",
|
|
@@ -109,6 +117,7 @@
|
|
|
109
117
|
"start:examples": "cd doc && yarn build && yarn start",
|
|
110
118
|
"test": "TZ='UTC' jest",
|
|
111
119
|
"test:watch": "yarn test --watchAll",
|
|
120
|
+
"tsc": "tsc",
|
|
112
121
|
"types:backend": "openapi-typescript https://developer.geops.io/swagger/routing.json --output types/routing.d.ts && openapi-typescript https://developer.geops.io/swagger/stops.json --output types/stops.d.ts"
|
|
113
122
|
},
|
|
114
123
|
"browserslist": {
|
|
@@ -124,37 +133,6 @@
|
|
|
124
133
|
"last 1 ie version"
|
|
125
134
|
]
|
|
126
135
|
},
|
|
127
|
-
"eslintConfig": {
|
|
128
|
-
"env": {
|
|
129
|
-
"cypress/globals": true,
|
|
130
|
-
"node": true,
|
|
131
|
-
"browser": true,
|
|
132
|
-
"es6": true,
|
|
133
|
-
"jest": true
|
|
134
|
-
},
|
|
135
|
-
"parser": "@babel/eslint-parser",
|
|
136
|
-
"extends": [
|
|
137
|
-
"airbnb",
|
|
138
|
-
"prettier"
|
|
139
|
-
],
|
|
140
|
-
"plugins": [
|
|
141
|
-
"cypress",
|
|
142
|
-
"prettier"
|
|
143
|
-
],
|
|
144
|
-
"rules": {
|
|
145
|
-
"arrow-body-style": 0,
|
|
146
|
-
"react/jsx-filename-extension": [
|
|
147
|
-
1,
|
|
148
|
-
{
|
|
149
|
-
"extensions": [
|
|
150
|
-
".js",
|
|
151
|
-
".jsx"
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
"prettier/prettier": "error"
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
136
|
"keywords": [
|
|
159
137
|
"mobility",
|
|
160
138
|
"toolbox"
|
package/setupTests.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../src/setupTests.js"],"names":[],"mappings":""}
|
package/types/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Paths as Routing } from './routing';
|
|
2
|
+
import { Paths as Stops } from './stops';
|
|
3
|
+
|
|
3
4
|
export * from './realtime';
|
|
4
5
|
|
|
5
|
-
export type RoutingParameters =
|
|
6
|
-
export type RoutingResponse =
|
|
6
|
+
export type RoutingParameters = Routing['/']['get']['parameters']['query'];
|
|
7
|
+
export type RoutingResponse = Routing['/']['get']['responses']['200']['schema'];
|
|
7
8
|
|
|
8
|
-
export type StopsParameters =
|
|
9
|
-
export type StopsResponse =
|
|
9
|
+
export type StopsParameters = Stops['/']['get']['parameters']['query'];
|
|
10
|
+
export type StopsResponse = Stops['/']['get']['responses']['200']['schema'];
|
package/types/routing.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface Paths {
|
|
7
|
+
'/': {
|
|
8
8
|
/** Returns a route as GeoJSON */
|
|
9
9
|
get: {
|
|
10
10
|
parameters: {
|
|
@@ -54,31 +54,31 @@ export interface paths {
|
|
|
54
54
|
via: string;
|
|
55
55
|
/** Mode of transport */
|
|
56
56
|
mot:
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
57
|
+
| 'rail'
|
|
58
|
+
| 'bus'
|
|
59
|
+
| 'coach'
|
|
60
|
+
| 'foot'
|
|
61
|
+
| 'tram'
|
|
62
|
+
| 'subway'
|
|
63
|
+
| 'gondola'
|
|
64
|
+
| 'funicular'
|
|
65
|
+
| 'ferry'
|
|
66
|
+
| 'car';
|
|
67
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?:
|
|
68
|
+
graph?: 'gen1' | 'gen2' | 'gen3' | 'gen4';
|
|
69
69
|
/** A line name that should be preferred */
|
|
70
70
|
line?: string;
|
|
71
71
|
/** Name of origin of the preferred line */
|
|
72
|
-
|
|
72
|
+
'line-from'?: string;
|
|
73
73
|
/** Name of destination of the preferred line */
|
|
74
|
-
|
|
74
|
+
'line-to'?: string;
|
|
75
75
|
/** Douglas-Peucker distance parameter for simplification. Default 0.5 in Mercator units */
|
|
76
76
|
simplify?: number;
|
|
77
77
|
/**
|
|
78
78
|
* Maximum allowed ratio of hops to skip if not found. Only non-start
|
|
79
79
|
* and non-end hops are counted in ratio numerator and denominator.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
'max-skip-hop-ratio'?: number;
|
|
82
82
|
/**
|
|
83
83
|
* Whether to include intermediate hops (stations/stops) found on the
|
|
84
84
|
* route to the response. "true", "on", "yes", "y", "1" will enable
|
|
@@ -91,24 +91,24 @@ export interface paths {
|
|
|
91
91
|
* errors. "true", "on", "yes", "y", "1" will enable the
|
|
92
92
|
* fallback. Default: enabled
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
'beeline-fallback'?: string;
|
|
95
95
|
/**
|
|
96
96
|
* Search radius for candidate edges during snapping of coordinates
|
|
97
97
|
* (see "Note on coordinates" at the top) Default: -1.0
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
'coord-radius'?: number;
|
|
100
100
|
/**
|
|
101
101
|
* Distance punishment factor for edge snapping of coordinates (see
|
|
102
102
|
* "Note on coordinates" at the top). Large: prefer close edge. Small:
|
|
103
103
|
* prefer short total route. Negative value: like worst edge
|
|
104
104
|
* category. Default: -1.0
|
|
105
105
|
*/
|
|
106
|
-
|
|
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
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
'way-ids'?: string;
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
responses: {
|
|
@@ -131,7 +131,7 @@ export interface paths {
|
|
|
131
131
|
*/
|
|
132
132
|
coordinates?: number[][];
|
|
133
133
|
/** @enum {string} */
|
|
134
|
-
type?:
|
|
134
|
+
type?: 'LineString';
|
|
135
135
|
};
|
|
136
136
|
properties?: {
|
|
137
137
|
lines?: {
|
|
@@ -172,7 +172,7 @@ export interface paths {
|
|
|
172
172
|
longitude?: number;
|
|
173
173
|
};
|
|
174
174
|
/** @enum {string} */
|
|
175
|
-
type?:
|
|
175
|
+
type?: 'Feature';
|
|
176
176
|
};
|
|
177
177
|
properties?: {
|
|
178
178
|
lines?: {
|
|
@@ -193,7 +193,7 @@ export interface paths {
|
|
|
193
193
|
skippedVias?: string[];
|
|
194
194
|
};
|
|
195
195
|
/** @enum {string} */
|
|
196
|
-
type?:
|
|
196
|
+
type?: 'FeatureCollection';
|
|
197
197
|
};
|
|
198
198
|
};
|
|
199
199
|
};
|
|
@@ -201,6 +201,6 @@ export interface paths {
|
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
export interface
|
|
204
|
+
export interface Operations {}
|
|
205
205
|
|
|
206
|
-
export interface
|
|
206
|
+
export interface External {}
|
package/types/stops.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface Paths {
|
|
7
|
+
'/': {
|
|
8
8
|
/** Returns a stop (or multiple) as GeoJSON FeatureCollection */
|
|
9
9
|
get: {
|
|
10
10
|
parameters: {
|
|
@@ -17,27 +17,27 @@ export interface paths {
|
|
|
17
17
|
* comma seperated list, order chooses which agency will be preferred
|
|
18
18
|
* as ident_source (for id and code fields)
|
|
19
19
|
*/
|
|
20
|
-
prefagencies?:
|
|
20
|
+
prefagencies?: 'sbb' | 'db';
|
|
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
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
26
|
+
| 'bus'
|
|
27
|
+
| 'ferry'
|
|
28
|
+
| 'gondola'
|
|
29
|
+
| 'tram'
|
|
30
|
+
| 'rail'
|
|
31
|
+
| 'funicular'
|
|
32
|
+
| 'cable_car'
|
|
33
|
+
| 'subway';
|
|
34
34
|
/**
|
|
35
35
|
* left,bottom,right,up coordinates in WGS84 wherein the
|
|
36
36
|
* station should lie
|
|
37
37
|
*/
|
|
38
38
|
bbox?: string;
|
|
39
39
|
/** which field to look up, default: all of them */
|
|
40
|
-
field?:
|
|
40
|
+
field?: 'id' | 'name' | 'coords';
|
|
41
41
|
/**
|
|
42
42
|
* Coordinates in WGS84 (in lat,lon order) used to rank stops close to
|
|
43
43
|
* this position higher
|
|
@@ -50,10 +50,10 @@ export interface paths {
|
|
|
50
50
|
200: {
|
|
51
51
|
schema: {
|
|
52
52
|
/** @enum {string} */
|
|
53
|
-
type?:
|
|
53
|
+
type?: 'FeatureCollection';
|
|
54
54
|
features?: {
|
|
55
55
|
/** @enum {string} */
|
|
56
|
-
type?:
|
|
56
|
+
type?: 'Feature';
|
|
57
57
|
properties?: {
|
|
58
58
|
/** @description internal ID */
|
|
59
59
|
uid?: string;
|
|
@@ -79,7 +79,7 @@ export interface paths {
|
|
|
79
79
|
translated_names?: {
|
|
80
80
|
value?: string;
|
|
81
81
|
/** @enum {string} */
|
|
82
|
-
language?:
|
|
82
|
+
language?: 'de' | 'en' | 'fr' | 'it';
|
|
83
83
|
}[];
|
|
84
84
|
/** @description Means of transport that are available at this station */
|
|
85
85
|
mot?: {
|
|
@@ -114,7 +114,7 @@ export interface paths {
|
|
|
114
114
|
/** @description the coordinates of the stop */
|
|
115
115
|
geometry?: {
|
|
116
116
|
/** @enum {string} */
|
|
117
|
-
type?:
|
|
117
|
+
type?: 'Point';
|
|
118
118
|
/**
|
|
119
119
|
* @example [
|
|
120
120
|
* 7.439119,
|
|
@@ -130,7 +130,7 @@ export interface paths {
|
|
|
130
130
|
400: {
|
|
131
131
|
schema: {
|
|
132
132
|
/** @enum {string} */
|
|
133
|
-
error?:
|
|
133
|
+
error?: '400 Bad Request: Limit has to be an integer between 1 and 500';
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
136
|
};
|
|
@@ -138,6 +138,6 @@ export interface paths {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
export interface
|
|
141
|
+
export interface Operations {}
|
|
142
142
|
|
|
143
|
-
export interface
|
|
143
|
+
export interface External {}
|