/** * SPDX-FileCopyrightText: © 2022 Liferay, Inc. * SPDX-License-Identifier: BSD-3-Clause */ import React from 'react'; import { MoveItemIndex } from './context'; export declare type DragAndDropMessages = { dragDescriptionKeyboard: string; dragItem: string; dragStartedKeyboard: string; dropCanceled: string; dropComplete: string; dropDescriptionKeyboard: string; dropIndicator: string; dropOn: string; endDragKeyboard: string; insertAfter: string; insertBefore: string; }; export declare type Value = { [propName: string]: any; cursor: Array; indexes: Array; itemRef: React.RefObject; key: React.Key; nextKey?: React.Key; parentItemRef: React.RefObject; prevKey?: React.Key; }; declare type ContextProps = { mode: 'keyboard' | 'mouse' | null; position: 'bottom' | 'middle' | 'top' | null; currentDrag: React.Key | null; dragDescribedBy: string; dragDropDescribedBy: string; dragCancelDescribedBy: string; currentTarget: React.Key | null; messages: DragAndDropMessages; onCancel: () => void; onEnd: () => void; onDragStart: (mode: 'keyboard' | 'mouse', target: React.Key) => void; onPositionChange: (key: React.Key, position: Position) => void; onDrop: () => void; }; declare type Props = { children: React.ReactNode; messages?: DragAndDropMessages; nestedKey: string; onItemHover?: (item: T, parentItem: T, index: MoveItemIndex) => boolean; onItemMove?: (item: T, parentItem: T, index: MoveItemIndex) => boolean; rootRef: React.RefObject; }; export declare function DragAndDropProvider({ children, messages, nestedKey, onItemMove, onItemHover, rootRef, }: Props): JSX.Element; export declare const TARGET_POSITION: { readonly BOTTOM: "bottom"; readonly MIDDLE: "middle"; readonly TOP: "top"; }; declare type ValueOf = T[keyof T]; export declare type Position = ValueOf; export declare function getNewItemPath(path: Array, overPosition: Position): number[]; export declare const useDnD: () => ContextProps; export {};