mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update react-dnd-multi-backend to version 4.0 (#38736)
* Update to version 4.0 * Update backends type+add dependency
This commit is contained in:
parent
a21d984ca4
commit
16ec9170ea
6
types/react-dnd-multi-backend/index.d.ts
vendored
6
types/react-dnd-multi-backend/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for react-dnd-multi-backend 3.0
|
||||
// Type definitions for react-dnd-multi-backend 4.0
|
||||
// Project: https://github.com/LouisBrunner/react-dnd-multi-backend, https://louisbrunner.github.io/dnd-multi-backend/packages/react-dnd-multi-backend
|
||||
// Definitions by: Janeene Beeforth <https://github.com/dawnmist>
|
||||
// Adam Haglund <https://github.com/beeequeue>
|
||||
@ -53,6 +53,10 @@ export interface BackendDeclaration {
|
||||
* Backend - e.g. the one provided by react-dnd-html5-backend.
|
||||
*/
|
||||
backend: BackendFactory;
|
||||
/**
|
||||
* Parameters to the backend
|
||||
*/
|
||||
options?: object;
|
||||
/**
|
||||
* Flag to indicate that this backend needs to have a custom preview generated. This is mainly
|
||||
* used for backends such as the react-dnd-touch-backend, where there is no default preview
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"dnd-core": "^4.0.5"
|
||||
"dnd-core": "^9.3.1",
|
||||
"react-dnd-touch-backend": "^9.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ const context = {};
|
||||
/**
|
||||
* Most common use case - using the default HTML5 with Touch as a fallback.
|
||||
*/
|
||||
const multiDndComponent = createDragDropManager(MultiBackend(HTML5ToTouch), context);
|
||||
const multiDndComponent = createDragDropManager(MultiBackend(HTML5ToTouch), context, {});
|
||||
|
||||
/**
|
||||
* Creating a custom list of backends, including creating a touch transition.
|
||||
@ -17,18 +17,19 @@ const multiDndComponent = createDragDropManager(MultiBackend(HTML5ToTouch), cont
|
||||
const CustomBackends: Backends = {
|
||||
backends: [
|
||||
{
|
||||
backend: TouchBackend({ enableMouseEvents: false }),
|
||||
backend: TouchBackend,
|
||||
options: { enableMouseEvents: false },
|
||||
preview: true,
|
||||
transition: createTransition('touchstart', (event: TouchEvent) => {
|
||||
return event.touches != null;
|
||||
})
|
||||
},
|
||||
{
|
||||
backend: TouchBackend({}),
|
||||
backend: TouchBackend,
|
||||
transition: TouchTransition
|
||||
}]
|
||||
};
|
||||
const multiCustomBackendsComponent = createDragDropManager(MultiBackend(CustomBackends), context);
|
||||
const multiCustomBackendsComponent = createDragDropManager(MultiBackend(CustomBackends), context, {});
|
||||
|
||||
/**
|
||||
* Testing the Preview component.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user