Merge pull request #8078 from electron/dts-docs-update-again

Update Docs
This commit is contained in:
Kevin Sawicki 2016-12-21 13:39:53 -08:00 committed by GitHub
commit f99dabbac6
14 changed files with 66 additions and 42 deletions

View file

@ -189,7 +189,7 @@ Returns:
* `event` Event * `event` Event
* `webContents` [WebContents](web-contents.md) * `webContents` [WebContents](web-contents.md)
* `url` URL * `url` String
* `error` String - The error code * `error` String - The error code
* `certificate` [Certificate](structures/certificate.md) * `certificate` [Certificate](structures/certificate.md)
* `callback` Function * `callback` Function
@ -845,7 +845,7 @@ When `informational` is passed, the dock icon will bounce for one second.
However, the request remains active until either the application becomes active However, the request remains active until either the application becomes active
or the request is canceled. or the request is canceled.
Returns an ID representing the request. Returns `Integer` an ID representing the request.
### `app.dock.cancelBounce(id)` _macOS_ ### `app.dock.cancelBounce(id)` _macOS_
@ -891,7 +891,7 @@ Sets the application's [dock menu][dock-menu].
### `app.dock.setIcon(image)` _macOS_ ### `app.dock.setIcon(image)` _macOS_
* `image` [NativeImage](native-image.md) * `image` ([NativeImage](native-image.md) | String)
Sets the `image` associated with this dock icon. Sets the `image` associated with this dock icon.

View file

