@types/mapbox__mapbox-gl-traffic 1.0.0

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,74 @@
1
+ # Installation
2
+ > `npm install --save @types/mapbox__mapbox-gl-traffic`
3
+
4
+ # Summary
5
+ This package contains type definitions for @mapbox/mapbox-gl-traffic (https://github.com/mapbox/mapbox-gl-traffic).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-traffic.
9
+ ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-traffic/index.d.ts)
10
+ ````ts
11
+ // Type definitions for @mapbox/mapbox-gl-traffic 1.0
12
+ // Project: https://github.com/mapbox/mapbox-gl-traffic
13
+ // Definitions by: Niek van Bennekom <https://github.com/niekvb>
14
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
+
16
+ /// <reference types="mapbox-gl" />
17
+ /// <reference types="node" />
18
+
19
+ export as namespace MapboxTraffic;
20
+ export = MapboxTraffic;
21
+
22
+ declare class MapboxTraffic {
23
+ /**
24
+ * Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that allows you to hide and show
25
+ * traffic layers in your map and an optional toggle button.
26
+ *
27
+ * @param options - Options to configure the plugin.
28
+ */
29
+ constructor(options?: MapboxTraffic.Options);
30
+ _hasTraffic(): boolean;
31
+ _hideTraffic(): void;
32
+ _showTraffic(): void;
33
+ onAdd(map: mapboxgl.Map): HTMLDivElement;
34
+ onRemove(): void;
35
+ render(): void;
36
+ /**
37
+ * Toggle visibility of traffic layer.
38
+ */
39
+ toggleTraffic(): void;
40
+ }
41
+
42
+ declare namespace MapboxTraffic {
43
+ /** Options to configure the `MapboxTraffic` plugin. */
44
+ interface Options {
45
+ /**
46
+ * Show or hide traffic overlay by default.
47
+ *
48
+ * @default false
49
+ */
50
+ showTraffic?: boolean;
51
+ /**
52
+ * Show a toggle button to turn traffic on and off.
53
+ *
54
+ * @default true
55
+ */
56
+ showTrafficButton?: boolean;
57
+ /**
58
+ * The traffic source regex used to determine whether a layer displays traffic or not.
59
+ *
60
+ * @default /mapbox-traffic-v\d/
61
+ */
62
+ trafficSource?: RegExp;
63
+ }
64
+ }
65
+
66
+ ````
67
+
68
+ ### Additional Details
69
+ * Last updated: Thu, 14 Apr 2022 06:01:17 GMT
70
+ * Dependencies: [@types/mapbox-gl](https://npmjs.com/package/@types/mapbox-gl), [@types/node](https://npmjs.com/package/@types/node)
71
+ * Global values: `MapboxTraffic`
72
+
73
+ # Credits
74
+ These definitions were written by [Niek van Bennekom](https://github.com/niekvb).
@@ -0,0 +1,54 @@
1
+ // Type definitions for @mapbox/mapbox-gl-traffic 1.0
2
+ // Project: https://github.com/mapbox/mapbox-gl-traffic
3
+ // Definitions by: Niek van Bennekom <https://github.com/niekvb>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+
6
+ /// <reference types="mapbox-gl" />
7
+ /// <reference types="node" />
8
+
9
+ export as namespace MapboxTraffic;
10
+ export = MapboxTraffic;
11
+
12
+ declare class MapboxTraffic {
13
+ /**
14
+ * Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that allows you to hide and show
15
+ * traffic layers in your map and an optional toggle button.
16
+ *
17
+ * @param options - Options to configure the plugin.
18
+ */
19
+ constructor(options?: MapboxTraffic.Options);
20
+ _hasTraffic(): boolean;
21
+ _hideTraffic(): void;
22
+ _showTraffic(): void;
23
+ onAdd(map: mapboxgl.Map): HTMLDivElement;
24
+ onRemove(): void;
25
+ render(): void;
26
+ /**
27
+ * Toggle visibility of traffic layer.
28
+ */
29
+ toggleTraffic(): void;
30
+ }
31
+
32
+ declare namespace MapboxTraffic {
33
+ /** Options to configure the `MapboxTraffic` plugin. */
34
+ interface Options {
35
+ /**
36
+ * Show or hide traffic overlay by default.
37
+ *
38
+ * @default false
39
+ */
40
+ showTraffic?: boolean;
41
+ /**
42
+ * Show a toggle button to turn traffic on and off.
43
+ *
44
+ * @default true
45
+ */
46
+ showTrafficButton?: boolean;
47
+ /**
48
+ * The traffic source regex used to determine whether a layer displays traffic or not.
49
+ *
50
+ * @default /mapbox-traffic-v\d/
51
+ */
52
+ trafficSource?: RegExp;
53
+ }
54
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@types/mapbox__mapbox-gl-traffic",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript definitions for @mapbox/mapbox-gl-traffic",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-traffic",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Niek van Bennekom",
10
+ "url": "https://github.com/niekvb",
11
+ "githubUsername": "niekvb"
12
+ }
13
+ ],
14
+ "main": "",
15
+ "types": "index.d.ts",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
19
+ "directory": "types/mapbox__mapbox-gl-traffic"
20
+ },
21
+ "scripts": {},
22
+ "dependencies": {
23
+ "@types/mapbox-gl": "*",
24
+ "@types/node": "*"
25
+ },
26
+ "typesPublisherContentHash": "abcd9fc7667e376df8b84caf0fcca957e52f387a55c0fb33fa68528bbb517b9a",
27
+ "typeScriptVersion": "3.9"
28
+ }