mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
added typings for mapbox-gl-leaflet (#25120)
* added typings for mapbox-gl-leaflet * fixed build errors
This commit is contained in:
committed by
Ryan Cavanaugh
parent
4f374d225e
commit
f0bf0a7cef
20
types/mapbox-gl-leaflet/index.d.ts
vendored
Normal file
20
types/mapbox-gl-leaflet/index.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Type definitions for mapbox-gl-leaflet 0.0
|
||||
// Project: https://github.com/brunob/leaflet.fullscreen
|
||||
// Definitions by: Alexey Gorshkov <https://github.com/agorshkov23>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as L from 'leaflet';
|
||||
|
||||
declare module 'leaflet' {
|
||||
class MapboxGL extends Layer {
|
||||
constructor(options: MapboxGLOptions);
|
||||
}
|
||||
|
||||
function mapboxGL(options: MapboxGLOptions): MapboxGL;
|
||||
|
||||
interface MapboxGLOptions {
|
||||
accessToken: string;
|
||||
style: string;
|
||||
}
|
||||
}
|
||||
14
types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts
Normal file
14
types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as L from 'leaflet';
|
||||
|
||||
const token = 'token';
|
||||
|
||||
const map = L.map('map').setView([38.912753, -77.032194], 15);
|
||||
L.marker([38.912753, -77.032194])
|
||||
.bindPopup("Hello <b>Leaflet GL</b>!<br>Whoa, it works!")
|
||||
.addTo(map)
|
||||
.openPopup();
|
||||
|
||||
const gl = L.mapboxGL({
|
||||
accessToken: token,
|
||||
style: 'mapbox://styles/mapbox/bright-v8'
|
||||
}).addTo(map);
|
||||
24
types/mapbox-gl-leaflet/tsconfig.json
Normal file
24
types/mapbox-gl-leaflet/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"mapbox-gl-leaflet-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/mapbox-gl-leaflet/tslint.json
Normal file
3
types/mapbox-gl-leaflet/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user