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 коммит произвёл GitHub
Родитель 12bbbef688
Коммит db3cf52add
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 53 добавлений и 68 удалений

Просмотреть файл

@ -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`. Changes the [Application User Model ID][app-user-model-id] to `id`.
### `app.importCertificate(options, callback)` _LINUX_ ### `app.importCertificate(options, callback)` _Linux_
* `options` Object * `options` Object
* `certificate` String - Path for the pkcs12 file. * `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. 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. * `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, **Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement]. 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 A [`CommandLine`](./command-line.md) object that allows you to read and manipulate the
command line arguments that Chromium uses. 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 A [`Dock`](./dock.md) object that allows you to perform actions on your app icon in the user's
dock on macOS. 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. 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.

Просмотреть файл

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

Просмотреть файл

@ -50,7 +50,7 @@ The `dialog` module has the following methods:
as a directory instead of a file. as a directory instead of a file.
* `message` String (optional) _macOS_ - Message to display above input * `message` String (optional) _macOS_ - Message to display above input
boxes. 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. 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. as a directory instead of a file.
* `message` String (optional) _macOS_ - Message to display above input * `message` String (optional) _macOS_ - Message to display above input
boxes. 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: Returns `Promise<Object>` - Resolve with an object containing the following:

Просмотреть файл

@ -46,10 +46,10 @@ Stops recording network events. If not called, net logging will automatically en
## Properties ## Properties
### `netLog.currentlyLogging` ### `netLog.currentlyLogging` _Readonly_
A `Boolean` property that indicates whether network logs are recorded. 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. A `String` property that returns the path to the current log file.

Просмотреть файл

@ -56,17 +56,17 @@ process.once('loaded', () => {
## Properties ## Properties
### `process.defaultApp` ### `process.defaultApp` _Readonly_
A `Boolean`. When app is started by being passed as parameter to the default app, this 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`. 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 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`. 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 A `Boolean`. For Mac App Store build, this property is `true`, for other builds it is
`undefined`. `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` formerly callback-based APIs converted to Promises are invoked using callbacks. Setting this to `true`
will enable deprecation warnings. will enable deprecation warnings.
### `process.resourcesPath` ### `process.resourcesPath` _Readonly_
A `String` representing the path to the resources directory. 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`, A `Boolean`. When the renderer process is sandboxed, this property is `true`,
otherwise it is `undefined`. 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 (including deprecations). This property is instead of the `--trace-warnings` command
line flag. 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). 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. A `String` representing Chrome's version string.
### `process.versions.electron` ### `process.versions.electron` _Readonly_
A `String` representing Electron's version string. 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`, A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
for otherwise it is `undefined`. for otherwise it is `undefined`.

Просмотреть файл

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

Просмотреть файл

@ -427,15 +427,15 @@ registered.
The following properties are available on instances of `Session`: The following properties are available on instances of `Session`:
#### `ses.cookies` #### `ses.cookies` _Readonly_
A [`Cookies`](cookies.md) object for this session. A [`Cookies`](cookies.md) object for this session.
#### `ses.webRequest` #### `ses.webRequest` _Readonly_
A [`WebRequest`](web-request.md) object for this session. A [`WebRequest`](web-request.md) object for this session.
#### `ses.protocol` #### `ses.protocol` _Readonly_
A [`Protocol`](protocol.md) object for this session. 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. A [`NetLog`](net-log.md) object for this session.

Просмотреть файл

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

Просмотреть файл

