export interface FileIntakeFilter { /** * E.g. `"application/pdf,image/*"`, matched on MIME (extension when undeclared) or on the * filename for a `.ext` pattern. */ accept?: string; /** Default true. */ multiple?: boolean; } /** * A drop's `dataTransfer` and a paste's `clipboardData` are the same object; structural so it tests * without a DOM. */ export interface FileTransferLike { readonly files?: ArrayLike | null; readonly items?: ArrayLike<{ readonly kind: string; getAsFile: () => File | null; }> | null; } /** Readonly, so a `RefObject` assigns. */ export interface RegionRef { readonly current: unknown; } export interface UsePasteFilesOptions extends FileIntakeFilter { /** Upload belongs to the host. */ onFiles: (files: File[]) => void; /** * Default true; scope it to while the surface is open so a background screen never swallows a * paste. */ enabled?: boolean; /** * Focus inside it wins over a later sink (`selectPasteSink`). Omit for a modal, which routes by * stack order. */ region?: RegionRef; } /** * Patterns are `.ext`, `type/*` or an exact MIME; empty accepts all. An undeclared or * `octet-stream` type is judged by extension, since an OS clipboard paste declares nothing and * rejecting it would drop the file invisibly. `resolveMimeType` decides, matching what the server * stores. */ export declare function matchesAccept(file: File, accept: string | undefined): boolean; /** A new array; never throws on an empty transfer. */ export declare function filesFromTransfer(transfer: FileTransferLike | null | undefined, filter?: FileIntakeFilter): File[]; export interface PasteSinkEntry { sink: T; /** A region-less sink is always false. */ focused: boolean; } /** * Sinks in mount order: the top-most focused region wins; with none focused, the top of the stack * (right for modals). `undefined` when empty. Pure; `focused` is computed at dispatch. */ export declare function selectPasteSink(entries: readonly PasteSinkEntry[]): T | undefined;