import { getTableColumns, type SQL } from 'drizzle-orm'; import type { ResolvedTableAccess, SortOrder } from './access.js'; import type { AnyDb } from './dialect.js'; /** Caps both `?limit=` and the number of values in an `IN` filter. */ export declare const MAX_LIST_LIMIT = 200; /** Default page size when a request omits `limit`. */ export declare const DEFAULT_LIST_LIMIT = 20; /** * What a list procedure accepts. Shape and column types are enforced by the * generated input schema, so by the time these params arrive they are already * validated and coerced — this module only applies policy (defaults, the limit * cap, cursor rules). */ export type ListParamsInput = { limit?: number; offset?: number; cursor?: string; sort?: string; order?: SortOrder; q?: string; count?: boolean; filters?: Record; }; export type ParsedListParams = { limit: number; offset?: number; sort: string; order: SortOrder; q: string; cursor?: string; count: boolean; filters: Record; }; export type ListResult = { items: T[]; limit: number; offset?: number; cursor?: string; nextCursor?: string; hasMore: boolean; total?: number; q?: string; sort: string; order: SortOrder; }; type CursorPayload = { sort: string; order: SortOrder; v: string | number | null; id: string | number; }; /** * Applies list policy to already-validated input: defaults, the limit cap, and * the rules a schema cannot express (cursor excludes offset, and a cursor must * agree with the sort it was minted for). */ export declare function resolveListParams(input: ListParamsInput, access: ResolvedTableAccess): ParsedListParams; export declare function encodeCursor(payload: CursorPayload): string; export declare function decodeCursor(cursor: string): CursorPayload; export declare function executeList>(db: AnyDb, table: Parameters[0], access: ResolvedTableAccess, params: ParsedListParams, idCol: unknown, scopeWhere?: SQL): Promise>; export {}; //# sourceMappingURL=list-query.d.ts.map