Merge pull request #9105 from miniak/fix-api-docs
Use point / size / rectangle structures consistently in API docs
This commit is contained in:
commit
f64d82cf16
9 changed files with 25 additions and 50 deletions
|
@ -682,10 +682,8 @@ Returns `Boolean` - Whether the window is in fullscreen mode.
|
||||||
|
|
||||||
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
|
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
|
||||||
content view.
|
content view.
|
||||||
* `extraSize` Object (optional) - The extra size not to be included while
|
* `extraSize` [Size](structures/size.md) - The extra size not to be included while
|
||||||
maintaining the aspect ratio.
|
maintaining the aspect ratio.
|
||||||
* `width` Integer
|
|
||||||
* `height` Integer
|
|
||||||
|
|
||||||
This will make a window maintain an aspect ratio. The extra size allows a
|
This will make a window maintain an aspect ratio. The extra size allows a
|
||||||
developer to have space, specified in pixels, not included within the aspect
|
developer to have space, specified in pixels, not included within the aspect
|
||||||
|
|
|
@ -60,9 +60,8 @@ The `desktopCapturer` module has the following methods:
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `types` String[] - An array of Strings that lists the types of desktop sources
|
* `types` String[] - An array of Strings that lists the types of desktop sources
|
||||||
to be captured, available types are `screen` and `window`.
|
to be captured, available types are `screen` and `window`.
|
||||||
* `thumbnailSize` Object (optional) - The size that the media source thumbnail should be scaled to.
|
* `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail
|
||||||
* `width` Integer - Default is `150`
|
should be scaled to. Default is `150` x `150`.
|
||||||
* `height` Integer - Default is `150`
|
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
* `error` Error
|
* `error` Error
|
||||||
* `sources` [DesktopCapturerSource[]](structures/desktop-capturer-source.md)
|
* `sources` [DesktopCapturerSource[]](structures/desktop-capturer-source.md)
|
||||||
|
|
|
@ -219,10 +219,7 @@ Returns `Boolean` - Whether the image is empty.
|
||||||
|
|
||||||
#### `image.getSize()`
|
#### `image.getSize()`
|
||||||
|
|
||||||
Returns `Object`:
|
Returns [`Size`](structures/size.md)
|
||||||
|
|
||||||
* `width` Integer
|
|
||||||
* `height` Integer
|
|
||||||
|
|
||||||
#### `image.setTemplateImage(option)`
|
#### `image.setTemplateImage(option)`
|
||||||
|
|
||||||
|
@ -236,11 +233,7 @@ Returns `Boolean` - Whether the image is a template image.
|
||||||
|
|
||||||
#### `image.crop(rect)`
|
#### `image.crop(rect)`
|
||||||
|
|
||||||
* `rect` Object - The area of the image to crop
|
* `rect` [Rectangle](structures/rectangle.md) - The area of the image to crop
|
||||||
* `x` Integer
|
|
||||||
* `y` Integer
|
|
||||||
* `width` Integer
|
|
||||||
* `height` Integer
|
|
||||||
|
|
||||||
Returns `NativeImage` - The cropped image.
|
Returns `NativeImage` - The cropped image.
|
||||||
|
|
||||||
|
|
|
@ -91,10 +91,7 @@ The `screen` module has the following methods:
|
||||||
|
|
||||||
### `screen.getCursorScreenPoint()`
|
### `screen.getCursorScreenPoint()`
|
||||||
|
|
||||||
Returns `Object`:
|
Returns [`Point`](structures/point.md)
|
||||||
|
|
||||||
* `x` Integer
|
|
||||||
* `y` Integer
|
|
||||||
|
|
||||||
The current absolute position of the mouse pointer.
|
The current absolute position of the mouse pointer.
|
||||||
|
|
||||||
|
@ -108,9 +105,7 @@ Returns [`Display[]`](structures/display.md) - An array of displays that are cur
|
||||||
|
|
||||||
### `screen.getDisplayNearestPoint(point)`
|
### `screen.getDisplayNearestPoint(point)`
|
||||||
|
|
||||||
* `point` Object
|
* `point` [Point](structures/point.md)
|
||||||
* `x` Integer
|
|
||||||
* `y` Integer
|
|
||||||
|
|
||||||
Returns [`Display`](structures/display.md) - The display nearest the specified point.
|
Returns [`Display`](structures/display.md) - The display nearest the specified point.
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,9 @@
|
||||||
* `scaleFactor` Number - Output device's pixel scale factor.
|
* `scaleFactor` Number - Output device's pixel scale factor.
|
||||||
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
|
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
|
||||||
* `bounds` [Rectangle](rectangle.md)
|
* `bounds` [Rectangle](rectangle.md)
|
||||||
* `size` Object
|
* `size` [Size](size.md)
|
||||||
* `height` Number
|
|
||||||
* `width` Number
|
|
||||||
* `workArea` [Rectangle](rectangle.md)
|
* `workArea` [Rectangle](rectangle.md)
|
||||||
* `workAreaSize` Object
|
* `workAreaSize` [Size](size.md)
|
||||||
* `height` Number
|
|
||||||
* `width` Number
|
|
||||||
|
|
||||||
The `Display` object represents a physical display connected to the system. A
|
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
|
fake `Display` may exist on a headless system, or a `Display` may correspond to
|
||||||
|
|
4
docs/api/structures/point.md
Normal file
4
docs/api/structures/point.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Point Object
|
||||||
|
|
||||||
|
* `x` Number
|
||||||
|
* `y` Number
|
4
docs/api/structures/size.md
Normal file
4
docs/api/structures/size.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Size Object
|
||||||
|
|
||||||
|
* `width` Number
|
||||||
|
* `height` Number
|
|
@ -219,9 +219,7 @@ Displays a tray balloon.
|
||||||
#### `tray.popUpContextMenu([menu, position])` _macOS_ _Windows_
|
#### `tray.popUpContextMenu([menu, position])` _macOS_ _Windows_
|
||||||
|
|
||||||
* `menu` Menu (optional)
|
* `menu` Menu (optional)
|
||||||
* `position` Object (optional) - The pop up position.
|
* `position` [Point](structures/point.md) (optional) - The pop up position.
|
||||||
* `x` Integer
|
|
||||||
* `y` Integer
|
|
||||||
|
|
||||||
Pops up the context menu of the tray icon. When `menu` is passed, the `menu` will
|
Pops up the context menu of the tray icon. When `menu` is passed, the `menu` will
|
||||||
be shown instead of the tray icon's context menu.
|
be shown instead of the tray icon's context menu.
|
||||||
|
|
|
@ -375,12 +375,8 @@ Returns:
|
||||||
* `type` String
|
* `type` String
|
||||||
* `image` NativeImage (optional)
|
* `image` NativeImage (optional)
|
||||||
* `scale` Float (optional) - scaling factor for the custom cursor
|
* `scale` Float (optional) - scaling factor for the custom cursor
|
||||||
* `size` Object (optional) - the size of the `image`
|
* `size` [Size](structures/size.md) (optional) - the size of the `image`
|
||||||
* `width` Integer
|
* `hotspot` [Point](structures/point.md) (optional) - coordinates of the custom cursor's hotspot
|
||||||
* `height` Integer
|
|
||||||
* `hotspot` Object (optional) - coordinates of the custom cursor's hotspot
|
|
||||||
* `x` Integer - x coordinate
|
|
||||||
* `y` Integer - y coordinate
|
|
||||||
|
|
||||||
Emitted when the cursor's type changes. The `type` parameter can be `default`,
|
Emitted when the cursor's type changes. The `type` parameter can be `default`,
|
||||||
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
|
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
|
||||||
|
@ -1067,24 +1063,16 @@ app.on('ready', () => {
|
||||||
(default: `desktop`)
|
(default: `desktop`)
|
||||||
* `desktop` - Desktop screen type
|
* `desktop` - Desktop screen type
|
||||||
* `mobile` - Mobile screen type
|
* `mobile` - Mobile screen type
|
||||||
* `screenSize` Object - Set the emulated screen size (screenPosition == mobile)
|
* `screenSize` [Size](structures/size.md) - Set the emulated screen size (screenPosition == mobile)
|
||||||
* `width` Integer - Set the emulated screen width
|
* `viewPosition` [Point](structures/point.md) - Position the view on the screen
|
||||||
* `height` Integer - Set the emulated screen height
|
|
||||||
* `viewPosition` Object - Position the view on the screen
|
|
||||||
(screenPosition == mobile) (default: `{x: 0, y: 0}`)
|
(screenPosition == mobile) (default: `{x: 0, y: 0}`)
|
||||||
* `x` Integer - Set the x axis offset from top left corner
|
|
||||||
* `y` Integer - Set the y axis offset from top left corner
|
|
||||||
* `deviceScaleFactor` Integer - Set the device scale factor (if zero defaults to
|
* `deviceScaleFactor` Integer - Set the device scale factor (if zero defaults to
|
||||||
original device scale factor) (default: `0`)
|
original device scale factor) (default: `0`)
|
||||||
* `viewSize` Object - Set the emulated view size (empty means no override)
|
* `viewSize` [Size](structures/size.md) - Set the emulated view size (empty means no override)
|
||||||
* `width` Integer - Set the emulated view width
|
|
||||||
* `height` Integer - Set the emulated view height
|
|
||||||
* `fitToView` Boolean - Whether emulated view should be scaled down if
|
* `fitToView` Boolean - Whether emulated view should be scaled down if
|
||||||
necessary to fit into available space (default: `false`)
|
necessary to fit into available space (default: `false`)
|
||||||
* `offset` Object - Offset of the emulated view inside available space (not in
|
* `offset` [Point](structures/point.md) - Offset of the emulated view inside available space
|
||||||
fit to view mode) (default: `{x: 0, y: 0}`)
|
(not in fit to view mode) (default: `{x: 0, y: 0}`)
|
||||||
* `x` Float - Set the x axis offset from top left corner
|
|
||||||
* `y` Float - Set the y axis offset from top left corner
|
|
||||||
* `scale` Float - Scale of emulated view inside available space (not in fit to
|
* `scale` Float - Scale of emulated view inside available space (not in fit to
|
||||||
view mode) (default: `1`)
|
view mode) (default: `1`)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue