import { type SQL, type SQLWrapper } from "drizzle-orm"; import type { FilterAllowlist, SortAllowlist } from "./filter-allowlist.js"; type AnyTable = any; export interface ParseFilterOpts { query: Record; table: AnyTable; allowlist: FilterAllowlist; sortAllowlist: SortAllowlist; dialect: "sqlite" | "postgres"; maxNesting?: number; maxInListSize?: number; } export interface ParseFilterResult { where?: SQL; orderBy?: SQLWrapper[]; limit?: number; offset?: number; /** Search predicate — OR(like('%term%')) across @filterable string fields. */ searchWhere?: SQL; } export declare class FilterParseError extends Error { readonly code: string; readonly details?: Record | undefined; constructor(code: string, message: string, details?: Record | undefined); } export declare function parseFilterParams(opts: ParseFilterOpts): ParseFilterResult; /** * Translate a SQL LIKE pattern into an equivalent SQLite GLOB pattern: * `%` → `*`, `_` → `?`, and GLOB's own metacharacters (`*`, `?`, `[`) are * wrapped in single-character classes so they match literally. `]` is only * special inside a class, so it passes through. GLOB is case-sensitive, * which is why the sqlite `like` branch uses it (ADR-0049) — SQLite's * native LIKE folds ASCII case by default. */ export declare function likePatternToGlob(pattern: string): string; export {}; //# sourceMappingURL=filter-parser.d.ts.map