/**
 * Low-level wrapper around the WASM engine
 * Node.js / Bundler target
 */
import type { RenderCallback, ActionHandler, ComponentResolver } from "./types.js";
export type { Patch, Action, RenderCallback, ActionHandler, ResolvedComponent, ComponentResolver } from "./types.js";
/**
 * Engine wraps the WASM engine and provides a TypeScript-friendly API
 */
export declare class Engine {
    private wasmEngine;
    private initialized;
    /**
     * Initialize the WASM module
     */
    init(): Promise<void>;
    /**
     * Ensure the engine is initialized before operations
     */
    private ensureInitialized;
    /**
     * Set the render callback that receives patches
     */
    setRenderCallback(callback: RenderCallback): void;
    /**
     * Set the component resolver for dynamic component composition
     */
    setComponentResolver(resolver: ComponentResolver): void;
    /**
     * Parse and render Hypen DSL source code
     * @throws {ParseError} if the source fails to parse
     * @throws {RenderError} if rendering fails
     */
    renderSource(source: string): void;
    /**
     * Render a lazy component (for lazy route loading)
     */
    renderLazyComponent(source: string): void;
    /**
     * Render a component into a specific parent node (subtree rendering)
     * @throws {ParseError} if the source fails to parse
     * @throws {RenderError} if the parent node is not found or rendering fails
     */
    renderInto(source: string, parentNodeId: string, state: Record<string, any>): void;
    /**
     * Notify the engine of state changes using sparse updates
     * @throws {StateError} if the state patch is invalid
     */
    notifyStateChange(paths: string[], values: Record<string, any>): void;
    /**
     * Notify the engine of state changes using full state replacement
     * @deprecated Use notifyStateChange with sparse values instead
     */
    notifyStateChangeFull(paths: string[], currentState: Record<string, any>): void;
    /**
     * Update state (triggers re-render of affected nodes)
     * @deprecated Use notifyStateChange instead
     */
    updateState(statePatch: Record<string, any>): void;
    /**
     * Dispatch an action
     * @throws {HypenError} if the action dispatch fails
     */
    dispatchAction(name: string, payload?: any): void;
    /**
     * Register an action handler
     */
    private _onErrorHandler?;
    /**
     * Set error handler for action errors
     */
    setOnError(handler: (error: Error) => void): void;
    onAction(actionName: string, handler: ActionHandler): void;
    /**
     * Initialize a module
     */
    setModule(name: string, actions: string[], stateKeys: string[], initialState: Record<string, any>): void;
    /**
     * Get the current revision number
     */
    getRevision(): number;
    /**
     * Clear the engine tree
     */
    clearTree(): void;
    /**
     * Debug method to inspect parsed components
     */
    debugParseComponent(source: string): string;
    /**
     * Set (or replace) a named data source context.
     *
     * Registers the provider in the dependency graph, stores the data,
     * and re-renders every node bound to `$name.*`.
     * Sparse merging (if needed) should happen at the SDK layer before
     * calling this method with the merged object.
     *
     * @param name - Provider name (e.g., "spacetime", "firebase")
     * @param data - Full state object for this provider
     */
    setContext(name: string, data: Record<string, unknown>): void;
    /**
     * Remove a data source context entirely.
     * Drops the provider's state and re-renders bound nodes (they resolve to null).
     */
    removeContext(name: string): void;
}
