@uva-glass/component-library
Version:
React components UvA
24 lines (23 loc) • 915 B
TypeScript
import { ReactElement } from 'react';
import { SortableStateType } from './sortableReducer';
type SortableContextType = {
clearDraggingSource: () => void;
clearDraggingTarget: () => void;
dragEnd: () => void;
dragStart: (index: number) => void;
drop: (index: number) => void;
moveToPosition: (index: number) => void;
reset: () => void;
setClone: (node: Element) => void;
setDraggingSource: (index: number) => void;
setDraggingTarget: (index: number) => void;
};
interface Props {
children: SortableStateType['sortableItems'];
items: ReactElement[] | string[];
scrollable?: boolean;
onSort?: (items: (string | ReactElement)[]) => void;
}
export declare function SortableProvider({ children, items, scrollable, onSort }: Props): import("react/jsx-runtime").JSX.Element;
export declare function useSortable(): SortableContextType & SortableStateType;
export {};