Skip to content

Commit f80601d

Browse files
docs: ensure that optionality matches between documented params and signatures (electron#18613)
* docs: ensure that optionality matches between documented params and signatures * docs: ensure that all optional declarations are lower case * chore: fix broken link
1 parent 69e32ad commit f80601d

File tree

14 files changed

+127
-33
lines changed

14 files changed

+127
-33
lines changed

docs/api/app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ Hides all application windows without minimizing them.
576576
Shows application windows after they were hidden. Does not automatically focus
577577
them.
578578

579-
### `app.setAppLogsPath(path)`
579+
### `app.setAppLogsPath([path])`
580580

581581
* `path` String (optional) - A custom path for your logs. Must be absolute.
582582

docs/api/browser-window.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ Returns `Boolean` - Whether the window is in normal state (not maximized, not mi
864864

865865
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
866866
content view.
867-
* `extraSize` [Size](structures/size.md) - The extra size not to be included while
867+
* `extraSize` [Size](structures/size.md) (optional) - The extra size not to be included while
868868
maintaining the aspect ratio.
869869

870870
This will make a window maintain an aspect ratio. The extra size allows a

docs/api/content-tracing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ as soon as they receive the EnableRecording request.
5252
If a recording is already running, the promise will be immediately resolved, as
5353
only one trace operation can be in progress at a time.
5454

55-
### `contentTracing.stopRecording(resultFilePath)`
55+
### `contentTracing.stopRecording([resultFilePath])`
5656

5757
* `resultFilePath` String (optional)
5858

docs/api/in-app-purchase.md

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

2222
The `inAppPurchase` module has the following methods:
2323

24-
### `inAppPurchase.purchaseProduct(productID, quantity)`
24+
### `inAppPurchase.purchaseProduct(productID[, quantity])`
2525

2626
* `productID` String - The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).
2727
* `quantity` Integer (optional) - The number of items the user wants to purchase.

docs/api/ipc-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Removes the specified `listener` from the listener array for the specified
8484

8585
### `ipcMain.removeAllListeners([channel])`
8686

87-
* `channel` String
87+
* `channel` String (optional)
8888

8989
Removes listeners of the specified `channel`.
9090

docs/api/ipc-renderer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Removes the specified `listener` from the listener array for the specified
5151

5252
Removes all listeners, or those of the specified `channel`.
5353

54-
### `ipcRenderer.send(channel[, arg1][, arg2][, ...])`
54+
### `ipcRenderer.send(channel, ...args)`
5555

5656
* `channel` String
5757
* `...args` any[]
@@ -63,7 +63,7 @@ hence no functions or prototype chain will be included.
6363
The main process handles it by listening for `channel` with the
6464
[`ipcMain`](ipc-main.md) module.
6565

66-
### `ipcRenderer.invoke(channel[, arg1][, arg2][, ...])`
66+
### `ipcRenderer.invoke(channel, ...args)`
6767

6868
* `channel` String
6969
* `...args` any[]
@@ -91,7 +91,7 @@ ipcMain.handle('some-name', async (event, someArgument) => {
9191
})
9292
```
9393

94-
### `ipcRenderer.sendSync(channel[, arg1][, arg2][, ...])`
94+
### `ipcRenderer.sendSync(channel, ...args)`
9595

9696
* `channel` String
9797
* `...args` any[]
@@ -108,15 +108,15 @@ and replies by setting `event.returnValue`.
108108
**Note:** Sending a synchronous message will block the whole renderer process,
109109
unless you know what you are doing you should never use it.
110110

111-
### `ipcRenderer.sendTo(webContentsId, channel, [, arg1][, arg2][, ...])`
111+
### `ipcRenderer.sendTo(webContentsId, channel, ...args)`
112112

113113
* `webContentsId` Number
114114
* `channel` String
115115
* `...args` any[]
116116

117117
Sends a message to a window with `webContentsId` via `channel`.
118118

119-
### `ipcRenderer.sendToHost(channel[, arg1][, arg2][, ...])`
119+
### `ipcRenderer.sendToHost(channel, ...args)`
120120

121121
* `channel` String
122122
* `...args` any[]

docs/api/menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ You can also attach other fields to the element of the `template` and they will
6565

6666
The `menu` object has the following instance methods:
6767

68-
#### `menu.popup(options)`
68+
#### `menu.popup([options])`
6969

7070
* `options` Object (optional)
7171
* `window` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.

docs/api/native-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Creates a new `NativeImage` instance from `dataURL`.
172172
### `nativeImage.createFromNamedImage(imageName[, hslShift])` _macOS_
173173

174174
* `imageName` String
175-
* `hslShift` Number[]
175+
* `hslShift` Number[] (optional)
176176

177177
Returns `NativeImage`
178178

docs/api/notification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Returns `Boolean` - Whether or not desktop notifications are supported on the cu
2929

3030
### `new Notification([options])` _Experimental_
3131

32-
* `options` Object
32+
* `options` Object (optional)
3333
* `title` String - A title for the notification, which will be shown at the top of the notification window when it is shown.
3434
* `subtitle` String (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
3535
* `body` String - The body text of the notification, which will be displayed below the title or subtitle.

docs/api/web-contents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ Opens the developer tools for the shared worker context.
13961396

13971397
Opens the developer tools for the service worker context.
13981398

1399-
#### `contents.send(channel[, arg1][, arg2][, ...])`
1399+
#### `contents.send(channel, ...args)`
14001400

14011401
* `channel` String
14021402
* `...args` any[]
@@ -1437,7 +1437,7 @@ app.on('ready', () => {
14371437
</html>
14381438
```
14391439

1440-
#### `contents.sendToFrame(frameId, channel[, arg1][, arg2][, ...])`
1440+
#### `contents.sendToFrame(frameId, channel, ...args)`
14411441

14421442
* `frameId` Integer
14431443
* `channel` String

0 commit comments

Comments
 (0)