/** * SemanticNode → Runtime AST Converter * * Converts framework SemanticNode (LSE IR) to a structural AST format * that the core runtime can execute directly. Uses structural typing * to avoid a dependency on the core package. * * This is the canonical converter — AOT compiler delegates to it. * * The output matches the core runtime's expected node shapes: * - `{ type: 'command', name, args, roles }` → processCommand() * - `{ type: 'event', event, modifiers, body }` → adapted to executeEventHandler() */ import type { SemanticNode, SemanticValue } from '../core/types'; /** Minimal AST node that the core runtime can execute. */ export interface RuntimeASTNode { readonly type: string; readonly [key: string]: unknown; } /** Command node shape expected by runtime's processCommand(). */ export interface RuntimeCommandNode extends RuntimeASTNode { readonly type: 'command'; readonly name: string; readonly args: RuntimeASTNode[]; readonly roles?: Readonly>; readonly modifiers?: Record; } /** Event node shape expected by runtime's event adapter. */ export interface RuntimeEventNode extends RuntimeASTNode { readonly type: 'event'; readonly event: string; readonly modifiers: Record; readonly body: RuntimeASTNode[]; } /** * Convert a SemanticNode to a RuntimeASTNode that the core runtime can execute. * * @example * ```typescript * import { parseExplicit } from '@lokascript/framework/ir'; * import { semanticNodeToRuntimeAST } from '@lokascript/framework/ir'; * * const node = parseExplicit('[toggle patient:.active]'); * const ast = semanticNodeToRuntimeAST(node); * // { type: 'command', name: 'toggle', args: [{ type: 'selector', value: '.active' }], roles: { patient: ... } } * ``` */ export declare function semanticNodeToRuntimeAST(node: SemanticNode): RuntimeASTNode; /** * Convert a SemanticValue to a RuntimeASTNode. */ export declare function semanticValueToAST(value: SemanticValue): RuntimeASTNode; //# sourceMappingURL=to-runtime-ast.d.ts.map