/**
 * Minimal S3-compatible client for Cloudflare R2, built on aws4fetch (SigV4
 * over the platform `fetch` + WebCrypto — works identically under Bun and
 * Node >= 22). Only the verbs the backup target needs: put / get / head / list /
 * delete.
 *
 * No mounting, no FUSE: this is a plain object-store client driven on demand by
 * `agents sessions export --to-r2` / `import --from-r2`, which is the only
 * approach that is seamless on both macOS and Linux (Mountpoint for S3 is
 * Linux-only; rclone-mount needs macFUSE).
 */
import type { R2Config } from './config.js';
export interface HeadResult {
    size: number;
    etag: string;
}
export declare class R2Client {
    readonly kind: "byo";
    private aws;
    private base;
    constructor(cfg: R2Config);
    private url;
    /** Upload an object. Overwrites unconditionally. */
    put(key: string, body: string | Uint8Array, contentType?: string): Promise<void>;
    /** Fetch an object as text, or null if it does not exist (404). */
    get(key: string): Promise<string | null>;
    /** HEAD an object for size + etag, or null if it does not exist. */
    head(key: string): Promise<HeadResult | null>;
    /** Delete an object (no error if it is already absent). */
    delete(key: string): Promise<void>;
    /** List immediate sub-prefixes under a prefix (delimiter '/'), e.g. machine dirs. */
    listPrefixes(prefix: string): Promise<string[]>;
    /** List all object keys under a prefix (handles pagination). An empty prefix
     *  lists the whole bucket — the default so R2Client satisfies the shared
     *  {@link SessionsBackupClient} interface (managed lists with no prefix). */
    list(prefix?: string): Promise<string[]>;
}
