diff --git a/types/leaflet-polylinemeasure/index.d.ts b/types/leaflet-polylinemeasure/index.d.ts new file mode 100644 index 0000000000..ec9e160702 --- /dev/null +++ b/types/leaflet-polylinemeasure/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for leaflet.polylinemeasure 1.0 +// Project: https://github.com/ppete2/Leaflet.PolylineMeasure#readme +// Definitions by: Rinat Sultanov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module L { + namespace Control { + + export interface PolylineMeasure extends L.Control { + new (options?: PolylineMeasureOptions): any; + } + + export interface PolylineMeasureOptions { + position?: string; + unit?: string; + measureControlTitleOn?: string; + measureControlTitleOff?: string; + measureControlLabel?: string; + measureControlClasses?: any[]; + backgroundColor?: string; + cursor?: string; + clearMeasurementsOnStop?: boolean; + showMeasurementsClearControl?: boolean; + clearControlTitle?: string; + clearControlLabel?: string; + clearControlClasses?: any[]; + showUnitControl?: boolean; + tempLine?: any; + fixedLine?: any; + startCircle?: any; + intermedCircle?: any; + currentCircle?: any; + endCircle?: any; + } + } + + export namespace control { + export function polylineMeasure (options?: Control.PolylineMeasureOptions): Control.PolylineMeasure; + } +} diff --git a/types/leaflet-polylinemeasure/leaflet-polylinemeasure-tests.ts b/types/leaflet-polylinemeasure/leaflet-polylinemeasure-tests.ts new file mode 100644 index 0000000000..4b3aeeb440 --- /dev/null +++ b/types/leaflet-polylinemeasure/leaflet-polylinemeasure-tests.ts @@ -0,0 +1,12 @@ +import * as L from 'leaflet'; +import 'leaflet.polylinemeasure'; + + +let map = L.map('map', {center: L.latLng(43.24209, 76.87743), zoom:15}); + +L.tileLayer("http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png", { + subdomains:['a', 'b', 'c'], + attribution: '© OpenStreetMap' +}).addTo(map); + +L.control.polylineMeasure().addTo(map); diff --git a/types/leaflet-polylinemeasure/tsconfig.json b/types/leaflet-polylinemeasure/tsconfig.json new file mode 100644 index 0000000000..3eeed134d0 --- /dev/null +++ b/types/leaflet-polylinemeasure/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "DOM" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "leaflet-polylinemeasure-tests.ts" + ] +} diff --git a/types/leaflet-polylinemeasure/tslint.json b/types/leaflet-polylinemeasure/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/leaflet-polylinemeasure/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }