Skip to content

Improve method signatures returning Node type #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Gets or sets the version attribute specified in the declaration of an XML document.
*/
xmlVersion: string | null;
adoptNode(source: Node): Node;
adoptNode<T extends Node>(source: T): T;
captureEvents(): void;
caretRangeFromPoint(x: number, y: number): Range;
clear(): void;
Expand Down Expand Up @@ -3385,7 +3385,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Gets a value indicating whether the object currently has focus.
*/
hasFocus(): boolean;
importNode(importedNode: Node, deep: boolean): Node;
importNode<T extends Node>(importedNode: T, deep: boolean): T;
msElementsFromPoint(x: number, y: number): NodeListOf<Element>;
msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf<Element>;
/**
Expand Down Expand Up @@ -8254,15 +8254,15 @@ interface Node extends EventTarget {
contains(child: Node): boolean;
hasAttributes(): boolean;
hasChildNodes(): boolean;
insertBefore(newChild: Node, refChild: Node | null): Node;
insertBefore<T extends Node>(newChild: T, refChild: Node | null): T;
isDefaultNamespace(namespaceURI: string | null): boolean;
isEqualNode(arg: Node): boolean;
isSameNode(other: Node): boolean;
lookupNamespaceURI(prefix: string | null): string | null;
lookupPrefix(namespaceURI: string | null): string | null;
normalize(): void;
removeChild(oldChild: Node): Node;
replaceChild(newChild: Node, oldChild: Node): Node;
removeChild<T extends Node>(oldChild: T): T;
replaceChild<T extends Node>(newChild: Node, oldChild: T): T;
readonly ATTRIBUTE_NODE: number;
readonly CDATA_SECTION_NODE: number;
readonly COMMENT_NODE: number;
Expand Down
30 changes: 27 additions & 3 deletions inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,40 @@
},
{
"kind": "method",
"interface": "Node",
"name": "insertBefore",
"signatures": ["insertBefore(newChild: Node, refChild: Node | null): Node"]
"interface": "Document",
"name": "adoptNode",
"signatures": ["adoptNode<T extends Node>(source: T): T"]
},
{
"kind": "method",
"interface": "Document",
"name": "importNode",
"signatures": ["importNode<T extends Node>(importedNode: T, deep: boolean): T"]
},
{
"kind": "method",
"interface": "Node",
"name": "appendChild",
"signatures": ["appendChild<T extends Node>(newChild: T): T"]
},
{
"kind": "method",
"interface": "Node",
"name": "insertBefore",
"signatures": ["insertBefore<T extends Node>(newChild: T, refChild: Node | null): T"]
},
{
"kind": "method",
"interface": "Node",
"name": "removeChild",
"signatures": ["removeChild<T extends Node>(oldChild: T): T"]
},
{
"kind": "method",
"interface": "Node",
"name": "replaceChild",
"signatures": ["replaceChild<T extends Node>(newChild: Node, oldChild: T): T"]
},
{
"kind": "method",
"interface": "HTMLCollection",
Expand Down