create a one-liner description for each API

This commit is contained in:
Zeke Sikelianos 2016-04-21 15:35:29 -07:00
parent a4de40ec89
commit ee190ca62a
34 changed files with 70 additions and 39 deletions

View file

@ -1,7 +1,9 @@
# Accelerator # Accelerator
An accelerator is a string that represents a keyboard shortcut. It can contain Define keyboard shortcuts.
multiple modifiers and key codes, combined by the `+` character.
Accelerators can contain multiple modifiers and key codes, combined by
the `+` character.
Examples: Examples:

View file

@ -1,6 +1,6 @@
# app # app
The `app` module is responsible for controlling the application's lifecycle. Control your application's event lifecycle.
The following example shows how to quit the application when the last window is The following example shows how to quit the application when the last window is
closed: closed:

View file

@ -1,6 +1,8 @@
# autoUpdater # autoUpdater
This module provides an interface for the `Squirrel` auto-updater framework. Enable apps to update themselves automatically.
The `autoUpdater` module provides and interface for the [Squirrel](https://github.com/Squirrel) framework.
You can quickly launch a multi-platform release server for distributing your You can quickly launch a multi-platform release server for distributing your
application by using one of these projects: application by using one of these projects:

View file

@ -1,7 +1,6 @@
# BrowserWindow # BrowserWindow
The `BrowserWindow` class gives you the ability to create a browser window. For Create and control browser windows.
example:
```javascript ```javascript
// In the main process. // In the main process.

View file

@ -1,9 +1,10 @@
# Supported Chrome command line switches # Supported Chrome command line switches
This page lists the command line switches used by the Chrome browser that are Command line switches supported by Electron.
also supported by Electron. You can use
[app.commandLine.appendSwitch][append-switch] to append them in your app's main You can use [app.commandLine.appendSwitch][append-switch] to append them in
script before the [ready][ready] event of [app][app] module is emitted: your app's main script before the [ready][ready] event of [app][app] module is
emitted:
```javascript ```javascript
const app = require('electron').app; const app = require('electron').app;

View file

@ -1,6 +1,7 @@
# clipboard # clipboard
The `clipboard` module provides methods to perform copy and paste operations. Perform copy and paste operations on the system clipboard.
The following example shows how to write a string to the clipboard: The following example shows how to write a string to the clipboard:
```javascript ```javascript

View file

@ -1,7 +1,8 @@
# contentTracing # contentTracing
The `content-tracing` module is used to collect tracing data generated by the Debug your application using Chromium's content module.
underlying Chromium content module. This module does not include a web interface
This module does not include a web interface
so you need to open `chrome://tracing/` in a Chrome browser and load the so you need to open `chrome://tracing/` in a Chrome browser and load the
generated file to view the result. generated file to view the result.

View file

@ -1,6 +1,6 @@
# crashReporter # crashReporter
The `crash-reporter` module enables sending your app's crash reports. Submit crash reports to a remote server.
The following is an example of automatically submitting a crash report to a The following is an example of automatically submitting a crash report to a
remote server: remote server:

View file

@ -1,7 +1,7 @@
# desktopCapturer # desktopCapturer
The `desktopCapturer` module can be used to get available sources that can be Capture audio, video, and images from a microphone, camera, or
used to be captured with `getUserMedia`. screen using the `getUserMedia` API.
```javascript ```javascript
// In the renderer process. // In the renderer process.

View file

@ -1,8 +1,6 @@
# dialog # dialog
The `dialog` module provides APIs to show native system dialogs, such as opening Display native system dialogs for opening and saving files, alerting, etc.
files or alerting, so web applications can deliver the same user experience as
native applications.
An example of showing a dialog to select multiple files and directories: An example of showing a dialog to select multiple files and directories:

View file

@ -1,5 +1,7 @@
# DownloadItem # DownloadItem
Trigger file downloads from remote sources.
`DownloadItem` is an EventEmitter represents a download item in Electron. It `DownloadItem` is an EventEmitter represents a download item in Electron. It
is used in `will-download` event of `Session` module, and allows users to is used in `will-download` event of `Session` module, and allows users to
control the download item. control the download item.

View file

@ -1,5 +1,7 @@
# Environment variables # Environment variables
Control application configuration and behavior without changing code.
Some behaviors of Electron are controlled by environment variables, because they Some behaviors of Electron are controlled by environment variables, because they
are initialized earlier than command line and the app's code. are initialized earlier than command line and the app's code.

View file

@ -1,5 +1,7 @@
# `File` object # `File` object
Use the HTML5 `File` API to work natively with files on the filesystem.
The DOM's File interface provides abstraction around native files in order to The DOM's File interface provides abstraction around native files in order to
let users work on native files directly with the HTML5 file API. Electron has let users work on native files directly with the HTML5 file API. Electron has
added a `path` attribute to the `File` interface which exposes the file's real added a `path` attribute to the `File` interface which exposes the file's real

View file

@ -1,5 +1,7 @@
# Frameless Window # Frameless Window
> Open a window without toolbars, borders, or other graphical "chrome".
A frameless window is a window that has no A frameless window is a window that has no
[chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of
the window, like toolbars, that are not a part of the web page. These are the window, like toolbars, that are not a part of the web page. These are

View file

@ -1,5 +1,7 @@
# globalShortcut # globalShortcut
Detect keyboard events when the application does not have keyboard focus.
The `globalShortcut` module can register/unregister a global keyboard shortcut The `globalShortcut` module can register/unregister a global keyboard shortcut
with the operating system so that you can customize the operations for various with the operating system so that you can customize the operations for various
shortcuts. shortcuts.

View file

@ -1,5 +1,7 @@
# ipcMain # ipcMain
Communicate asynchronously from the main process to renderer processes.
The `ipcMain` module is an instance of the The `ipcMain` module is an instance of the
[EventEmitter](https://nodejs.org/api/events.html) class. When used in the main [EventEmitter](https://nodejs.org/api/events.html) 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

View file

@ -1,5 +1,7 @@
# ipcRenderer # ipcRenderer
Communicate asynchronously from a renderer process to the main process.
The `ipcRenderer` module is an instance of the The `ipcRenderer` module is an instance of the
[EventEmitter](https://nodejs.org/api/events.html) class. It provides a few [EventEmitter](https://nodejs.org/api/events.html) 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

View file

@ -1,7 +1,6 @@
# MenuItem # MenuItem
The `menu-item` module allows you to add items to an application or context Add items to application and context menus.
[`menu`](menu.md).
See [`menu`](menu.md) for examples. See [`menu`](menu.md) for examples.

View file

@ -1,8 +1,7 @@
# Menu # Menu
The `menu` class is used to create native menus that can be used as Create native application menus and context menus.
application menus and
[context menus](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/PopupGuide/ContextMenus).
This module is a main process module which can be used in a render process via This module is a main process module which can be used in a render process via
the `remote` module. the `remote` module.

View file

@ -1,5 +1,7 @@
# nativeImage # nativeImage
Create tray, dock, and application icons using PNG or JPG files.
In Electron, for the APIs that take images, you can pass either file paths or In Electron, for the APIs that take images, you can pass either file paths or
`nativeImage` instances. An empty image will be used when `null` is passed. `nativeImage` instances. An empty image will be used when `null` is passed.

View file

@ -1,7 +1,8 @@
# powerMonitor # powerMonitor
The `power-monitor` module is used to monitor power state changes. You can Monitor power state changes.
only use it in the main process. You should not use this module until the `ready`
You can only use it in the main process. You should not use this module until the `ready`
event of the `app` module is emitted. event of the `app` module is emitted.
For example: For example:

View file

@ -1,8 +1,6 @@
# powerSaveBlocker # powerSaveBlocker
The `powerSaveBlocker` module is used to block the system from entering Block the system from entering low-power (sleep) mode.
low-power (sleep) mode and thus allowing the app to keep the system and screen
active.
For example: For example:

View file

@ -1,5 +1,7 @@
# process # process
Get information about the running application process.
The `process` object in Electron has the following differences from the one in The `process` object in Electron has the following differences from the one in
upstream node: upstream node:

View file

@ -1,7 +1,7 @@
# protocol # protocol
The `protocol` module can register a custom protocol or intercept an existing Register a custom protocol to intercept click events from other running
protocol. applications.
An example of implementing a protocol that has the same effect as the An example of implementing a protocol that has the same effect as the
`file://` protocol: `file://` protocol:

View file

@ -1,5 +1,7 @@
# remote # remote
Communicate between the renderer process and the main process.
The `remote` module provides a simple way to do inter-process communication The `remote` module provides a simple way to do inter-process communication
(IPC) between the renderer process (web page) and the main process. (IPC) between the renderer process (web page) and the main process.

View file

@ -1,8 +1,9 @@
# screen # screen
The `screen` module retrieves information about screen size, displays, cursor > Retrieve information about screen size, displays, cursor position, etc.
position, etc. You can not use this module until the `ready` event of the
`app` module is emitted (by invoking or requiring it). You cannot not use this module until the `ready` event of the `app` module is
emitted (by invoking or requiring it).
`screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). `screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter).

View file

@ -1,5 +1,7 @@
# session # session
Manage browser cookies, cache, and other session data.
The `session` module can be used to create new `Session` objects. The `session` module can be used to create new `Session` objects.
You can also access the `session` of existing pages by using the `session` You can also access the `session` of existing pages by using the `session`

View file

@ -1,5 +1,7 @@
# shell # shell
Manage files and URLs using their default applications.
The `shell` module provides functions related to desktop integration. The `shell` module provides functions related to desktop integration.
An example of opening a URL in the user's default browser: An example of opening a URL in the user's default browser:

View file

@ -1,5 +1,7 @@
# Synopsis # Synopsis
Info about Node.js and the main and renderer processes.
All of [Node.js's built-in modules](http://nodejs.org/api/) are available in All of [Node.js's built-in modules](http://nodejs.org/api/) are available in
Electron and third-party node modules also fully supported as well (including Electron and third-party node modules also fully supported as well (including
the [native modules](../tutorial/using-native-node-modules.md)). the [native modules](../tutorial/using-native-node-modules.md)).

View file

@ -1,7 +1,6 @@
# Tray # Tray
A `Tray` represents an icon in an operating system's notification area, it is Add icons and context menus to the system's notification area.
usually attached with a context menu.
```javascript ```javascript
const electron = require('electron'); const electron = require('electron');

View file

@ -1,8 +1,9 @@
# webContents # webContents
Render and control web pages using lifecycle events.
`webContents` is an `webContents` is an
[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). [EventEmitter](http://nodejs.org/api/events.html#events_class_events_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:

View file

@ -1,7 +1,6 @@
# webFrame # webFrame
The `web-frame` module allows you to customize the rendering of the current Customize the rendering of the current web page.
web page.
An example of zooming current page to 200%. An example of zooming current page to 200%.

View file

@ -1,5 +1,7 @@
# The `<webview>` tag # The `<webview>` tag
Display external web content in an isolated frame and process.
Use the `webview` tag to embed 'guest' content (such as web pages) in your Use the `webview` tag to embed 'guest' content (such as web pages) in your
Electron app. The guest content is contained within the `webview` container. Electron app. The guest content is contained within the `webview` container.
An embedded page within your app controls how the guest content is laid out and An embedded page within your app controls how the guest content is laid out and

View file

@ -1,5 +1,7 @@
# The `window.open` function # The `window.open` function
Create a new window in a web page.
When `window.open` is called to create a new window in a web page, a new instance When `window.open` is called to create a new window in a web page, a new instance
of `BrowserWindow` will be created for the `url` and a proxy will be returned of `BrowserWindow` will be created for the `url` and a proxy will be returned
to `window.open` to let the page have limited control over it. to `window.open` to let the page have limited control over it.