Move reused object structures to a standard structures folder

This commit is contained in:
Samuel Attard 2016-09-28 20:00:01 +13:00 committed by Zeke Sikelianos
parent 4d7050553c
commit 03979936f3
14 changed files with 157 additions and 136 deletions

View file

@ -49,23 +49,6 @@ app.on('ready', () => {
})
```
## The `Display` object
The `Display` object represents a physical display connected to the system. A
fake `Display` may exist on a headless system, or a `Display` may correspond to
a remote, virtual display.
* `display` object
* `id` Integer - Unique identifier associated with the display.
* `rotation` Integer - Can be 0, 90, 180, 270, represents screen rotation in
clock-wise degrees.
* `scaleFactor` Number - Output device's pixel scale factor.
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
* `bounds` Object
* `size` Object
* `workArea` Object
* `workAreaSize` Object
## Events
The `screen` module emits the following events:
@ -75,7 +58,7 @@ The `screen` module emits the following events:
Returns:
* `event` Event
* `newDisplay` Object
* `newDisplay` [Display](structures/display.md)
Emitted when `newDisplay` has been added.
@ -84,7 +67,7 @@ Emitted when `newDisplay` has been added.
Returns:
* `event` Event
* `oldDisplay` Object
* `oldDisplay` [Display](structures/display.md)
Emitted when `oldDisplay` has been removed.
@ -93,7 +76,7 @@ Emitted when `oldDisplay` has been removed.
Returns:
* `event` Event
* `display` Object
* `display` [Display](structures/display.md)
* `changedMetrics` String[]
Emitted when one or more metrics change in a `display`. The `changedMetrics` is
@ -130,10 +113,6 @@ Returns `Display` - The display nearest the specified point.
### `screen.getDisplayMatching(rect)`
* `rect` Object
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
* `rect` [Bounds](structures/bounds.md)
Returns `Display` - The display that most closely intersects the provided bounds.

View file

@ -64,21 +64,7 @@ Play the beep sound.
* `update` - Updates specified properties only on an existing shortcut.
* `replace` - Overwrites an existing shortcut, fails if the shortcut doesn't
exist.
* `options` Object
* `target` String - The target to launch from this shortcut.
* `cwd` String (optional) - The working directory. Default
is empty.
* `args` String (optional) - The arguments to be applied to `target` when
launching from this shortcut. Default is empty.
* `description` String (optional) - The description of the shortcut. Default
is empty.
* `icon` String (optional) - The path to the icon, can be a DLL or EXE. `icon`
and `iconIndex` have to be set together. Default is empty, which uses the
target's icon.
* `iconIndex` Integer (optional) - The resource ID of icon when `icon` is a
DLL or EXE. Default is 0.
* `appUserModelId` String (optional) - The Application User Model ID. Default
is empty.
* `options` [ShortcutDetails](structures/shortcut-details.md)
Returns `Boolean` - Whether the shortcut was created successfully
@ -88,20 +74,7 @@ Creates or updates a shortcut link at `shortcutPath`.
* `shortcutPath` String
Returns `Object`:
* `target` String - The target to launch from this shortcut.
* `cwd` String (optional) - The working directory. Default is empty.
* `args` String (optional) - The arguments to be applied to `target` when
launching from this shortcut. Default is empty.
* `description` String (optional) - The description of the shortcut. Default
is empty.
* `icon` String (optional) - The path to the icon, can be a DLL or EXE. `icon`
and `iconIndex` have to be set together. Default is empty, which uses the
target's icon.
* `iconIndex` Integer (optional) - The resource ID of icon when `icon` is a
DLL or EXE. Default is 0.
* `appUserModelId` String (optional) - The Application User Model ID. Default
is empty.
Returns `ShortcutDetails`
Resolves the shortcut link at `shortcutPath`.

View file

@ -0,0 +1,6 @@
# Bounds
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer

View file

@ -0,0 +1,9 @@
# Certificate
* `data` String - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` String - Hex value represented string
* `validStart` Integer - Start date of the certificate being valid in seconds
* `validExpiry` Integer - End date of the certificate being valid in seconds
* `fingerprint` String - Fingerprint of the certificate

View file

