mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 21:47:35 +00:00
@types/leaflet: extracted L.DivOverlay abstract class definition (#38406)
* @types/leaflet: extracted DivOverlay abstract class definition - this prevented proper subclassing when creating Tooltip/Popup-like implementations * @types/leaflet: extracted DivOverlay abstract class definition - rollback of accidental removal of Tooltip setOpacity method * @types/leaflet: add missing ctor to L.DivOverlay
This commit is contained in:
parent
77614d5fac
commit
bc8addff53
37
types/leaflet/index.d.ts
vendored
37
types/leaflet/index.d.ts
vendored
@ -1163,6 +1163,21 @@ export interface DivOverlayOptions {
|
||||
pane?: string;
|
||||
}
|
||||
|
||||
export abstract class DivOverlay extends Layer {
|
||||
constructor(options?: DivOverlayOptions, source?: Layer);
|
||||
getLatLng(): LatLng | undefined;
|
||||
setLatLng(latlng: LatLngExpression): this;
|
||||
getContent(): Content | ((source: Layer) => Content) | undefined;
|
||||
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
||||
getElement(): HTMLElement | undefined;
|
||||
update(): void;
|
||||
isOpen(): boolean;
|
||||
bringToFront(): this;
|
||||
bringToBack(): this;
|
||||
|
||||
options: DivOverlayOptions;
|
||||
}
|
||||
|
||||
export interface PopupOptions extends DivOverlayOptions {
|
||||
maxWidth?: number;
|
||||
minWidth?: number;
|
||||
@ -1180,17 +1195,8 @@ export interface PopupOptions extends DivOverlayOptions {
|
||||
|
||||
export type Content = string | HTMLElement;
|
||||
|
||||
export class Popup extends Layer {
|
||||
export class Popup extends DivOverlay {
|
||||
constructor(options?: PopupOptions, source?: Layer);
|
||||
getLatLng(): LatLng | undefined;
|
||||
setLatLng(latlng: LatLngExpression): this;
|
||||
getContent(): Content | ((source: Layer) => Content) | undefined;
|
||||
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
||||
getElement(): HTMLElement | undefined;
|
||||
update(): void;
|
||||
isOpen(): boolean;
|
||||
bringToFront(): this;
|
||||
bringToBack(): this;
|
||||
openOn(map: Map): this;
|
||||
|
||||
options: PopupOptions;
|
||||
@ -1210,18 +1216,9 @@ export interface TooltipOptions extends DivOverlayOptions {
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
export class Tooltip extends Layer {
|
||||
export class Tooltip extends DivOverlay {
|
||||
constructor(options?: TooltipOptions, source?: Layer);
|
||||
setOpacity(val: number): void;
|
||||
getLatLng(): LatLng | undefined;
|
||||
setLatLng(latlng: LatLngExpression): this;
|
||||
getContent(): Content | undefined;
|
||||
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
||||
getElement(): HTMLElement | undefined;
|
||||
update(): void;
|
||||
isOpen(): boolean;
|
||||
bringToFront(): this;
|
||||
bringToBack(): this;
|
||||
|
||||
options: TooltipOptions;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user