@tempots/dom
DOMContext class
DOMContext
is an immutable class that represents the context of a DOM element. It provides methods and properties to manipulate and interact with the DOM element.
A reference in a DOMContext is to mark a position within a set of sibblings. It is used to insert new elements before the reference.
Signature:
declare class DOMContext
Constructors
Constructor |
Modifiers |
Description |
---|---|---|
(constructor)(document, element, reference, providers, isFirstLevel) |
Constructs a new |
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
(child: Node) => void |
Appends or inserts a child node to the element, depending on whether a reference node is provided. | |
|
(tagName: string, namespace: string | undefined) => Element |
Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace. | |
|
(text: string) => Text |
Creates a new text node with the specified text content. | |
|
Document |
The | |
|
Element |
The | |
|
|
Retrieves a provider for the given provider mark. | |
|
boolean |
A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated | |
|
() => DOMContext |
Creates a new | |
|
The | ||
|
Node | undefined |
An optional | |
|
(document: Document) => DOMContext |
Creates a new | |
|
(element: Element) => DOMContext |
Creates a new | |
|
() => DOMContext |
Creates a new | |
|
|
Creates a new DOMContext with the provided provider value. | |
|
(providers: { [K in ProviderMark |
Returns a new DOMContext instance with the specified providers merged into the existing providers. | |
|
(reference: Text | undefined) => DOMContext |
Creates a new |
Methods
Method |
Modifiers |
Description |
---|---|---|
|
Creates a new |