-
-
Notifications
You must be signed in to change notification settings - Fork 111
/
window-provider.interface.ts
62 lines (53 loc) · 2.03 KB
/
window-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
59
60
61
62
import { Point, Region, Size } from "@nut-tree/shared";
/**
* A WindowActionProvider should provide access to a system's window system
*
* @interface WindowProviderInterface
*/
export interface WindowProviderInterface {
/**
* {@link getWindows} returns a list of window handles for further processing.
* These window handles may serve as input to e.g. {@link getWindowTitle}
*
* @returns A list of window handles
*/
getWindows(): Promise<number[]>;
/**
* {@link getActiveWindow} returns the window handle of the currently active foreground window
*
* @returns The handle to the currently active foreground window
*/
getActiveWindow(): Promise<number>;
/**
* {@link getWindowTitle} returns the title of a window addressed via its window handle
*
* @returns A string representing the title of a window addressed via its window handle
*/
getWindowTitle(windowHandle: number): Promise<string>;
/**
* {@link getWindowRegion} returns a {@link Region} object representing the size and position of the window addressed via its window handle
*
* @returns The {@link Region} occupied by the window addressed via its window handle
*/
getWindowRegion(windowHandle: number): Promise<Region>;
/**
* {@link focusWindow} Focuses the window addressed via its window handle
*/
focusWindow(windowHandle: number): Promise<boolean>;
/**
* {@link moveWindow} Moves the window addressed via its window handle to a new origin given as {@link Point}
*/
moveWindow(windowHandle: number, newOrigin: Point): Promise<boolean>;
/**
* {@link resizeWindow} Resizes the window addressed via its window handle to a new {@link Size}
*/
resizeWindow(windowHandle: number, newSize: Size): Promise<boolean>;
/**
* {@link minimizeWindow} Minimizes the window addressed via its window handle
*/
minimizeWindow(windowHandle: number): Promise<boolean>;
/**
* {@link restoreWindow} Restores a window addressed via its window handle
*/
restoreWindow(windowHandle: number): Promise<boolean>;
}