docs: add support for readonly,deprecated and platform doc annotations (#19478)

This commit is contained in:
Samuel Attard 2019-07-26 16:12:59 -07:00 committed by GitHub
parent 12bbbef688
commit db3cf52add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 53 additions and 68 deletions

View file

@ -983,7 +983,7 @@ Updates the current activity if its type matches `type`, merging the entries fro
Changes the [Application User Model ID][app-user-model-id] to `id`.
### `app.importCertificate(options, callback)` _LINUX_
### `app.importCertificate(options, callback)` _Linux_
* `options` Object
* `certificate` String - Path for the pkcs12 file.
@ -1193,7 +1193,7 @@ Returns `Boolean` - whether or not the current OS version allows for native emoj
Show the platform's native emoji picker.
### `app.startAccessingSecurityScopedResource(bookmarkData)` _macOS (mas)_
### `app.startAccessingSecurityScopedResource(bookmarkData)` _mas_
* `bookmarkData` String - The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.
@ -1287,17 +1287,17 @@ On macOS, setting this with any nonzero integer shows on the dock icon. On Linux
**Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement].
### `app.commandLine`
### `app.commandLine` _Readonly_
A [`CommandLine`](./command-line.md) object that allows you to read and manipulate the
command line arguments that Chromium uses.
### `app.dock` _macOS_
### `app.dock` _macOS_ _Readonly_
A [`Dock`](./dock.md) object that allows you to perform actions on your app icon in the user's
dock on macOS.
### `app.isPackaged`
### `app.isPackaged` _Readonly_
A `Boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.

View file

@ -750,7 +750,7 @@ let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
```
#### `win.webContents`
#### `win.webContents` _Readonly_
A `WebContents` object this window owns. All web page related events and
operations will be done via it.
@ -758,7 +758,7 @@ operations will be done via it.
See the [`webContents` documentation](web-contents.md) for its methods and
events.
#### `win.id`
#### `win.id` _Readonly_
A `Integer` property representing the unique ID of the window.

View file

