Skip to content

Commit

Permalink
docs: ensure that optionality matches between documented params and s…
Browse files Browse the repository at this point in the history
…ignatures (#18613)

* docs: ensure that optionality matches between documented params and signatures

* docs: ensure that all optional declarations are lower case

* chore: fix broken link
  • Loading branch information
MarshallOfSound committed Jun 4, 2019
1 parent 69e32ad commit f80601d
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 33 deletions.
2 changes: 1 addition & 1 deletion docs/api/app.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ Hides all application windows without minimizing them.
Shows application windows after they were hidden. Does not automatically focus Shows application windows after they were hidden. Does not automatically focus
them. them.


### `app.setAppLogsPath(path)` ### `app.setAppLogsPath([path])`


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


Expand Down
2 changes: 1 addition & 1 deletion docs/api/browser-window.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ Returns `Boolean` - Whether the window is in normal state (not maximized, not mi


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


This will make a window maintain an aspect ratio. The extra size allows a This will make a window maintain an aspect ratio. The extra size allows a
Expand Down
2 changes: 1 addition & 1 deletion docs/api/content-tracing.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ as soon as they receive the EnableRecording request.
If a recording is already running, the promise will be immediately resolved, as If a recording is already running, the promise will be immediately resolved, as
only one trace operation can be in progress at a time. only one trace operation can be in progress at a time.


### `contentTracing.stopRecording(resultFilePath)` ### `contentTracing.stopRecording([resultFilePath])`


* `resultFilePath` String (optional) * `resultFilePath` String (optional)


Expand Down
2 changes: 1 addition & 1 deletion docs/api/in-app-purchase.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Returns:


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


### `inAppPurchase.purchaseProduct(productID, quantity)` ### `inAppPurchase.purchaseProduct(productID[, quantity])`


* `productID` String - The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`). * `productID` String - The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).
* `quantity` Integer (optional) - The number of items the user wants to purchase. * `quantity` Integer (optional) - The number of items the user wants to purchase.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/ipc-main.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Removes the specified `listener` from the listener array for the specified


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


* `channel` String * `channel` String (optional)


Removes listeners of the specified `channel`. Removes listeners of the specified `channel`.


Expand Down
10 changes: 5 additions & 5 deletions docs/api/ipc-renderer.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Removes the specified `listener` from the listener array for the specified


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


### `ipcRenderer.send(channel[, arg1][, arg2][, ...])` ### `ipcRenderer.send(channel, ...args)`


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


### `ipcRenderer.invoke(channel[, arg1][, arg2][, ...])` ### `ipcRenderer.invoke(channel, ...args)`


* `channel` String * `channel` String
* `...args` any[] * `...args` any[]
Expand Down Expand Up @@ -91,7 +91,7 @@ ipcMain.handle('some-name', async (event, someArgument) => {
}) })
``` ```


### `ipcRenderer.sendSync(channel[, arg1][, arg2][, ...])` ### `ipcRenderer.sendSync(channel, ...args)`


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


### `ipcRenderer.sendTo(webContentsId, channel, [, arg1][, arg2][, ...])` ### `ipcRenderer.sendTo(webContentsId, channel, ...args)`


* `webContentsId` Number * `webContentsId` Number
* `channel` String * `channel` String
* `...args` any[] * `...args` any[]


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


### `ipcRenderer.sendToHost(channel[, arg1][, arg2][, ...])` ### `ipcRenderer.sendToHost(channel, ...args)`


* `channel` String * `channel` String
* `...args` any[] * `...args` any[]
Expand Down
2 changes: 1 addition & 1 deletion docs/api/menu.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ You can also attach other fields to the element of the `template` and they will


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


#### `menu.popup(options)` #### `menu.popup([options])`


* `options` Object (optional) * `options` Object (optional)
* `window` [BrowserWindow](browser-window.md) (optional) - Default is the focused window. * `window` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/native-image.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Creates a new `NativeImage` instance from `dataURL`.
### `nativeImage.createFromNamedImage(imageName[, hslShift])` _macOS_ ### `nativeImage.createFromNamedImage(imageName[, hslShift])` _macOS_


* `imageName` String * `imageName` String
* `hslShift` Number[] * `hslShift` Number[] (optional)


Returns `NativeImage` Returns `NativeImage`


Expand Down
2 changes: 1 addition & 1 deletion docs/api/notification.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Returns `Boolean` - Whether or not desktop notifications are supported on the cu


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


* `options` Object * `options` Object (optional)
* `title` String - A title for the notification, which will be shown at the top of the notification window when it is shown. * `title` String - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `subtitle` String (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title. * `subtitle` String (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` String - The body text of the notification, which will be displayed below the title or subtitle. * `body` String - The body text of the notification, which will be displayed below the title or subtitle.
Expand Down
4 changes: 2 additions & 2 deletions docs/api/web-contents.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ Opens the developer tools for the shared worker context.


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


#### `contents.send(channel[, arg1][, arg2][, ...])` #### `contents.send(channel, ...args)`


* `channel` String * `channel` String
* `...args` any[] * `...args` any[]
Expand Down Expand Up @@ -1437,7 +1437,7 @@ app.on('ready', () => {
</html> </html>
``` ```


#### `contents.sendToFrame(frameId, channel[, arg1][, arg2][, ...])` #### `contents.sendToFrame(frameId, channel, ...args)`


* `frameId` Integer * `frameId` Integer
* `channel` String * `channel` String
Expand Down
8 changes: 4 additions & 4 deletions docs/api/web-request.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ response are visible by the time this listener is fired.
* `timestamp` Double * `timestamp` Double
* `statusLine` String * `statusLine` String
* `statusCode` Integer * `statusCode` Integer
* `responseHeaders` Record<string, string> (Optional) * `responseHeaders` Record<string, string> (optional)
* `callback` Function * `callback` Function
* `response` Object * `response` Object
* `cancel` Boolean (optional) * `cancel` Boolean (optional)
Expand Down Expand Up @@ -160,7 +160,7 @@ The `callback` has to be called with an `response` object.
* `resourceType` String * `resourceType` String
* `referrer` String * `referrer` String
* `timestamp` Double * `timestamp` Double
* `responseHeaders` Record<string, string> (Optional) * `responseHeaders` Record<string, string> (optional)
* `fromCache` Boolean - Indicates whether the response was fetched from disk * `fromCache` Boolean - Indicates whether the response was fetched from disk
cache. cache.
* `statusCode` Integer * `statusCode` Integer
Expand Down Expand Up @@ -189,7 +189,7 @@ and response headers are available.
* `ip` String (optional) - The server IP address that the request was * `ip` String (optional) - The server IP address that the request was
actually sent to. actually sent to.
* `fromCache` Boolean * `fromCache` Boolean
* `responseHeaders` Record<string, string> (Optional) * `responseHeaders` Record<string, string> (optional)


The `listener` will be called with `listener(details)` when a server initiated The `listener` will be called with `listener(details)` when a server initiated
redirect is about to occur. redirect is about to occur.
Expand All @@ -208,7 +208,7 @@ redirect is about to occur.
* `resourceType` String * `resourceType` String
* `referrer` String * `referrer` String
* `timestamp` Double * `timestamp` Double
* `responseHeaders` Record<string, string> (Optional) * `responseHeaders` Record<string, string> (optional)
* `fromCache` Boolean * `fromCache` Boolean
* `statusCode` Integer * `statusCode` Integer
* `statusLine` String * `statusLine` String
Expand Down
4 changes: 2 additions & 2 deletions docs/api/webview-tag.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)


Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.


### `<webview>.send(channel[, arg1][, arg2][, ...])` ### `<webview>.send(channel, ...args)`


* `channel` String * `channel` String
* `...args` any[] * `...args` any[]
Expand All @@ -566,7 +566,7 @@ Send an asynchronous message to renderer process via `channel`, you can also
send arbitrary arguments. The renderer process can handle the message by send arbitrary arguments. The renderer process can handle the message by
listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) module. listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) module.


See [webContents.send](web-contents.md#contentssendchannel-arg1-arg2-) for See [webContents.send](web-contents.md#contentssendchannel-args) for
examples. examples.


### `<webview>.sendInputEvent(event)` ### `<webview>.sendInputEvent(event)`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@
"git add filenames.auto.gni" "git add filenames.auto.gni"
] ]
} }
} }
Loading

0 comments on commit f80601d

Please sign in to comment.