docs: type names changed from wrapper to primitive (#31752)

This commit is contained in:
Milan Burda 2021-11-16 05:13:18 +01:00 committed by GitHub
parent 246884c4fb
commit e6b1d95a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
115 changed files with 1685 additions and 1685 deletions

View file

@ -8,7 +8,7 @@ In Electron, for the APIs that take images, you can pass either file paths or
`NativeImage` instances. An empty image will be used when `null` is passed.
For example, when creating a tray or setting a window's icon, you can pass an
image file path as a `String`:
image file path as a `string`:
```javascript
const { BrowserWindow, Tray } = require('electron')
@ -121,14 +121,14 @@ Creates an empty `NativeImage` instance.
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
* `path` String - path to a file that we intend to construct a thumbnail out of.
* `path` string - path to a file that we intend to construct a thumbnail out of.
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
### `nativeImage.createFromPath(path)`
* `path` String
* `path` string
Returns `NativeImage`
@ -170,7 +170,7 @@ Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or JP
### `nativeImage.createFromDataURL(dataURL)`
* `dataURL` String
* `dataURL` string
Returns `NativeImage`
@ -178,8 +178,8 @@ Creates a new `NativeImage` instance from `dataURL`.
### `nativeImage.createFromNamedImage(imageName[, hslShift])` _macOS_
* `imageName` String
* `hslShift` Number[] (optional)
* `imageName` string
* `hslShift` number[] (optional)
Returns `NativeImage`
@ -248,7 +248,7 @@ data.
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns `String` - The data URL of the image.
Returns `string` - The data URL of the image.
#### `image.getBitmap([options])`
@ -272,7 +272,7 @@ image instead of a copy, so you _must_ ensure that the associated
#### `image.isEmpty()`
Returns `Boolean` - Whether the image is empty.
Returns `boolean` - Whether the image is empty.
#### `image.getSize([scaleFactor])`
@ -284,13 +284,13 @@ If `scaleFactor` is passed, this will return the size corresponding to the image
#### `image.setTemplateImage(option)`
* `option` Boolean
* `option` boolean
Marks the image as a template image.
#### `image.isTemplateImage()`
Returns `Boolean` - Whether the image is a template image.
Returns `boolean` - Whether the image is a template image.
#### `image.crop(rect)`
@ -303,7 +303,7 @@ Returns `NativeImage` - The cropped image.
* `options` Object
* `width` Integer (optional) - Defaults to the image's width.
* `height` Integer (optional) - Defaults to the image's height.
* `quality` String (optional) - The desired quality of the resize image.
* `quality` string (optional) - The desired quality of the resize image.
Possible values are `good`, `better`, or `best`. The default is `best`.
These values express a desired quality/speed tradeoff. They are translated
into an algorithm-specific method that depends on the capabilities
@ -336,7 +336,7 @@ Returns `Float[]` - An array of all scale factors corresponding to representatio
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer
is specified as `buffer`.
* `buffer` Buffer (optional) - The buffer containing the raw image data.
* `dataURL` String (optional) - The data URL containing either a base 64
* `dataURL` string (optional) - The data URL containing either a base 64
encoded PNG or JPEG image.
Add an image representation for a specific scale factor. This can be used
@ -349,6 +349,6 @@ can be called on empty images.
#### `nativeImage.isMacTemplateImage` _macOS_
A `Boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).
A `boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).
Please note that this property only has an effect on macOS.