/** * Pure validation core of FileDropzone — typed rejections, accept matching * (MIME exact / wildcard / extension), size and collective count rules. * Ported behaviors from the react-dropzone reference study (blueprint M5). */ export type FileDropzoneErrorCode = "file-invalid-type" | "file-too-large" | "file-too-small" | "too-many-files"; export interface FileDropzoneError { /** One of the four built-in codes, or a custom code from `validator`. */ code: FileDropzoneErrorCode | string; message: string; } export interface FileRejection { file: File; errors: FileDropzoneError[]; } export interface ValidateFilesOptions { accept?: Record; maxSize?: number; minSize?: number; maxFiles?: number; multiple?: boolean; validator?: (file: File) => FileDropzoneError | FileDropzoneError[] | null; } /** * Matches a file against an `accept` map ({mime: [ext...]}): exact MIME, * `type/*` wildcard, or extension (case-insensitive). No accept → accepts * everything. An empty `file.type` is accepted (Chrome reports "" for some * types during drag) — real validation happens again on drop. */ export declare function matchesAccept(file: File, accept?: Record): boolean; /** * Validates files against accept/size/count rules plus an optional custom * validator. Per-file errors accumulate; the maxFiles/multiple rule is * COLLECTIVE and all-or-nothing: exceeding it rejects EVERY file with * `too-many-files` (ported from the reference behavior). */ export declare function validateFiles(files: File[], options?: ValidateFilesOptions): { accepted: File[]; rejections: FileRejection[]; };