@@ -4803,11 +4803,11 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
48034803 * Returns a reference to the first object with the specified value of the ID attribute.
48044804 * @param elementId String that specifies the ID value.
48054805 */
4806- getElementById(elementId: string): HTMLElement | null;
4806+ getElementById<E extends Element = HTMLElement> (elementId: string): E | null;
48074807 /**
48084808 * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
48094809 */
4810- getElementsByClassName(classNames: string): HTMLCollectionOf<Element >;
4810+ getElementsByClassName<E extends Element = HTMLElement> (classNames: string): HTMLCollectionOf<E >;
48114811 /**
48124812 * Gets a collection of objects based on the value of the NAME or ID attribute.
48134813 * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -5003,7 +5003,7 @@ interface DocumentEvent {
50035003/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */
50045004interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
50055005 readonly ownerDocument: Document;
5006- getElementById(elementId: string): HTMLElement | null;
5006+ getElementById<E extends Element = HTMLElement> (elementId: string): E | null;
50075007}
50085008
50095009declare var DocumentFragment: {
@@ -5189,7 +5189,7 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
51895189 /**
51905190 * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
51915191 */
5192- getElementsByClassName(classNames: string): HTMLCollectionOf<Element >;
5192+ getElementsByClassName<E extends Element = HTMLElement> (classNames: string): HTMLCollectionOf<E >;
51935193 getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
51945194 getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
51955195 getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
@@ -6640,6 +6640,7 @@ interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementC
66406640 readonly offsetParent: Element | null;
66416641 readonly offsetTop: number;
66426642 readonly offsetWidth: number;
6643+ readonly parentElement: HTMLElement | null;
66436644 spellcheck: boolean;
66446645 title: string;
66456646 translate: boolean;
@@ -10833,7 +10834,7 @@ interface Node extends EventTarget {
1083310834 /**
1083410835 * Returns the parent element.
1083510836 */
10836- readonly parentElement: HTMLElement | null;
10837+ readonly parentElement: Element | null;
1083710838 /**
1083810839 * Returns the parent.
1083910840 */
@@ -11091,7 +11092,7 @@ interface NonElementParentNode {
1109111092 /**
1109211093 * Returns the first element within node's descendants whose ID is elementId.
1109311094 */
11094- getElementById(elementId: string): Element | null;
11095+ getElementById<E extends Element = HTMLElement> (elementId: string): E | null;
1109511096}
1109611097
1109711098interface NotificationEventMap {
@@ -13020,7 +13021,9 @@ interface SVGElement extends Element, DocumentAndElementEventHandlers, DocumentA
1302013021 /** @deprecated */
1302113022 readonly className: any;
1302213023 readonly ownerSVGElement: SVGSVGElement | null;
13024+ readonly parentElement: SVGElement | null;
1302313025 readonly viewportElement: SVGElement | null;
13026+ getElementsByClassName<E extends Element = SVGElement>(classNames: string): HTMLCollectionOf<E>;
1302413027 addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1302513028 addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1302613029 removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -13608,6 +13611,7 @@ interface SVGForeignObjectElement extends SVGGraphicsElement {
1360813611 readonly width: SVGAnimatedLength;
1360913612 readonly x: SVGAnimatedLength;
1361013613 readonly y: SVGAnimatedLength;
13614+ getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
1361113615 addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1361213616 addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1361313617 removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -14411,7 +14415,7 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB
1441114415 forceRedraw(): void;
1441214416 getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;
1441314417 getCurrentTime(): number;
14414- getElementById(elementId: string): Element ;
14418+ getElementById<E extends Element = HTMLElement> (elementId: string): E | null ;
1441514419 getEnclosureList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
1441614420 getIntersectionList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
1441714421 pauseAnimations(): void;
0 commit comments