import { Expr } from "../ast"; /** * JavaScript compilation options */ export interface JavaScriptCompileOptions { /** If true, always wrap output as a function (even if _ is not used) */ asFunction?: boolean; /** If true, immediately execute the function with null as input */ execute?: boolean; /** If true, strip guard/check assertions from output */ stripGuards?: boolean; } /** * Result of JavaScript compilation */ export interface JavaScriptCompileResult { /** The generated JavaScript code */ code: string; /** Whether the code uses the input variable _ */ usesInput: boolean; } /** * Compiles Elo expressions to JavaScript code * Uses luxon for temporal operations * * This compiler works in two phases: * 1. Transform AST to typed IR * 2. Emit JavaScript from IR (tracking required helpers) * 3. Wrap in IIFE with helper definitions if needed * * If the expression uses `_` (input variable), the output is a function * that takes `_` as a parameter instead of an IIFE. */ export declare function compileToJavaScript(expr: Expr, options?: JavaScriptCompileOptions): string; /** * Compiles Elo expressions to JavaScript with metadata about input usage. * Use this when you need to know if the expression uses input. * * Every Elo program compiles to a function taking _ as input parameter. * The usesInput field indicates whether _ is actually referenced. */ export declare function compileToJavaScriptWithMeta(expr: Expr, options?: JavaScriptCompileOptions): JavaScriptCompileResult; //# sourceMappingURL=javascript.d.ts.map