import { default as React } from 'react'; import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; export declare enum DropZoneStatus { /** Nothing is happening. */ Idle = "idle", /** A file drag is somewhere in the window — the zone is "armed". */ Dragging = "dragging", /** A file drag is hovering directly over this zone. */ Active = "active", /** The last drop / selection was rejected. */ Error = "error" } export declare enum DropZoneReturnType { /** Emit the raw `File` objects (default). */ File = "file", /** Read each file as a base64 data URL and emit `LoadedFile`. */ Base64 = "base64", /** Read each file as UTF-8 text and emit `LoadedFile`. */ Text = "text" } export interface LoadedFile { name: string; size: number; type: string; lastModified: number; /** The FileReader result — a base64 data URL or text, depending on `returnType`. */ data: string; } export type DropZoneRejectionReason = /** File extension / mime type not in `acceptedTypes`. */ 'unacceptedType' /** File exceeds `maxSize`. */ | 'tooLarge' /** More files than `maxFiles` were provided. */ | 'tooMany' /** Reading the file (base64 / text) failed. */ | 'readError'; export interface DropZoneRejection { file: File; reason: DropZoneRejectionReason; } export interface DropZoneRenderState { status: DropZoneStatus; /** A drag is anywhere in the window (zone armed) or directly over it. */ isDragging: boolean; /** A drag is directly over this zone. */ isActive: boolean; disabled: boolean; } export type DropZoneSlots = 'root' | 'content' | 'fileList' | 'fileItem' | 'input'; export interface DropZoneProps extends Omit { /** Static content, or a render function that receives the live drop state. */ children?: React.ReactNode | ((state: DropZoneRenderState) => React.ReactNode); /** * Accepted file types: extensions (`'.png'`), mime types (`'image/png'`), * or wildcards (`'image/*'`). Empty / omitted means accept everything. * Also drives the native picker's `accept` attribute. */ acceptedTypes?: string[]; /** Output shape for each accepted file. Default: `File`. */ returnType?: DropZoneReturnType; /** Open the native file picker when the zone is clicked. */ openPickerOnClick?: boolean; /** Allow more than one file. Default: `true`. */ multiple?: boolean; /** Reject files beyond this count (extras reported via `onReject`). */ maxFiles?: number; /** Reject files larger than this many bytes. */ maxSize?: number; /** Accept files pasted from the clipboard while the zone is focused. */ enablePaste?: boolean; /** Recurse into dropped directories. Default: `true`. */ allowDirectories?: boolean; /** Native `capture` attribute (mobile camera / mic). */ capture?: boolean | 'user' | 'environment'; disabled?: boolean; /** Drop the built-in border / background styling; keep only base layout. */ unstyled?: boolean; /** Render the names of `files` beneath the content. */ showFileNames?: boolean; /** Files whose names are listed when `showFileNames` is set. */ files?: (File | LoadedFile)[]; onFilesChanged?: (files: (File | LoadedFile)[]) => void; onReject?: (rejections: DropZoneRejection[]) => void; onStatusChanged?: (status: DropZoneStatus) => void; className?: string; style?: React.CSSProperties; classNames?: SlotClassNames; styles?: SlotStyles; }