-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathkeyboard-provider.interface.ts
41 lines (36 loc) · 1.06 KB
/
keyboard-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
import { Key } from "../key.enum";
/**
* A KeyboardActionProvider should provide access to a systems keyboard
*/
export interface KeyboardProviderInterface {
/**
* setKeyboardDelay should allow to configure a delay between key presses
*
* @param delay The delay between key presses in milliseconds
*/
setKeyboardDelay(delay: number): void;
/**
* type should allow to type a given text via OS level keyboard events
*
* @param input The text to type
*/
type(input: string): Promise<void>;
/**
* Click should allow to press a single key via OS level keyboard event
*
* @param keys Array of {@link Key}s to click
*/
click(...keys: Key[]): Promise<void>;
/**
* pressKey should allow to press and hold a key via OS level keyboard event
*
* @param keys Array of {@link Key}s to press and hold
*/
pressKey(...keys: Key[]): Promise<void>;
/**
* releaseKey should release a pressed key via OS level keyboard event
*
* @param keys Array of {@link Key}s to release
*/
releaseKey(...keys: Key[]): Promise<void>;
}