import type { Ref } from 'vue'; import DraggableGroup from 'vuedraggable'; export interface IChangeEvent { moved: { oldIndex: number; newIndex: number; }; } export declare function isChangeEvent(event: unknown): event is IChangeEvent; interface IUseFunctionReturnValue { onDragAndDrop(event: unknown): void; } declare type OnChangeWithIndices = (oldIndex: number, newIndex: number) => void; declare type OnChangeWithItems = (items: T[]) => void; /** * Use this with DraggableGroup to implement order change logic. * @param onChange called when user drops an item to a new place, receives old index and new index */ export declare function useDragAndDrop(onChange: OnChangeWithIndices): IUseFunctionReturnValue; /** * Use this with DraggableGroup to implement order change logic. * @param onChange called when user drops an item to a new place, receives new items array with swapped items * @param items any Ref`ish thing you want to be sortable */ export declare function useDragAndDrop(onChange: OnChangeWithItems, items?: Ref): IUseFunctionReturnValue; export default DraggableGroup;