Skip to content

Commit 5684545

Browse files
committed
Use point / size / rectangle structures consistently in API docs
1 parent 7265a0c commit 5684545

File tree

9 files changed

+25
-50
lines changed

9 files changed

+25
-50
lines changed

docs/api/browser-window.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,8 @@ Returns `Boolean` - Whether the window is in fullscreen mode.
682682

683683
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
684684
content view.
685-
* `extraSize` Object (optional) - The extra size not to be included while
685+
* `extraSize` [Size](structures/size.md) - The extra size not to be included while
686686
maintaining the aspect ratio.
687-
* `width` Integer
688-
* `height` Integer
689687

690688
This will make a window maintain an aspect ratio. The extra size allows a
691689
developer to have space, specified in pixels, not included within the aspect

docs/api/desktop-capturer.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ The `desktopCapturer` module has the following methods:
6060
* `options` Object
6161
* `types` String[] - An array of Strings that lists the types of desktop sources
6262
to be captured, available types are `screen` and `window`.
63-
* `thumbnailSize` Object (optional) - The size that the media source thumbnail should be scaled to.
64-
* `width` Integer - Default is `150`
65-
* `height` Integer - Default is `150`
63+
* `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail
64+
should be scaled to. Default is `150` x `150`.
6665
* `callback` Function
6766
* `error` Error
6867
* `sources` [DesktopCapturerSource[]](structures/desktop-capturer-source.md)

docs/api/native-image.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ Returns `Boolean` - Whether the image is empty.
219219

220220
#### `image.getSize()`
221221

222-
Returns `Object`:
223-
224-
* `width` Integer
225-
* `height` Integer
222+
Returns [`Size`](structures/size.md)
226223

227224
#### `image.setTemplateImage(option)`
228225

@@ -236,11 +233,7 @@ Returns `Boolean` - Whether the image is a template image.
236233

237234
#### `image.crop(rect)`
238235

239-
* `rect` Object - The area of the image to crop
240-
* `x` Integer
241-
* `y` Integer
242-
* `width` Integer
243-
* `height` Integer
236+
* `rect` [Rectangle](structures/rectangle.md) - The area of the image to crop
244237

245238
Returns `NativeImage` - The cropped image.
246239

docs/api/screen.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ The `screen` module has the following methods:
9191

9292
### `screen.getCursorScreenPoint()`
9393

94-
Returns `Object`:
95-
96-
* `x` Integer
97-
* `y` Integer
94+
Returns [`Point`](structures/point.md)
9895

9996
The current absolute position of the mouse pointer.
10097

@@ -108,9 +105,7 @@ Returns [`Display[]`](structures/display.md) - An array of displays that are cur
108105

109106
### `screen.getDisplayNearestPoint(point)`
110107

111-
* `point` Object
112-
* `x` Integer
113-
* `y` Integer
108+
* `point` [Point](structures/point.md)
114109

115110
Returns [`Display`](structures/display.md) - The display nearest the specified point.
116111

docs/api/structures/display.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@
66
* `scaleFactor` Number - Output device's pixel scale factor.
77
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
88
* `bounds` [Rectangle](rectangle.md)
9-
* `size` Object
10-
* `height` Number
11-
* `width` Number
9+
* `size` [Size](size.md)
1210
* `workArea` [Rectangle](rectangle.md)
13-
* `workAreaSize` Object
14-
* `height` Number
15-
* `width` Number
11+
* `workAreaSize` [Size](size.md)
1612

1713
The `Display` object represents a physical display connected to the system. A
1814
fake `Display` may exist on a headless system, or a `Display` may correspond to

docs/api/structures/point.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Point Object
2+
3+
* `x` Number
4+
* `y` Number

docs/api/structures/size.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Size Object
2+
3+
* `width` Number
4+
* `height` Number

docs/api/tray.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ Displays a tray balloon.
219219
#### `tray.popUpContextMenu([menu, position])` _macOS_ _Windows_
220220

221221
* `menu` Menu (optional)
222-
* `position` Object (optional) - The pop up position.
223-
* `x` Integer
224-
* `y` Integer
222+
* `position` [Point](structures/point.md) (optional) - The pop up position.
225223

226224
Pops up the context menu of the tray icon. When `menu` is passed, the `menu` will
227225
be shown instead of the tray icon's context menu.

docs/api/web-contents.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,8 @@ Returns:
375375
* `type` String
376376
* `image` NativeImage (optional)
377377
* `scale` Float (optional) - scaling factor for the custom cursor
378-
* `size` Object (optional) - the size of the `image`
379-
* `width` Integer
380-
* `height` Integer
381-
* `hotspot` Object (optional) - coordinates of the custom cursor's hotspot
382-
* `x` Integer - x coordinate
383-
* `y` Integer - y coordinate
378+
* `size` [Size](structures/size.md) (optional) - the size of the `image`
379+
* `hotspot` [Point](structures/point.md) (optional) - coordinates of the custom cursor's hotspot
384380

385381
Emitted when the cursor's type changes. The `type` parameter can be `default`,
386382
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
@@ -1067,24 +1063,16 @@ app.on('ready', () => {
10671063
(default: `desktop`)
10681064
* `desktop` - Desktop screen type
10691065
* `mobile` - Mobile screen type
1070-
* `screenSize` Object - Set the emulated screen size (screenPosition == mobile)
1071-
* `width` Integer - Set the emulated screen width
1072-
* `height` Integer - Set the emulated screen height
1073-
* `viewPosition` Object - Position the view on the screen
1066+
* `screenSize` [Size](structures/size.md) - Set the emulated screen size (screenPosition == mobile)
1067+
* `viewPosition` [Point](structures/point.md) - Position the view on the screen
10741068
(screenPosition == mobile) (default: `{x: 0, y: 0}`)
1075-
* `x` Integer - Set the x axis offset from top left corner
1076-
* `y` Integer - Set the y axis offset from top left corner
10771069
* `deviceScaleFactor` Integer - Set the device scale factor (if zero defaults to
10781070
original device scale factor) (default: `0`)
1079-
* `viewSize` Object - Set the emulated view size (empty means no override)
1080-
* `width` Integer - Set the emulated view width
1081-
* `height` Integer - Set the emulated view height
1071+
* `viewSize` [Size](structures/size.md) - Set the emulated view size (empty means no override)
10821072
* `fitToView` Boolean - Whether emulated view should be scaled down if
10831073
necessary to fit into available space (default: `false`)
1084-
* `offset` Object - Offset of the emulated view inside available space (not in
1085-
fit to view mode) (default: `{x: 0, y: 0}`)
1086-
* `x` Float - Set the x axis offset from top left corner
1087-
* `y` Float - Set the y axis offset from top left corner
1074+
* `offset` [Point](structures/point.md) - Offset of the emulated view inside available space
1075+
(not in fit to view mode) (default: `{x: 0, y: 0}`)
10881076
* `scale` Float - Scale of emulated view inside available space (not in fit to
10891077
view mode) (default: `1`)
10901078

0 commit comments

Comments
 (0)