Document the return values of all methods in the docs

This commit is contained in:
Samuel Attard 2016-09-25 12:59:30 +13:00 committed by Samuel Attard
parent bf88fe32fd
commit d2a701a465
22 changed files with 276 additions and 175 deletions

View file

@ -20,15 +20,17 @@ The `shell` module has the following methods:
* `fullPath` String
Show the given file in a file manager. If possible, select the file. Returns
true if the item was successfully shown, false otherwise.
Returns `Boolean` - Whether the item was successfully shown
Show the given file in a file manager. If possible, select the file.
### `shell.openItem(fullPath)`
* `fullPath` String
Open the given file in the desktop's default manner. Returns true if the item
was successfully opened, false otherwise.
Returns `Boolean` - Whether the item was successfully opened.
Open the given file in the desktop's default manner.
### `shell.openExternal(url[, options])`
@ -37,16 +39,18 @@ was successfully opened, false otherwise.
* `activate` Boolean - `true` to bring the opened application to the
foreground. The default is `true`.
Returns `Boolean` - Whether an application was available to open the URL.
Open the given external protocol URL in the desktop's default manner. (For
example, mailto: URLs in the user's default mail agent.) Returns true if an
application was available to open the URL, false otherwise.
example, mailto: URLs in the user's default mail agent).
### `shell.moveItemToTrash(fullPath)`
* `fullPath` String
Returns `Boolean` - Whether the item was successfully moved to the trash
Move the given file to trash and returns a boolean status for the operation.
Returns true if the item was successfully moved to the trash, false otherwise.
### `shell.beep()`
@ -76,14 +80,29 @@ Play the beep sound.
* `appUserModelId` String (optional) - The Application User Model ID. Default
is empty.
Creates or updates a shortcut link at `shortcutPath`. On success `true` is
returned, otherwise `false` is returned.
Returns `Boolean` - Whether the shortcut was created successfully
Creates or updates a shortcut link at `shortcutPath`.
### `shell.readShortcutLink(shortcutPath)` _Windows_
* `shortcutPath` String
Resolves the shortcut link at `shortcutPath`. An object is returned with the
fields described in the `options` of `shell.writeShortcutLink`.
Returns `Object`:
* `target` String - The target to launch from this shortcut.
* `cwd` String (optional) - The working directory. Default is empty.
* `args` String (optional) - The arguments to be applied to `target` when
launching from this shortcut. Default is empty.
* `description` String (optional) - The description of the shortcut. Default
is empty.
* `icon` String (optional) - The path to the icon, can be a DLL or EXE. `icon`
and `iconIndex` have to be set together. Default is empty, which uses the
target's icon.
* `iconIndex` Integer (optional) - The resource ID of icon when `icon` is a
DLL or EXE. Default is 0.
* `appUserModelId` String (optional) - The Application User Model ID. Default
is empty.
Resolves the shortcut link at `shortcutPath`.
An exception will be thrown when any error happens.