From d67df5565a88c3b96ff4fd45870ef18b06abdb35 Mon Sep 17 00:00:00 2001 From: Paulo Andrade Date: Thu, 1 Aug 2019 17:46:42 -0600 Subject: [PATCH] add @types/react-devtools (#37269) * create react-devtools type * lint * fixes done after running npm run lint react-devtools --- types/react-devtools/index.d.ts | 7 ++++++ types/react-devtools/react-devtools-tests.ts | 5 +++++ types/react-devtools/tsconfig.json | 23 ++++++++++++++++++++ types/react-devtools/tslint.json | 1 + 4 files changed, 36 insertions(+) create mode 100644 types/react-devtools/index.d.ts create mode 100644 types/react-devtools/react-devtools-tests.ts create mode 100644 types/react-devtools/tsconfig.json create mode 100644 types/react-devtools/tslint.json diff --git a/types/react-devtools/index.d.ts b/types/react-devtools/index.d.ts new file mode 100644 index 0000000000..1985c0aa72 --- /dev/null +++ b/types/react-devtools/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for react-devtools 3.6 +// Project: https://github.com/facebook/react-devtools +// Definitions by: Paulo Andrade +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export function main(): any; diff --git a/types/react-devtools/react-devtools-tests.ts b/types/react-devtools/react-devtools-tests.ts new file mode 100644 index 0000000000..885508b5ca --- /dev/null +++ b/types/react-devtools/react-devtools-tests.ts @@ -0,0 +1,5 @@ +async function init() { + await import('react-devtools'); +} + +init(); diff --git a/types/react-devtools/tsconfig.json b/types/react-devtools/tsconfig.json new file mode 100644 index 0000000000..15c5759a9e --- /dev/null +++ b/types/react-devtools/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-devtools-tests.ts" + ] +} \ No newline at end of file diff --git a/types/react-devtools/tslint.json b/types/react-devtools/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-devtools/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file