/**
 * Prisma-backed `DocumentPersistence` for `@actuate-media/realtime`.
 *
 * Reads and writes the `DocumentCRDT` table (see
 * `prisma/cms-schema.prisma`). The adapter is intentionally narrow — it only
 * implements the two methods declared by the realtime package, so it can be
 * swapped for an S3 / Redis / Postgres-LO adapter without touching the
 * gateway code.
 *
 * The `save` path also keeps the `stateVector` column in sync so future
 * versions of the gateway can answer `SyncStep1` without ever booting a
 * `Y.Doc` (a future optimisation for hot-path late joins).
 */
import type { DocumentPersistence } from '@actuate-media/realtime';
/** Minimal subset of the Prisma client the persistence adapter needs. */
export interface PrismaDocumentCRDTClient {
    documentCRDT: {
        findUnique(args: {
            where: {
                documentId: string;
            };
            select?: {
                state?: boolean;
                stateVector?: boolean;
                version?: boolean;
            };
        }): Promise<{
            state: Uint8Array;
            stateVector?: Uint8Array;
            version?: number;
        } | null>;
        upsert(args: {
            where: {
                documentId: string;
            };
            create: {
                documentId: string;
                state: Uint8Array;
                stateVector: Uint8Array;
                version: number;
                lastUpdatedById?: string | null;
            };
            update: {
                state: Uint8Array;
                stateVector: Uint8Array;
                version: {
                    increment: number;
                };
                lastUpdatedById?: string | null;
            };
        }): Promise<{
            documentId: string;
            version: number;
        }>;
    };
}
export interface PrismaDocumentPersistenceOptions {
    /**
     * Optional default editor id used for `lastUpdatedById` when the gateway
     * does not supply one. In production the gateway derives this from the
     * authenticated session per save.
     */
    lastUpdatedById?: string | null;
}
/**
 * Create a `DocumentPersistence` backed by a `DocumentCRDT` Prisma table.
 *
 * The returned object satisfies the realtime package's contract so it can
 * be passed straight to `bindPersistence(room, persistence)`.
 */
export declare function createPrismaDocumentPersistence(db: PrismaDocumentCRDTClient, options?: PrismaDocumentPersistenceOptions): DocumentPersistence;
//# sourceMappingURL=persistence.d.ts.map