From 06960704c41914801cefaad0ee223c80bdf2ad12 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 25 Nov 2016 23:17:31 +1100 Subject: [PATCH] Update docs for dts again --- docs/api/app.md | 6 +++--- docs/api/browser-window.md | 2 +- docs/api/incoming-message.md | 8 ++++++++ docs/api/menu-item.md | 8 ++++++++ docs/api/protocol.md | 2 +- docs/api/session.md | 2 +- docs/api/structures/cookie.md | 14 ++++++------- docs/api/structures/jump-list-category.md | 2 +- docs/api/structures/jump-list-item.md | 6 +++--- docs/api/structures/mime-typed-buffer.md | 4 ++++ docs/api/tray.md | 8 ++++---- docs/api/web-contents.md | 24 +++++++++++------------ 12 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 docs/api/structures/mime-typed-buffer.md diff --git a/docs/api/app.md b/docs/api/app.md index de1ae1138f9a..e87614b5bded 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -113,7 +113,7 @@ Returns: * `url` String Emitted when the user wants to open a URL with the application. Your application's -`Info.plist` file must define the url scheme within the `CFBundleURLTypes` key, and +`Info.plist` file must define the url scheme within the `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`. You should call `event.preventDefault()` if you want to handle this event. @@ -189,7 +189,7 @@ Returns: * `event` Event * `webContents` [WebContents](web-contents.md) -* `url` URL +* `url` String * `error` String - The error code * `certificate` [Certificate](structures/certificate.md) * `callback` Function @@ -891,7 +891,7 @@ Sets the application's [dock menu][dock-menu]. ### `app.dock.setIcon(image)` _macOS_ -* `image` [NativeImage](native-image.md) +* `image` ([NativeImage](native-image.md) | String) Sets the `image` associated with this dock icon. diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 40a2ccacac38..ff335db9fe81 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -202,7 +202,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. * `thickFrame` Boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard window frame. Setting it to `false` will remove 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`, `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. * `zoomToPageWidth` Boolean - Controls the behavior on macOS when diff --git a/docs/api/incoming-message.md b/docs/api/incoming-message.md index 345658e04289..addb975c5b76 100644 --- a/docs/api/incoming-message.md +++ b/docs/api/incoming-message.md @@ -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 Integer-valued readable properties that return respectively the HTTP major and 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. diff --git a/docs/api/menu-item.md b/docs/api/menu-item.md index 7802c3c01558..01ca90bf2361 100644 --- a/docs/api/menu-item.md +++ b/docs/api/menu-item.md @@ -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. 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 diff --git a/docs/api/protocol.md b/docs/api/protocol.md index da5604b1fe7c..956cd5ee8e2c 100644 --- a/docs/api/protocol.md +++ b/docs/api/protocol.md @@ -118,7 +118,7 @@ treated as a standard scheme. * `method` String * `uploadData` [UploadData[]](structures/upload-data.md) * `callback` Function - * `buffer` Buffer (optional) + * `buffer` (Buffer | [MimeTypedBuffer](structures/mime-typed-buffer.md)) (optional) * `completion` Function (optional) * `error` Error diff --git a/docs/api/session.md b/docs/api/session.md index 3f1e41cdaefb..dbf4b45e35cc 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -200,7 +200,7 @@ The `proxyBypassRules` is a comma separated list of rules described below: Match local addresses. The meaning of `` is whether the host matches one of: "127.0.0.1", "::1", "localhost". -### `ses.resolveProxy(url, callback)` +#### `ses.resolveProxy(url, callback)` * `url` URL * `callback` Function diff --git a/docs/api/structures/cookie.md b/docs/api/structures/cookie.md index d00c35b61d28..de5ac5883b7c 100644 --- a/docs/api/structures/cookie.md +++ b/docs/api/structures/cookie.md @@ -2,13 +2,13 @@ * `name` String - The name of the cookie. * `value` String - The value of the cookie. -* `domain` String - The domain of the cookie. -* `hostOnly` String - Whether the cookie is a host-only cookie. -* `path` String - The path of the cookie. -* `secure` Boolean - Whether the cookie is marked as secure. -* `httpOnly` Boolean - Whether the cookie is marked as HTTP only. -* `session` Boolean - Whether the cookie is a session cookie or a persistent +* `domain` String - (optional) The domain of the cookie. +* `hostOnly` Boolean - (optional) Whether the cookie is a host-only cookie. +* `path` String - (optional) The path of the cookie. +* `secure` Boolean - (optional) Whether the cookie is marked as secure. +* `httpOnly` Boolean - (optional) Whether the cookie is marked as HTTP only. +* `session` Boolean - (optional) Whether the cookie is a session cookie or a persistent 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 cookies. diff --git a/docs/api/structures/jump-list-category.md b/docs/api/structures/jump-list-category.md index 6ff328eea650..ca5f48f8b35f 100644 --- a/docs/api/structures/jump-list-category.md +++ b/docs/api/structures/jump-list-category.md @@ -1,6 +1,6 @@ # 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` category. There can be only one such category, and it will always be displayed at the bottom of the Jump List. diff --git a/docs/api/structures/jump-list-item.md b/docs/api/structures/jump-list-item.md index 0eb6f56d8f06..c7f508dd5c86 100644 --- a/docs/api/structures/jump-list-item.md +++ b/docs/api/structures/jump-list-item.md @@ -1,6 +1,6 @@ # 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. * `separator` - Can be used to separate items in the standard `Tasks` category. @@ -18,11 +18,11 @@ Should only be set if `type` is `task`. * `description` String - (optional) Description of the task (displayed in a tooltip). 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 (e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to 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 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. diff --git a/docs/api/structures/mime-typed-buffer.md b/docs/api/structures/mime-typed-buffer.md new file mode 100644 index 000000000000..dc1a20d28f79 --- /dev/null +++ b/docs/api/structures/mime-typed-buffer.md @@ -0,0 +1,4 @@ +# MimeTypedBuffer Object + +* `mimeType` String - The mimeType of the Buffer that you are sending +* `buffer` Buffer - The actual Buffer content diff --git a/docs/api/tray.md b/docs/api/tray.md index f83117bdb9a8..d98b31689f99 100644 --- a/docs/api/tray.md +++ b/docs/api/tray.md @@ -154,7 +154,7 @@ Destroys the tray icon immediately. #### `tray.setImage(image)` -* `image` [NativeImage](native-image.md) +* `image` ([NativeImage](native-image.md) | String) Sets the `image` associated with this tray icon. @@ -210,9 +210,9 @@ win.on('hide', () => { #### `tray.displayBalloon(options)` _Windows_ * `options` Object - * `icon` [NativeImage](native-image.md) - * `title` String - * `content` String + * `icon` ([NativeImage](native-image.md) | String) - (optional) + * `title` String - (optional) + * `content` String - (optional) Displays a tray balloon. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 30fcca58d9cf..29361619ce17 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -249,7 +249,7 @@ Emitted when DevTools is focused / opened. Returns: * `event` Event -* `url` URL +* `url` String * `error` String - The error code * `certificate` [Certificate](structures/certificate.md) * `callback` Function @@ -489,7 +489,7 @@ Emitted when the devtools window instructs the webContents to reload #### `contents.loadURL(url[, options])` -* `url` URL +* `url` String * `options` Object (optional) * `httpReferrer` String (optional) - A HTTP Referrer url. * `userAgent` String (optional) - A user agent originating the request. @@ -777,14 +777,14 @@ Inserts `text` to the focused element. * `text` String - Content to be searched, must not be empty. * `options` Object (optional) - * `forward` Boolean - Whether to search forward or backward, defaults to `true`. - * `findNext` Boolean - Whether the operation is first request or a follow up, + * `forward` Boolean - (optional) Whether to search forward or backward, defaults to `true`. + * `findNext` Boolean - (optional) Whether the operation is first request or a follow up, defaults to `false`. - * `matchCase` Boolean - Whether search should be case-sensitive, + * `matchCase` Boolean - (optional) Whether search should be case-sensitive, 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`. - * `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 uppercase letter followed by a lowercase or non-letter. Accepts several other intra-word matches, defaults to `false`. @@ -860,14 +860,14 @@ Use `page-break-before: always; ` CSS style to force to print to a new page. #### `contents.printToPDF(options, callback)` * `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. - * `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` and `width` in microns. - * `printBackground` Boolean - Whether to print CSS backgrounds. - * `printSelectionOnly` Boolean - Whether to print selection only. - * `landscape` Boolean - `true` for landscape, `false` for portrait. + * `printBackground` Boolean - (optional) Whether to print CSS backgrounds. + * `printSelectionOnly` Boolean - (optional) Whether to print selection only. + * `landscape` Boolean - (optional) `true` for landscape, `false` for portrait. * `callback` Function * `error` Error * `data` Buffer