From 1bd11135c8be706a519b46753f477e3e3c4029fa Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Mon, 14 Dec 2015 12:09:18 +0900 Subject: [PATCH 1/2] Add electron.hideInternalModules() --- github-electron/github-electron-main-tests.ts | 4 ++- github-electron/github-electron.d.ts | 27 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index ef9c21e52f..8a0d4125f4 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -19,6 +19,8 @@ import { shell } from 'electron'; +require('electron').hideInternalModules(); + import path = require('path'); // Quick start @@ -201,7 +203,7 @@ ipcMain.on('online-status-changed', (event: any, status: any) => { app.on('ready', () => { window = new BrowserWindow({ width: 800, - height: 600, + height: 600, titleBarStyle: 'hidden-inset', }); window.loadURL('https://github.com'); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 7c5fa8b4d6..5dcaba2ffe 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1312,7 +1312,7 @@ declare module GitHubElectron { */ read(format: string, type?: string): any; } - + interface CrashReporterStartOptions { /** * Default: Electron @@ -1343,7 +1343,7 @@ declare module GitHubElectron { */ extra?: {} } - + interface CrashReporterPayload extends Object { /** * E.g., "electron-crash-service". @@ -1383,17 +1383,17 @@ declare module GitHubElectron { */ upload_file_minidump: File; } - + interface CrashReporter { start(options?: CrashReporterStartOptions): void; - + /** * @returns The date and ID of the last crash report. When there was no crash report * sent or the crash reporter is not started, null will be returned. */ getLastCrashReport(): CrashReporterPayload; } - + interface Shell{ /** * Show the given file in a file manager. If possible, select the file. @@ -1469,7 +1469,7 @@ declare module GitHubElectron { */ process: any; } - + interface WebFrame { /** * Changes the zoom factor to the specified factor, zoom factor is @@ -1588,7 +1588,7 @@ declare module GitHubElectron { ENABLE_SAMPLING: number; RECORD_CONTINUOUSLY: number; } - + interface Dialog { /** * @param callback If supplied, the API call will be asynchronous. @@ -1608,7 +1608,7 @@ declare module GitHubElectron { * @returns The index of the clicked button. */ showMessageBox: typeof GitHubElectron.Dialog.showMessageBox; - + /** * Runs a modal dialog that shows an error message. This API can be called safely * before the ready event of app module emits, it is usually used to report errors @@ -1616,7 +1616,7 @@ declare module GitHubElectron { */ showErrorBox(title: string, content: string): void; } - + interface GlobalShortcut { /** * Registers a global shortcut of accelerator. @@ -1643,14 +1643,14 @@ declare module GitHubElectron { */ unregisterAll(): void; } - + class RequestFileJob { /** * Create a request job which would query a file of path and set corresponding mime types. */ constructor(path: string); } - + class RequestStringJob { /** * Create a request job which sends a string as response. @@ -1667,7 +1667,7 @@ declare module GitHubElectron { data?: string; }); } - + class RequestBufferJob { /** * Create a request job which accepts a buffer and sends a string as response. @@ -1684,7 +1684,7 @@ declare module GitHubElectron { data?: Buffer; }); } - + interface Protocol { registerProtocol(scheme: string, handler: (request: any) => void): void; unregisterProtocol(scheme: string): void; @@ -1718,6 +1718,7 @@ declare module GitHubElectron { powerMonitor: NodeJS.EventEmitter; protocol: GitHubElectron.Protocol; Tray: typeof GitHubElectron.Tray; + hideInternalModules(): any; } } From 3746eb32840de17c1f4eb306047c505639194644 Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Wed, 16 Dec 2015 10:50:52 +0900 Subject: [PATCH 2/2] Fix wrong returning type of electron.hideInternalModules --- github-electron/github-electron.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 5dcaba2ffe..7334d04ae1 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1718,7 +1718,7 @@ declare module GitHubElectron { powerMonitor: NodeJS.EventEmitter; protocol: GitHubElectron.Protocol; Tray: typeof GitHubElectron.Tray; - hideInternalModules(): any; + hideInternalModules(): void; } }