From cda0a003272c175acd2a0a790a7299469a6ab89b Mon Sep 17 00:00:00 2001 From: prince0203 Date: Sun, 2 Sep 2018 18:08:08 +0900 Subject: [PATCH] Add type definitions for electron-load-devtool --- .../electron-load-devtool-tests.ts | 20 ++++++++++++++ types/electron-load-devtool/index.d.ts | 26 +++++++++++++++++++ types/electron-load-devtool/tsconfig.json | 23 ++++++++++++++++ types/electron-load-devtool/tslint.json | 1 + 4 files changed, 70 insertions(+) create mode 100644 types/electron-load-devtool/electron-load-devtool-tests.ts create mode 100644 types/electron-load-devtool/index.d.ts create mode 100644 types/electron-load-devtool/tsconfig.json create mode 100644 types/electron-load-devtool/tslint.json diff --git a/types/electron-load-devtool/electron-load-devtool-tests.ts b/types/electron-load-devtool/electron-load-devtool-tests.ts new file mode 100644 index 0000000000..5c41673adc --- /dev/null +++ b/types/electron-load-devtool/electron-load-devtool-tests.ts @@ -0,0 +1,20 @@ +import loadDevtool from 'electron-load-devtool'; + +loadDevtool(loadDevtool.REDUX_DEVTOOLS); +loadDevtool(loadDevtool.EMBER_INSPECTOR); +loadDevtool(loadDevtool.REACT_DEVELOPER_TOOLS); +loadDevtool(loadDevtool.BACKBONE_DEBUGGER); +loadDevtool(loadDevtool.JQUERY_DEBUGGER); +loadDevtool(loadDevtool.ANGULARJS_BATARANG); +loadDevtool(loadDevtool.VUEJS_DEVTOOLS); +loadDevtool('another-devtools-id'); + +loadDevtool(loadDevtool.REDUX_DEVTOOLS, { + enabled: false +}); + +loadDevtool(loadDevtool.REDUX_DEVTOOLS, { + name: 'chromium', + profile: 'another-profile-name', + version: '1.2.3' +}); diff --git a/types/electron-load-devtool/index.d.ts b/types/electron-load-devtool/index.d.ts new file mode 100644 index 0000000000..6e8379fdf6 --- /dev/null +++ b/types/electron-load-devtool/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for electron-load-devtool 1.0 +// Project: https://github.com/akameco/electron-load-devtool#readme +// Definitions by: prince +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface ElectronLoadDevtool { + (devtoolId: string, options?: ElectronLoadDevtoolOptions): void; + REDUX_DEVTOOLS: string; + EMBER_INSPECTOR: string; + REACT_DEVELOPER_TOOLS: string; + BACKBONE_DEBUGGER: string; + JQUERY_DEBUGGER: string; + ANGULARJS_BATARANG: string; + VUEJS_DEVTOOLS: string; +} + +interface ElectronLoadDevtoolOptions { + enabled?: boolean; + name?: string; + profile?: string; + version?: string; +} + +declare const electronLoadDevtool: ElectronLoadDevtool; + +export default electronLoadDevtool; diff --git a/types/electron-load-devtool/tsconfig.json b/types/electron-load-devtool/tsconfig.json new file mode 100644 index 0000000000..4de2349ea8 --- /dev/null +++ b/types/electron-load-devtool/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", + "electron-load-devtool-tests.ts" + ] +} diff --git a/types/electron-load-devtool/tslint.json b/types/electron-load-devtool/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/electron-load-devtool/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }