@tanstack/db
Version:
A reactive client store for building super fast apps on sync
20 lines (19 loc) • 801 B
text/typescript
import { BasicExpression } from '../ir.js';
import { NamespacedRow } from '../../types.js';
/**
* Compiled expression evaluator function type
*/
export type CompiledExpression = (namespacedRow: NamespacedRow) => any;
/**
* Compiled single-row expression evaluator function type
*/
export type CompiledSingleRowExpression = (item: Record<string, unknown>) => any;
/**
* Compiles an expression into an optimized evaluator function.
* This eliminates branching during evaluation by pre-compiling the expression structure.
*/
export declare function compileExpression(expr: BasicExpression): CompiledExpression;
/**
* Compiles a single-row expression into an optimized evaluator function.
*/
export declare function compileSingleRowExpression(expr: BasicExpression): CompiledSingleRowExpression;