doc: improve EventEmitter md formatting (#19345)

This commit is contained in:
Shelley Vohr 2019-07-22 08:20:43 -07:00 коммит произвёл GitHub
Родитель 0490189531
Коммит 3395a1d4db
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 34 добавлений и 20 удалений

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

@ -6,6 +6,8 @@ Process: [Main](../glossary.md#main-process)
**See also: [A detailed guide about how to implement updates in your application](../tutorial/updates.md).** **See also: [A detailed guide about how to implement updates in your application](../tutorial/updates.md).**
`autoUpdater` is an [EventEmitter][event-emitter].
## Platform Notices ## Platform Notices
Currently, only macOS and Windows are supported. There is no built-in support Currently, only macOS and Windows are supported. There is no built-in support
@ -136,3 +138,4 @@ application starts.
[installer-lib]: https://github.com/electron/windows-installer [installer-lib]: https://github.com/electron/windows-installer
[electron-forge-lib]: https://github.com/electron-userland/electron-forge [electron-forge-lib]: https://github.com/electron-userland/electron-forge
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx [app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -131,8 +131,7 @@ state is `hidden` in order to minimize power consumption.
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`BrowserWindow` is an `BrowserWindow` is an [EventEmitter][event-emitter].
[EventEmitter](https://nodejs.org/api/events.html#events_class_events_eventemitter).
It creates a new `BrowserWindow` with native properties as set by the `options`. It creates a new `BrowserWindow` with native properties as set by the `options`.
@ -1737,3 +1736,4 @@ removed in future Electron releases.
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc [vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc
[window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -5,7 +5,7 @@
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`ClientRequest` implements the [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams) `ClientRequest` implements the [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams)
interface and is therefore an [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). interface and is therefore an [EventEmitter][event-emitter].
### `new ClientRequest(options)` ### `new ClientRequest(options)`
@ -229,3 +229,5 @@ no other properties will be set
You can use this method in conjunction with `POST` requests to get the progress You can use this method in conjunction with `POST` requests to get the progress
of a file upload or other data transfer. of a file upload or other data transfer.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -4,7 +4,7 @@
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`DownloadItem` is an `EventEmitter` that represents a download item in Electron. `DownloadItem` is an [EventEmitter][event-emitter] that represents a download item in Electron.
It is used in `will-download` event of `Session` class, and allows users to It is used in `will-download` event of `Session` class, and allows users to
control the download item. control the download item.
@ -195,3 +195,5 @@ A `String` property that determines the save file path of the download item.
The property is only available in session's `will-download` callback function. The property is only available in session's `will-download` callback function.
If user doesn't set the save path via the property, Electron will use the original If user doesn't set the save path via the property, Electron will use the original
routine to determine the save path; this usually prompts a save dialog. routine to determine the save path; this usually prompts a save dialog.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -5,7 +5,7 @@
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`IncomingMessage` implements the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) `IncomingMessage` implements the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams)
interface and is therefore an [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). interface and is therefore an [EventEmitter][event-emitter].
### Instance Events ### Instance Events
@ -72,3 +72,5 @@ An `Integer` indicating the HTTP protocol major version number.
#### `response.httpVersionMinor` #### `response.httpVersionMinor`
An `Integer` indicating the HTTP protocol minor version number. An `Integer` indicating the HTTP protocol minor version number.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -4,8 +4,7 @@
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
The `ipcMain` module is an instance of the The `ipcMain` module is an [Event Emitter][event-emitter]. When used in the main
[EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) class. When used in the main
process, it handles asynchronous and synchronous messages sent from a renderer process, it handles asynchronous and synchronous messages sent from a renderer
process (web page). Messages sent from a renderer will be emitted to this process (web page). Messages sent from a renderer will be emitted to this
module. module.
@ -146,3 +145,5 @@ in the [`ipc-main-event`](structures/ipc-main-event.md) structure docs.
The documentation for the `event` object passed to `handle` callbacks can be The documentation for the `event` object passed to `handle` callbacks can be
found in the [`ipc-main-invoke-event`](structures/ipc-main-invoke-event.md) found in the [`ipc-main-invoke-event`](structures/ipc-main-invoke-event.md)
structure docs. structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -4,8 +4,7 @@
Process: [Renderer](../glossary.md#renderer-process) Process: [Renderer](../glossary.md#renderer-process)
The `ipcRenderer` module is an instance of the The `ipcRenderer` module is an [EventEmitter][event-emitter]. It provides a few
[EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) class. It provides a few
methods so you can send synchronous and asynchronous messages from the render methods so you can send synchronous and asynchronous messages from the render
process (web page) to the main process. You can also receive replies from the process (web page) to the main process. You can also receive replies from the
main process. main process.
@ -128,3 +127,5 @@ the host page instead of the main process.
The documentation for the `event` object passed to the `callback` can be found The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-renderer-event`](structures/ipc-renderer-event.md) structure docs. in the [`ipc-renderer-event`](structures/ipc-renderer-event.md) structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -14,8 +14,7 @@ If you want to show Notifications from a renderer process you should use the [HT
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`Notification` is an `Notification` is an [EventEmitter][event-emitter].
[EventEmitter](https://nodejs.org/api/events.html#events_class_events_eventemitter).
It creates a new `Notification` with native properties as set by the `options`. It creates a new `Notification` with native properties as set by the `options`.
@ -125,3 +124,5 @@ or one of the following locations:
* `/System/Library/Sounds` * `/System/Library/Sounds`
See the [`NSSound`](https://developer.apple.com/documentation/appkit/nssound) docs for more information. See the [`NSSound`](https://developer.apple.com/documentation/appkit/nssound) docs for more information.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -7,7 +7,7 @@ Process: [Main](../glossary.md#main-process)
This module cannot be used until the `ready` event of the `app` This module cannot be used until the `ready` event of the `app`
module is emitted. module is emitted.
`screen` is an [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). `screen` is an [EventEmitter][event-emitter].
**Note:** In the renderer / DevTools, `window.screen` is a reserved DOM **Note:** In the renderer / DevTools, `window.screen` is a reserved DOM
property, so writing `let { screen } = require('electron')` will not work. property, so writing `let { screen } = require('electron')` will not work.
@ -152,3 +152,5 @@ Returns [`Rectangle`](structures/rectangle.md)
Converts a screen DIP rect to a screen physical rect. Converts a screen DIP rect to a screen physical rect.
The DPI scale is performed relative to the display nearest to `window`. The DPI scale is performed relative to the display nearest to `window`.
If `window` is null, scaling will be performed to the display nearest to `rect`. If `window` is null, scaling will be performed to the display nearest to `rect`.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -4,8 +4,7 @@
Process: [Main](../glossary.md#main-process) Process: [Main](../glossary.md#main-process)
`webContents` is an `webContents` is an [EventEmitter][event-emitter].
[EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter).
It is responsible for rendering and controlling a web page and is a property of It is responsible for rendering and controlling a web page and is a property of
the [`BrowserWindow`](browser-window.md) object. An example of accessing the the [`BrowserWindow`](browser-window.md) object. An example of accessing the
`webContents` object: `webContents` object:
@ -1813,3 +1812,4 @@ when the DevTools has been closed.
A [`Debugger`](debugger.md) instance for this webContents. A [`Debugger`](debugger.md) instance for this webContents.
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent [keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

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

@ -5,7 +5,7 @@
"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.3.0",
"@electron/typescript-definitions": "^8.3.1", "@electron/typescript-definitions": "^8.3.5",
"@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",

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

@ -55,10 +55,10 @@
ora "^3.4.0" ora "^3.4.0"
pretty-ms "^5.0.0" pretty-ms "^5.0.0"
"@electron/typescript-definitions@^8.3.1": "@electron/typescript-definitions@^8.3.5":
version "8.3.4" version "8.3.5"
resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.3.4.tgz#2345e4058e66677792f1bc11662b13e6ccc9a17e" resolved "https://registry.yarnpkg.com/@electron/typescript-definitions/-/typescript-definitions-8.3.5.tgz#02bbeea578bf3ef44f57297ba9e101df57270dbd"
integrity sha512-hh2ls04hvsW6i7B/x2cHJLyB5jQAzzr8IFsEaTqTFsi+tOmQVbeaao87ffLbZdiHI3Jh2Ll+o0zWa13dcV5Txw== integrity sha512-kKxNdWmw+zy2ENECrDjNdzDTATezTQEHmx0OHccbb/JOuL/tLpQXlVEiieCVQ2XJ+SY3FHRuZCrBUo3VEyR2uA==
dependencies: dependencies:
"@electron/docs-parser" "^0.2.1" "@electron/docs-parser" "^0.2.1"
"@types/node" "^11.13.7" "@types/node" "^11.13.7"