jelenjs
Version:
Core runtime library for JelenJS - an experimental UI framework with fine-grained reactivity
25 lines (24 loc) • 908 B
TypeScript
import { Signal, Getter } from '../reactive';
type Child = Node | string | number | boolean | null | undefined | Signal<any> | Getter<any> | any[];
type Props = Record<string, any>;
/**
* Create an HTML element with the given tag name, props, and children
*/
export declare function h(tag: string, props?: Props, ...children: Child[]): HTMLElement;
/**
* Mount a component to a DOM element
*/
export declare function mount(component: () => any, container: HTMLElement): any;
/**
* Query selector helper that returns an element
*/
export declare function query(selector: string): HTMLElement | null;
/**
* Query selector that returns multiple elements
*/
export declare function queryAll(selector: string): HTMLElement[];
/**
* Creates a container element and initializes the app inside it
*/
export declare function createApp(rootComponent: () => any, containerSelector?: string): void;
export {};