/** * Host interop: deep conversion between Dvala's internal persistent * representations and plain JS arrays/objects. * * Used at all four boundaries where Dvala values cross into host code: * 1. dvala.run() return value — persistent → JS * 2. Effect handler arguments — persistent → JS before handler call * 3. Effect handler return values — JS → persistent when resuming * 4. bindings on entry — JS → persistent * * Also used at module boundaries for modules that will eventually be * rewritten in Dvala but currently operate on plain JS internally. * * Conversion is deep and recursive — nested arrays/objects are fully converted. */ import type { Any } from '../interface'; /** * Recursively validate that a host value can be represented in Dvala. * Throws TypeError for invalid types (undefined, functions, symbols, bigint, * Date, Map, Set, class instances, circular references). * * @param value The value to validate * @param context Human-readable description of the boundary (e.g. 'resume() in handler for "fetch"') * @param seen Set for circular reference detection * @param path Dot-path to current position for error messages (e.g. '.user.tags[0]') */ export declare function assertValidHostValue(value: unknown, context: string, seen?: Set, path?: string): void; /** * Convert a plain JS value to a Dvala runtime value, with validation. * Throws TypeError for values that cannot be represented in Dvala. * * Used at all host boundaries where external values enter the runtime. */ export declare function validateFromJS(value: unknown, context: string): Any; /** Convert a Dvala runtime value to a plain JS value (deep). */ export declare function toJS(value: Any): unknown; /** Convert a plain JS value to a Dvala runtime value (deep). */ export declare function fromJS(value: unknown): Any;