@maaxyz/maa-node 4.5.6 → 5.0.0-alpha.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 +18 -13
- package/dist/constant.d.ts +28 -0
- package/dist/context.d.ts +33 -53
- package/dist/controller.d.ts +225 -157
- package/dist/global.d.ts +17 -9
- package/dist/index-client.d.ts +12 -12
- package/dist/index-client.js +23 -982
- package/dist/index-server.d.ts +12 -12
- package/dist/index-server.js +23 -990
- package/dist/job.d.ts +30 -22
- package/dist/pipeline.d.ts +355 -211
- package/dist/plugin.d.ts +16 -0
- package/dist/resource.d.ts +47 -39
- package/dist/server.d.ts +24 -9
- package/dist/tasker.d.ts +97 -136
- package/dist/types.d.ts +61 -27
- package/package.json +9 -12
- package/src/index-client.js +27 -0
- package/src/index-server.js +27 -0
- package/dist/maa.d.ts +0 -422
- package/dist/pi.d.ts +0 -9
- package/dist/utils.d.ts +0 -5
- package/scripts/build.mjs +0 -20
- package/src/client.ts +0 -54
- package/src/context.ts +0 -91
- package/src/controller.ts +0 -430
- package/src/global.ts +0 -37
- package/src/index-client.ts +0 -14
- package/src/index-server.ts +0 -14
- package/src/job.ts +0 -68
- package/src/maa-client.js +0 -27
- package/src/maa-server.js +0 -27
- package/src/maa.d.ts +0 -422
- package/src/maa.js +0 -1
- package/src/pi.ts +0 -66
- package/src/pipeline.ts +0 -352
- package/src/resource.ts +0 -203
- package/src/server.ts +0 -64
- package/src/tasker.ts +0 -244
- package/src/types.ts +0 -33
- package/src/utils.ts +0 -40
- package/tsconfig.json +0 -9
package/dist/client.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
namespace maa {
|
|
3
|
+
class Client {
|
|
4
|
+
constructor(identifier?: string)
|
|
5
|
+
|
|
6
|
+
destroy(): void
|
|
7
|
+
get identifier(): string
|
|
8
|
+
bind_resource(resource: Resource): void
|
|
9
|
+
register_sink(tasker?: Tasker, resource?: Resource, controller?: Controller): void
|
|
10
|
+
connect(): Promise<void>
|
|
11
|
+
disconnect(): void
|
|
12
|
+
get connected(): boolean
|
|
13
|
+
get alive(): boolean
|
|
14
|
+
set timeout(ms: Uint64)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
14
17
|
}
|
|
18
|
+
|
|
19
|
+
export {}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace maa {
|
|
3
|
+
const Status: Record<'Invalid' | 'Pending' | 'Running' | 'Succeeded' | 'Failed', Status>
|
|
4
|
+
const AdbScreencapMethod: Record<
|
|
5
|
+
| 'EncodeToFileAndPull'
|
|
6
|
+
| 'Encode'
|
|
7
|
+
| 'RawWithGzip'
|
|
8
|
+
| 'RawByNetcat'
|
|
9
|
+
| 'MinicapDirect'
|
|
10
|
+
| 'MinicapStream'
|
|
11
|
+
| 'EmulatorExtras'
|
|
12
|
+
| 'All'
|
|
13
|
+
| 'Default',
|
|
14
|
+
ScreencapOrInputMethods
|
|
15
|
+
>
|
|
16
|
+
const AdbInputMethod: Record<
|
|
17
|
+
'AdbShell' | 'MinitouchAndAdbKey' | 'Maatouch' | 'EmulatorExtras' | 'All' | 'Default',
|
|
18
|
+
ScreencapOrInputMethods
|
|
19
|
+
>
|
|
20
|
+
const Win32ScreencapMethod: Record<
|
|
21
|
+
'GDI' | 'FramePool' | 'DXGI_DesktopDup',
|
|
22
|
+
ScreencapOrInputMethods
|
|
23
|
+
>
|
|
24
|
+
const Win32InputMethod: Record<'Seize' | 'SendMessage', ScreencapOrInputMethods>
|
|
25
|
+
const DbgControllerType: Record<'CarouselImage' | 'ReplayRecording', Uint64>
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,54 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
draws: ArrayBuffer[];
|
|
33
|
-
} | null>;
|
|
34
|
-
run_action(entry: string, box: maa.Rect, reco_detail: string, pipeline_override?: Record<string, unknown> | Record<string, unknown>[]): Promise<{
|
|
35
|
-
name: string;
|
|
36
|
-
reco: {
|
|
37
|
-
name: string;
|
|
38
|
-
algorithm: string;
|
|
39
|
-
hit: boolean;
|
|
40
|
-
box: maa.Rect;
|
|
41
|
-
detail: import("./tasker").RecoDetail;
|
|
42
|
-
raw: ArrayBuffer;
|
|
43
|
-
draws: ArrayBuffer[];
|
|
44
|
-
} | null;
|
|
45
|
-
completed: boolean;
|
|
46
|
-
} | null>;
|
|
47
|
-
override_pipeline(pipeline_override: Record<string, unknown> | Record<string, unknown>[]): void;
|
|
48
|
-
override_next(node_name: string, next: string[]): void;
|
|
49
|
-
get_node_data(node_name: string): string | null;
|
|
50
|
-
get_node_data_parsed(node_name: string): DumpTask | null;
|
|
51
|
-
get task_id(): maa.TaskId;
|
|
52
|
-
get tasker(): TaskerBase;
|
|
53
|
-
clone(): Context;
|
|
1
|
+
declare global {
|
|
2
|
+
namespace maa {
|
|
3
|
+
class Context {
|
|
4
|
+
constructor(handle?: string)
|
|
5
|
+
|
|
6
|
+
run_task(
|
|
7
|
+
entry: string,
|
|
8
|
+
pipeline_override?: Record<string, unknown> | Record<string, unknown>[],
|
|
9
|
+
): Promise<TaskDetail | null>
|
|
10
|
+
run_recognition(
|
|
11
|
+
entry: string,
|
|
12
|
+
image: ImageData | Buffer,
|
|
13
|
+
pipeline_override?: Record<string, unknown> | Record<string, unknown>[],
|
|
14
|
+
): Promise<RecoDetail | null>
|
|
15
|
+
run_action(
|
|
16
|
+
entry: string,
|
|
17
|
+
box: Rect,
|
|
18
|
+
reco_detail: string,
|
|
19
|
+
pipeline_override?: Record<string, unknown> | Record<string, unknown>[],
|
|
20
|
+
): Promise<NodeDetail | null>
|
|
21
|
+
override_pipeline(
|
|
22
|
+
pipeline_override: Record<string, unknown> | Record<string, unknown>[],
|
|
23
|
+
): void
|
|
24
|
+
override_next(node_name: string, next: string[]): void
|
|
25
|
+
get_node_data(node_name: string): string | null
|
|
26
|
+
get_node_data_parsed(node_name: string): DumpTask | null
|
|
27
|
+
get task_id(): TaskId
|
|
28
|
+
get tasker(): Tasker
|
|
29
|
+
clone(): Context
|
|
30
|
+
}
|
|
31
|
+
}
|
|
54
32
|
}
|
|
33
|
+
|
|
34
|
+
export {}
|
package/dist/controller.d.ts
CHANGED
|
@@ -1,158 +1,226 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
namespace maa {
|
|
3
|
+
type Point = [x: number, y: number]
|
|
4
|
+
|
|
5
|
+
type SwipeParam = {
|
|
6
|
+
begin: Point
|
|
7
|
+
end: Point[]
|
|
8
|
+
end_hold: number[]
|
|
9
|
+
duration: number[]
|
|
10
|
+
only_hover: boolean
|
|
11
|
+
starting: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type ControllerNotify = {
|
|
15
|
+
msg:
|
|
16
|
+
| 'Controller.Action.Starting'
|
|
17
|
+
| 'Controller.Action.Succeeded'
|
|
18
|
+
| 'Controller.Action.Failed'
|
|
19
|
+
ctrl_id: CtrlId
|
|
20
|
+
uuid: string
|
|
21
|
+
} & (
|
|
22
|
+
| {
|
|
23
|
+
action: 'connect'
|
|
24
|
+
param?: never
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
action: 'click'
|
|
28
|
+
param: {
|
|
29
|
+
point: Point
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
action: 'long_press'
|
|
34
|
+
param: {
|
|
35
|
+
point: Point
|
|
36
|
+
duration: number
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
action: 'swipe'
|
|
41
|
+
param: SwipeParam
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
action: 'multi_swipe'
|
|
45
|
+
param: SwipeParam[]
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
action: 'touch_down' | 'touch_move' | 'touch_up'
|
|
49
|
+
param: {
|
|
50
|
+
contact: number
|
|
51
|
+
point: Point
|
|
52
|
+
pressure: number
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
action: 'click_key' | 'key_down' | 'key_up'
|
|
57
|
+
param: {
|
|
58
|
+
keycode: number[]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
| {
|
|
62
|
+
action: 'long_press_key'
|
|
63
|
+
param: {
|
|
64
|
+
keycode: number[]
|
|
65
|
+
duration: number
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
| {
|
|
69
|
+
action: 'input_text'
|
|
70
|
+
param: {
|
|
71
|
+
text: string
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
| {
|
|
75
|
+
action: 'screencap'
|
|
76
|
+
param?: never
|
|
77
|
+
}
|
|
78
|
+
| {
|
|
79
|
+
action: 'start_app' | 'stop_app'
|
|
80
|
+
param: {
|
|
81
|
+
package: string
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
class ImageJob extends Job<CtrlId, Controller, ImageData | null> {
|
|
87
|
+
constructor(source: Controller, id: CtrlId)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class Controller {
|
|
91
|
+
constructor(handle?: string)
|
|
92
|
+
|
|
93
|
+
destroy(): void
|
|
94
|
+
add_sink(cb: (ctrl: Controller, msg: ControllerNotify) => MaybePromise<void>): SinkId
|
|
95
|
+
remove_sink(id: SinkId): void
|
|
96
|
+
clear_sinks(): void
|
|
97
|
+
|
|
98
|
+
set screenshot_target_long_side(value: number)
|
|
99
|
+
set screenshot_target_short_side(value: number)
|
|
100
|
+
set screenshot_use_raw_size(value: boolean)
|
|
101
|
+
|
|
102
|
+
post_connection(): Job<CtrlId, Controller>
|
|
103
|
+
post_click(x: number, y: number): Job<CtrlId, Controller>
|
|
104
|
+
post_swipe(
|
|
105
|
+
x1: number,
|
|
106
|
+
y1: number,
|
|
107
|
+
x2: number,
|
|
108
|
+
y2: number,
|
|
109
|
+
duration: number,
|
|
110
|
+
): Job<CtrlId, Controller>
|
|
111
|
+
post_click_key(keycode: number): Job<CtrlId, Controller>
|
|
112
|
+
post_input_text(text: string): Job<CtrlId, Controller>
|
|
113
|
+
post_start_app(intent: string): Job<CtrlId, Controller>
|
|
114
|
+
post_stop_app(intent: string): Job<CtrlId, Controller>
|
|
115
|
+
post_touch_down(
|
|
116
|
+
contact: number,
|
|
117
|
+
x: number,
|
|
118
|
+
y: number,
|
|
119
|
+
pressure: number,
|
|
120
|
+
): Job<CtrlId, Controller>
|
|
121
|
+
post_touch_move(
|
|
122
|
+
contact: number,
|
|
123
|
+
x: number,
|
|
124
|
+
y: number,
|
|
125
|
+
pressure: number,
|
|
126
|
+
): Job<CtrlId, Controller>
|
|
127
|
+
post_touch_up(contact: number): Job<CtrlId, Controller>
|
|
128
|
+
post_key_down(keycode: number): Job<CtrlId, Controller>
|
|
129
|
+
post_key_up(keycode: number): Job<CtrlId, Controller>
|
|
130
|
+
post_screencap(): ImageJob
|
|
131
|
+
override_pipeline(pipeline: Record<string, unknown> | Record<string, unknown>[]): void
|
|
132
|
+
override_next(node_name: string, next_list: string[]): void
|
|
133
|
+
get_node_data(node_name: string): string | null
|
|
134
|
+
get_node_data_parsed(node_name: string): DumpTask | null
|
|
135
|
+
clear(): void
|
|
136
|
+
status(id: CtrlId): Status
|
|
137
|
+
wait(id: CtrlId): Promise<Status>
|
|
138
|
+
get connected(): boolean
|
|
139
|
+
get cached_image(): ImageData | null
|
|
140
|
+
get uuid(): string | null
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type AdbDevice = [
|
|
144
|
+
name: string,
|
|
145
|
+
adb_path: string,
|
|
146
|
+
address: string,
|
|
147
|
+
screencap_methods: ScreencapOrInputMethods,
|
|
148
|
+
input_methods: ScreencapOrInputMethods,
|
|
149
|
+
config: string,
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
class AdbController extends Controller {
|
|
153
|
+
constructor(
|
|
154
|
+
adb_path: string,
|
|
155
|
+
address: string,
|
|
156
|
+
screencap_methods: ScreencapOrInputMethods,
|
|
157
|
+
input_methods: ScreencapOrInputMethods,
|
|
158
|
+
config: string,
|
|
159
|
+
agent?: string,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
static agent_path(): string
|
|
163
|
+
static find(adb?: string): Promise<AdbDevice[] | null>
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type DesktopDevice = [handle: DesktopHandle, class_name: string, window_name: string]
|
|
167
|
+
|
|
168
|
+
class Win32Controller extends Controller {
|
|
169
|
+
constructor(
|
|
170
|
+
hwnd: DesktopHandle,
|
|
171
|
+
screencap_methods: ScreencapOrInputMethods,
|
|
172
|
+
input_methods: ScreencapOrInputMethods,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
static find(): Promise<DesktopDevice[] | null>
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
class DbgController extends Controller {
|
|
179
|
+
constructor(
|
|
180
|
+
read_path: string,
|
|
181
|
+
write_path: string,
|
|
182
|
+
type: Uint64, // DbgControllerType
|
|
183
|
+
config: string,
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface CustomControllerActor {
|
|
188
|
+
connect?(): maa.MaybePromise<boolean>
|
|
189
|
+
request_uuid?(): maa.MaybePromise<string | null>
|
|
190
|
+
start_app?(intent: string): maa.MaybePromise<boolean>
|
|
191
|
+
stop_app?(intent: string): maa.MaybePromise<boolean>
|
|
192
|
+
screencap?(): maa.MaybePromise<maa.ImageData | null>
|
|
193
|
+
click?(x: number, y: number): maa.MaybePromise<boolean>
|
|
194
|
+
swipe?(
|
|
195
|
+
x1: number,
|
|
196
|
+
y1: number,
|
|
197
|
+
x2: number,
|
|
198
|
+
y2: number,
|
|
199
|
+
duration: number,
|
|
200
|
+
): maa.MaybePromise<boolean>
|
|
201
|
+
touch_down?(
|
|
202
|
+
contact: number,
|
|
203
|
+
x: number,
|
|
204
|
+
y: number,
|
|
205
|
+
pressure: number,
|
|
206
|
+
): maa.MaybePromise<boolean>
|
|
207
|
+
touch_move?(
|
|
208
|
+
contact: number,
|
|
209
|
+
x: number,
|
|
210
|
+
y: number,
|
|
211
|
+
pressure: number,
|
|
212
|
+
): maa.MaybePromise<boolean>
|
|
213
|
+
touch_up?(contact: number): maa.MaybePromise<boolean>
|
|
214
|
+
click_key?(keycode: number): maa.MaybePromise<boolean>
|
|
215
|
+
input_text?(text: string): maa.MaybePromise<boolean>
|
|
216
|
+
key_down?(keycode: number): maa.MaybePromise<boolean>
|
|
217
|
+
key_up?(keycode: number): maa.MaybePromise<boolean>
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
class CustomController extends Controller {
|
|
221
|
+
constructor(actor: CustomControllerActor)
|
|
222
|
+
}
|
|
223
|
+
}
|
|
17
224
|
}
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
begin: Point;
|
|
21
|
-
end: Point[];
|
|
22
|
-
end_hold: number[];
|
|
23
|
-
duration: number[];
|
|
24
|
-
only_hover: boolean;
|
|
25
|
-
starting: number;
|
|
26
|
-
};
|
|
27
|
-
export type ControllerNotify = {
|
|
28
|
-
msg: 'Action.Starting' | 'Action.Succeeded' | 'Action.Failed';
|
|
29
|
-
ctrl_id: maa.CtrlId;
|
|
30
|
-
uuid: string;
|
|
31
|
-
} & ({
|
|
32
|
-
action: 'connect';
|
|
33
|
-
param?: never;
|
|
34
|
-
} | {
|
|
35
|
-
action: 'click';
|
|
36
|
-
param: {
|
|
37
|
-
point: Point;
|
|
38
|
-
};
|
|
39
|
-
} | {
|
|
40
|
-
action: 'long_press';
|
|
41
|
-
param: {
|
|
42
|
-
point: Point;
|
|
43
|
-
duration: number;
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
action: 'swipe';
|
|
47
|
-
param: SwipeParam;
|
|
48
|
-
} | {
|
|
49
|
-
action: 'multi_swipe';
|
|
50
|
-
param: SwipeParam[];
|
|
51
|
-
} | {
|
|
52
|
-
action: 'touch_down' | 'touch_move' | 'touch_up';
|
|
53
|
-
param: {
|
|
54
|
-
contact: number;
|
|
55
|
-
point: Point;
|
|
56
|
-
pressure: number;
|
|
57
|
-
};
|
|
58
|
-
} | {
|
|
59
|
-
action: 'click_key' | 'key_down' | 'key_up';
|
|
60
|
-
param: {
|
|
61
|
-
keycode: number[];
|
|
62
|
-
};
|
|
63
|
-
} | {
|
|
64
|
-
action: 'long_press_key';
|
|
65
|
-
param: {
|
|
66
|
-
keycode: number[];
|
|
67
|
-
duration: number;
|
|
68
|
-
};
|
|
69
|
-
} | {
|
|
70
|
-
action: 'input_text';
|
|
71
|
-
param: {
|
|
72
|
-
text: string;
|
|
73
|
-
};
|
|
74
|
-
} | {
|
|
75
|
-
action: 'screencap';
|
|
76
|
-
param?: never;
|
|
77
|
-
} | {
|
|
78
|
-
action: 'start_app' | 'stop_app';
|
|
79
|
-
param: {
|
|
80
|
-
package: string;
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
export declare class ControllerBase {
|
|
84
|
-
#private;
|
|
85
|
-
handle: maa.ControllerHandle;
|
|
86
|
-
notify(message: string, details_json: string): maa.MaybePromise<void>;
|
|
87
|
-
chain_notify: typeof chain_notify_impl;
|
|
88
|
-
chain_parsed_notify(cb: (msg: ControllerNotify) => maa.MaybePromise<void>, order?: ChainNotifyType): void;
|
|
89
|
-
constructor(handle: maa.ControllerHandle);
|
|
90
|
-
destroy(): void;
|
|
91
|
-
set screenshot_target_long_side(value: number);
|
|
92
|
-
set screenshot_target_short_side(value: number);
|
|
93
|
-
set screenshot_use_raw_size(value: boolean);
|
|
94
|
-
post_connection(): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
95
|
-
post_click(x: number, y: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
96
|
-
post_swipe(x1: number, y1: number, x2: number, y2: number, duration: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
97
|
-
post_click_key(keycode: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
98
|
-
post_key_down(keycode: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
99
|
-
post_key_up(keycode: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
100
|
-
post_input_text(text: string): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
101
|
-
post_start_app(intent: string): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
102
|
-
post_stop_app(intent: string): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
103
|
-
post_touch_down(contact: number, x: number, y: number, pressure: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
104
|
-
post_touch_move(contact: number, x: number, y: number, pressure: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
105
|
-
post_touch_up(contact: number): Job<maa.CtrlId, JobSource<maa.CtrlId>>;
|
|
106
|
-
post_screencap(): ImageJob;
|
|
107
|
-
get connected(): boolean;
|
|
108
|
-
get cached_image(): ArrayBuffer | null;
|
|
109
|
-
get uuid(): string | null;
|
|
110
|
-
}
|
|
111
|
-
export declare class AdbController extends ControllerBase {
|
|
112
|
-
constructor(adb_path: string, address: string, screencap_methods: maa.ScreencapOrInputMethods, input_methods: maa.ScreencapOrInputMethods, config: string, agent?: string);
|
|
113
|
-
static agent_path(): string;
|
|
114
|
-
static find(adb?: string): Promise<[name: string, adb_path: string, address: string, screencap_methods: maa.Uint64, input_methods: maa.Uint64, config: string][] | null>;
|
|
115
|
-
}
|
|
116
|
-
export declare class Win32Controller extends ControllerBase {
|
|
117
|
-
constructor(hwnd: maa.DesktopHandle | null, screencap_methods: maa.ScreencapOrInputMethods, input_methods: maa.ScreencapOrInputMethods);
|
|
118
|
-
static find(): Promise<[handle: maa.DesktopHandle, class_name: string, window_name: string][] | null>;
|
|
119
|
-
}
|
|
120
|
-
export declare class DbgController extends ControllerBase {
|
|
121
|
-
constructor(read_path: string, write_path: string, type: maa.Uint64, config: string);
|
|
122
|
-
}
|
|
123
|
-
export declare abstract class CustomControllerActor {
|
|
124
|
-
abstract connect(): maa.MaybePromise<boolean>;
|
|
125
|
-
abstract request_uuid(): maa.MaybePromise<string | null>;
|
|
126
|
-
abstract start_app(intent: string): maa.MaybePromise<boolean>;
|
|
127
|
-
abstract stop_app(intent: string): maa.MaybePromise<boolean>;
|
|
128
|
-
abstract screencap(): maa.MaybePromise<ImageData | null>;
|
|
129
|
-
abstract click(x: number, y: number): maa.MaybePromise<boolean>;
|
|
130
|
-
abstract swipe(x1: number, y1: number, x2: number, y2: number, duration: number): maa.MaybePromise<boolean>;
|
|
131
|
-
abstract touch_down(contact: number, x: number, y: number, pressure: number): maa.MaybePromise<boolean>;
|
|
132
|
-
abstract touch_move(contact: number, x: number, y: number, pressure: number): maa.MaybePromise<boolean>;
|
|
133
|
-
abstract touch_up(contact: number): maa.MaybePromise<boolean>;
|
|
134
|
-
abstract click_key(keycode: number): maa.MaybePromise<boolean>;
|
|
135
|
-
abstract input_text(text: string): maa.MaybePromise<boolean>;
|
|
136
|
-
abstract key_down(keycode: number): maa.MaybePromise<boolean>;
|
|
137
|
-
abstract key_up(keycode: number): maa.MaybePromise<boolean>;
|
|
138
|
-
}
|
|
139
|
-
export declare class CustomControllerActorDefaultImpl extends CustomControllerActor {
|
|
140
|
-
connect(): maa.MaybePromise<boolean>;
|
|
141
|
-
request_uuid(): maa.MaybePromise<string | null>;
|
|
142
|
-
start_app(intent: string): maa.MaybePromise<boolean>;
|
|
143
|
-
stop_app(intent: string): maa.MaybePromise<boolean>;
|
|
144
|
-
screencap(): maa.MaybePromise<ImageData | null>;
|
|
145
|
-
click(x: number, y: number): maa.MaybePromise<boolean>;
|
|
146
|
-
swipe(x1: number, y1: number, x2: number, y2: number, duration: number): maa.MaybePromise<boolean>;
|
|
147
|
-
touch_down(contact: number, x: number, y: number, pressure: number): maa.MaybePromise<boolean>;
|
|
148
|
-
touch_move(contact: number, x: number, y: number, pressure: number): maa.MaybePromise<boolean>;
|
|
149
|
-
touch_up(contact: number): maa.MaybePromise<boolean>;
|
|
150
|
-
click_key(keycode: number): maa.MaybePromise<boolean>;
|
|
151
|
-
input_text(text: string): maa.MaybePromise<boolean>;
|
|
152
|
-
key_down(keycode: number): maa.MaybePromise<boolean>;
|
|
153
|
-
key_up(keycode: number): maa.MaybePromise<boolean>;
|
|
154
|
-
}
|
|
155
|
-
export declare class CustomController extends ControllerBase {
|
|
156
|
-
constructor(actor: CustomControllerActor);
|
|
157
|
-
}
|
|
158
|
-
export {};
|
|
225
|
+
|
|
226
|
+
export {}
|
package/dist/global.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
namespace maa {
|
|
3
|
+
const Global: {
|
|
4
|
+
get version_from_macro(): string
|
|
5
|
+
get version(): string
|
|
6
|
+
set log_dir(value: string)
|
|
7
|
+
set save_draw(value: boolean)
|
|
8
|
+
set stdout_level(
|
|
9
|
+
value: 'Off' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'All',
|
|
10
|
+
)
|
|
11
|
+
set debug_mode(value: boolean)
|
|
12
|
+
config_init_option(user_path: string, default_json?: string): void
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {}
|
package/dist/index-client.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
1
|
+
/// <reference path="./client.d.ts" />
|
|
2
|
+
/// <reference path="./constant.d.ts" />
|
|
3
|
+
/// <reference path="./context.d.ts" />
|
|
4
|
+
/// <reference path="./controller.d.ts" />
|
|
5
|
+
/// <reference path="./global.d.ts" />
|
|
6
|
+
/// <reference path="./job.d.ts" />
|
|
7
|
+
/// <reference path="./pipeline.d.ts" />
|
|
8
|
+
/// <reference path="./resource.d.ts" />
|
|
9
|
+
/// <reference path="./tasker.d.ts" />
|
|
10
|
+
/// <reference path="./types.d.ts" />
|
|
11
|
+
|
|
12
|
+
export {}
|