@ -50,7 +50,7 @@ The `dialog` module has the following methods:
as a directory instead of a file.
* `message` String (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _masOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@ -110,7 +110,7 @@ dialog.showOpenDialogSync(mainWindow, {
as a directory instead of a file.
* `message` String (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _masOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
Returns `Promise<Object>` - Resolve with an object containing the following:

View file

@ -46,10 +46,10 @@ Stops recording network events. If not called, net logging will automatically en
## Properties
### `netLog.currentlyLogging`
### `netLog.currentlyLogging` _Readonly_
A `Boolean` property that indicates whether network logs are recorded.
### `netLog.currentlyLoggingPath` **Deprecated**
### `netLog.currentlyLoggingPath` _Readonly_ _Deprecated_
A `String` property that returns the path to the current log file.

View file

@ -56,17 +56,17 @@ process.once('loaded', () => {
## Properties
### `process.defaultApp`
### `process.defaultApp` _Readonly_
A `Boolean`. When app is started by being passed as parameter to the default app, this
property is `true` in the main process, otherwise it is `undefined`.
### `process.isMainFrame`
### `process.isMainFrame` _Readonly_
A `Boolean`, `true` when the current renderer context is the "main" renderer
frame. If you want the ID of the current frame you should use `webFrame.routingId`.
### `process.mas`
### `process.mas` _Readonly_
A `Boolean`. For Mac App Store build, this property is `true`, for other builds it is
`undefined`.
@ -88,11 +88,11 @@ A `Boolean` that controls whether or not deprecation warnings are printed to `st
formerly callback-based APIs converted to Promises are invoked using callbacks. Setting this to `true`
will enable deprecation warnings.
### `process.resourcesPath`
### `process.resourcesPath` _Readonly_
A `String` representing the path to the resources directory.
### `process.sandboxed`
### `process.sandboxed` _Readonly_
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
otherwise it is `undefined`.
@ -115,19 +115,19 @@ A `Boolean` that controls whether or not process warnings printed to `stderr` in
(including deprecations). This property is instead of the `--trace-warnings` command
line flag.
### `process.type`
### `process.type` _Readonly_
A `String` representing the current process's type, can be `"browser"` (i.e. main process), `"renderer"`, or `"worker"` (i.e. web worker).
### `process.versions.chrome`
### `process.versions.chrome` _Readonly_
A `String` representing Chrome's version string.
### `process.versions.electron`
### `process.versions.electron` _Readonly_
A `String` representing Electron's version string.
### `process.windowsStore`
### `process.windowsStore` _Readonly_
A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
for otherwise it is `undefined`.

View file

@ -199,7 +199,7 @@ process.
## Properties
### `remote.process`
### `remote.process` _Readonly_
A `NodeJS.Process` object. The `process` object in the main process. This is the same as
`remote.getGlobal('process')` but is cached.

View file

@ -427,15 +427,15 @@ registered.
The following properties are available on instances of `Session`:
#### `ses.cookies`
#### `ses.cookies` _Readonly_
A [`Cookies`](cookies.md) object for this session.
#### `ses.webRequest`
#### `ses.webRequest` _Readonly_
A [`WebRequest`](web-request.md) object for this session.
#### `ses.protocol`
#### `ses.protocol` _Readonly_
A [`Protocol`](protocol.md) object for this session.
@ -454,7 +454,7 @@ app.on('ready', function () {
})
```
#### `ses.netLog`
#### `ses.netLog` _Readonly_
A [`NetLog`](net-log.md) object for this session.

View file

@ -1760,26 +1760,26 @@ Only values between 1 and 60 are accepted.
Only applicable if *offscreen rendering* is enabled.
#### `contents.id`
#### `contents.id` _Readonly_
A `Integer` representing the unique ID of this WebContents.
#### `contents.session`
#### `contents.session` _Readonly_
A [`Session`](session.md) used by this webContents.
#### `contents.hostWebContents`
#### `contents.hostWebContents` _Readonly_
A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
#### `contents.devToolsWebContents`
#### `contents.devToolsWebContents` _Readonly_
A `WebContents` of DevTools for this `WebContents`.
**Note:** Users should never store this object because it may become `null`
when the DevTools has been closed.
#### `contents.debugger`
#### `contents.debugger` _Readonly_
A [`Debugger`](debugger.md) instance for this webContents.

View file

@ -228,35 +228,35 @@ Returns `WebFrame` - that has the supplied `routingId`, `null` if not found.
## Properties
### `webFrame.top`
### `webFrame.top` _Readonly_
A `WebFrame` representing top frame in frame hierarchy to which `webFrame`
A `WebFrame | null` representing top frame in frame hierarchy to which `webFrame`
belongs, the property would be `null` if top frame is not in the current
renderer process.
### `webFrame.opener`
### `webFrame.opener` _Readonly_
A `WebFrame` representing the frame which opened `webFrame`, the property would
A `WebFrame | null` representing the frame which opened `webFrame`, the property would
be `null` if there's no opener or opener is not in the current renderer process.
### `webFrame.parent`
### `webFrame.parent` _Readonly_
A `WebFrame` representing parent frame of `webFrame`, the property would be
A `WebFrame | null` representing parent frame of `webFrame`, the property would be
`null` if `webFrame` is top or parent is not in the current renderer process.
### `webFrame.firstChild`
### `webFrame.firstChild` _Readonly_
A `WebFrame` representing the first child frame of `webFrame`, the property
A `WebFrame | null` representing the first child frame of `webFrame`, the property
would be `null` if `webFrame` has no children or if first child is not in the
current renderer process.
### `webFrame.nextSibling`
### `webFrame.nextSibling` _Readonly_
A `WebFrame` representing next sibling frame, the property would be `null` if
A `WebFrame | null` representing next sibling frame, the property would be `null` if
`webFrame` is the last frame in its parent or if the next sibling is not in the
current renderer process.
### `webFrame.routingId`
### `webFrame.routingId` _Readonly_
An `Integer` representing the unique frame id in the current renderer process.
Distinct WebFrame instances that refer to the same underlying frame will have