-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
screen-provider.interface.ts
58 lines (52 loc) · 1.55 KB
/
screen-provider.interface.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
import { Image, Region } from "@nut-tree/shared";
/**
* A ScreenActionProvider should provide access to a system's main screen
*
* @interface ScreenProviderInterface
*/
export interface ScreenProviderInterface {
/**
* grabScreen should return an {@link Image} object containing a screenshot data of a systems
* main screen as well as its dimensions
*
* @returns The {@link Image} object holding screenshot data
*/
grabScreen(): Promise<Image>;
/**
* Returns the same result as grabScreen, but limited to a specified region
*
* @param region The {@link Region} to take the screenshot of
* @returns The {@link Image} object holding screenshot data
*/
grabScreenRegion(region: Region): Promise<Image>;
/**
* Highlights a screen {@link Region} for a given duration by overlaying it with an opaque window
*
* @param region The {@link Region} to highlight
* @param duration The highlight duration
* @param opacity Overlay opacity
*/
highlightScreenRegion(
region: Region,
duration: number,
opacity: number
): Promise<void>;
/**
* screenWidth returns a systems main screen width
*
* @returns The screen width
*/
screenWidth(): Promise<number>;
/**
* screenHeight returns a systems main screen height
*
* @returns The screen height
*/
screenHeight(): Promise<number>;
/**
* screenSize returns a {@link Region} object the size of a systems main screen
*
* @returns The {@link Region} object representing the screen dimensions
*/
screenSize(): Promise<Region>;
}