import { constants } from 'node:fs'; import type { SqliteSerializationDatabase } from './adapter.js'; export interface BackupArtifactAttestation { readonly device: bigint; readonly inode: bigint; readonly owner: bigint; readonly group: bigint; readonly mode: bigint; readonly size: bigint; readonly linkCount: bigint; readonly sha256: string; } export interface BackupDirectoryAttestation { readonly path: string; readonly device: bigint; readonly inode: bigint; readonly owner: bigint; readonly group: bigint; readonly mode: bigint; } export interface SerializedBackupArtifact { readonly path: string; readonly directory: BackupDirectoryAttestation; readonly artifact: BackupArtifactAttestation; } export interface BackupCreationHooks { /** Runs immediately before serializing the already-open source connection. */ readonly beforeSerialization?: () => void | Promise; /** Runs after the backup directory inode is bound, before the backup worker starts. */ readonly afterDirectoryBound?: () => void | Promise; /** Runs with the unpredictable output name before its create-only open. */ readonly beforeArtifactWrite?: (output: string) => void | Promise; /** Runs after the worker attests the artifact, before it is handed to init. */ readonly afterArtifactWritten?: (output: string) => void | Promise; } export interface SerializedBackupCreationHooks extends BackupCreationHooks { /** Runs with the canonical output path before source serialization or filesystem mutation. */ readonly validateDestination?: (output: string) => void | Promise; } export interface PosixBackupOpenFlags { readonly directory: number; readonly noFollow: number; readonly nonBlock: number; } type BackupOpenFlagConstants = Pick; /** * Resolve the pathname-safety flags as one mandatory POSIX capability. A * supported non-Windows runtime must provide every flag; dropping one to zero * would silently remove the directory, no-follow, or nonblocking guarantee. */ export declare function requirePosixBackupOpenFlags(platform?: NodeJS.Platform, openFlags?: Partial): PosixBackupOpenFlags | undefined; /** * Serialize the exact already-open source and install one create-only backup. * The output directory must already exist and is never chmodded by this path. */ export declare function createSerializedBackupArtifact(database: SqliteSerializationDatabase, destination: string, hooks?: SerializedBackupCreationHooks): Promise; export {}; //# sourceMappingURL=serialized-backup.d.ts.map