/** * VNode: The virtual node type with Merkle-style content hashing. * The hash enables fast subtree comparison - if hashes match, subtrees are identical. */ import type { Style } from "./cell.js"; export interface BaseProps { x?: number; y?: number; width?: number; height?: number; style?: Style; } export type Props = BaseProps & Record; export type Component

= (props: P) => VNode; export type VNodeType = string | Component; export interface VNode { type: VNodeType; props: Props; children: VNode[]; hash: string; } export declare const TEXT_NODE_TYPE = "__text__"; export declare function isTextNode(node: VNode): boolean; export declare function getTextContent(node: VNode): string; /** * Fast hash function (FNV-1a). * For TUI elements, this is plenty fast and has good distribution. */ export declare function fnv1a(str: string): string; /** * Compute the hash for a VNode. * This is the Merkle property: hash = f(type, props, children.hashes) */ export declare function computeHash(type: VNodeType, props: Props, children: VNode[]): string; /** * Create a VNode. This is the low-level factory - JSX calls this. * Overloaded to support both intrinsic elements and typed components. */ export declare function createVNode(type: string, props: Props, children: VNode[]): VNode; export declare function createVNode

(type: Component

, props: P, children: VNode[]): VNode; /** * Create a text VNode. */ export declare function createTextNode(text: string): VNode; /** * Expand functional components into their rendered output. * Note: With the current JSX runtime, components are expanded at JSX time, * so this mainly handles edge cases and recursively expands children. */ export declare function expandNode(node: VNode): VNode; //# sourceMappingURL=vnode.d.ts.map