import { type Readable } from 'node:stream';
import type { MediaRecord } from '../media_record.js';
import { type MediaAccountConsoleOptions } from './extension.js';
/** What the upload endpoint needs from the request. */
export interface AccountUploadRequest {
    header(name: string): string | undefined | null;
    body: Readable;
}
/** What it answers. */
export interface AccountUploadResponse {
    status: number;
    body: {
        id: string;
    } | {
        error: string;
    };
}
/** What it stores through. */
export interface AccountUploadMedia {
    readonly tenancy: {
        enabled: boolean;
    };
    readonly library: {
        attach(input: {
            ownerType: string;
            ownerId: string;
            collection: string;
            fileName: string;
            mimeType: string;
            contents: Readable;
            size?: number;
            tenantId?: string | null;
        }): Promise<MediaRecord>;
    };
}
/**
 * `POST <accountConsole.path>/uploads`: stores one file for the account console's upload
 * component. The request carries the ticket the page issued (owner, collection, tenant, expiry,
 * HMAC-signed) in `x-media-upload-ticket`, the file name in `x-file-name` and the bytes as the body.
 * Everything a collection enforces on attach (MIME whitelist, content check) still applies.
 */
export declare function handleAccountUpload(request: AccountUploadRequest, deps: {
    media: () => Promise<AccountUploadMedia>;
    options: MediaAccountConsoleOptions;
    secret: string;
    now?: () => number;
}): Promise<AccountUploadResponse>;
//# sourceMappingURL=upload_endpoint.d.ts.map