/**
 * File Upload Handler
 * Handles multipart/form-data file uploads with validation and storage integration
 */
import type { ReadableOptions } from '../node-singletons/stream';
import type { IRequest } from './Request';
type Streamer = ReadableOptions | NodeJS.ReadableStream;
export interface UploadedFile {
    fieldName: string;
    originalName: string;
    mimeType: string;
    size: number;
    encoding?: string;
    /**
     * Legacy in-memory payload (Phase 3). Optional in Phase 4.
     */
    buffer?: Buffer;
    /**
     * Disk-backed upload path (Phase 4, provided by @zintrust/storage).
     */
    path?: string;
    /**
     * Returns a fresh readable stream for the uploaded content.
     */
    stream?: () => Streamer;
    /**
     * Optional cleanup hook (e.g., delete temp file after response).
     */
    cleanup?: () => Promise<void>;
}
export interface FileUploadOptions {
    maxSize?: number;
    mimeTypes?: string[];
    required?: boolean;
}
export interface IFileUploadHandler {
    file(fieldName: string, options?: FileUploadOptions): UploadedFile | undefined;
    files(fieldName: string, options?: FileUploadOptions): UploadedFile[];
    hasFile(fieldName: string): boolean;
    validate(): {
        valid: boolean;
        errors: Record<string, string[]>;
    };
}
/**
 * Create file upload handler for request
 */
export declare const createFileUploadHandler: (req: IRequest) => IFileUploadHandler;
export declare const FileUpload: Readonly<{
    /**
     * Create handler for request
     */
    createHandler(req: IRequest): IFileUploadHandler;
    /**
     * Validate uploaded files
     */
    validateFiles(files: UploadedFile[], options: {
        required?: boolean;
        minCount?: number;
        maxCount?: number;
        mimeTypes?: string[];
        maxSize?: number;
    }): {
        valid: boolean;
        error?: string;
    };
}>;
export default FileUpload;
//# sourceMappingURL=FileUpload.d.ts.map