@uva-glass/component-library
Version:
React components UvA
50 lines (49 loc) • 2.06 kB
TypeScript
import { CLEAR_DRAGGING_SOURCE, CLEAR_DRAGGING_TARGET, DRAG_END, DRAG_START, DROP, MOVE_TO_POSITION, RESET, SET_CLONE, SET_DRAGGING_SOURCE, SET_DRAGGING_TARGET } from './constants';
type ClearDraggingSourceAction = {
type: typeof CLEAR_DRAGGING_SOURCE;
};
type ClearDraggingTargetAction = {
type: typeof CLEAR_DRAGGING_TARGET;
};
type DragEndAction = {
type: typeof DRAG_END;
};
type DragStartAction = {
type: typeof DRAG_START;
payload: number;
};
type DropAction = {
type: typeof DROP;
payload: number;
};
type MoveToPositionAction = {
type: typeof MOVE_TO_POSITION;
payload: number;
};
type ResetAction = {
type: typeof RESET;
};
type SetCloneAction = {
type: typeof SET_CLONE;
payload: Element;
};
type SetDraggingSourceAction = {
type: typeof SET_DRAGGING_SOURCE;
payload: number;
};
type SetDraggingTargetAction = {
type: typeof SET_DRAGGING_TARGET;
payload: number;
};
export type Actions = ClearDraggingSourceAction | ClearDraggingTargetAction | DragEndAction | DragStartAction | DropAction | MoveToPositionAction | ResetAction | SetCloneAction | SetDraggingSourceAction | SetDraggingTargetAction;
export declare const setClone: (payload: SetCloneAction["payload"]) => SetCloneAction;
export declare const clearDraggingSource: () => ClearDraggingSourceAction;
export declare const clearDraggingTarget: () => ClearDraggingTargetAction;
export declare const dragEnd: () => DragEndAction;
export declare const dragStart: (draggingItemIndex: DragStartAction["payload"]) => DragStartAction;
export declare const drop: (targetItemIndex: DropAction["payload"]) => DropAction;
export declare const moveToPosition: (targetItemIndex: MoveToPositionAction["payload"]) => MoveToPositionAction;
export declare const reset: () => ResetAction;
export declare const setDraggingSource: (sourceItemIndex: SetDraggingSourceAction["payload"]) => SetDraggingSourceAction;
export declare const setDraggingTarget: (targetItemIndex: SetDraggingTargetAction["payload"]) => SetDraggingTargetAction;
export {};