/** * Returns `expression` when it only uses the allowed grammar, otherwise `null`. */ export declare const getSafeStateExpression: (expression: string) => string | null; /** * Extracts the expression from code produced by `parseCode` (`return (expr);`) or * from the editor's transpiled form (`var _virtual_index=expr;` followed by a return of it). * (Mitosis treats any file containing a literal "return" + " _virtual_index" as a function body.) */ export declare const getSafeStateExpressionFromCode: (code: string) => string | null; type SafeExpressionFn = (state: Record) => unknown; /** * The compiled expression for `code`, or `null` when `code` is not a safe state expression. */ export declare const getSafeStateExpressionFn: (code: string) => SafeExpressionFn | null; /** * A read-only view of local state over root state, without copying either. * * Plain objects and arrays are wrapped so every nested read is checked: accessors * anywhere on the prototype chain, class instances and functions (which could run * getters or custom `valueOf`/`toString`) abort the read. Each source object maps to * one wrapper for the life of the view, so `===` still compares the underlying objects. * Wrappers target a fresh empty container rather than the object itself, because proxy * invariants forbid returning a wrapper for a frozen (non-configurable) property. */ export declare const getReadOnlyStateView: (rootState: Record, localState: Record | undefined, isProxy: (value: unknown) => boolean) => {}; export declare const NOT_EVALUATED: unique symbol; /** * Evaluates `code` outside the sandbox when it is a safe state expression over plain * data and produces a primitive. Returns `NOT_EVALUATED` when the sandbox must run it. */ export declare const evaluateSafeStateExpression: (code: string, rootState: Record, localState: Record | undefined, isProxy: (value: unknown) => boolean) => unknown; export {};