@razen-core/zenweb
Version:
A minimalist TypeScript framework for building reactive web applications with no virtual DOM
94 lines • 2.68 kB
TypeScript
/**
* ZenWeb Helper Functions
* UI component helpers for building layouts
*/
import type { VNode, VNodeProps, VNodeChild } from './types.js';
/**
* Vertical box layout (flex column)
*/
export declare function vbox(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Horizontal box layout (flex row)
*/
export declare function hbox(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Text element
*/
export declare function text(props: VNodeProps | string, content?: string): VNode;
/**
* Button element
*/
export declare function button(props: VNodeProps, content: VNodeChild): VNode;
/**
* Input element
*/
export declare function input(props: VNodeProps): VNode;
/**
* Image element
*/
export declare function image(props: VNodeProps & {
src: string;
alt?: string;
lazy?: boolean;
}): VNode;
/**
* Link/anchor element
*/
export declare function link(props: VNodeProps & {
href: string;
}, children: VNodeChild[]): VNode;
/**
* Grid layout container
*/
export declare function grid(props: VNodeProps & {
columns?: number;
gap?: string;
}, children: VNodeChild[]): VNode;
/**
* List element with optimized rendering
*/
export declare function list<T>(props: VNodeProps & {
items: T[];
renderItem: (item: T, index: number) => VNode;
keyExtractor?: (item: T, index: number) => string | number;
}): VNode;
/**
* Div element (generic container)
*/
export declare function div(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Span element (inline container)
*/
export declare function span(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Heading elements
*/
export declare function h1(props: VNodeProps, content: VNodeChild): VNode;
export declare function h2(props: VNodeProps, content: VNodeChild): VNode;
export declare function h3(props: VNodeProps, content: VNodeChild): VNode;
export declare function h4(props: VNodeProps, content: VNodeChild): VNode;
export declare function h5(props: VNodeProps, content: VNodeChild): VNode;
export declare function h6(props: VNodeProps, content: VNodeChild): VNode;
/**
* Paragraph element
*/
export declare function p(props: VNodeProps, content: VNodeChild): VNode;
/**
* Form element
*/
export declare function form(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Textarea element
*/
export declare function textarea(props: VNodeProps, content?: string): VNode;
/**
* Select element
*/
export declare function select(props: VNodeProps, children: VNodeChild[]): VNode;
/**
* Option element
*/
export declare function option(props: VNodeProps & {
value: string;
}, content: VNodeChild): VNode;
//# sourceMappingURL=helpers.d.ts.map