import type { HDOMImplementation, HDOMOpts } from "./api.js"; /** * See {@link HDOMImplementation} interface for further details. * * @param opts - hdom config options * @param parent - DOM element * @param tree - component tree * @param insert - child index */ export declare const createTree: (opts: Partial, impl: HDOMImplementation, parent: T, tree: any, insert?: number, init?: boolean) => any; /** * See {@link HDOMImplementation} interface for further details. * * @param opts - hdom config options * @param parent - DOM element * @param tree - component tree * @param index - child index */ export declare const hydrateTree: (opts: Partial, impl: HDOMImplementation, parent: T, tree: any, index?: number) => void; /** * Creates a new DOM element of type `tag` with optional `attribs`. If * `parent` is not `null`, the new element will be inserted as child at * given `insert` index. If `insert` is missing, the element will be * appended to the `parent`'s list of children. Returns new DOM node. * * If `tag` is a known SVG element name, the new element will be created * with the proper SVG XML namespace. * * @param parent - DOM element * @param tag - component tree * @param attribs - attributes * @param insert - child index */ export declare const createElement: (parent: Element, tag: string, attribs?: any, insert?: number) => Node; export declare const createTextElement: (parent: Element, content: string, insert?: number) => Node; export declare const addChild: (parent: Element, child: Node, insert?: number) => Node; export declare const getChild: (parent: Element, child: number) => Element; export declare const replaceChild: (opts: Partial, impl: HDOMImplementation, parent: Element, child: number, tree: any, init?: boolean) => any; export declare const cloneWithNewAttribs: (el: Element, attribs: any) => Element; export declare const setContent: (el: Element, body: any) => any; export declare const setAttribs: (el: Element, attribs: any) => Element; /** * Sets a single attribute on given element. If attrib name is NOT an * event name (prefix: "on") and its value is a function, it is called * with given `attribs` object (usually the full attrib object passed to * {@link setAttribs}) and the function's return value is used as the actual * attrib value. * * Special rules apply for certain attributes: * * - "style": delegated to {@link setStyle} * - "value": delegated to {@link updateValueAttrib} * - attrib IDs starting with "on" are treated as event listeners * * If the given (or computed) attrib value is `false` or `undefined` the * attrib is removed from the element. * * @param el - DOM element * @param id - attribute name * @param val - attribute value * @param attribs - object of all attribs */ export declare const setAttrib: (el: Element, id: string, val: any, attribs?: any) => Element | undefined; /** * Updates an element's `value` property. For form elements it too * ensures the edit cursor retains its position. * * @param el - DOM element * @param value - value */ export declare const updateValueAttrib: (el: HTMLInputElement, value: any) => void; export declare const removeAttribs: (el: Element, attribs: string[], prev: any) => void; export declare const setStyle: (el: Element, styles: any) => Element; /** * Adds event listener (possibly with options). * * @param el - DOM element * @param id - event name (w/o `on` prefix) * @param listener - */ export declare const setListener: (el: Element, id: string, listener: string | EventListener | [EventListener, boolean | AddEventListenerOptions]) => void; /** * Removes event listener (possibly with options). * * @param el - DOM element * @param id - event name (w/o `on` prefix) * @param listener - */ export declare const removeListener: (el: Element, id: string, listener: EventListener | [EventListener, boolean | AddEventListenerOptions]) => void; export declare const clearDOM: (el: Element) => string; export declare const removeChild: (parent: Element, childIdx: number) => void; //# sourceMappingURL=dom.d.ts.map