Skip to content
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
1 change: 1 addition & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13395,6 +13395,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
*/
createElementNS<K extends keyof HTMLElementTagNameMap>(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: K): HTMLElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
Expand Down
1 change: 1 addition & 0 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13384,6 +13384,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
*/
createElementNS<K extends keyof HTMLElementTagNameMap>(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: K): HTMLElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
Expand Down
1 change: 1 addition & 0 deletions baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13392,6 +13392,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
*/
createElementNS<K extends keyof HTMLElementTagNameMap>(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: K): HTMLElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
Expand Down
1 change: 1 addition & 0 deletions baselines/ts5.9/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13392,6 +13392,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
*/
createElementNS<K extends keyof HTMLElementTagNameMap>(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: K): HTMLElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
Expand Down
1 change: 1 addition & 0 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
"createElementNS": {
"name": "createElementNS",
"additionalSignatures": [
"createElementNS<K extends keyof HTMLElementTagNameMap>(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: K): HTMLElementTagNameMap[K]",
"createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement",
"createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: K): SVGElementTagNameMap[K]",
"createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement",
Expand Down
7 changes: 7 additions & 0 deletions unittests/files/createelementns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const div: HTMLDivElement = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
const input: HTMLInputElement = document.createElementNS("http://www.w3.org/1999/xhtml", "input");
const custom: HTMLElement = document.createElementNS("http://www.w3.org/1999/xhtml", "my-element");
const circle: SVGCircleElement = document.createElementNS("http://www.w3.org/2000/svg", "circle");

// @ts-expect-error an XHTML div is not an input element
const wrong: HTMLInputElement = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
Loading