diff --git a/types/react-file-reader-input/index.d.ts b/types/react-file-reader-input/index.d.ts index fae97ca49e..53299e6f5b 100644 --- a/types/react-file-reader-input/index.d.ts +++ b/types/react-file-reader-input/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for react-file-reader-input 1.1 +// Type definitions for react-file-reader-input 2.0 // Project: https://github.com/ngokevin/react-file-reader-input -// Definitions by: Dmitry Rogozhny , Ali Taheri +// Definitions by: Dmitry Rogozhny , +// Ali Taheri , +// bjoluc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.5 import * as React from 'react'; @@ -13,7 +15,7 @@ declare namespace FileInput { type Format = 'buffer' | 'binary' | 'url' | 'text'; type Result = [ProgressEvent, File]; - interface Props { + interface Props extends Omit, 'onChange'> { /** * what format the `FileReader` should read the file as * (i.e., `'buffer'`, `'binary'`, `'url'`, `'text'`). @@ -23,7 +25,7 @@ declare namespace FileInput { as?: Format; /** - * Callback function called when the files are choosen by the user. + * Callback function called when the files are chosen by the user. * * Results will be an array of arrays, the size of which depending * on how many files were selected. @@ -40,7 +42,7 @@ declare namespace FileInput { * @param event The event that triggered file changes * @param results The array of files */ - onChange(event: React.SyntheticEvent, results: Result[]): void; + onChange(event: React.ChangeEvent, results: Result[]): void; } } diff --git a/types/react-file-reader-input/react-file-reader-input-tests.tsx b/types/react-file-reader-input/react-file-reader-input-tests.tsx index 0367152f27..51295b42fe 100644 --- a/types/react-file-reader-input/react-file-reader-input-tests.tsx +++ b/types/react-file-reader-input/react-file-reader-input-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import FileReaderInput = require('react-file-reader-input'); +import FileReaderInput from 'react-file-reader-input'; class MyComponent extends React.Component { handleChange = (event: React.SyntheticEvent, results: FileReaderInput.Result[]) => { @@ -13,7 +13,7 @@ class MyComponent extends React.Component { return (
- + diff --git a/types/react-file-reader-input/tsconfig.json b/types/react-file-reader-input/tsconfig.json index 760b2a3838..3c23170e4e 100644 --- a/types/react-file-reader-input/tsconfig.json +++ b/types/react-file-reader-input/tsconfig.json @@ -5,6 +5,7 @@ "es6", "dom" ], + "esModuleInterop": true, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true,