bknd
Version:
Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
16 lines (15 loc) • 634 B
TypeScript
import { type ChangeEvent } from "react";
import { type FileWithPath, fromEvent } from "./file-selector";
type DropzoneProps = {
onDropped: (files: FileWithPath[]) => void;
onOver?: (items: DataTransferItem[], event: DragEvent) => void;
onLeave?: () => void;
};
export declare function useDropzone({ onDropped, onOver, onLeave }: DropzoneProps): {
ref: import("react").RefObject<HTMLDivElement | null>;
isOver: boolean;
fromEvent: typeof fromEvent;
onDropped: (files: FileWithPath[]) => void;
handleFileInputChange: (e: ChangeEvent<HTMLInputElement>) => Promise<void>;
};
export type { FileWithPath };