mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update shell module
This commit is contained in:
parent
87b243541e
commit
c43bf44206
@ -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();
|
||||
|
||||
18
github-electron/github-electron.shell.d.ts
vendored
18
github-electron/github-electron.shell.d.ts
vendored
@ -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.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user