import { VendoError, type IsoDateTime } from "@vendoai/core"; import type { Db } from "../db.js"; export declare function iso(value: unknown): IsoDateTime; export declare function optionalIso(value: unknown): IsoDateTime | undefined; export declare function text(value: unknown): string; /** Keyset timestamps compare at millisecond precision. The timestamptz cursor * columns can hold microseconds — the §2 table map is public (direct host * SQL, and DEFAULT now() on the columns that carry one), and caller-supplied * ISO timestamps * (audit `at`, run `startedAt`) are z.string().datetime()-validated, which * accepts sub-ms digits — while cursors round-trip through JS Dates (ms). * Comparing at full precision against a truncated cursor silently skips rows * (DESC lists) or repeats them (ASC export), so every keyset predicate and * its ORDER BY route BOTH the column and the cursor parameter through this * same truncated expression. */ export declare function cursorMs(expr: string): string; export declare function encodeCursor(date: IsoDateTime, id: string): string; export declare function decodeCursor(value: string): { c: IsoDateTime; i: string; }; export declare function pageLimit(value: number | undefined): number; export declare function jsonParam(value: unknown): string; export declare function escapeLike(value: string): string; /** The owning appId of an app-scoped record collection or blob namespace, or * undefined for non-app-scoped scopes. */ export declare function appScopeId(scope: string): string | undefined; /** 02-store §4 (STORE-1): the fail-closed refusal for app-scoped writes whose * owning app has no `vendo_apps` row — never existed, or its ephemeral * session was swept. */ export declare function unknownAppError(appId: string): VendoError; /** Pre-check for non-row-creating verbs (delete, guarded mutations): a clean * error signal, not the no-orphan guarantee. Row-CREATING statements embed * the same condition in the statement itself (`WHERE EXISTS (SELECT 1 FROM * vendo_apps WHERE id = ...)`) so a sweep racing the write can never leave an * orphaned row — the guarantee is structural, not ordering care. */ export declare function requireKnownApp(db: Db, appId: string | undefined): Promise; //# sourceMappingURL=utils.d.ts.map