import { type Readable } from 'node:stream';
import type { AppConfig } from '../config.js';
import type { UploadManifest, UploadResponse } from '../../shared/protocol.js';
export type UploadLimits = Pick<AppConfig, 'uploadMaxFiles' | 'uploadMaxFileBytes' | 'uploadMaxBatchBytes'>;
export interface CreateUploadSessionOptions {
    destinationCwd: string;
    limits: UploadLimits;
    manifest: UploadManifest;
}
export declare class UploadRequestError extends Error {
    readonly statusCode: number;
    readonly code: string;
    constructor(statusCode: number, code: string);
}
export interface UploadSession {
    writeFile(fieldName: string, stream: Readable): Promise<void>;
    finish(): Promise<UploadResponse>;
    abort(): Promise<void>;
}
export declare function createUploadSession(options: CreateUploadSessionOptions): Promise<UploadSession>;
export declare function parseUploadManifest(value: unknown): UploadManifest | null;
