import type { BackupDestination } from './model';
export interface BackupSecretBackend {
    resolve(reference: string): Promise<string>;
}
export interface BackupObjectClient {
    putObject(input: {
        bucket: string;
        key: string;
        body: string | Buffer | Uint8Array;
        contentType?: string;
        metadata?: Record<string, string>;
    }): Promise<void>;
    getObjectBytes(bucket: string, key: string): Promise<{
        body: Uint8Array;
        contentLength?: number;
    }>;
    deleteObject(bucket: string, key: string): Promise<void>;
    createMultipartUpload(bucket: string, key: string, options?: {
        contentType?: string;
        metadata?: Record<string, string>;
    }): Promise<{
        UploadId: string;
    }>;
    uploadPart(bucket: string, key: string, uploadId: string, partNumber: number, body: Uint8Array | Buffer): Promise<{
        ETag: string;
    }>;
    completeMultipartUpload(bucket: string, key: string, uploadId: string, parts: Array<{
        PartNumber: number;
        ETag: string;
    }>): Promise<void>;
    abortMultipartUpload(bucket: string, key: string, uploadId: string): Promise<void>;
}
export interface MultipartCheckpoint {
    uploadId: string;
    key: string;
    parts: Array<{
        PartNumber: number;
        ETag: string;
    }>;
    bytesUploaded: number;
    encryptionIv?: string;
    plaintextChecksum?: string;
}
export interface StoredBackup {
    uri: string;
    key: string;
    sizeBytes: number;
    checksum: string;
    manifest: {
        format: 'ts-cloud-backup-v1';
        encrypted: boolean;
        plaintextChecksum: string;
        storageChecksum: string;
        contentType: string;
    };
}
export declare function encryptBackup(value: Uint8Array, secret: string, suppliedIv?: Uint8Array): Buffer;
export declare function decryptBackup(value: Uint8Array, secret: string): Buffer;
export declare function backupCredentialStatus(_destination: BackupDestination, secrets: BackupSecretBackend, now?: Date): Promise<{
    status: 'default' | 'static' | 'valid' | 'expiring' | 'expired' | 'invalid';
    expiresAt?: string;
}>;
export declare class S3BackupDestinationAdapter {
    private readonly secrets;
    private readonly clientFactory;
    private readonly multipartThreshold;
    private readonly partSize;
    constructor(secrets: BackupSecretBackend, clientFactory?: (destination: BackupDestination, credentials?: {
        accessKeyId: string;
        secretAccessKey: string;
        sessionToken?: string;
    }) => BackupObjectClient, multipartThreshold?: number, partSize?: number);
    private client;
    test(destination: BackupDestination): Promise<void>;
    upload(destination: BackupDestination, input: {
        key: string;
        body: Uint8Array;
        contentType?: string;
        resume?: MultipartCheckpoint;
        checkpoint?: (value: MultipartCheckpoint) => void;
    }): Promise<StoredBackup>;
    download(destination: BackupDestination, stored: Pick<StoredBackup, 'key' | 'checksum' | 'manifest'>): Promise<Buffer>;
    abortPartial(destination: BackupDestination, checkpoint: MultipartCheckpoint): Promise<void>;
    delete(destination: BackupDestination, key: string): Promise<void>;
}
