From c43bf44206ba99ef5fc669c64e0726ea0030912c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 25 Mar 2016 21:02:03 +0100 Subject: [PATCH] Update shell module --- github-electron/github-electron-main-tests.ts | 10 +++++++++- github-electron/github-electron.shell.d.ts | 18 ++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index d36418fe4e..b32de6865e 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -565,4 +565,12 @@ app.on('ready', () => { // shell // https://github.com/atom/electron/blob/master/docs/api/shell.md -shell.openExternal('https://github.com'); +shell.showItemInFolder('/home/user/Desktop/test.txt'); +shell.openItem('/home/user/Desktop/test.txt'); +shell.moveItemToTrash('/home/user/Desktop/test.txt'); + +shell.openExternal('https://github.com', { + activate: false +}); + +shell.beep(); diff --git a/github-electron/github-electron.shell.d.ts b/github-electron/github-electron.shell.d.ts index 6ac4c9da28..34ddf21031 100644 --- a/github-electron/github-electron.shell.d.ts +++ b/github-electron/github-electron.shell.d.ts @@ -4,7 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Electron { - + /** + * The shell module provides functions related to desktop integration. + */ interface Shell { /** * Show the given file in a file manager. If possible, select the file. @@ -17,12 +19,20 @@ declare namespace Electron { /** * Open the given external protocol URL in the desktop's default manner * (e.g., mailto: URLs in the default mail user agent). + * @returns true if an application was available to open the URL, false otherwise. */ - openExternal(url: string): void; + openExternal(url: string, options?: { + /** + * Bring the opened application to the foreground. + * Default: true. + */ + activate: boolean; + }): boolean; /** - * Move the given file to trash and returns boolean status for the operation. + * Move the given file to trash. + * @returns boolean status for the operation. */ - moveItemToTrash(fullPath: string): void; + moveItemToTrash(fullPath: string): boolean; /** * Play the beep sound. */