UNPKG

vue-hooks-plus

Version:
64 lines (63 loc) 1.75 kB
import { BasicTarget } from '../utils/domTarget'; export interface UseDropOptions { /** * The callback when file is dropped or pasted * @param files File[] * @param event DragEvent * @returns void */ onFiles?: (files: File[], event?: DragEvent) => void; /** * The callback when uri is dropped or pasted * @param url string * @param event DragEvent * @returns void */ onUri?: (url: string, event?: DragEvent) => void; /** * The callback when DOM is dropped or pasted * @param content any * @param event DragEvent * @returns void */ onDom?: (content: any, event?: DragEvent) => void; /** * The callback when text is dropped or pasted * @param text `string` * @param event `ClipboardEvent` * @returns `void` */ onText?: (text: string, event?: ClipboardEvent) => void; /** * On drag enter callback * @param event `DragEvent` * @returns `void` */ onDragEnter?: (event?: DragEvent) => void; /** * On drag over callback * @param event `DragEvent`` * @returns `void` */ onDragOver?: (event?: DragEvent) => void; /** * On drag leave callback * @param event `DragEvent` * @returns `void` */ onDragLeave?: (event?: DragEvent) => void; /** * The callback when any is dropped * @param event DragEvent * @returns void */ onDrop?: (event?: DragEvent) => void; /** * The callback when any is pasted * @param event ClipboardEvent * @returns void */ onPaste?: (event?: ClipboardEvent) => void; } declare const useDrop: (target: BasicTarget, options?: UseDropOptions) => void; export default useDrop;