UNPKG

@forest-js/core

Version:

A tiny, functional DOM engine with explicit update and real DOM.

20 lines 814 B
import { Child, StoreMap, UtilityProps } from "../types"; /** * @function addChild * @description Utility for adding children to an element * @template E Element type * @template R Child content to add (can be promise or dynamic import) * @template S StoreMap type when used reactively * @param args - Child content or store and mapper function * @returns Utility function for adding children * @example * ```ts * addChild("Hello")(MyElement); * // if you want to add head in your app, you can do this: * addChild([...someHead's children])(tree("head")); * ``` */ export declare const addChild: <E extends HTMLElement, R extends Child | Promise<Child> | Promise<{ default: Child; }>, S extends StoreMap = StoreMap>(...args: UtilityProps<R, S>) => (el: E) => E; //# sourceMappingURL=child.d.ts.map