@ -0,0 +1,15 @@
# Display
* `id` Integer - Unique identifier associated with the display.
* `rotation` Integer - Can be 0, 90, 180, 270, represents screen rotation in
clock-wise degrees.
* `scaleFactor` Number - Output device's pixel scale factor.
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
* `bounds` Object
* `size` Object
* `workArea` Object
* `workAreaSize` Object
The `Display` object represents a physical display connected to the system. A
fake `Display` may exist on a headless system, or a `Display` may correspond to
a remote, virtual display.

View file

@ -0,0 +1,21 @@
# JumpListCategory
* `type` String - 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.
* `frequent` - Displays a list of files frequently opened by the app, the
name of the category and its items are set by Windows.
* `recent` - Displays a list of files recently opened by the app, the name
of the category and its items are set by Windows. Items may be added to
this category indirectly using `app.addRecentDocument(path)`.
* `custom` - Displays tasks or file links, `name` must be set by the app.
* `name` String - Must be set if `type` is `custom`, otherwise it should be
omitted.
* `items` JumpListItem[] - Array of [`JumpListItem`](jump-list-item.md) objects if `type` is `tasks` or
`custom`, otherwise it should be omitted.
**Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
property set then its `type` is assumed to be `tasks`. If the `name` property
is set but the `type` property is omitted then the `type` is assumed to be
`custom`.

View file

