Add react-dnd-touch-backend types (#20770)

* Add react-dnd-touch-backend types

* CS fixes

* Add dom lib
This commit is contained in:
Daniel Król
2017-10-20 22:19:43 +02:00
committed by Andy
parent 38e3db12b8
commit da6e5dabc8
4 changed files with 44 additions and 0 deletions

View File

@@ -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 <https://github.com/mleko>
// 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;
}

View File

@@ -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);

View File

@@ -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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }