@maaxyz/maa-node 5.0.0-beta.4 → 5.0.0

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.
@@ -18,10 +18,18 @@ declare global {
18
18
  ScreencapOrInputMethods
19
19
  >
20
20
  const Win32ScreencapMethod: Record<
21
- 'GDI' | 'FramePool' | 'DXGI_DesktopDup',
21
+ | 'GDI'
22
+ | 'FramePool'
23
+ | 'DXGI_DesktopDup'
24
+ | 'DXGI_DesktopDup_Window'
25
+ | 'PrintWindow'
26
+ | 'ScreenDC',
27
+ ScreencapOrInputMethods
28
+ >
29
+ const Win32InputMethod: Record<
30
+ 'Seize' | 'SendMessage' | 'PostMessage' | 'LegacyEvent' | 'PostThreadMessage',
22
31
  ScreencapOrInputMethods
23
32
  >
24
- const Win32InputMethod: Record<'Seize' | 'SendMessage', ScreencapOrInputMethods>
25
33
  const DbgControllerType: Record<'CarouselImage' | 'ReplayRecording', Uint64>
26
34
  }
27
35
  }
@@ -1,6 +1,15 @@
1
1
  declare global {
2
2
  namespace maa {
3
- type Point = [x: number, y: number]
3
+ type ClickParam = {
4
+ point: Point
5
+ contact: number
6
+ }
7
+
8
+ type LongPressParam = {
9
+ point: Point
10
+ duration: number
11
+ contact: number
12
+ }
4
13
 
5
14
  type SwipeParam = {
6
15
  begin: Point
@@ -9,8 +18,48 @@ declare global {
9
18
  duration: number[]
10
19
  only_hover: boolean
11
20
  starting: number
21
+ contact: number
22
+ }
23
+
24
+ type MultiSwipeParam = {
25
+ swipes: SwipeParam[]
26
+ }
27
+
28
+ type TouchParam = {
29
+ contact: number
30
+ point: Point
31
+ pressure: number
32
+ }
33
+
34
+ type ClickKeyParam = {
35
+ keycode: number[]
36
+ }
37
+
38
+ type LongPressKeyParam = {
39
+ keycode: number[]
40
+ duration: number
41
+ }
42
+
43
+ type InputTextParam = {
44
+ text: string
45
+ }
46
+
47
+ type AppParam = {
48
+ package: string
12
49
  }
13
50
 
51
+ type ActionParam =
52
+ | {}
53
+ | ClickParam
54
+ | LongPressParam
55
+ | SwipeParam
56
+ | MultiSwipeParam
57
+ | TouchParam
58
+ | ClickKeyParam
59
+ | LongPressKeyParam
60
+ | InputTextParam
61
+ | AppParam
62
+
14
63
  type ControllerNotify = {
15
64
  msg:
16
65
  | 'Controller.Action.Starting'
@@ -25,16 +74,11 @@ declare global {
25
74
  }
26
75
  | {
27
76
  action: 'click'
28
- param: {
29
- point: Point
30
- }
77
+ param: ClickParam
31
78
  }
32
79
  | {
33
80
  action: 'long_press'
34
- param: {
35
- point: Point
36
- duration: number
37
- }
81
+ param: LongPressParam
38
82
  }
39
83
  | {
40
84
  action: 'swipe'
@@ -42,34 +86,23 @@ declare global {
42
86
  }
43
87
  | {
44
88
  action: 'multi_swipe'
45
- param: SwipeParam[]
89
+ param: MultiSwipeParam
46
90
  }
47
91
  | {
48
92
  action: 'touch_down' | 'touch_move' | 'touch_up'
49
- param: {
50
- contact: number
51
- point: Point
52
- pressure: number
53
- }
93
+ param: TouchParam
54
94
  }
55
95
  | {
56
96
  action: 'click_key' | 'key_down' | 'key_up'
57
- param: {
58
- keycode: number[]
59
- }
97
+ param: ClickKeyParam
60
98
  }
61
99
  | {
62
100
  action: 'long_press_key'
63
- param: {
64
- keycode: number[]
65
- duration: number
66
- }
101
+ param: LongPressKeyParam
67
102
  }
68
103
  | {
69
104
  action: 'input_text'
70
- param: {
71
- text: string
72
- }
105
+ param: InputTextParam
73
106
  }
74
107
  | {
75
108
  action: 'screencap'
@@ -77,9 +110,7 @@ declare global {
77
110
  }
78
111
  | {
79
112
  action: 'start_app' | 'stop_app'
80
- param: {
81
- package: string
82
- }
113
+ param: AppParam
83
114
  }
84
115
  )
85
116
 
package/dist/tasker.d.ts CHANGED
@@ -42,12 +42,14 @@ declare global {
42
42
  draws: ArrayBuffer[]
43
43
  }
44
44
 
45
+ type ActionDetailObject = ActionParam
46
+
45
47
  type ActionDetail = {
46
48
  name: string
47
49
  action: string
48
50
  box: Rect
49
51
  success: boolean
50
- detail: unknown
52
+ detail: ActionDetailObject
51
53
  }
52
54
 
53
55
  type TaskerNotify = {
package/dist/types.d.ts CHANGED
@@ -10,6 +10,7 @@ declare global {
10
10
  type CtrlId = Id & { __brand: 'CtrlId' }
11
11
  type TaskId = Id & { __brand: 'TaskId' }
12
12
  type RecoId = Id & { __brand: 'RecoId' }
13
+ type ActId = Id & { __brand: 'ActId' }
13
14
  type NodeId = Id & { __brand: 'NodeId' }
14
15
  type SinkId = Id & { __brand: 'SinkId' }
15
16
 
@@ -24,6 +25,7 @@ declare global {
24
25
  height: number
25
26
  }
26
27
 
28
+ type Point = [x: number, y: number]
27
29
  type FlatRect = [x: number, y: number, width: number, height: number]
28
30
 
29
31
  type MaybePromise<T> = T | Promise<T>
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.0-beta.4",
31
+ "version": "5.0.0",
32
32
  "optionalDependencies": {
33
- "@maaxyz/maa-node-darwin-arm64": "5.0.0-beta.4",
34
- "@maaxyz/maa-node-darwin-x64": "5.0.0-beta.4",
35
- "@maaxyz/maa-node-linux-arm64": "5.0.0-beta.4",
36
- "@maaxyz/maa-node-linux-x64": "5.0.0-beta.4",
37
- "@maaxyz/maa-node-win32-arm64": "5.0.0-beta.4",
38
- "@maaxyz/maa-node-win32-x64": "5.0.0-beta.4"
33
+ "@maaxyz/maa-node-darwin-arm64": "5.0.0",
34
+ "@maaxyz/maa-node-darwin-x64": "5.0.0",
35
+ "@maaxyz/maa-node-linux-arm64": "5.0.0",
36
+ "@maaxyz/maa-node-linux-x64": "5.0.0",
37
+ "@maaxyz/maa-node-win32-arm64": "5.0.0",
38
+ "@maaxyz/maa-node-win32-x64": "5.0.0"
39
39
  }
40
40
  }