feat: promisify app.getFileIcon() (#15742)

This commit is contained in:
Shelley Vohr 2018-12-05 08:50:12 -08:00 committed by GitHub
parent cfbea4a0e3
commit 3f15f51615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 68 deletions

View file

@ -552,8 +552,29 @@ On _Windows_, there a 2 kinds of icons:
- Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
- Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
On _Linux_ and _macOS_, icons depend on the application associated with file
mime type.
On _Linux_ and _macOS_, icons depend on the application associated with file mime type.
**[Deprecated Soon](promisification.md)**
### `app.getFileIcon(path[, options])`
* `path` String
* `options` Object (optional)
* `size` String
* `small` - 16x16
* `normal` - 32x32
* `large` - 48x48 on _Linux_, 32x32 on _Windows_, unsupported on _macOS_.
Returns `Promise<NativeImage>` - fulfilled with the app's icon, which is a [NativeImage](native-image.md).
Fetches a path's associated icon.
On _Windows_, there a 2 kinds of icons:
- Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
- Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
On _Linux_ and _macOS_, icons depend on the application associated with file mime type.
### `app.setPath(name, path)`