@ -0,0 +1,28 @@
# JumpListItem
* `type` String - 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.
* `file` - A file link will open a file using the app that created the
Jump List, for this to work the app must be registered as a handler for
the file type (though it doesn't have to be the default handler).
* `path` String - Path of the file to open, should only be set if `type` is
`file`.
* `program` String - Path of the program to execute, usually you should
specify `process.execPath` which opens the current program. Should only be
set if `type` is `task`.
* `args` String - The command line arguments when `program` is executed. Should
only be set if `type` is `task`.
* `title` String - The text to be displayed for the item in the Jump List.
Should only be set if `type` is `task`.
* `description` String - 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
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` Integer - 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.

View file

@ -0,0 +1,8 @@
# MemoryUsageDetails
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer

View file

@ -0,0 +1,15 @@
# ShortcutDetails
* `target` String - The target to launch from this shortcut.
* `cwd` String (optional) - The working directory. Default is empty.
* `args` String (optional) - The arguments to be applied to `target` when
launching from this shortcut. Default is empty.
* `description` String (optional) - The description of the shortcut. Default
is empty.
* `icon` String (optional) - The path to the icon, can be a DLL or EXE. `icon`
and `iconIndex` have to be set together. Default is empty, which uses the
target's icon.
* `iconIndex` Integer (optional) - The resource ID of icon when `icon` is a
DLL or EXE. Default is 0.
* `appUserModelId` String (optional) - The Application User Model ID. Default
is empty.

View file

@ -0,0 +1,14 @@
# Task
* `program` String - Path of the program to execute, usually you should
specify `process.execPath` which opens the current program.
* `arguments` String - The command line arguments when `program` is
executed.
* `title` String - The string to be displayed in a JumpList.
* `description` String - Description of this task.
* `iconPath` String - The absolute path to an icon to be displayed in a
JumpList, which can be an arbitrary resource file that contains an icon. You
can usually specify `process.execPath` to show the icon of the program.
* `iconIndex` Integer - The icon index in the icon file. If an icon file
consists of two or more icons, set this value to identify the icon. If an
icon file consists of one icon, this value is 0.

View file

@ -0,0 +1,21 @@
# ThumbarButton
* `icon` [NativeImage](native-image.md) - The icon showing in thumbnail
toolbar.
* `click` Function
* `tooltip` String (optional) - The text of the button's tooltip.
* `flags` Array (optional) - Control specific states and behaviors of the
button. By default, it is `['enabled']`.
The `flags` is an array that can include following `String`s:
* `enabled` - The button is active and available to the user.
* `disabled` - The button is disabled. It is present, but has a visual state
indicating it will not respond to user action.
* `dismissonclick` - When the button is clicked, the thumbnail window closes
immediately.
* `nobackground` - Do not draw a button border, use only the image.
* `hidden` - The button is not shown to the user.
* `noninteractive` - The button is enabled but not interactive; no pressed
button state is drawn. This value is intended for instances where the button
is used in a notification.

View file

@ -70,11 +70,7 @@ The `Tray` module emits the following events:
* `shiftKey` Boolean
* `ctrlKey` Boolean
* `metaKey` Boolean
* `bounds` Object _macOS_ _Windows_ - the bounds of tray icon.
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
* `bounds` Bounds - The [Bounds](structures/bounds.md) of tray icon
Emitted when the tray icon is clicked.
@ -85,11 +81,7 @@ Emitted when the tray icon is clicked.
* `shiftKey` Boolean
* `ctrlKey` Boolean
* `metaKey` Boolean
* `bounds` Object - the bounds of tray icon.
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
* `bounds` Bounds - The [Bounds](structures/bounds.md) of tray icon
Emitted when the tray icon is right clicked.
@ -100,11 +92,7 @@ Emitted when the tray icon is right clicked.
* `shiftKey` Boolean
* `ctrlKey` Boolean
* `metaKey` Boolean
* `bounds` Object - the bounds of tray icon
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
* `bounds` Bounds - The [Bounds](structures/bounds.md) of tray icon
Emitted when the tray icon is double clicked.
@ -243,11 +231,7 @@ Sets the context menu for this icon.
#### `tray.getBounds()` _macOS_ _Windows_
Returns `Object`:
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
Returns `Bounds` - A [Bounds](structures/bounds.md) object
The `bounds` of this tray icon as `Object`.

View file

@ -247,14 +247,7 @@ Returns:
* `event` Event
* `url` URL
* `error` String - The error code
* `certificate` Object
* `data` String - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` String - Hex value represented string
* `validStart` Integer - Start date of the certificate being valid in seconds
* `validExpiry` Integer - End date of the certificate being valid in seconds
* `fingerprint` String - Fingerprint of the certificate
* `certificate` [Certificate](structures/certificate.md)
* `callback` Function
Emitted when failed to verify the `certificate` for `url`.
@ -268,14 +261,7 @@ Returns:
* `event` Event
* `url` URL
* `certificateList` [Objects]
* `data` String - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` String - Hex value represented string
* `validStart` Integer - Start date of the certificate being valid in seconds
* `validExpiry` Integer - End date of the certificate being valid in seconds
* `fingerprint` String - Fingerprint of the certificate
* `certificateList` Certificate[]
* `callback` Function
Emitted when a client certificate is requested.
@ -479,11 +465,7 @@ app.on('ready', () => {
Returns:
* `event` Event
* `dirtyRect` Object
* `x` Integer - The x coordinate on the image.
* `y` Integer - The y coordinate on the image.
* `width` Integer - The width of the dirty area.
* `height` Integer - The height of the dirty area.
* `dirtyRect` [Bounds](structures/bounds.md)
* `image` [NativeImage](native-image.md) - The image data of the whole frame.
Emitted when a new frame is generated. Only the dirty area is passed in the
@ -521,7 +503,7 @@ webContents.loadURL('https://github.com', options)
#### `contents.downloadURL(url)`
* `url` URL
* `url` String
Initiates a download of the resource at `url` without navigating. The
`will-download` event of `session` will be triggered.
@ -798,11 +780,7 @@ console.log(requestId)
#### `contents.capturePage([rect, ]callback)`
* `rect` Object (optional) - The area of the page to be captured
* `x` Integer
* `y` Integer
* `width` Integer
* `height` Integer
* `rect` [Bounds](structures/bounds.md) (optional) - The area of the page to be captured
* `callback` Function
Captures a snapshot of the page within `rect`. Upon completion `callback` will

View file

@ -110,41 +110,11 @@ this limitation.
### `webFrame.getResourceUsage()`
Returns `Object`:
* `images` Object
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer
* `cssStyleSheets` Object
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer
* `xslStyleSheets` Object
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer
* `fonts` Object
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer
* `other` Object
* `count` Integer
* `size` Integer
* `liveSize` Integer
* `decodedSize` Integer
* `purgedSize` Integer
* `purgeableSize` Integer
* `images` [MemoryUsageDetails](structures/memory-usage-details.md)
* `cssStyleSheets` [MemoryUsageDetails](structures/memory-usage-details.md)
* `xslStyleSheets` [MemoryUsageDetails](structures/memory-usage-details.md)
* `fonts` [MemoryUsageDetails](structures/memory-usage-details.md)
* `other` [MemoryUsageDetails](structures/memory-usage-details.md)
Returns an object describing usage information of Blink's internal memory
caches.