@ -202,10 +202,10 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `thickFrame` Boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on * `thickFrame` Boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
Windows, which adds standard window frame. Setting it to `false` will remove Windows, which adds standard window frame. Setting it to `false` will remove
window shadow and window animations. Default is `true`. window shadow and window animations. Default is `true`.
* `vibrancy` String - Add a type of vibrancy effect to the window, only on * `vibrancy` String - (optional) Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`.
* `zoomToPageWidth` Boolean - Controls the behavior on macOS when * `zoomToPageWidth` Boolean - (optional) Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred Window > Zoom menu item. If `true`, the window will grow to the preferred
width of the web page when zoomed, `false` will cause it to zoom to the width of the web page when zoomed, `false` will cause it to zoom to the

View file

@ -79,15 +79,15 @@ with `callback(error, cookies)` on complete.
* `details` Object * `details` Object
* `url` String - The url to associate the cookie with. * `url` String - The url to associate the cookie with.
* `name` String - The name of the cookie. Empty by default if omitted. * `name` String - (optional) The name of the cookie. Empty by default if omitted.
* `value` String - The value of the cookie. Empty by default if omitted. * `value` String - (optional) The value of the cookie. Empty by default if omitted.
* `domain` String - The domain of the cookie. Empty by default if omitted. * `domain` String - (optional) The domain of the cookie. Empty by default if omitted.
* `path` String - The path of the cookie. Empty by default if omitted. * `path` String - (optional) The path of the cookie. Empty by default if omitted.
* `secure` Boolean - Whether the cookie should be marked as Secure. Defaults to * `secure` Boolean - (optional) Whether the cookie should be marked as Secure. Defaults to
false. false.
* `httpOnly` Boolean - Whether the cookie should be marked as HTTP only. * `httpOnly` Boolean - (optional) Whether the cookie should be marked as HTTP only.
Defaults to false. Defaults to false.
* `expirationDate` Double - The expiration date of the cookie as the number of * `expirationDate` Double - (optional) The expiration date of the cookie as the number of
seconds since the UNIX epoch. If omitted then the cookie becomes a session seconds since the UNIX epoch. If omitted then the cookie becomes a session
cookie and will not be retained between sessions. cookie and will not be retained between sessions.
* `callback` Function * `callback` Function

View file

@ -64,3 +64,11 @@ A String indicating the HTTP protocol version number. Typical values are '1.0'
or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
Integer-valued readable properties that return respectively the HTTP major and Integer-valued readable properties that return respectively the HTTP major and
minor version numbers. minor version numbers.
#### `response.httpVersionMajor`
An Integer indicating the HTTP protocol major version number.
#### `response.httpVersionMinor`
An Integer indicating the HTTP protocol minor version number.

View file

@ -106,3 +106,11 @@ A `radio` menu item will turn on its `checked` property when clicked, and
will turn off that property for all adjacent items in the same menu. will turn off that property for all adjacent items in the same menu.
You can add a `click` function for additional behavior. You can add a `click` function for additional behavior.
#### `menuItem.label`
A String representing the menu items visible label
#### `menuItem.click`
A Function that is fired when the MenuItem recieves a click event

View file

@ -121,7 +121,7 @@ treated as a standard scheme.
* `method` String * `method` String
* `uploadData` [UploadData[]](structures/upload-data.md) * `uploadData` [UploadData[]](structures/upload-data.md)
* `callback` Function * `callback` Function
* `buffer` Buffer (optional) * `buffer` (Buffer | [MimeTypedBuffer](structures/mime-typed-buffer.md)) (optional)
* `completion` Function (optional) * `completion` Function (optional)
* `error` Error * `error` Error

View file

@ -200,7 +200,7 @@ The `proxyBypassRules` is a comma separated list of rules described below:
Match local addresses. The meaning of `<local>` is whether the Match local addresses. The meaning of `<local>` is whether the
host matches one of: "127.0.0.1", "::1", "localhost". host matches one of: "127.0.0.1", "::1", "localhost".
### `ses.resolveProxy(url, callback)` #### `ses.resolveProxy(url, callback)`
* `url` URL * `url` URL
* `callback` Function * `callback` Function

View file

@ -2,13 +2,13 @@
* `name` String - The name of the cookie. * `name` String - The name of the cookie.
* `value` String - The value of the cookie. * `value` String - The value of the cookie.
* `domain` String - The domain of the cookie. * `domain` String - (optional) The domain of the cookie.
* `hostOnly` String - Whether the cookie is a host-only cookie. * `hostOnly` Boolean - (optional) Whether the cookie is a host-only cookie.
* `path` String - The path of the cookie. * `path` String - (optional) The path of the cookie.
* `secure` Boolean - Whether the cookie is marked as secure. * `secure` Boolean - (optional) Whether the cookie is marked as secure.
* `httpOnly` Boolean - Whether the cookie is marked as HTTP only. * `httpOnly` Boolean - (optional) Whether the cookie is marked as HTTP only.
* `session` Boolean - Whether the cookie is a session cookie or a persistent * `session` Boolean - (optional) Whether the cookie is a session cookie or a persistent
cookie with an expiration date. cookie with an expiration date.
* `expirationDate` Double (optional) - The expiration date of the cookie as * `expirationDate` Double - (optional) The expiration date of the cookie as
the number of seconds since the UNIX epoch. Not provided for session the number of seconds since the UNIX epoch. Not provided for session
cookies. cookies.

View file

@ -1,6 +1,6 @@
# JumpListCategory Object # JumpListCategory Object
* `type` String - One of the following: * `type` String - (optional) One of the following:
* `tasks` - Items in this category will be placed into the standard `Tasks` * `tasks` - Items in this category will be placed into the standard `Tasks`
category. There can be only one such category, and it will always be category. There can be only one such category, and it will always be
displayed at the bottom of the Jump List. displayed at the bottom of the Jump List.

View file

@ -1,6 +1,6 @@
# JumpListItem Object # JumpListItem Object
* `type` String - One of the following: * `type` String - (optional) One of the following:
* `task` - A task will launch an app with specific arguments. * `task` - A task will launch an app with specific arguments.
* `separator` - Can be used to separate items in the standard `Tasks` * `separator` - Can be used to separate items in the standard `Tasks`
category. category.
@ -18,11 +18,11 @@
Should only be set if `type` is `task`. Should only be set if `type` is `task`.
* `description` String - (optional) Description of the task (displayed in a tooltip). * `description` String - (optional) Description of the task (displayed in a tooltip).
Should only be set if `type` is `task`. Should only be set if `type` is `task`.
* `iconPath` String - The absolute path to an icon to be displayed in a * `iconPath` String - (optional) The absolute path to an icon to be displayed in a
Jump List, which can be an arbitrary resource file that contains an icon Jump List, which can be an arbitrary resource file that contains an icon
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to (e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to
show the program icon. show the program icon.
* `iconIndex` Number - The index of the icon in the resource file. If a * `iconIndex` Number - (optional) The index of the icon in the resource file. If a
resource file contains multiple icons this value can be used to specify the resource file contains multiple icons this value can be used to specify the
zero-based index of the icon that should be displayed for this task. If a zero-based index of the icon that should be displayed for this task. If a
resource file contains only one icon, this property should be set to zero. resource file contains only one icon, this property should be set to zero.

View file

@ -0,0 +1,4 @@
# MimeTypedBuffer Object
* `mimeType` String - The mimeType of the Buffer that you are sending
* `buffer` Buffer - The actual Buffer content

View file

@ -154,7 +154,7 @@ Destroys the tray icon immediately.
#### `tray.setImage(image)` #### `tray.setImage(image)`
* `image` [NativeImage](native-image.md) * `image` ([NativeImage](native-image.md) | String)
Sets the `image` associated with this tray icon. Sets the `image` associated with this tray icon.
@ -210,9 +210,9 @@ win.on('hide', () => {
#### `tray.displayBalloon(options)` _Windows_ #### `tray.displayBalloon(options)` _Windows_
* `options` Object * `options` Object
* `icon` [NativeImage](native-image.md) * `icon` ([NativeImage](native-image.md) | String) - (optional)
* `title` String * `title` String - (optional)
* `content` String * `content` String - (optional)
Displays a tray balloon. Displays a tray balloon.

View file

@ -267,7 +267,7 @@ Emitted when DevTools is focused / opened.
Returns: Returns:
* `event` Event * `event` Event
* `url` URL * `url` String
* `error` String - The error code * `error` String - The error code
* `certificate` [Certificate](structures/certificate.md) * `certificate` [Certificate](structures/certificate.md)
* `callback` Function * `callback` Function
@ -507,7 +507,7 @@ Emitted when the devtools window instructs the webContents to reload
#### `contents.loadURL(url[, options])` #### `contents.loadURL(url[, options])`
* `url` URL * `url` String
* `options` Object (optional) * `options` Object (optional)
* `httpReferrer` String (optional) - A HTTP Referrer url. * `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request. * `userAgent` String (optional) - A user agent originating the request.
@ -795,14 +795,14 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty. * `text` String - Content to be searched, must not be empty.
* `options` Object (optional) * `options` Object (optional)
* `forward` Boolean - Whether to search forward or backward, defaults to `true`. * `forward` Boolean - (optional) Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean - Whether the operation is first request or a follow up, * `findNext` Boolean - (optional) Whether the operation is first request or a follow up,
defaults to `false`. defaults to `false`.
* `matchCase` Boolean - Whether search should be case-sensitive, * `matchCase` Boolean - (optional) Whether search should be case-sensitive,
defaults to `false`. defaults to `false`.
* `wordStart` Boolean - Whether to look only at the start of words. * `wordStart` Boolean - (optional) Whether to look only at the start of words.
defaults to `false`. defaults to `false`.
* `medialCapitalAsWordStart` Boolean - When combined with `wordStart`, * `medialCapitalAsWordStart` Boolean - (optional) When combined with `wordStart`,
accepts a match in the middle of a word if the match begins with an accepts a match in the middle of a word if the match begins with an
uppercase letter followed by a lowercase or non-letter. uppercase letter followed by a lowercase or non-letter.
Accepts several other intra-word matches, defaults to `false`. Accepts several other intra-word matches, defaults to `false`.
@ -878,14 +878,14 @@ Use `page-break-before: always; ` CSS style to force to print to a new page.
#### `contents.printToPDF(options, callback)` #### `contents.printToPDF(options, callback)`
* `options` Object * `options` Object
* `marginsType` Integer - Specifies the type of margins to use. Uses 0 for * `marginsType` Integer - (optional) Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin. default margin, 1 for no margin, and 2 for minimum margin.
* `pageSize` String - Specify page size of the generated PDF. Can be `A3`, * `pageSize` String - (optional) Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` `A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
and `width` in microns. and `width` in microns.
* `printBackground` Boolean - Whether to print CSS backgrounds. * `printBackground` Boolean - (optional) Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean - Whether to print selection only. * `printSelectionOnly` Boolean - (optional) Whether to print selection only.
* `landscape` Boolean - `true` for landscape, `false` for portrait. * `landscape` Boolean - (optional) `true` for landscape, `false` for portrait.
* `callback` Function * `callback` Function
* `error` Error * `error` Error
* `data` Buffer * `data` Buffer

View file

@ -66,6 +66,8 @@ Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
* `language` String * `language` String
* `autoCorrectWord` Boolean * `autoCorrectWord` Boolean
* `provider` Object * `provider` Object
* `spellCheck` Function - Returns `Boolean`
* `text` String
Sets a provider for spell checking in input fields and text areas. Sets a provider for spell checking in input fields and text areas.
@ -127,10 +129,12 @@ webFrame.registerURLSchemeAsPrivileged('foo', { bypassCSP: false })
Inserts `text` to the focused element. Inserts `text` to the focused element.
### `webFrame.executeJavaScript(code[, userGesture])` ### `webFrame.executeJavaScript(code[, userGesture, callback])`
* `code` String * `code` String
* `userGesture` Boolean (optional) - Default is `false`. * `userGesture` Boolean (optional) - Default is `false`.
* `callback` Function (optional) - Called after script has been executed.
* `result` Any
Evaluates `code` in page. Evaluates `code` in page.