@maaxyz/maa-node 5.0.5 → 5.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -0
- package/dist/context.d.ts +4 -0
- package/dist/controller.d.ts +12 -0
- package/dist/global.d.ts +1 -0
- package/dist/pipeline.d.ts +17 -5
- package/dist/resource.d.ts +2 -0
- package/dist/tasker.d.ts +1 -1
- package/package.json +7 -7
package/dist/client.d.ts
CHANGED
package/dist/context.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ declare global {
|
|
|
28
28
|
get task_id(): TaskId
|
|
29
29
|
get tasker(): Tasker
|
|
30
30
|
clone(): Context
|
|
31
|
+
set_anchor(anchor_name: string, node_name: string): boolean
|
|
32
|
+
get_anchor(anchor_name: string): string | null
|
|
33
|
+
get_hit_count(node_name: string): number
|
|
34
|
+
clear_hit_count(node_name: string): boolean
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
}
|
package/dist/controller.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ declare global {
|
|
|
48
48
|
package: string
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
type ScrollParam = {
|
|
52
|
+
dx: number
|
|
53
|
+
dy: number
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
type ActionParam =
|
|
52
57
|
| {}
|
|
53
58
|
| ClickParam
|
|
@@ -59,6 +64,7 @@ declare global {
|
|
|
59
64
|
| LongPressKeyParam
|
|
60
65
|
| InputTextParam
|
|
61
66
|
| AppParam
|
|
67
|
+
| ScrollParam
|
|
62
68
|
|
|
63
69
|
type ControllerNotify = {
|
|
64
70
|
msg: NotifyMessage<'Action'>
|
|
@@ -109,6 +115,10 @@ declare global {
|
|
|
109
115
|
action: 'start_app' | 'stop_app'
|
|
110
116
|
param: AppParam
|
|
111
117
|
}
|
|
118
|
+
| {
|
|
119
|
+
action: 'scroll'
|
|
120
|
+
param: ScrollParam
|
|
121
|
+
}
|
|
112
122
|
)
|
|
113
123
|
|
|
114
124
|
class ImageJob extends Job<CtrlId, Controller, ImageData | null> {
|
|
@@ -155,6 +165,7 @@ declare global {
|
|
|
155
165
|
post_touch_up(contact: number): Job<CtrlId, Controller>
|
|
156
166
|
post_key_down(keycode: number): Job<CtrlId, Controller>
|
|
157
167
|
post_key_up(keycode: number): Job<CtrlId, Controller>
|
|
168
|
+
post_scroll(dx: number, dy: number): Job<CtrlId, Controller>
|
|
158
169
|
post_screencap(): ImageJob
|
|
159
170
|
override_pipeline(pipeline: Record<string, unknown> | Record<string, unknown>[]): void
|
|
160
171
|
override_next(node_name: string, next_list: string[]): void
|
|
@@ -245,6 +256,7 @@ declare global {
|
|
|
245
256
|
input_text?(text: string): maa.MaybePromise<boolean>
|
|
246
257
|
key_down?(keycode: number): maa.MaybePromise<boolean>
|
|
247
258
|
key_up?(keycode: number): maa.MaybePromise<boolean>
|
|
259
|
+
scroll?(dx: number, dy: number): maa.MaybePromise<boolean>
|
|
248
260
|
}
|
|
249
261
|
|
|
250
262
|
class CustomController extends Controller {
|
package/dist/global.d.ts
CHANGED
package/dist/pipeline.d.ts
CHANGED
|
@@ -282,6 +282,11 @@ declare global {
|
|
|
282
282
|
|
|
283
283
|
type ActionStopTask = {}
|
|
284
284
|
|
|
285
|
+
type ActionScroll = {
|
|
286
|
+
dx?: number
|
|
287
|
+
dy?: number
|
|
288
|
+
}
|
|
289
|
+
|
|
285
290
|
type ActionCommand<Mode> = RequiredIfStrict<
|
|
286
291
|
{
|
|
287
292
|
exec?: string
|
|
@@ -344,9 +349,16 @@ declare global {
|
|
|
344
349
|
| MixAct<'StartApp', ActionStartApp<Mode>, Mode>
|
|
345
350
|
| MixAct<'StopApp', ActionStopApp<Mode>, Mode>
|
|
346
351
|
| MixAct<'StopTask', ActionStopTask, Mode>
|
|
352
|
+
| MixAct<'Scroll', ActionScroll, Mode>
|
|
347
353
|
| MixAct<'Command', ActionCommand<Mode>, Mode>
|
|
348
354
|
| MixAct<'Custom', ActionCustom<Mode>, Mode>
|
|
349
355
|
|
|
356
|
+
type NodeAttr = {
|
|
357
|
+
name: string
|
|
358
|
+
jump_back: boolean
|
|
359
|
+
anchor: boolean
|
|
360
|
+
}
|
|
361
|
+
|
|
350
362
|
type WaitFreeze = {
|
|
351
363
|
time?: number
|
|
352
364
|
target?: true | NodeName | Rect
|
|
@@ -358,20 +370,20 @@ declare global {
|
|
|
358
370
|
}
|
|
359
371
|
|
|
360
372
|
type General<Mode> = {
|
|
361
|
-
next?: MaybeArray<
|
|
362
|
-
interrupt?: MaybeArray<NodeName, Mode>
|
|
363
|
-
is_sub?: boolean
|
|
373
|
+
next?: MaybeArray<NodeAttr, Mode>
|
|
364
374
|
rate_limit?: number
|
|
365
375
|
timeout?: number
|
|
366
|
-
on_error?: MaybeArray<
|
|
376
|
+
on_error?: MaybeArray<NodeAttr, Mode>
|
|
377
|
+
anchor?: MaybeArray<string, Mode>
|
|
367
378
|
inverse?: boolean
|
|
368
379
|
enabled?: boolean
|
|
380
|
+
max_hit?: number
|
|
369
381
|
pre_delay?: boolean
|
|
370
382
|
post_delay?: boolean
|
|
371
383
|
pre_wait_freezes?: RemoveIfDump<number, Mode> | WaitFreeze
|
|
372
384
|
post_wait_freezes?: RemoveIfDump<number, Mode> | WaitFreeze
|
|
373
385
|
focus?: unknown
|
|
374
|
-
attach?: Record<string, unknown>
|
|
386
|
+
attach?: Record<string, unknown>
|
|
375
387
|
}
|
|
376
388
|
|
|
377
389
|
type Task = Recognition<ModeFragment> & Action<ModeFragment> & General<ModeFragment>
|
package/dist/resource.d.ts
CHANGED
package/dist/tasker.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"prettier": "^3.5.2",
|
|
29
29
|
"typescript": "^5.8.2"
|
|
30
30
|
},
|
|
31
|
-
"version": "5.0.
|
|
31
|
+
"version": "5.1.0-beta.2",
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@maaxyz/maa-node-darwin-arm64": "5.0.
|
|
34
|
-
"@maaxyz/maa-node-darwin-x64": "5.0.
|
|
35
|
-
"@maaxyz/maa-node-linux-arm64": "5.0.
|
|
36
|
-
"@maaxyz/maa-node-linux-x64": "5.0.
|
|
37
|
-
"@maaxyz/maa-node-win32-arm64": "5.0.
|
|
38
|
-
"@maaxyz/maa-node-win32-x64": "5.0.
|
|
33
|
+
"@maaxyz/maa-node-darwin-arm64": "5.1.0-beta.2",
|
|
34
|
+
"@maaxyz/maa-node-darwin-x64": "5.1.0-beta.2",
|
|
35
|
+
"@maaxyz/maa-node-linux-arm64": "5.1.0-beta.2",
|
|
36
|
+
"@maaxyz/maa-node-linux-x64": "5.1.0-beta.2",
|
|
37
|
+
"@maaxyz/maa-node-win32-arm64": "5.1.0-beta.2",
|
|
38
|
+
"@maaxyz/maa-node-win32-x64": "5.1.0-beta.2"
|
|
39
39
|
}
|
|
40
40
|
}
|