import type { RowType, UntypedTableDef } from './table.ts'; import { Timestamp } from './timestamp.ts'; import { Uuid } from './uuid.ts'; export type Value = string | number | boolean | Uuid | Timestamp; export type Expr = { type: 'eq'; key: Column; value: Value; } | { type: 'and'; children: Expr[]; } | { type: 'or'; children: Expr[]; }; export declare const eq: (key: Column, value: Value) => Expr; export declare const and: (...children: Expr[]) => Expr; export declare const or: (...children: Expr[]) => Expr; export declare const isEq: (e: Expr) => e is Extract, { type: "eq"; }>; export declare const isAnd: (e: Expr) => e is Extract, { type: "and"; }>; export declare const isOr: (e: Expr) => e is Extract, { type: "or"; }>; export declare function evaluate(expr: Expr, row: Record): boolean; export declare function toString(tableDef: TableDef, expr: Expr>>): string; /** * This is just the identity function to make things look like SQL. * @param expr * @returns */ export declare function where(expr: Expr): Expr; type MembershipChange = 'enter' | 'leave' | 'stayIn' | 'stayOut'; export declare function classifyMembership>(where: Expr | undefined, oldRow: R, newRow: R): MembershipChange; /** * Extracts the column names from a RowType whose values are of type Value. * Note that this will exclude columns that are of type object, array, etc. */ export type ColumnsFromRow = { [K in keyof R]-?: R[K] extends Value | undefined ? K : never; }[keyof R] & string; export {}; //# sourceMappingURL=filter.d.ts.map