Skip to content

Commit 161d26c

Browse files
committed
(#87) Native provider interface docs
1 parent a483b36 commit 161d26c

4 files changed

+32
-67
lines changed
+6-12
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
/**
22
* A ClipboardActionProvider should allow access to the system clipboard
3-
*
4-
* @interface ClipboardActionProvider
53
*/
64
export interface ClipboardActionProvider {
75
/**
86
* hasText should return whether the system clipboard currently holds text or not
97
*
10-
* @returns {Promise<boolean>} True if there's text on the clipboard, false otherwise
11-
* @memberof ClipboardActionProvider
8+
* @returns True if there's text on the clipboard, false otherwise
129
*/
1310
hasText(): Promise<boolean>;
1411

1512
/**
1613
* clear should allow to clear the system clipboard
1714
*
18-
* @returns {Promise<boolean>} Successfully cleared or not
19-
* @memberof ClipboardActionProvider
15+
* @returns True when successfully cleared, false otherwise
2016
*/
2117
clear(): Promise<boolean>;
2218

2319
/**
24-
* copy should allow to copy text to the system's clipboard
20+
* copy should allow to copy text to the systems clipboard
2521
*
26-
* @param {string} text The text to copy to the clipboard
27-
* @memberof ClipboardActionProvider
22+
* @param text The text to copy to the clipboard
2823
*/
2924
copy(text: string): Promise<void>;
3025

3126
/**
32-
* paste should allow to paste the current text on the system's clipboard
27+
* paste should allow to paste the current text on the systems clipboard
3328
*
34-
* @returns {Promise<string>} The current clipboard text
35-
* @memberof ClipboardActionProvider
29+
* @returns The current clipboard text
3630
*/
3731
paste(): Promise<string>;
3832
}
+6-13
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
11
import { Key } from "../../key.enum";
22

33
/**
4-
* A KeyboardActionProvider should provide access to a system's keyboard
5-
*
6-
* @interface KeyboardActionProvider
4+
* A KeyboardActionProvider should provide access to a systems keyboard
75
*/
86
export interface KeyboardActionProvider {
97
/**
108
* setKeyboardDelay should allow to configure a delay between key presses
119
*
12-
* @param {number} delay The delay
13-
* @memberof KeybaordActionProvider
10+
* @param delay The delay between key presses in milliseconds
1411
*/
1512
setKeyboardDelay(delay: number): void;
1613

1714
/**
1815
* type should allow to type a given text via OS level keyboard events
1916
*
20-
* @param {string} input The text to type
21-
* @memberof KeyboardActionProvider
17+
* @param input The text to type
2218
*/
2319
type(input: string): Promise<void>;
2420

2521
/**
2622
* Click should allow to press a single key via OS level keyboard event
2723
*
28-
* @param {Key[]} keys The keys to click
29-
* @memberof KeyboardActionProvider
24+
* @param keys Array of {@link Key}s to click
3025
*/
3126
click(...keys: Key[]): Promise<void>;
3227

3328
/**
3429
* pressKey should allow to press and hold a key via OS level keyboard event
3530
*
36-
* @param {Key[]} keys to press and hold
37-
* @memberof KeyboardActionProvider
31+
* @param keys Array of {@link Key}s to press and hold
3832
*/
3933
pressKey(...keys: Key[]): Promise<void>;
4034

4135
/**
4236
* releaseKey should release a pressed key via OS level keyboard event
4337
*
44-
* @param {Key[]} keys to release
45-
* @memberof KeyboardActionProvider
38+
* @param keys Array of {@link Key}s to release
4639
*/
4740
releaseKey(...keys: Key[]): Promise<void>;
4841
}

Diff for: lib/provider/native/mouse-action-provider.interface.ts

+10-27
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,84 @@ import { Button } from "../../button.enum";
22
import { Point } from "../../point.class";
33

44
/**
5-
* A MouseActionProvider should provide access to a system's mouse input
6-
*
7-
* @interface MouseActionInterface
5+
* A MouseActionProvider should provide access to a systems mouse input
86
*/
97
export interface MouseActionInterface {
108
/**
119
* setMouseDelay should allow to configure mouse movement speed
1210
*
13-
* @param {number} delay The delay
14-
* @memberof MouseActionInterface
11+
* @param delay The delay in milliseconds
1512
*/
1613
setMouseDelay(delay: number): void;
1714

1815
/**
1916
* setMousePosition should allow to set the mouse cursor position
2017
*
21-
* @param {Point} p The point to which the mouse pointer should be set
22-
* @memberof MouseActionInterface
18+
* @param p The {@link Point} to which the mouse pointer should be set
2319
*/
2420
setMousePosition(p: Point): Promise<void>;
2521

2622
/**
2723
* currentMousePosition should return the current mouse pointer position
2824
*
29-
* @returns {Promise<Point>} The current mouse pointer position
30-
* @memberof MouseActionInterface
25+
* @returns The current mouse pointer position
3126
*/
3227
currentMousePosition(): Promise<Point>;
3328

3429
/**
3530
* leftClick should allow to perform a left click via OS event
36-
*
37-
* @memberof MouseActionInterface
3831
*/
3932
leftClick(): Promise<void>;
4033

4134
/**
4235
* rightClick should allow to perform a right click via OS event
43-
*
44-
* @memberof MouseActionInterface
4536
*/
4637
rightClick(): Promise<void>;
4738

4839
/**
4940
* middleClick should allow to perform a middle click via OS event
50-
*
51-
* @memberof MouseActionInterface
5241
*/
5342
middleClick(): Promise<void>;
5443

5544
/**
5645
* scrollUp should allow to perform an upward mouse scroll
5746
*
58-
* @param {number} amount The scroll amount
59-
* @memberof MouseActionInterface
47+
* @param amount The scroll amount
6048
*/
6149
scrollUp(amount: number): Promise<void>;
6250

6351
/**
6452
* scrollDown should allow to perform an downward mouse scroll
6553
*
66-
* @param {number} amount The scroll amount
67-
* @memberof MouseActionInterface
54+
* @param amount The scroll amount
6855
*/
6956
scrollDown(amount: number): Promise<void>;
7057

7158
/**
7259
* scrollLeft should allow to perform a left mouse scroll
7360
*
74-
* @param {number} amount The scroll amount
75-
* @memberof MouseActionInterface
61+
* @param amount The scroll amount
7662
*/
7763
scrollLeft(amount: number): Promise<void>;
7864

7965
/**
8066
* scrollRight should perform a right mouse scroll
8167
*
82-
* @param {number} amount The scroll amount
83-
* @memberof MouseActionInterface
68+
* @param amount The scroll amount
8469
*/
8570
scrollRight(amount: number): Promise<void>;
8671

8772
/**
8873
* pressButton should allow to press and hold a mouse button
8974
*
90-
* @param {Button} btn The button to press and hold
91-
* @memberof MouseActionInterface
75+
* @param btn The {@link Button} to press and hold
9276
*/
9377
pressButton(btn: Button): Promise<void>;
9478

9579
/**
9680
* releaseButton should allow to release a pressed button
9781
*
98-
* @param {Button} btn The button to release
99-
* @memberof MouseActionInterface
82+
* @param btn The {@link Button} to release
10083
*/
10184
releaseButton(btn: Button): Promise<void>;
10285
}

Diff for: lib/provider/native/screen-action-provider.interface.ts

+10-15
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,39 @@ import { Region } from "../../region.class";
88
*/
99
export interface ScreenActionProvider {
1010
/**
11-
* grabScreen should return an Image object containing a screenshot data of a system's
11+
* grabScreen should return an {@link Image} object containing a screenshot data of a systems
1212
* main screen as well as its dimensions
1313
*
14-
* @returns {Promise<Image>} The Image object holding screenshot data
15-
* @memberof ScreenActionProvider
14+
* @returns The {@link Image} object holding screenshot data
1615
*/
1716
grabScreen(): Promise<Image>;
1817

1918
/**
2019
* Returns the same result as grabScreen, but limited to a specified region
2120
*
22-
* @param {Region} region The region to take the screenshot of
23-
* @returns {Promise<Image>} The Image object holding screenshot data
24-
* @memberof ScreenActionProvider
21+
* @param region The {@link Region} to take the screenshot of
22+
* @returns The {@link Image} object holding screenshot data
2523
*/
2624
grabScreenRegion(region: Region): Promise<Image>;
2725

2826
/**
29-
* screenWidth returns a system's main screen width
27+
* screenWidth returns a systems main screen width
3028
*
31-
* @returns {Promise<number>} The screen width
32-
* @memberof ScreenActionProvider
29+
* @returns The screen width
3330
*/
3431
screenWidth(): Promise<number>;
3532

3633
/**
37-
* screenHeight returns a system's main screen height
34+
* screenHeight returns a systems main screen height
3835
*
39-
* @returns {Promise<number>} The screen height
40-
* @memberof ScreenActionProvider
36+
* @returns The screen height
4137
*/
4238
screenHeight(): Promise<number>;
4339

4440
/**
45-
* screenSize returns a Region object the size of a system's main screen
41+
* screenSize returns a {@link Region} object the size of a systems main screen
4642
*
47-
* @returns {Promise<Region>} The Region object
48-
* @memberof ScreenActionProvider
43+
* @returns The {@link Region} object representing the screen dimensions
4944
*/
5045
screenSize(): Promise<Region>;
5146
}

0 commit comments

Comments
 (0)