Skip to content

Commit e0e47ea

Browse files
Update docs to contain more specific return values
1 parent 5114d57 commit e0e47ea

File tree

11 files changed

+28
-25
lines changed

11 files changed

+28
-25
lines changed

docs/api/app.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ and `will-quit` events will not be emitted.
329329
### `app.relaunch([options])`
330330

331331
* `options` Object (optional)
332-
* `args` Array (optional)
332+
* `args` String[] (optional)
333333
* `execPath` String (optional)
334334

335335
Relaunches the app when current instance exits.
@@ -470,7 +470,9 @@ Clears the recent documents list.
470470
app to handle `electron://` links, call this method with `electron` as the
471471
parameter.
472472
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
473-
* `args` Array (optional) _Windows_ - Defaults to an empty array
473+
* `args` String[] (optional) _Windows_ - Defaults to an empty array
474+
475+
Returns `Boolean` - Whether the call succeeded.
474476

475477
This method sets the current executable as the default handler for a protocol
476478
(aka URI scheme). It allows you to integrate your app deeper into the operating
@@ -481,8 +483,6 @@ your application as a parameter.
481483
On Windows you can provide optional parameters path, the path to your executable,
482484
and args, an array of arguments to be passed to your executable when it launches.
483485

484-
Returns `true` when the call succeeded, otherwise returns `false`.
485-
486486
**Note:** On macOS, you can only register protocols that have been added to
487487
your app's `info.plist`, which can not be modified at runtime. You can however
488488
change the file with a simple text editor or script during build time.
@@ -494,18 +494,19 @@ The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally
494494

495495
* `protocol` String - The name of your protocol, without `://`.
496496
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
497-
* `args` Array (optional) _Windows_ - Defaults to an empty array
497+
* `args` String[] (optional) _Windows_ - Defaults to an empty array
498+
499+
Returns `Boolean` - Whether the call succeeded.
498500

499501
This method checks if the current executable as the default handler for a
500502
protocol (aka URI scheme). If so, it will remove the app as the default handler.
501503

502-
Returns `true` when the call succeeded, otherwise returns `false`.
503504

504505
### `app.isDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
505506

506507
* `protocol` String - The name of your protocol, without `://`.
507508
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
508-
* `args` Array (optional) _Windows_ - Defaults to an empty array
509+
* `args` String[] (optional) _Windows_ - Defaults to an empty array
509510

510511
Returns `Boolean`
511512

@@ -543,7 +544,7 @@ Adds `tasks` to the [Tasks][tasks] category of the JumpList on Windows.
543544
consists of two or more icons, set this value to identify the icon. If an
544545
icon file consists of one icon, this value is 0.
545546

546-
Returns `true` when the call succeeded, otherwise returns `false`.
547+
Returns `Boolean` - Whether the call succeeded.
547548

548549
**Note:** If you'd like to customize the Jump List even more use
549550
`app.setJumpList(categories)` instead.
@@ -790,8 +791,10 @@ This method can only be called before app is ready.
790791

791792
* `count` Integer
792793

794+
Returns `Boolean` - Whether the call succeeded.
795+
793796
Sets the counter badge for current app. Setting the count to `0` will hide the
794-
badge. Returns `true` when the call succeeded, otherwise returns `false`.
797+
badge.
795798

796799
On macOS it shows on the dock icon. On Linux it only works for Unity launcher,
797800

docs/api/browser-window.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ The `buttons` is an array of `Button` objects:
10731073
toolbar.
10741074
* `click` Function
10751075
* `tooltip` String (optional) - The text of the button's tooltip.
1076-
* `flags` Array (optional) - Control specific states and behaviors of the
1076+
* `flags` String[] (optional) - Control specific states and behaviors of the
10771077
button. By default, it is `['enabled']`.
10781078

10791079
The `flags` is an array that can include following `String`s:

docs/api/desktop-capturer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The `desktopCapturer` module has the following methods:
5656
### `desktopCapturer.getSources(options, callback)`
5757

5858
* `options` Object
59-
* `types` Array - An array of String that lists the types of desktop sources
59+
* `types` String[] - An array of Strings that lists the types of desktop sources
6060
to be captured, available types are `screen` and `window`.
6161
* `thumbnailSize` Object (optional) - The suggested size that the media source
6262
thumbnail should be scaled to, defaults to `{width: 150, height: 150}`.

