UNPKG

fluxel

Version:

An ultra-lightweight, high-performance library for efficient DOM building and dynamic web UIs

20 lines (19 loc) 1.42 kB
import ReactiveDependency from "./reactiveDependency.js"; import type { FluxelInternalOptions, ChildrenType, FluxelInternalOptionsFromNode } from "./type.js"; declare function fluxelInternal<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: FluxelInternalOptions<K>): HTMLElementTagNameMap[K]; declare function fluxelInternal<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ChildrenType): HTMLElementTagNameMap[K]; declare namespace fluxelInternal { var fragment: <T extends Node = Node, C extends ChildrenType<T> = ChildrenType<T>>(children: C, options: FluxelInternalOptionsFromNode<T>) => C extends ReactiveDependency<infer _> ? ReactiveDependency<Node[]> : (Node | ReactiveDependency<Node>)[]; var forwardStyle: (style: string) => void; var forwardStyleCache: string[]; var useUniqueString: <T extends ChildrenType>(renderer: (id: string) => T) => T; var createComponent: <P extends object, R extends ChildrenType>(renderer: (props: P) => R) => (props?: P) => R; var createElement: typeof fluxelInternal; } interface TagFluxel<TAG extends keyof HTMLElementTagNameMap> { (options: ChildrenType): HTMLElementTagNameMap[TAG]; (options: FluxelInternalOptions<TAG>): HTMLElementTagNameMap[TAG]; (): HTMLElementTagNameMap[TAG]; } declare const Fluxel: typeof fluxelInternal & { [TAG in keyof HTMLElementTagNameMap]: TagFluxel<TAG>; }; export default Fluxel;