Skip to content
Open
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: 10 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,10 @@ interface SecurityPolicyViolationEventInit extends EventInit {
violatedDirective?: string;
}

interface SetHTMLOptions {
sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets;
}

interface ShadowRootInit {
clonable?: boolean;
customElementRegistry?: CustomElementRegistry | null;
Expand Down Expand Up @@ -13999,6 +14003,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
*/
setAttributeNodeNS(attr: Attr): Attr | null;
/**
* The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML)
*/
setHTML(html: string, options?: SetHTMLOptions): void;
/**
* The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM.
*
Expand Down
10 changes: 10 additions & 0 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,10 @@ interface SecurityPolicyViolationEventInit extends EventInit {
violatedDirective?: string;
}

interface SetHTMLOptions {
sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets;
}

interface ShadowRootInit {
clonable?: boolean;
customElementRegistry?: CustomElementRegistry | null;
Expand Down Expand Up @@ -13986,6 +13990,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
*/
setAttributeNodeNS(attr: Attr): Attr | null;
/**
* The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML)
*/
setHTML(html: string, options?: SetHTMLOptions): void;
/**
* The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM.
*
Expand Down
10 changes: 10 additions & 0 deletions baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,10 @@ interface SecurityPolicyViolationEventInit extends EventInit {
violatedDirective?: string;
}

interface SetHTMLOptions {
sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets;
}

interface ShadowRootInit {
clonable?: boolean;
customElementRegistry?: CustomElementRegistry | null;
Expand Down Expand Up @@ -13996,6 +14000,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
*/
setAttributeNodeNS(attr: Attr): Attr | null;
/**
* The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML)
*/
setHTML(html: string, options?: SetHTMLOptions): void;
/**
* The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM.
*
Expand Down
10 changes: 10 additions & 0 deletions baselines/ts5.9/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,10 @@ interface SecurityPolicyViolationEventInit extends EventInit {
violatedDirective?: string;
}

interface SetHTMLOptions {
sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets;
}

interface ShadowRootInit {
clonable?: boolean;
customElementRegistry?: CustomElementRegistry | null;
Expand Down Expand Up @@ -13996,6 +14000,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
*/
setAttributeNodeNS(attr: Attr): Attr | null;
/**
* The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML)
*/
setHTML(html: string, options?: SetHTMLOptions): void;
/**
* The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM.
*
Expand Down
20 changes: 20 additions & 0 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,26 @@
"get textContent(): string",
"set textContent(value: string | null)"
]
},
"setHTML": {
"name": "setHTML",
"mdnUrl": "https://developer.mozilla.org/docs/Web/API/Element/setHTML",
"signature": [
{
"param": [
{
"name": "html",
"type": "DOMString"
},
{
"name": "options",
"type": "SetHTMLOptions",
"optional": true
}
],
"type": "undefined"
}
]
}
}
},
Expand Down
Loading