import type { FormField, FormSubmissionFile } from './types.js';
/** Conservative default allowlist for form attachments (images + common docs). */
export declare const FORM_UPLOAD_ALLOWED_MIME_TYPES: readonly string[];
export declare const DEFAULT_MAX_FILE_BYTES: number;
export interface IncomingFile {
    fieldKey: string;
    fileName: string;
    mimeType: string;
    size: number;
    buffer: Buffer;
}
export interface FileValidationError {
    fieldKey: string;
    message: string;
}
export interface ValidateFilesResult {
    ok: boolean;
    errors: FileValidationError[];
}
export interface ValidateFilesOptions {
    /** Global ceiling; per-field `maxFileSizeMB` can only be smaller. */
    maxSizeBytes?: number;
    /** Global MIME allowlist; per-field `fileTypes` can only narrow it. */
    allowedMimeTypes?: readonly string[];
}
/**
 * Validate every incoming file against its field's rules. Returns all errors
 * (not just the first) so the submitter can fix everything in one round-trip.
 */
export declare function validateSubmissionFiles(fields: FormField[], incoming: IncomingFile[], options?: ValidateFilesOptions): ValidateFilesResult;
/**
 * Upload validated files via the storage adapter and persist metadata rows.
 * Must be called *after* the submission row exists (files reference it). When
 * no storage adapter is configured the upload is skipped and the file is
 * dropped with a warning rather than failing the whole submission.
 */
export declare function persistSubmissionFiles(formId: string, submissionId: string, files: IncomingFile[]): Promise<FormSubmissionFile[]>;
//# sourceMappingURL=files.d.ts.map