Skip to content

Commit c43bf44

Browse files
committed
Update shell module
1 parent 87b2435 commit c43bf44

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

github-electron/github-electron-main-tests.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,4 +565,12 @@ app.on('ready', () => {
565565
// shell
566566
// https://github.com/atom/electron/blob/master/docs/api/shell.md
567567

568-
shell.openExternal('https://github.com');
568+
shell.showItemInFolder('/home/user/Desktop/test.txt');
569+
shell.openItem('/home/user/Desktop/test.txt');
570+
shell.moveItemToTrash('/home/user/Desktop/test.txt');
571+
572+
shell.openExternal('https://github.com', {
573+
activate: false
574+
});
575+
576+
shell.beep();

github-electron/github-electron.shell.d.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

66
declare namespace Electron {
7-
7+
/**
8+
* The shell module provides functions related to desktop integration.
9+
*/
810
interface Shell {
911
/**
1012
* Show the given file in a file manager. If possible, select the file.
@@ -17,12 +19,20 @@ declare namespace Electron {
1719
/**
1820
* Open the given external protocol URL in the desktop's default manner
1921
* (e.g., mailto: URLs in the default mail user agent).
22+
* @returns true if an application was available to open the URL, false otherwise.
2023
*/
21-
openExternal(url: string): void;
24+
openExternal(url: string, options?: {
25+
/**
26+
* Bring the opened application to the foreground.
27+
* Default: true.
28+
*/
29+
activate: boolean;
30+
}): boolean;
2231
/**
23-
* Move the given file to trash and returns boolean status for the operation.
32+
* Move the given file to trash.
33+
* @returns boolean status for the operation.
2434
*/
25-
moveItemToTrash(fullPath: string): void;
35+
moveItemToTrash(fullPath: string): boolean;
2636
/**
2737
* Play the beep sound.
2838
*/

0 commit comments

Comments
 (0)