react-dnd-test-utils
Version:
20 lines (19 loc) • 922 B
TypeScript
import type { BackendFactory } from 'dnd-core';
import type { ComponentType } from 'react';
import type { ITestBackend } from 'react-dnd-test-backend';
/**
* Wrap a Component with a DnDContext using the TestBackend
*
* @param DecoratedComponent The component to decorate
* @returns [Component, getBackend] The wrapped component and a utility method
* to get the test backend instance.
*/
export declare function wrapWithTestBackend<T>(DecoratedComponent: ComponentType<T>): [ComponentType<T>, () => ITestBackend | undefined];
/**
* Wrap a component with a DndContext providing a backend.
*
* @param DecoratedComponent The compoent to decorate
* @param Backend The backend to use (default=HTML5Backend)
* @param backendOptions The optional backend options
*/
export declare function wrapWithBackend<T>(DecoratedComponent: ComponentType<T>, Backend?: BackendFactory, backendOptions?: unknown): ComponentType<T>;