import { HsonNode } from "../../../core/types.js"; import { Primitive } from "../../../core/types.js"; import { LiveTree } from "../livetree.js"; import { LiveFormApi } from "../../../types/livetree-internals.types.js"; /** * Options for form state writers that mirror to the DOM when available. */ export type SetNodeFormOpts = Readonly<{ silent?: boolean; strict?: boolean; }>; export type LiveTextApi = Readonly<{ set: (value: Primitive) => TOwner; add: (value: Primitive) => TOwner; overwrite: (value: Primitive) => TOwner; insert: (ix: number, value: Primitive) => TOwner; get: () => string; }>; export declare function get_node_text_content(node: HsonNode): string; /** * Set a form value on the node and mirror it to the DOM when mounted. * * By default, missing DOM elements are ignored (attrs are canonical). * * @param node - The Hson node to update. * @param value - Form value string to store. * @param opts - Optional flags controlling missing DOM behavior. * @returns void. */ export declare function set_form_value(node: HsonNode, value: string, opts?: SetNodeFormOpts): void; /** * Read a form value, preferring DOM when mounted. * * @param node - The Hson node to read from. * @returns The current form value (empty string if missing). */ export declare function get_form_value(node: HsonNode): string; /** * Set the checked state for checkbox/radio inputs and mirror to the DOM. * * @param node - The Hson node to update. * @param checked - New checked state. * @param opts - Optional flags controlling missing DOM behavior. * @returns void. */ export declare function set_input_checked(node: HsonNode, checked: boolean, opts?: SetNodeFormOpts): void; /** * Read the checked state for checkbox/radio inputs, preferring DOM when mounted. * * @param node - The Hson node to read from. * @returns True when checked, otherwise false. */ export declare function get_input_checked(node: HsonNode): boolean; /** * Set selected state for a , preferring DOM when mounted. * * @param node - The Hson node to read from. * @returns The selected value string or array of values for multi-select. */ export declare function get_input_selected(node: HsonNode): string | readonly string[]; export declare function make_form_api(tree: TTree): LiveFormApi; /** * Replace ONLY the text leaves (_hson_str/_hson_val) under this node. * Keeps non-leaf content untouched. * * DOM: reconciles the shared browser realization, including Hson boundary markers. */ export declare function set_node_text_content(node: HsonNode, value: Primitive): void; /** * Append another text leaf to $_content (non-destructive). * * DOM: appends a Text node to the host element. */ export declare function add_node_text_content(node: HsonNode, value: Primitive): void; /** * Insert a text leaf at a specific $_content index. * Index counts all items in the VSN bucket $_content. */ export declare function insert_node_text_leaf(node: HsonNode, index: number, value: Primitive): void; /** * Destructive overwrite: replace ALL content with one leaf; mirror to DOM using textContent. */ export declare function overwrite_node_text_content(node: HsonNode, value: Primitive): void; export declare function make_text_api(tree: TTree): LiveTextApi; //# sourceMappingURL=text-form-values.d.ts.map