diff --git a/types/leaflet.polylinemeasure/index.d.ts b/types/leaflet.polylinemeasure/index.d.ts new file mode 100644 index 0000000000..134b459ed1 --- /dev/null +++ b/types/leaflet.polylinemeasure/index.d.ts @@ -0,0 +1,41 @@ +// 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 + +import * as L from 'leaflet'; + +declare module 'leaflet' { + namespace Control { + interface PolylineMeasure extends Control { + new (options?: PolylineMeasureOptions): any; + } + + 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; + } + } + + namespace control { + 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..58a9f3ccb8 --- /dev/null +++ b/types/leaflet.polylinemeasure/leaflet.polylinemeasure-tests.ts @@ -0,0 +1,11 @@ +import * as L from 'leaflet'; +import 'leaflet.polylinemeasure'; + +const 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..b1db5e086d --- /dev/null +++ b/types/leaflet.polylinemeasure/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "DOM" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "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" }