/* tslint:disable */
/* eslint-disable */
/**
 * Export patches as JSON string (for debugging)
 */
export function patchesToJson(patches: any): string;
/**
 * Parse Hypen DSL and return AST as JSON
 */
export function parseToJson(source: string): string;
export function main(): void;
/**
 * WASM-exported engine instance for JavaScript runtimes
 * Uses Rc<RefCell<>> instead of Send+Sync for WASM single-threaded environment
 */
export class WasmEngine {
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Create a new engine instance
   */
  constructor();
  /**
   * Parse and render Hypen DSL source code
   */
  renderSource(source: string): void;
  /**
   * Set the render callback that receives patches
   */
  setRenderCallback(callback: Function): void;
  /**
   * Set the component resolver callback
   * The resolver receives (componentName, contextPath) and should return
   * { source: string, path: string } or null
   *
   * contextPath is the path of the component that's referencing this component
   * The returned path should be the resolved absolute path to the component file
   */
  setComponentResolver(resolver: Function): void;
  /**
   * Register a primitive element (like Text, Button, etc.) to skip component resolution
   * This prevents unnecessary resolver calls for built-in DOM elements
   */
  registerPrimitive(name: string): void;
  /**
   * Render a component source (for lazy loading routes)
   * This allows rendering a component on-demand
   */
  renderLazyComponent(source: string): void;
  /**
   * Render a component into a specific parent node (subtree rendering)
   * This is used for lazy routing where components are rendered on-demand into route containers
   *
   * # Arguments
   * * `source` - The Hypen DSL source to parse and render
   * * `parent_node_id_str` - The serialized node ID string of the parent element
   * * `state_js` - The state to use for rendering (as JsValue)
   */
  renderInto(source: string, parent_node_id_str: string, state_js: any): void;
  /**
   * Update state from JavaScript
   */
  updateState(state_patch: any): void;
  /**
   * Update state using sparse path-value pairs
   * More efficient than updateState for large state objects when only a few paths changed
   *
   * # Arguments
   * * `paths_js` - Array of changed paths (e.g., ["user.name", "count"])
   * * `values_js` - Object mapping paths to their new values (e.g., { "user.name": "Bob", "count": 42 })
   */
  updateStateSparse(paths_js: any, values_js: any): void;
  /**
   * Dispatch an action
   */
  dispatchAction(name: string, payload: any): void;
  /**
   * Register an action handler
   */
  onAction(action_name: string, handler: Function): void;
  /**
   * Clear the engine tree (useful when switching samples)
   */
  clearTree(): void;
  /**
   * Debug method to inspect parsed components
   */
  debugParseComponent(source: string): string;
  /**
   * Initialize a module
   */
  setModule(name: string, actions: string[], state_keys: string[], initial_state: any): void;
  /**
   * Get the current revision number
   */
  getRevision(): bigint;
}
