mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add type definition for leaflet-deepzoom (#36355)
https://github.com/alfarisi/leaflet-deepzoom/
This commit is contained in:
parent
c2953f446b
commit
e37a0f98c0
28
types/leaflet-deepzoom/index.d.ts
vendored
Normal file
28
types/leaflet-deepzoom/index.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Type definitions for leaflet-deepzoom 2.0
|
||||
// Project: https://github.com/alfarisi/leaflet-deepzoom/
|
||||
// Definitions by: Håkon Løvdal <https://github.com/hlovdal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as L from 'leaflet';
|
||||
|
||||
declare module 'leaflet' {
|
||||
namespace TileLayer {
|
||||
interface DeepZoomOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
imageFormat?: string;
|
||||
tileSize?: number;
|
||||
maxZoom?: number;
|
||||
}
|
||||
|
||||
class DeepZoom extends TileLayer {
|
||||
constructor(urlTemplate: string, options?: DeepZoomOptions);
|
||||
// getTileUrl(tilePoint: Coords): string;
|
||||
}
|
||||
}
|
||||
|
||||
namespace tileLayer {
|
||||
function deepzoom(urlTemplate: string, options?: TileLayer.DeepZoomOptions): TileLayer.DeepZoom;
|
||||
}
|
||||
}
|
||||
8
types/leaflet-deepzoom/leaflet-deepzoom-tests.ts
Normal file
8
types/leaflet-deepzoom/leaflet-deepzoom-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import * as L from 'leaflet';
|
||||
import 'leaflet-deepzoom';
|
||||
|
||||
const map = L.map('image2d').setView(new L.LatLng(0, 0), 0);
|
||||
const dzLayer = L.tileLayer.deepzoom('DeepZoomImage/hubble_files/', {
|
||||
width: 2400,
|
||||
height: 3000,
|
||||
}).addTo(map);
|
||||
24
types/leaflet-deepzoom/tsconfig.json
Normal file
24
types/leaflet-deepzoom/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"leaflet-deepzoom-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/leaflet-deepzoom/tslint.json
Normal file
1
types/leaflet-deepzoom/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user