diff --git a/types/react-dnd-touch-backend/index.d.ts b/types/react-dnd-touch-backend/index.d.ts new file mode 100644 index 0000000000..91ea6ce999 --- /dev/null +++ b/types/react-dnd-touch-backend/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for react-dnd-touch-backend 0.3 +// Project: https://github.com/yahoo/react-dnd-touch-backend#readme +// Definitions by: Daniel Król +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as ReactDnd from "react-dnd"; + +export default function createTouchBackend(options: TouchBackendOptions): ReactDnd.Backend; + +export interface TouchBackendOptions { + enableMouseEvents?: boolean; +} diff --git a/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts new file mode 100644 index 0000000000..07994e71be --- /dev/null +++ b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts @@ -0,0 +1,7 @@ +import * as ReactDnd from "react-dnd"; +import TouchBackend from "react-dnd-touch-backend"; + +const component = () => null; + +const dndComponent = ReactDnd.DragDropContext(TouchBackend)(component); +const dndComponentMouseEvents = ReactDnd.DragDropContext(TouchBackend({enableMouseEvents: true}))(component); diff --git a/types/react-dnd-touch-backend/tsconfig.json b/types/react-dnd-touch-backend/tsconfig.json new file mode 100644 index 0000000000..926592e1c3 --- /dev/null +++ b/types/react-dnd-touch-backend/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-dnd-touch-backend-tests.ts" + ] +} diff --git a/types/react-dnd-touch-backend/tslint.json b/types/react-dnd-touch-backend/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-dnd-touch-backend/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }