mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
[Leaflet] Making an L.Control class that extends L.Class so you can extend Control (#13954)
* Need to make static Class functions available on Control so you can extend Control class * The latest leaflet 0.7.x added the PositionString type to the L namespace * Specifying Control to only be a class that extends Class * Synching back the mapzen changes
This commit is contained in:
Vendored
+1
-1
@@ -963,7 +963,7 @@ declare namespace L {
|
||||
position?: ControlPosition;
|
||||
}
|
||||
|
||||
export interface Control {
|
||||
export class Control extends Class {
|
||||
getPosition(): ControlPosition;
|
||||
setPosition(position: ControlPosition): this;
|
||||
getContainer(): HTMLElement;
|
||||
|
||||
@@ -390,3 +390,10 @@ class MyDivIcon extends L.DivIcon {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
let myControlClass = L.Control.extend({});
|
||||
let myControl = new myControlClass();
|
||||
|
||||
L.Control.include({});
|
||||
L.Control.mergeOptions({});
|
||||
L.Control.addInitHook(() => {});
|
||||
|
||||
Reference in New Issue
Block a user