-
-
Notifications
You must be signed in to change notification settings - Fork 111
/
window.interface.ts
44 lines (32 loc) · 1.35 KB
/
window.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
import { OptionalSearchParameters, Point, Region, Size, WindowElementQuery } from "../objects";
import { WindowElement } from "./window-element.interface";
import { PointResultFindInput, RegionResultFindInput, WindowElementResultFindInput } from "./index";
export interface WindowInterface {
getTitle(): Promise<string>;
getRegion(): Promise<Region>;
move(newOrigin: Point): Promise<boolean>;
resize(newSize: Size): Promise<boolean>;
focus(): Promise<boolean>;
getElements(maxElements?: number): Promise<WindowElement>;
find(
searchInput: WindowElementResultFindInput | Promise<WindowElementResultFindInput>
): Promise<WindowElement>;
findAll(
searchInput: WindowElementResultFindInput | Promise<WindowElementResultFindInput>
): Promise<WindowElement[]>;
waitFor<PROVIDER_DATA_TYPE>(
searchInput: WindowElementQuery | Promise<WindowElementQuery>,
timeoutMs?: number,
updateInterval?: number,
params?: OptionalSearchParameters<PROVIDER_DATA_TYPE>
): Promise<WindowElement>;
on(searchInput: WindowElementQuery, callback: WindowElementCallback): void;
}
export type WindowedFindInput =
| RegionResultFindInput
| WindowElementResultFindInput
| PointResultFindInput;
export type WindowedFindResult = Region | Point | WindowElement;
export type WindowElementCallback = (
target: WindowElement
) => void | Promise<void>;