/**
 * Safe Expression Evaluator
 *
 * Replaces unsafe `new Function()` and `eval()` calls with sandboxed
 * evaluation using Node.js `vm.runInNewContext()`.
 *
 * Security features:
 * - Runs code in an isolated V8 context (no access to global scope)
 * - Configurable timeout to prevent infinite loops
 * - Allowlisted globals only (no process, require, fs, etc.)
 * - No access to the module system
 */
export interface SafeEvalOptions {
    /** Timeout in milliseconds (default: 5000) */
    timeout?: number;
    /** Additional context variables available to the expression */
    context?: Record<string, unknown>;
    /** Whether to wrap the code in an async IIFE (default: false) */
    async?: boolean;
}
/**
 * Safely evaluate a JavaScript expression in an isolated V8 context.
 *
 * @param code - The JavaScript expression or code to evaluate
 * @param options - Evaluation options (timeout, context, async)
 * @returns The result of the evaluation
 * @throws Error if the code times out, throws, or is otherwise invalid
 */
export declare function safeEval(code: string, options?: SafeEvalOptions): unknown;
/**
 * Safely evaluate an async JavaScript expression in an isolated V8 context.
 *
 * The code is wrapped in an async IIFE so `await` can be used.
 * Note: The code cannot import modules or access the file system.
 *
 * @param code - The async JavaScript code to evaluate
 * @param options - Evaluation options (timeout, context)
 * @returns A promise resolving to the result of the evaluation
 */
export declare function safeEvalAsync(code: string, options?: SafeEvalOptions): Promise<unknown>;
/**
 * Safely evaluate a condition expression.
 *
 * Returns a boolean result. If evaluation fails, returns false.
 *
 * @param condition - The condition expression to evaluate
 * @param context - Variables available to the expression
 * @returns boolean result of the condition
 */
export declare function safeEvalCondition(condition: string, context?: Record<string, unknown>): boolean;
/**
 * Safely interpolate template expressions within `{{...}}` markers.
 *
 * Each expression is evaluated in a sandboxed context with the
 * provided variables. If an expression fails, the original
 * `{{expression}}` is preserved.
 *
 * @param template - The template string with `{{expr}}` placeholders
 * @param context - Variables available to expressions
 * @returns The interpolated string
 */
export declare function safeInterpolate(template: string, context: Record<string, unknown>): string;
