From 85ae3c5af7328219db37806ba0edd4fb5a6ffbe4 Mon Sep 17 00:00:00 2001 From: Robin Van den Broeck Date: Thu, 22 Sep 2016 18:16:12 +0200 Subject: [PATCH 1/4] Added electron-devtools-installer --- .../electron-devtools-installer-tests.ts | 35 +++++++++++++++++++ .../electron-devtools-installer.d.ts | 27 ++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 electron-devtools-installer/electron-devtools-installer-tests.ts create mode 100644 electron-devtools-installer/electron-devtools-installer.d.ts diff --git a/electron-devtools-installer/electron-devtools-installer-tests.ts b/electron-devtools-installer/electron-devtools-installer-tests.ts new file mode 100644 index 0000000000..5f42759c00 --- /dev/null +++ b/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -0,0 +1,35 @@ +/// +/// + +import installExtension, { + EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS, + BACKBONE_DEBUGGER, JQUERY_DEBUGGER, + ANGULARJS_BATARANG, VUEJS_DEVTOOLS, + REDUX_DEVTOOLS, REACT_PERF, +} from 'electron-devtools-installer'; + + +installExtension(EMBER_INSPECTOR) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(REACT_DEVELOPER_TOOLS) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(BACKBONE_DEBUGGER) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(JQUERY_DEBUGGER) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(ANGULARJS_BATARANG) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(VUEJS_DEVTOOLS) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(REDUX_DEVTOOLS) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); +installExtension(REACT_PERF) + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); \ No newline at end of file diff --git a/electron-devtools-installer/electron-devtools-installer.d.ts b/electron-devtools-installer/electron-devtools-installer.d.ts new file mode 100644 index 0000000000..439dc44388 --- /dev/null +++ b/electron-devtools-installer/electron-devtools-installer.d.ts @@ -0,0 +1,27 @@ +// Type definitions for electron-devtools-installer v2.0.1 +// Project: https://github.com/MarshallOfSound/electron-devtools-installer +// Definitions by: Robin Van den Broeck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + + +declare module "electron-devtools-installer" { + // Default installation function + export default function (extensionReference: any, forceDownload?: boolean): Promise; + + interface Extension { + id: string, + electron: string, + } + + // Devtools themself + export const EMBER_INSPECTOR: Extension; + export const REACT_DEVELOPER_TOOLS: Extension; + export const BACKBONE_DEBUGGER: Extension; + export const JQUERY_DEBUGGER: Extension; + export const ANGULARJS_BATARANG: Extension; + export const VUEJS_DEVTOOLS: Extension; + export const REDUX_DEVTOOLS: Extension; + export const REACT_PERF: Extension; +} \ No newline at end of file From 86d1fed5cb956233729b8a5f0869397577b3a64f Mon Sep 17 00:00:00 2001 From: Robin Van den Broeck Date: Thu, 22 Sep 2016 18:24:44 +0200 Subject: [PATCH 2/4] Refactoring --- .../electron-devtools-installer.d.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/electron-devtools-installer/electron-devtools-installer.d.ts b/electron-devtools-installer/electron-devtools-installer.d.ts index 439dc44388..da2b4bdecd 100644 --- a/electron-devtools-installer/electron-devtools-installer.d.ts +++ b/electron-devtools-installer/electron-devtools-installer.d.ts @@ -7,21 +7,21 @@ declare module "electron-devtools-installer" { - // Default installation function - export default function (extensionReference: any, forceDownload?: boolean): Promise; - - interface Extension { + interface ExtensionReference { id: string, electron: string, } + // Default installation function + export default function (extensionReference: ExtensionReference, forceDownload?: boolean): Promise; + // Devtools themself - export const EMBER_INSPECTOR: Extension; - export const REACT_DEVELOPER_TOOLS: Extension; - export const BACKBONE_DEBUGGER: Extension; - export const JQUERY_DEBUGGER: Extension; - export const ANGULARJS_BATARANG: Extension; - export const VUEJS_DEVTOOLS: Extension; - export const REDUX_DEVTOOLS: Extension; - export const REACT_PERF: Extension; + export const EMBER_INSPECTOR: ExtensionReference; + export const REACT_DEVELOPER_TOOLS: ExtensionReference; + export const BACKBONE_DEBUGGER: ExtensionReference; + export const JQUERY_DEBUGGER: ExtensionReference; + export const ANGULARJS_BATARANG: ExtensionReference; + export const VUEJS_DEVTOOLS: ExtensionReference; + export const REDUX_DEVTOOLS: ExtensionReference; + export const REACT_PERF: ExtensionReference; } \ No newline at end of file From 29b93b2328f20c62aa3dbc8d527a0072090bbe22 Mon Sep 17 00:00:00 2001 From: Robin Van den Broeck Date: Thu, 22 Sep 2016 18:29:46 +0200 Subject: [PATCH 3/4] Fixed problem with es6 --- electron-devtools-installer/electron-devtools-installer.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/electron-devtools-installer/electron-devtools-installer.d.ts b/electron-devtools-installer/electron-devtools-installer.d.ts index da2b4bdecd..2f0616eea8 100644 --- a/electron-devtools-installer/electron-devtools-installer.d.ts +++ b/electron-devtools-installer/electron-devtools-installer.d.ts @@ -3,9 +3,6 @@ // Definitions by: Robin Van den Broeck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - - declare module "electron-devtools-installer" { interface ExtensionReference { id: string, From 818575e714763fe1f23111d019031dc3ae57b7ec Mon Sep 17 00:00:00 2001 From: Robin Van den Broeck Date: Thu, 22 Sep 2016 19:13:59 +0200 Subject: [PATCH 4/4] Changed the stuff asked --- .../electron-devtools-installer-tests.ts | 33 +++++-------------- .../electron-devtools-installer.d.ts | 2 +- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/electron-devtools-installer/electron-devtools-installer-tests.ts b/electron-devtools-installer/electron-devtools-installer-tests.ts index 5f42759c00..daf19a1daf 100644 --- a/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -9,27 +9,12 @@ import installExtension, { } from 'electron-devtools-installer'; -installExtension(EMBER_INSPECTOR) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(REACT_DEVELOPER_TOOLS) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(BACKBONE_DEBUGGER) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(JQUERY_DEBUGGER) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(ANGULARJS_BATARANG) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(VUEJS_DEVTOOLS) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(REDUX_DEVTOOLS) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); -installExtension(REACT_PERF) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); \ No newline at end of file +installExtension(EMBER_INSPECTOR); +installExtension(REACT_DEVELOPER_TOOLS); +installExtension(BACKBONE_DEBUGGER); +installExtension(JQUERY_DEBUGGER); +installExtension(ANGULARJS_BATARANG); +installExtension(VUEJS_DEVTOOLS); +installExtension(REDUX_DEVTOOLS); +installExtension(REACT_PERF); +installExtension('abcdefghijkl'); \ No newline at end of file diff --git a/electron-devtools-installer/electron-devtools-installer.d.ts b/electron-devtools-installer/electron-devtools-installer.d.ts index 2f0616eea8..8a108c1d2f 100644 --- a/electron-devtools-installer/electron-devtools-installer.d.ts +++ b/electron-devtools-installer/electron-devtools-installer.d.ts @@ -10,7 +10,7 @@ declare module "electron-devtools-installer" { } // Default installation function - export default function (extensionReference: ExtensionReference, forceDownload?: boolean): Promise; + export default function (extensionReference: ExtensionReference | string, forceDownload?: boolean): Promise; // Devtools themself export const EMBER_INSPECTOR: ExtensionReference;