mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-29 15:44:31 +00:00
add DragDropContextProvider
This commit is contained in:
8
types/react-dnd/index.d.ts
vendored
8
types/react-dnd/index.d.ts
vendored
@@ -52,6 +52,14 @@ declare module __ReactDnd {
|
||||
backend: Backend
|
||||
): <P>(componentClass: React.ComponentClass<P> | React.StatelessComponent<P>) => ContextComponentClass<P>;
|
||||
|
||||
interface DragDropContextProviderProps {
|
||||
backend: Backend,
|
||||
window?: Window,
|
||||
}
|
||||
|
||||
export class DragDropContextProvider extends React.Component<DragDropContextProviderProps> {
|
||||
}
|
||||
|
||||
export function DragLayer<P>(
|
||||
collect: DragLayerCollector,
|
||||
options?: DndOptions<P>
|
||||
|
||||
@@ -10,17 +10,18 @@ import DragSource = ReactDnd.DragSource;
|
||||
import DropTarget = ReactDnd.DropTarget;
|
||||
import DragLayer = ReactDnd.DragLayer;
|
||||
import DragDropContext = ReactDnd.DragDropContext;
|
||||
import DragDropContextProvider = ReactDnd.DragDropContextProvider;
|
||||
import HTML5Backend, { getEmptyImage, NativeTypes } from "react-dnd-html5-backend";
|
||||
declare class TestBackend {
|
||||
setup(): void;
|
||||
teardown(): void;
|
||||
connectDragSource(): void;
|
||||
connectDropTarget(): void;
|
||||
simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void;
|
||||
simulatePublishDragSource(): void;
|
||||
simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void;
|
||||
simulateDrop(): void;
|
||||
simulateEndDrag(): void;
|
||||
setup(): void;
|
||||
teardown(): void;
|
||||
connectDragSource(): void;
|
||||
connectDropTarget(): void;
|
||||
simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void;
|
||||
simulatePublishDragSource(): void;
|
||||
simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void;
|
||||
simulateDrop(): void;
|
||||
simulateEndDrag(): void;
|
||||
}
|
||||
|
||||
// Game Component
|
||||
@@ -307,3 +308,17 @@ Board.createWithHTMLBackend({
|
||||
Board.createWithTestBackend({
|
||||
knightPosition: [0, 0]
|
||||
});
|
||||
|
||||
|
||||
// DragAndDropContextProvider
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default class YourApp {
|
||||
render() {
|
||||
return (
|
||||
<DragDropContextProvider backend={HTML5Backend}>
|
||||
/* ... */
|
||||
</DragDropContextProvider>
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
@@ -18,6 +19,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-dnd-tests.ts"
|
||||
"react-dnd-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user