UNPKG

@forest-js/core

Version:

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

28 lines 910 B
import { ForestAppProps } from "../types/dom"; /** * @function createForest * @description Create a Forest app * @param props - Forest app props * @template T - Type of the root element * @param {T} props - The DOM element to be decorated. * @returns {T} The decorated DOM element. * @example * ```ts * const { routerStore } = createRouter(); * * const app = createForest((body) => addChild({ routerStore }, ({ routerStore }) => { * if (routerStore?.path === "/") { * return import("./pages/home"); * } * if (routerStore?.path === "/about") { * return import("./pages/about"); * } * if (routerStore?.path === "/404") { * return import("./pages/404"); * } * return import("./pages/404"); * })(body)); * ``` */ export declare function createForest<T extends HTMLElement>(...props: ForestAppProps<T>): T | HTMLHtmlElement | null; //# sourceMappingURL=app.d.ts.map