@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 CHANGED
@@ -14,6 +14,8 @@ declare global {
14
14
  get connected(): boolean
15
15
  get alive(): boolean
16
16
  set timeout(ms: Uint64)
17
+ get custom_recognition_list(): string[] | null
18
+ get custom_action_list(): string[] | null
17
19
  }
18
20
  }
19
21
  }
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
  }
@@ -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
@@ -5,6 +5,7 @@ declare global {
5
5
  get version(): string
6
6
  set log_dir(value: string)
7
7
  set save_draw(value: boolean)
8
+ set save_on_error(value: boolean)
8
9
  set stdout_level(
9
10
  value: 'Off' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'All',
10
11
  )
@@ -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<NodeName, Mode>
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<string, Mode>
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> // 附加 JSON 对象
386
+ attach?: Record<string, unknown>
375
387
  }
376
388
 
377
389
  type Task = Recognition<ModeFragment> & Action<ModeFragment> & General<ModeFragment>
@@ -39,6 +39,8 @@ declare global {
39
39
  get loaded(): boolean
40
40
  get hash(): string | null
41
41
  get node_list(): string[] | null
42
+ get custom_recognition_list(): string[] | null
43
+ get custom_action_list(): string[] | null
42
44
  }
43
45
  }
44
46
  }
package/dist/tasker.d.ts CHANGED
@@ -88,7 +88,7 @@ declare global {
88
88
  msg: NotifyMessage<'NextList'>
89
89
  task_id: number // TaskId
90
90
  name: string
91
- list: string[]
91
+ list: { name: string; jump_back: boolean }[]
92
92
  focus: unknown
93
93
  }
94
94
 
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.5",
31
+ "version": "5.1.0-beta.2",
32
32
  "optionalDependencies": {
33
- "@maaxyz/maa-node-darwin-arm64": "5.0.5",
34
- "@maaxyz/maa-node-darwin-x64": "5.0.5",
35
- "@maaxyz/maa-node-linux-arm64": "5.0.5",
36
- "@maaxyz/maa-node-linux-x64": "5.0.5",
37
- "@maaxyz/maa-node-win32-arm64": "5.0.5",
38
- "@maaxyz/maa-node-win32-x64": "5.0.5"
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
  }