react-dnd-test-backend
Version:
A mock backend for testing React DnD apps
18 lines (17 loc) • 557 B
TypeScript
import type { Backend, Identifier } from 'dnd-core';
export interface TestBackendContext {
window?: Window;
document?: Document;
}
export interface TestBackendOptions {
onCreate?: (be: ITestBackend) => void;
}
export interface ITestBackend extends Backend {
didCallSetup: boolean;
didCallTeardown: boolean;
simulateBeginDrag(sourceIds: Identifier[], options?: any): void;
simulatePublishDragSource(): void;
simulateHover(targetIds: Identifier[], options?: any): void;
simulateDrop(): void;
simulateEndDrag(): void;
}