react-dnd-test-backend
Version:
A mock backend for testing React DnD apps
22 lines (21 loc) • 913 B
TypeScript
import type { Backend, BeginDragOptions, DragDropManager, HoverOptions, Identifier, Unsubscribe } from 'dnd-core';
import type { ITestBackend, TestBackendContext } from './types.js';
export declare class TestBackendImpl implements Backend, ITestBackend {
didCallSetup: boolean;
didCallTeardown: boolean;
manager: DragDropManager;
context: TestBackendContext;
private actions;
constructor(manager: DragDropManager, context: TestBackendContext);
profile(): Record<string, number>;
setup(): void;
teardown(): void;
connectDragSource(): Unsubscribe;
connectDragPreview(): Unsubscribe;
connectDropTarget(): Unsubscribe;
simulateBeginDrag(sourceIds: Identifier[], options: BeginDragOptions): void;
simulatePublishDragSource(): void;
simulateHover(targetIds: Identifier[], options: HoverOptions): void;
simulateDrop(): void;
simulateEndDrag(): void;
}