@@ -25,10 +25,10 @@ export class Mouse {
25
25
26
26
/**
27
27
* {@link Mouse } class constructor
28
- * @param native {@link NativeAdapter } instance which bundles access to mouse, keyboard and clipboard
28
+ * @param nativeAdapter {@link NativeAdapter } instance which bundles access to mouse, keyboard and clipboard
29
29
*/
30
- constructor ( private native : NativeAdapter ) {
31
- this . native . setMouseDelay ( 0 ) ;
30
+ constructor ( private nativeAdapter : NativeAdapter ) {
31
+ this . nativeAdapter . setMouseDelay ( 0 ) ;
32
32
}
33
33
34
34
/**
@@ -38,7 +38,7 @@ export class Mouse {
38
38
public async setPosition ( target : Point ) : Promise < Mouse > {
39
39
return new Promise < Mouse > ( async ( resolve , reject ) => {
40
40
try {
41
- await this . native . setMousePosition ( target ) ;
41
+ await this . nativeAdapter . setMousePosition ( target ) ;
42
42
resolve ( this ) ;
43
43
} catch ( e ) {
44
44
reject ( e ) ;
@@ -50,7 +50,7 @@ export class Mouse {
50
50
* {@link getPosition } returns a {@link Point } representing the current mouse position
51
51
*/
52
52
public getPosition ( ) : Promise < Point > {
53
- return this . native . currentMousePosition ( ) ;
53
+ return this . nativeAdapter . currentMousePosition ( ) ;
54
54
}
55
55
56
56
/**
@@ -67,7 +67,7 @@ export class Mouse {
67
67
const node = pathSteps [ idx ] ;
68
68
const minTime = timeSteps [ idx ] ;
69
69
await busyWaitForNanoSeconds ( minTime ) ;
70
- await this . native . setMousePosition ( node ) ;
70
+ await this . nativeAdapter . setMousePosition ( node ) ;
71
71
}
72
72
resolve ( this ) ;
73
73
} catch ( e ) {
@@ -82,7 +82,7 @@ export class Mouse {
82
82
public async leftClick ( ) : Promise < Mouse > {
83
83
return new Promise < Mouse > ( async resolve => {
84
84
await sleep ( this . config . autoDelayMs ) ;
85
- await this . native . leftClick ( ) ;
85
+ await this . nativeAdapter . leftClick ( ) ;
86
86
resolve ( this ) ;
87
87
} ) ;
88
88
}
@@ -94,7 +94,7 @@ export class Mouse {
94
94
return new Promise < Mouse > ( async ( resolve , reject ) => {
95
95
try {
96
96
await sleep ( this . config . autoDelayMs ) ;
97
- await this . native . rightClick ( ) ;
97
+ await this . nativeAdapter . rightClick ( ) ;
98
98
resolve ( this ) ;
99
99
} catch ( e ) {
100
100
reject ( e ) ;
@@ -111,7 +111,7 @@ export class Mouse {
111
111
return new Promise < Mouse > ( async ( resolve , reject ) => {
112
112
try {
113
113
await sleep ( this . config . autoDelayMs ) ;
114
- await this . native . scrollDown ( amount ) ;
114
+ await this . nativeAdapter . scrollDown ( amount ) ;
115
115
resolve ( this ) ;
116
116
} catch ( e ) {
117
117
reject ( e ) ;
@@ -128,7 +128,7 @@ export class Mouse {
128
128
return new Promise < Mouse > ( async ( resolve , reject ) => {
129
129
try {
130
130
await sleep ( this . config . autoDelayMs ) ;
131
- await this . native . scrollUp ( amount ) ;
131
+ await this . nativeAdapter . scrollUp ( amount ) ;
132
132
resolve ( this ) ;
133
133
} catch ( e ) {
134
134
reject ( e ) ;
@@ -145,7 +145,7 @@ export class Mouse {
145
145
return new Promise < Mouse > ( async ( resolve , reject ) => {
146
146
try {
147
147
await sleep ( this . config . autoDelayMs ) ;
148
- await this . native . scrollLeft ( amount ) ;
148
+ await this . nativeAdapter . scrollLeft ( amount ) ;
149
149
resolve ( this ) ;
150
150
} catch ( e ) {
151
151
reject ( e ) ;
@@ -162,7 +162,7 @@ export class Mouse {
162
162
return new Promise < Mouse > ( async ( resolve , reject ) => {
163
163
try {
164
164
await sleep ( this . config . autoDelayMs ) ;
165
- await this . native . scrollRight ( amount ) ;
165
+ await this . nativeAdapter . scrollRight ( amount ) ;
166
166
resolve ( this ) ;
167
167
} catch ( e ) {
168
168
reject ( e ) ;
@@ -179,9 +179,9 @@ export class Mouse {
179
179
return new Promise < Mouse > ( async ( resolve , reject ) => {
180
180
try {
181
181
await sleep ( this . config . autoDelayMs ) ;
182
- await this . native . pressButton ( Button . LEFT ) ;
182
+ await this . nativeAdapter . pressButton ( Button . LEFT ) ;
183
183
await this . move ( path ) ;
184
- await this . native . releaseButton ( Button . LEFT ) ;
184
+ await this . nativeAdapter . releaseButton ( Button . LEFT ) ;
185
185
resolve ( this ) ;
186
186
} catch ( e ) {
187
187
reject ( e ) ;
@@ -196,7 +196,7 @@ export class Mouse {
196
196
public async pressButton ( btn : Button ) : Promise < Mouse > {
197
197
return new Promise < Mouse > ( async ( resolve , reject ) => {
198
198
try {
199
- await this . native . pressButton ( btn ) ;
199
+ await this . nativeAdapter . pressButton ( btn ) ;
200
200
resolve ( this ) ;
201
201
} catch ( e ) {
202
202
reject ( e ) ;
@@ -211,7 +211,7 @@ export class Mouse {
211
211
public async releaseButton ( btn : Button ) : Promise < Mouse > {
212
212
return new Promise < Mouse > ( async ( resolve , reject ) => {
213
213
try {
214
- await this . native . releaseButton ( btn ) ;
214
+ await this . nativeAdapter . releaseButton ( btn ) ;
215
215
resolve ( this ) ;
216
216
} catch ( e ) {
217
217
reject ( e ) ;
0 commit comments