Added react-dropzone

This commit is contained in:
Mathieu Larouche Dube
2015-10-29 10:27:36 -04:00
parent 62eedc3121
commit 1fc9f8415e
3 changed files with 70 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
///<reference path='../react/react.d.ts' />
///<reference path='../react-dropzone/react-dropzone.d.ts' />
import * as React from 'react';
import Dropzone = require('react-dropzone');
class Test extends React.Component<any, any> {
constructor(props: any) {
super(props);
}
render() {
return (<div>
<Dropzone
onDrop={(e: any) => { e.preventDefault(); } }
onDropAccepted={(e: any) => { e.preventDefault(); } }
onDropRejected={(e: any) => { e.preventDefault(); } }
onDragEnter={(e: any) => { e.preventDefault(); } }
onDragLeave={(e: any) => { e.preventDefault(); } }
style={{ borderStyle: "dashed" }}
activeStyle={{ borderStyle: "dotted" }}
className="regular"
activeClassName="active"
rejectClassName="reject"
disableClick={true}
multiple={false}
accept="*.png"
/>
</div>);
}
}
export default Test;
@@ -0,0 +1 @@
--target es5 --noImplicitAny --experimentalDecorators --jsx react
+37
View File
@@ -0,0 +1,37 @@
// Type definitions for react-dropzone
// Project: https://github.com/paramaggarwal/react-dropzone
// Definitions by: Mathieu Larouche Dube <https://github.com/matdube>
// Definitions: https://github.com/Vooban/DefinitelyTyped
///<reference path='../react/react.d.ts' />
declare module "react-dropzone" {
import * as React from 'react';
namespace reactDropzone {
interface DropzoneProps {
onDrop?: Function;
onDropAccepted?: Function;
onDropRejected?: Function;
onDragEnter?: Function;
onDragLeave?: Function;
style?: Object;
activeStyle?: Object;
className?: string;
activeClassName?: string;
rejectClassName?: string;
disableClick?: boolean;
multiple?: boolean;
accept?: string;
}
export class Dropzone extends React.Component<DropzoneProps, {}> {
}
}
export = reactDropzone.Dropzone;
}