UNPKG

reblendjs

Version:

This is build using react way of handling dom but with web components

45 lines (44 loc) 2.56 kB
import { ReblendTyping } from 'reblend-typing'; export declare const ElementUtil: { new (): {}; /** * Creates an HTML, SVG, MathML, or XML element based on the provided tag name. * * @param {string} tag - The tag name of the element to create. * @returns {HTMLElement | SVGElement | Element} The created element. */ createElementWithNamespace(tag: string): HTMLElement | SVGElement | Element; /** * Sets attributes on the given element, handling namespaces for XML, SVG, MathML, and XLink attributes. * * @param {HTMLElement | SVGElement} element - The element on which to set attributes. * @param {Record<string, string>} attributes - A record of attribute names and values to set. */ setAttributesWithNamespace(element: HTMLElement | SVGElement, attributes: Record<string, string>): void; /** * Creates child nodes from the given ReblendTyping.VNode children and appends them to the container array. * Supports nested arrays, Sets, and various node types such as Reblend, DOM Nodes, React Nodes, and primitive values. * * @param {ReblendTyping.VNodeChildren} children - The children to process. * @param {(ReblendTyping.Component<P, S> | HTMLElement)[]} [containerArr=[]] - The array to store the created child nodes. * @returns {(ReblendTyping.Component<P, S> | HTMLElement)[]} The array containing the created child nodes. */ createChildren<P, S>(children: ReblendTyping.VNodeChildren, containerArr?: (ReblendTyping.Component<P, S> | HTMLElement)[]): Promise<(ReblendTyping.Component<P, S> | HTMLElement)[]>; /** * Creates an element based on the provided virtual node (ReblendTyping.VNode) or primitive value. * The created element is returned as a `BaseComponent`. * * @param {ReblendTyping.VNode | ReblendTyping.VNode[] | ReblendTyping.ReactNode | ReblendTyping.Primitive} vNode - The virtual node or primitive to create an element from. * @returns {ReblendTyping.Component<P, S>[]} The created `BaseComponent` instances. */ createElement<P, S>(vNode: ReblendTyping.VNode | ReblendTyping.VNode[] | ReblendTyping.ReactNode | ReblendTyping.Primitive): Promise<ReblendTyping.Component<P, S>[]>; /** * Creates a new Reblend primitive element. * * @returns {ReblendTyping.Primitive} The newly created Reblend primitive element. */ newReblendPrimitive(): Text & { setData: (data: ReblendTyping.Primitive) => Text; getData: () => ReblendTyping.Primitive; }; };