@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
33 lines (32 loc) • 1.51 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2023 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------*/
import * as React from 'react';
import { NormalizedDragEvent } from '@progress/kendo-draggable-common';
/**
* Represents the `ref` object of the `Droppable` component.
*/
export interface DroppableHandle {
/**
* The element which is registered as droppable.
*/
element?: HTMLElement;
}
/**
* Represents the KendoReact `useDroppable` hook.
* Use it to attach `drop` events to a native HTML DOM elements, or custom React Components.
*
* For more information, refer to the [KendoReact Droppable]({% slug droppable_drag-and-drop %}) article.
*
* @param ref - The `ref` of the HTML Element or React Component which will enable the `droppable` functionality.
* @param callbacks - A collection of callbacks, called by the `useDroppable` hook when a specific action occurs.
*/
export declare function useDroppable(ref: React.RefObject<HTMLElement | null | {
element: HTMLElement | null;
}>, callbacks?: {
onDragEnter?: (event: NormalizedDragEvent) => void;
onDragOver?: (event: NormalizedDragEvent) => void;
onDragLeave?: (event: NormalizedDragEvent) => void;
onDrop?: (event: NormalizedDragEvent) => void;
}): void;