added leaflet-draw handlers

This commit is contained in:
Yun Shi
2017-09-14 12:55:50 -04:00
parent acc37d8b9d
commit 4c389ad82c

View File

@@ -1,6 +1,8 @@
// Type definitions for leaflet-draw 0.4
// Project: https://github.com/Leaflet/Leaflet.draw
// Definitions by: Matt Guest <https://github.com/matt-guest>, Ryan Blace <https://github.com/reblace>
// Definitions by: Matt Guest <https://github.com/matt-guest>
// Ryan Blace <https://github.com/reblace>
// Yun Shi <https://github.com/YunS-Stacy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -252,6 +254,70 @@ declare module 'leaflet' {
const DELETESTART: string;
const DELETESTOP: string;
}
class Feature {
initialize(): void;
/**
* Enables this handler.
*/
enable(): void;
/**
* Add's event listeners to this handler
*/
addHooks(): void;
/**
* Removes event listeners from this handler
*/
removeHooks(): void;
/**
* Sets new options to this handler
*/
setOptions(options: DrawOptions.EditHandlerOptions): void;
}
class SimpleShape extends Feature { }
class Marker extends Feature {
constructor(
map: Map,
options?: DrawOptions.MarkerOptions
)
}
class CircleMarker extends Feature {
constructor(
map: Map,
options?: DrawOptions.MarkerOptions
)
}
class Circle extends Feature {
constructor(
map: Map,
options?: DrawOptions.CircleOptions
)
}
class Polyline extends Feature {
constructor(
map: Map,
options?: DrawOptions.PolylineOptions
)
}
class Rectangle extends Feature {
constructor(
map: Map,
options?: DrawOptions.RectangleOptions
)
}
class Polygon extends Feature {
constructor(
map: Map,
options?: DrawOptions.PolygonOptions
)
}
}
namespace DrawEvents {