-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
index.d.ts
100 lines (71 loc) · 1.91 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
export type GetOptions = {
/**
__macOS only.__
The screen to get the wallpaper from.
Values: `all`, `main`, or the index of a screen from `.screens()`.
@default 'main'
*/
readonly screen?: 'all' | 'main' | number;
};
export type SetOptions = {
/**
__macOS only.__
The screen to set the wallpaper on.
Values: `all`, `main`, or the index of a screen from `.screens()`.
*On Linux and Windows it's hard-coded to `main`.*
@default 'all'
*/
readonly screen?: 'all' | 'main' | number;
/**
__macOS & Windows__
Scaling method.
macOS Values: `auto` `fill` `fit` `stretch` `center`.
Windows Values: `stretch` `center` `tile` `span` `max` `crop-to-fit` `keep-aspect-ratio`.
@default 'auto' for macOS
@default 'span' for Windows
*/
readonly scale?: 'auto' | 'fill' | 'fit' | 'stretch' | 'center' | 'tile' | 'span';
};
/**
Get the path to the wallpaper image currently set.
@returns The path of the current desktop wallpaper.
@example
```
import {getWallpaper} from 'wallpaper';
await getWallpaper();
//=> '/Users/sindresorhus/unicorn.jpg'
```
*/
export function getWallpaper(options?: GetOptions): Promise<string>;
/**
Set a new wallpaper.
@param imagePath - The path to the image to set as the desktop wallpaper.
@example
```
import {setWallpaper} from 'wallpaper';
await setWallpaper('unicorn.jpg');
```
*/
export function setWallpaper(imagePath: string, options?: SetOptions): Promise<void>;
/**
__macOS only.__
@returns The available screens.
@example
```
import {screens} from 'wallpaper';
await screens();
//=> ['Color LCD']
```
*/
export function screens(): Promise<string[]>;
/**
__macOS only.__
Set a solid color.
@param color - The color to set as a RGB Hex value. For example, `000000` for black.
@example
```
import {setSolidColorWallpaper} from 'wallpaper';
await setSolidColorWallpaper('000000');
```
*/
export function setSolidColorWallpaper(rgbHexColor: string, options?: SetOptions): Promise<void>;