import type { BindingContext } from './types'; /** * Registers ahead-of-time compiled expression functions produced by the * optional view compiler ({@link https://bquery.js.org/guide/view | view guide}). * * Each function must accept the binding context (or its lazy proxy) and return * the expression's value — exactly the calling convention the runtime evaluator * uses — so the same function serves both {@link evaluate} (signals unwrapped) * and {@link evaluateRaw} (raw signals). Registering an expression is purely an * optimization: unregistered expressions still evaluate at runtime, unchanged. * * This is normally called by the module emitted from * `@bquery/bquery/view/compiler`, not by hand. * * @example * ```ts * import { registerCompiledExpressions } from '@bquery/bquery/view'; * * registerCompiledExpressions({ * 'count + 1': ($ctx) => $ctx.count + 1, * }); * ``` */ export declare const registerCompiledExpressions: (entries: Record unknown>) => void; /** * Removes all registered ahead-of-time compiled expressions. Mainly useful for * tests that want to assert the runtime fallback path. */ export declare const clearCompiledExpressions: () => void; /** * Clears all cached compiled expression functions. * Call this when unmounting views or to free memory after heavy template usage. * * @example * ```ts * import { clearExpressionCache } from 'bquery/view'; * * // After destroying a view or when cleaning up * clearExpressionCache(); * ``` */ export declare const clearExpressionCache: () => void; /** * Evaluates an expression in the given context using `new Function()`. * * Signals and computed values in the context are lazily unwrapped only when * accessed by the expression, avoiding unnecessary subscriptions to unused values. * * @security **WARNING:** This function uses dynamic code execution via `new Function()`. * - NEVER pass expressions derived from user input or untrusted sources * - Expressions should only come from developer-controlled templates * - Malicious expressions can access and exfiltrate context data * - Consider this equivalent to `eval()` in terms of security implications * * @internal */ export declare const evaluate: (expression: string, context: BindingContext) => T; /** * Evaluates an expression and returns the raw value (for signal access). * * @security **WARNING:** Uses dynamic code execution. See {@link evaluate} for security notes. * @internal */ export declare const evaluateRaw: (expression: string, context: BindingContext) => T; /** * Parses object expression like "{ active: isActive, disabled: !enabled }". * Handles nested structures like function calls, arrays, and template literals. * @internal */ export declare const parseObjectExpression: (expression: string) => Record; //# sourceMappingURL=evaluate.d.ts.map