Skip to content

Commit a6d6651

Browse files
authored
🤖 Merge PR DefinitelyTyped#74434 [openseadragon] Fix: Element type by @rssaini01
1 parent e138fcf commit a6d6651

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

types/openseadragon/index.d.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ declare namespace OpenSeadragon {
109109

110110
function getCssPropertyWithVendorPrefix(property: string): string;
111111

112-
function getElement(element: string | Element): Element;
112+
function getElement(element: string | Element): HTMLElement;
113113

114114
function getElementOffset(element: Element | string): Point;
115115

@@ -146,11 +146,11 @@ declare namespace OpenSeadragon {
146146
withCredentials?: boolean | undefined;
147147
}): XMLHttpRequest;
148148

149-
function makeCenteredNode(element: Element | string): Element;
149+
function makeCenteredNode(element: Element | string): HTMLElement;
150150

151-
function makeNeutralElement(tagName: string): Element;
151+
function makeNeutralElement(tagName: string): HTMLElement;
152152

153-
function makeTransparentImage(src: string): Element;
153+
function makeTransparentImage(src: string): HTMLElement;
154154

155155
function normalizeEventListenerOptions(
156156
options: boolean | { capture?: boolean; passive?: boolean; once?: boolean },
@@ -347,7 +347,7 @@ declare namespace OpenSeadragon {
347347
zoomPerDblClickDrag?: number;
348348
zoomPerSecond?: number | undefined;
349349
showNavigator?: boolean | undefined;
350-
navigatorElement?: Element;
350+
navigatorElement?: HTMLElement;
351351
navigatorId?: string | undefined;
352352
navigatorPosition?: "TOP_LEFT" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_RIGHT" | "ABSOLUTE" | undefined;
353353
navigatorSizeRatio?: number | undefined;
@@ -385,7 +385,7 @@ declare namespace OpenSeadragon {
385385
showSequenceControl?: boolean | undefined;
386386
sequenceControlAnchor?: ControlAnchor | undefined;
387387
navPrevNextWrap?: boolean | undefined;
388-
toolbar?: string | Element | undefined;
388+
toolbar?: string | HTMLElement | undefined;
389389
zoomInButton?: string | Element | undefined;
390390
zoomOutButton?: string | Element | undefined;
391391
homeButton?: string | Element | undefined;
@@ -442,7 +442,7 @@ declare namespace OpenSeadragon {
442442

443443
class Button extends EventSource<ButtonEventMap> {
444444
currentState: ButtonState;
445-
element: Element;
445+
element: HTMLElement;
446446
fadeDelay: number;
447447
fadeLength: number;
448448
tracker: MouseTracker;
@@ -474,7 +474,7 @@ declare namespace OpenSeadragon {
474474

475475
class ButtonGroup {
476476
buttons: Button[];
477-
element: Element;
477+
element: HTMLElement;
478478
tracker: MouseTracker;
479479

480480
constructor(options: { buttons: Button[]; element?: Element | undefined });
@@ -492,9 +492,9 @@ declare namespace OpenSeadragon {
492492
class Control {
493493
anchor: ControlAnchor;
494494
autoFade: boolean;
495-
container: Element;
496-
element: Element;
497-
wrapper: Element;
495+
container: HTMLElement;
496+
element: HTMLElement;
497+
wrapper: HTMLElement;
498498

499499
constructor(element: Element, options: TControlOptions, container: Element);
500500

@@ -522,15 +522,15 @@ declare namespace OpenSeadragon {
522522
}
523523

524524
class Drawer {
525-
canvas: HTMLCanvasElement | HTMLElement;
526-
container: Element;
525+
canvas: HTMLCanvasElement;
526+
container: HTMLElement;
527527
context: CanvasRenderingContext2D | null;
528528
// element : Element; // Deprecated
529529

530530
constructor(options: {
531531
viewer: Viewer;
532532
viewport: Viewport;
533-
element: Element;
533+
element: HTMLElement;
534534
debugGridColor?: string | undefined;
535535
});
536536

@@ -575,13 +575,13 @@ declare namespace OpenSeadragon {
575575
interface TDrawerOptions {
576576
viewer: Viewer;
577577
viewport: Viewport;
578-
element: Element;
578+
element: HTMLElement;
579579
debugGridColor?: number;
580580
}
581581

582582
class CanvasDrawer extends DrawerBase {
583-
canvas: Element;
584-
container: Element;
583+
canvas: HTMLCanvasElement;
584+
container: HTMLElement;
585585

586586
constructor(options: TDrawerOptions);
587587
}
@@ -624,8 +624,8 @@ declare namespace OpenSeadragon {
624624
}
625625

626626
class HTMLDrawer extends DrawerBase {
627-
canvas: Element;
628-
container: Element;
627+
canvas: HTMLCanvasElement;
628+
container: HTMLElement;
629629
constructor(options: TDrawerOptions);
630630
}
631631

@@ -702,7 +702,7 @@ declare namespace OpenSeadragon {
702702
}
703703

704704
interface MouseTrackerOptions {
705-
element: Element | string;
705+
element: HTMLElement | string;
706706
startDisabled?: boolean | undefined;
707707
clickTimeThreshold?: number | undefined;
708708
clickDistThreshold?: number | undefined;
@@ -743,7 +743,7 @@ declare namespace OpenSeadragon {
743743
clickDistThreshold: number;
744744
dblClickTimeThreshold: number;
745745
dblClickDistThreshold: number;
746-
element: Element;
746+
element: HTMLElement;
747747

748748
constructor(options: MouseTrackerOptions);
749749

@@ -787,7 +787,7 @@ declare namespace OpenSeadragon {
787787
interface EventProcessInfo {
788788
eventSource: MouseTracker;
789789
originalEvent: Event;
790-
originalTarget: Element;
790+
originalTarget: HTMLElement;
791791
eventPhase: EventPhase;
792792
eventType:
793793
| "keydown"
@@ -874,7 +874,7 @@ declare namespace OpenSeadragon {
874874
type OnDrawCallback = (position: Point, size: Point, element: Element) => void;
875875

876876
interface OverlayOptions {
877-
element: Element;
877+
element: HTMLElement;
878878
location: Point | Rect;
879879
placement?: Placement | undefined;
880880
onDraw?: OnDrawCallback | undefined;
@@ -975,7 +975,7 @@ declare namespace OpenSeadragon {
975975
bounds: Rect;
976976
cacheKey: string;
977977
context2D: CanvasRenderingContext2D;
978-
element: Element;
978+
element: HTMLElement;
979979
exists: boolean;
980980
flipped: boolean;
981981
hasTransparency: boolean;
@@ -1229,10 +1229,10 @@ declare namespace OpenSeadragon {
12291229
}
12301230

12311231
class Viewer {
1232-
canvas: Element;
1233-
container: Element;
1232+
canvas: HTMLCanvasElement;
1233+
container: HTMLElement;
12341234
drawer: Drawer;
1235-
element: Element;
1235+
element: HTMLElement;
12361236
initialPage: number;
12371237
navigator: Navigator;
12381238
viewport: Viewport;
@@ -1384,8 +1384,8 @@ declare namespace OpenSeadragon {
13841384
}
13851385

13861386
class WebGLDrawer extends DrawerBase {
1387-
canvas: Element;
1388-
container: Element;
1387+
canvas: HTMLCanvasElement;
1388+
container: HTMLElement;
13891389

13901390
constructor(options: TDrawerOptions);
13911391

@@ -1573,7 +1573,7 @@ declare namespace OpenSeadragon {
15731573
}
15741574

15751575
interface AddOverlayEvent extends ViewerEvent {
1576-
element: Element;
1576+
element: HTMLElement;
15771577
location: Point | Rect;
15781578
placement: Placement;
15791579
}
@@ -1598,7 +1598,7 @@ declare namespace OpenSeadragon {
15981598
interface CanvasClickEvent extends CanvasEvent {
15991599
quick: boolean;
16001600
shift: boolean;
1601-
originalTarget: Element;
1601+
originalTarget: HTMLElement;
16021602
preventDefaultAction: boolean;
16031603
}
16041604

@@ -1780,7 +1780,7 @@ declare namespace OpenSeadragon {
17801780
}
17811781

17821782
interface RemoveOverlayEvent extends ViewerEvent {
1783-
element: Element;
1783+
element: HTMLElement;
17841784
}
17851785

17861786
interface ResetSizeEvent extends ViewerEvent {
@@ -1841,7 +1841,7 @@ declare namespace OpenSeadragon {
18411841
}
18421842

18431843
interface UpdateOverlayEvent extends ViewerEvent {
1844-
element: Element;
1844+
element: HTMLElement;
18451845
location: Point | Rect;
18461846
placement: Placement;
18471847
}

types/openseadragon/openseadragon-tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ viewer = OpenSeadragon({
103103
});
104104

105105
declare const buttonElement: Element;
106-
declare const toolbarElement: Element;
106+
declare const toolbarElement: HTMLElement;
107107
viewer = OpenSeadragon({
108108
toolbar: "toolbar-id",
109109
zoomInButton: "zoomInButton-id",
@@ -157,7 +157,7 @@ viewer.addControl(button.element, {
157157

158158
const viewport = new Viewport({ margins: {} });
159159

160-
const element = new Element();
160+
const element = new HTMLElement();
161161

162162
const drawer = new Drawer({ viewer, viewport, element });
163163

0 commit comments

Comments
 (0)