docs/api/dialog.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The `dialog` module has the following methods:
2929
* `defaultPath` String
3030
* `buttonLabel` String - Custom label for the confirmation button, when
3131
left empty the default label will be used.
32-
* `filters` Array
33-
* `properties` Array - Contains which features the dialog should use, can
32+
* `filters` String[]
33+
* `properties` String[] - Contains which features the dialog should use, can
3434
contain `openFile`, `openDirectory`, `multiSelections`, `createDirectory`
3535
and `showHiddenFiles`.
3636
* `callback` Function (optional)
@@ -72,7 +72,7 @@ shown.
7272
* `defaultPath` String
7373
* `buttonLabel` String - Custom label for the confirmation button, when
7474
left empty the default label will be used.
75-
* `filters` Array
75+
* `filters` String[]
7676
* `callback` Function (optional)
7777

7878
On success this method returns the path of the file chosen by the user,
@@ -91,7 +91,7 @@ will be passed via `callback(filename)`
9191
* `type` String - Can be `"none"`, `"info"`, `"error"`, `"question"` or
9292
`"warning"`. On Windows, "question" displays the same icon as "info", unless
9393
you set an icon using the "icon" option.
94-
* `buttons` Array - Array of texts for buttons. On Windows, an empty array
94+
* `buttons` String[] - Array of texts for buttons. On Windows, an empty array
9595
will result in one button labeled "OK".
9696
* `defaultId` Integer - Index of the button in the buttons array which will
9797
be selected by default when the message box opens.

docs/api/menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ for more information on macOS' native actions.
252252

253253
#### `Menu.buildFromTemplate(template)`
254254

255-
* `template` Array
255+
* `template` MenuItem[]
256256

257257
Generally, the `template` is just an array of `options` for constructing a
258258
[MenuItem](menu-item.md). The usage can be referenced above.

docs/api/protocol.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The `protocol` module has the following methods:
2828

2929
### `protocol.registerStandardSchemes(schemes)`
3030

31-
* `schemes` Array - Custom schemes to be registered as standard schemes.
31+
* `schemes` String[] - Custom schemes to be registered as standard schemes.
3232

3333
A standard scheme adheres to what RFC 3986 calls [generic URI
3434
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
@@ -70,7 +70,7 @@ module gets emitted.
7070

7171
### `protocol.registerServiceWorkerSchemes(schemes)`
7272

73-
* `schemes` Array - Custom schemes to be registered to handle service workers.
73+
* `schemes` String[] - Custom schemes to be registered to handle service workers.
7474

7575
### `protocol.registerFileProtocol(scheme, handler[, completion])`
7676

docs/api/screen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Returns:
9494

9595
* `event` Event
9696
* `display` Object
97-
* `changedMetrics` Array
97+
* `changedMetrics` String[]
9898

9999
Emitted when one or more metrics change in a `display`. The `changedMetrics` is
100100
an array of strings that describe the changes. Possible changes are `bounds`,

docs/api/session.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ Clears the session’s HTTP cache.
107107
* `options` Object (optional)
108108
* `origin` String - Should follow `window.location.origin`’s representation
109109
`scheme://host:port`.
110-
* `storages` Array - The types of storages to clear, can contain:
110+
* `storages` String[] - The types of storages to clear, can contain:
111111
`appcache`, `cookies`, `filesystem`, `indexdb`, `local storage`,
112112
`shadercache`, `websql`, `serviceworkers`
113-
* `quotas` Array - The types of quotas to clear, can contain:
113+
* `quotas` String[] - The types of quotas to clear, can contain:
114114
`temporary`, `persistent`, `syncable`.
115115
* `callback` Function (optional) - Called when operation is done.
116116

docs/api/tray.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Emitted when any dragged items are dropped on the tray icon.
128128
#### Event: 'drop-files' _macOS_
129129

130130
* `event` Event
131-
* `files` Array - the file path of dropped files.
131+
* `files` String[] - The paths of the dropped files.
132132

133133
Emitted when dragged files are dropped in the tray icon.
134134

docs/api/web-contents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Emitted when the document in the given frame is loaded.
132132
Returns:
133133

134134
* `event` Event
135-
* `favicons` Array - Array of URLs
135+
* `favicons` String[] - Array of URLs
136136

137137
Emitted when page receives favicon urls.
138138

@@ -1026,7 +1026,7 @@ Disable device emulation enabled by `webContents.enableDeviceEmulation`.
10261026
* `type` String (**required**) - The type of the event, can be `mouseDown`,
10271027
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel`,
10281028
`mouseMove`, `keyDown`, `keyUp`, `char`.
1029-
* `modifiers` Array - An array of modifiers of the event, can
1029+
* `modifiers` String[] - An array of modifiers of the event, can
10301030
include `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`,
10311031
`leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`,
10321032
`numLock`, `left`, `right`.

0 commit comments

Comments
 (0)