@ -228,35 +228,35 @@ Returns `WebFrame` - that has the supplied `routingId`, `null` if not found.
## Properties ## 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 belongs, the property would be `null` if top frame is not in the current
renderer process. 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. 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. `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 would be `null` if `webFrame` has no children or if first child is not in the
current renderer process. 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 `webFrame` is the last frame in its parent or if the next sibling is not in the
current renderer process. current renderer process.
### `webFrame.routingId` ### `webFrame.routingId` _Readonly_
An `Integer` representing the unique frame id in the current renderer process. An `Integer` representing the unique frame id in the current renderer process.
Distinct WebFrame instances that refer to the same underlying frame will have Distinct WebFrame instances that refer to the same underlying frame will have

Просмотреть файл

@ -37,7 +37,7 @@ Object.defineProperty(app, 'applicationMenu', {
} }
}) })
app.isPackaged = (() => { App.prototype.isPackaged = (() => {
const execFile = path.basename(process.execPath).toLowerCase() const execFile = path.basename(process.execPath).toLowerCase()
if (process.platform === 'win32') { if (process.platform === 'win32') {
return execFile !== 'electron.exe' return execFile !== 'electron.exe'

Просмотреть файл

@ -4,8 +4,8 @@
"repository": "https://github.com/electron/electron", "repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": { "devDependencies": {
"@electron/docs-parser": "^0.3.0", "@electron/docs-parser": "^0.4.1",
"@electron/typescript-definitions": "^8.3.5", "@electron/typescript-definitions": "^8.5.0",
"@octokit/rest": "^16.3.2", "@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1", "@primer/octicons": "^9.1.1",
"@types/chai": "^4.1.7", "@types/chai": "^4.1.7",

Просмотреть файл

@ -25,10 +25,10 @@
dependencies: dependencies:
regenerator-runtime "^0.13.2" regenerator-runtime "^0.13.2"
"@electron/docs-parser@^0.2.1": "@electron/docs-parser@^0.4.1":
version "0.2.2" version "0.4.1"
resolved "https://registry.yarnpkg.com/@electron/docs-parser/-/docs-parser-0.2.2.tgz#7c9acd6cc10559c86a27bb0653ec13df10955f02" resolved "https://registry.yarnpkg.com/@electron/docs-parser/-/docs-parser-0.4.1.tgz#e6557a6a3899ca1168b9f2d70ad24d9ba924e4a9"
integrity sha512-FKXktu5i6cHL+AkvWv34j2lpBXNpqfHN7YwhswcBqRFXsj24phpih/sY2NKx6OrFP9R3ReJeg681/luAf/3k8Q== integrity sha512-mn4ofEvH8HNdzRMb++cUbiTkO88BAKwM0yjED3KrQ07yEl7CU1lK13qSMVSRhDzNkbg4kFTqBDjaJ57fdHlkxQ==
dependencies: dependencies:
"@types/markdown-it" "^0.0.7" "@types/markdown-it" "^0.0.7"
chai "^4.2.0" chai "^4.2.0"
@ -40,27 +40,12 @@
ora "^3.4.0" ora "^3.4.0"
pretty-ms "^5.0.0" pretty-ms "^5.0.0"
"@electron/docs-parser@^0.3.0": "@electron/typescript-definitions@^8.5.0":
version "0.3.0" version "8.5.0"
resolved "https://registry.yarnpkg.com/@electron/docs-parser/-/docs-parser-0.3.0.tgz#cf8c33ed9cebffe7f3463a1e2d60ccf457b52ec6" resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.5.0.tgz#8be8d90e2245478368180795b3632db02e90ccdc"
integrity sha512-/q2et0q6eMDItzv1ZCAH5ZJZY8AFGFkK1+wfAJfdarMDJOVs29pH8b0HjTXo2k+kLGlbC2TROZfuCHRgx+l/EQ== integrity sha512-sq7tTIyQyGMxrSbmCsbpyfV5Yc68Pb74rp5cbpaS3Kopi5sAL2nIi4TdTakVE7Pp4cye75i8HqDUBhsMpt+TvA==
dependencies: dependencies:
"@types/markdown-it" "^0.0.7" "@electron/docs-parser" "^0.4.1"
chai "^4.2.0"
chalk "^2.4.2"
fs-extra "^7.0.1"
lodash.camelcase "^4.3.0"
markdown-it "^8.4.2"
minimist "^1.2.0"
ora "^3.4.0"
pretty-ms "^5.0.0"
"@electron/typescript-definitions@^8.3.5":
version "8.4.0"
resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.4.0.tgz#934b8b0b4433245794686f416398fc2503742f35"
integrity sha512-P+j99jjv7KD54p/nbrG3esPJzTq1fkK+MAuK+AnaU395Z6+5IRiXutLPFaO9i1idXg2Y3aknad0HKke4jQJB1Q==
dependencies:
"@electron/docs-parser" "^0.2.1"
"@types/node" "^11.13.7" "@types/node" "^11.13.7"
chalk "^2.4.2" chalk "^2.4.2"
colors "^1.1.2" colors "^1.1.2"