@maaxyz/maa-node 3.0.0-beta.1 → 3.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.
- package/dist/index.js +5 -9
- package/dist/maa.d.ts +1 -1
- package/dist/tasker.d.ts +13 -24
- package/package.json +7 -7
- package/src/maa.d.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/tasker.ts +16 -31
package/dist/index.js
CHANGED
|
@@ -427,7 +427,7 @@ var TaskerBase = class {
|
|
|
427
427
|
set parsed_notify(cb) {
|
|
428
428
|
this.notify = (msg, details) => {
|
|
429
429
|
return cb({
|
|
430
|
-
msg: msg.replace(/^
|
|
430
|
+
msg: msg.replace(/^(?:Tasker|Node)?\./, ""),
|
|
431
431
|
...JSON.parse(details)
|
|
432
432
|
});
|
|
433
433
|
};
|
|
@@ -467,11 +467,7 @@ var TaskerBase = class {
|
|
|
467
467
|
return import_maa2.default.tasker_running(this.handle);
|
|
468
468
|
}
|
|
469
469
|
post_stop() {
|
|
470
|
-
return new TaskJob(
|
|
471
|
-
this,
|
|
472
|
-
this.#source,
|
|
473
|
-
import_maa2.default.tasker_post_stop(this.handle)
|
|
474
|
-
);
|
|
470
|
+
return new TaskJob(this, this.#source, import_maa2.default.tasker_post_stop(this.handle));
|
|
475
471
|
}
|
|
476
472
|
get resource() {
|
|
477
473
|
const res = import_maa2.default.tasker_get_resource(this.handle);
|
|
@@ -537,8 +533,8 @@ var TaskerBase = class {
|
|
|
537
533
|
return null;
|
|
538
534
|
}
|
|
539
535
|
}
|
|
540
|
-
latest_node(
|
|
541
|
-
return import_maa2.default.tasker_get_latest_node(this.handle,
|
|
536
|
+
latest_node(node) {
|
|
537
|
+
return import_maa2.default.tasker_get_latest_node(this.handle, node);
|
|
542
538
|
}
|
|
543
539
|
};
|
|
544
540
|
var Tasker = class extends TaskerBase {
|
|
@@ -730,7 +726,7 @@ var ResourceBase = class {
|
|
|
730
726
|
return import_maa3.default.resource_get_hash(this.handle);
|
|
731
727
|
}
|
|
732
728
|
get task_list() {
|
|
733
|
-
return import_maa3.default.
|
|
729
|
+
return import_maa3.default.resource_get_node_list(this.handle);
|
|
734
730
|
}
|
|
735
731
|
};
|
|
736
732
|
var Resource = class extends ResourceBase {
|
package/dist/maa.d.ts
CHANGED
|
@@ -229,7 +229,7 @@ export declare function resource_status(handle: ResourceHandle, res_id: ResId):
|
|
|
229
229
|
export declare function resource_wait(handle: ResourceHandle, res_id: ResId): Promise<Status>
|
|
230
230
|
export declare function resource_loaded(handle: ResourceHandle): boolean
|
|
231
231
|
export declare function resource_get_hash(handle: ResourceHandle): string | null
|
|
232
|
-
export declare function
|
|
232
|
+
export declare function resource_get_node_list(handle: ResourceHandle): string[] | null
|
|
233
233
|
|
|
234
234
|
// tasker.cpp
|
|
235
235
|
|
package/dist/tasker.d.ts
CHANGED
|
@@ -40,31 +40,20 @@ export type TaskerNotify = {
|
|
|
40
40
|
} & ({
|
|
41
41
|
msg: 'Task.Started' | 'Task.Completed' | 'Task.Failed';
|
|
42
42
|
} | {
|
|
43
|
-
msg: '
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
name: string;
|
|
48
|
-
/**
|
|
49
|
-
* Won't be `null` for msg `Debug.Hit`
|
|
50
|
-
*/
|
|
51
|
-
box: maa.FlatRect | null;
|
|
52
|
-
detail: string;
|
|
53
|
-
};
|
|
43
|
+
msg: 'NextList.Starting' | 'NextList.Succeeded' | 'NextList.Failed';
|
|
44
|
+
task_id: number;
|
|
45
|
+
name: string;
|
|
46
|
+
list: string[];
|
|
54
47
|
} | {
|
|
55
|
-
msg: '
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
name: string;
|
|
60
|
-
reco_id: maa.RecoId;
|
|
61
|
-
times: number;
|
|
62
|
-
completed: boolean;
|
|
63
|
-
};
|
|
48
|
+
msg: 'Recognition.Starting' | 'Recognition.Succeeded' | 'Recognition.Failed';
|
|
49
|
+
task_id: number;
|
|
50
|
+
reco_id: number;
|
|
51
|
+
name: string;
|
|
64
52
|
} | {
|
|
65
|
-
msg: '
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
msg: 'Action.Starting' | 'Action.Succeeded' | 'Action.Failed';
|
|
54
|
+
task_id: number;
|
|
55
|
+
node_id: number;
|
|
56
|
+
name: string;
|
|
68
57
|
});
|
|
69
58
|
export declare class TaskerBase {
|
|
70
59
|
#private;
|
|
@@ -120,7 +109,7 @@ export declare class TaskerBase {
|
|
|
120
109
|
} | null)[];
|
|
121
110
|
status: maa.Status;
|
|
122
111
|
} | null;
|
|
123
|
-
latest_node(
|
|
112
|
+
latest_node(node: string): maa.NodeId | null;
|
|
124
113
|
}
|
|
125
114
|
export declare class Tasker extends TaskerBase {
|
|
126
115
|
constructor();
|
package/package.json
CHANGED
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"prettier": "^3.3.2",
|
|
22
22
|
"typescript": "^5.4.5"
|
|
23
23
|
},
|
|
24
|
-
"version": "3.0.0
|
|
24
|
+
"version": "3.0.0",
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@maaxyz/maa-node-darwin-arm64": "3.0.0
|
|
27
|
-
"@maaxyz/maa-node-darwin-x64": "3.0.0
|
|
28
|
-
"@maaxyz/maa-node-linux-arm64": "3.0.0
|
|
29
|
-
"@maaxyz/maa-node-linux-x64": "3.0.0
|
|
30
|
-
"@maaxyz/maa-node-win32-arm64": "3.0.0
|
|
31
|
-
"@maaxyz/maa-node-win32-x64": "3.0.0
|
|
26
|
+
"@maaxyz/maa-node-darwin-arm64": "3.0.0",
|
|
27
|
+
"@maaxyz/maa-node-darwin-x64": "3.0.0",
|
|
28
|
+
"@maaxyz/maa-node-linux-arm64": "3.0.0",
|
|
29
|
+
"@maaxyz/maa-node-linux-x64": "3.0.0",
|
|
30
|
+
"@maaxyz/maa-node-win32-arm64": "3.0.0",
|
|
31
|
+
"@maaxyz/maa-node-win32-x64": "3.0.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/maa.d.ts
CHANGED
|
@@ -229,7 +229,7 @@ export declare function resource_status(handle: ResourceHandle, res_id: ResId):
|
|
|
229
229
|
export declare function resource_wait(handle: ResourceHandle, res_id: ResId): Promise<Status>
|
|
230
230
|
export declare function resource_loaded(handle: ResourceHandle): boolean
|
|
231
231
|
export declare function resource_get_hash(handle: ResourceHandle): string | null
|
|
232
|
-
export declare function
|
|
232
|
+
export declare function resource_get_node_list(handle: ResourceHandle): string[] | null
|
|
233
233
|
|
|
234
234
|
// tasker.cpp
|
|
235
235
|
|
package/src/resource.ts
CHANGED
package/src/tasker.ts
CHANGED
|
@@ -48,33 +48,22 @@ export type TaskerNotify = {
|
|
|
48
48
|
msg: 'Task.Started' | 'Task.Completed' | 'Task.Failed'
|
|
49
49
|
}
|
|
50
50
|
| {
|
|
51
|
-
msg: '
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
name: string
|
|
56
|
-
/**
|
|
57
|
-
* Won't be `null` for msg `Debug.Hit`
|
|
58
|
-
*/
|
|
59
|
-
box: maa.FlatRect | null
|
|
60
|
-
detail: string
|
|
61
|
-
}
|
|
51
|
+
msg: 'NextList.Starting' | 'NextList.Succeeded' | 'NextList.Failed'
|
|
52
|
+
task_id: number
|
|
53
|
+
name: string
|
|
54
|
+
list: string[]
|
|
62
55
|
}
|
|
63
56
|
| {
|
|
64
|
-
msg: '
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
name: string
|
|
69
|
-
reco_id: maa.RecoId
|
|
70
|
-
times: number
|
|
71
|
-
completed: boolean
|
|
72
|
-
}
|
|
57
|
+
msg: 'Recognition.Starting' | 'Recognition.Succeeded' | 'Recognition.Failed'
|
|
58
|
+
task_id: number
|
|
59
|
+
reco_id: number
|
|
60
|
+
name: string
|
|
73
61
|
}
|
|
74
62
|
| {
|
|
75
|
-
msg: '
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
msg: 'Action.Starting' | 'Action.Succeeded' | 'Action.Failed'
|
|
64
|
+
task_id: number
|
|
65
|
+
node_id: number
|
|
66
|
+
name: string
|
|
78
67
|
}
|
|
79
68
|
)
|
|
80
69
|
|
|
@@ -87,7 +76,7 @@ export class TaskerBase {
|
|
|
87
76
|
set parsed_notify(cb: (msg: TaskerNotify) => maa.MaybePromise<void>) {
|
|
88
77
|
this.notify = (msg, details) => {
|
|
89
78
|
return cb({
|
|
90
|
-
msg: msg.replace(/^
|
|
79
|
+
msg: msg.replace(/^(?:Tasker|Node)?\./, '') as any,
|
|
91
80
|
...JSON.parse(details)
|
|
92
81
|
})
|
|
93
82
|
}
|
|
@@ -134,11 +123,7 @@ export class TaskerBase {
|
|
|
134
123
|
}
|
|
135
124
|
|
|
136
125
|
post_stop() {
|
|
137
|
-
return new TaskJob(
|
|
138
|
-
this,
|
|
139
|
-
this.#source,
|
|
140
|
-
maa.tasker_post_stop(this.handle)
|
|
141
|
-
)
|
|
126
|
+
return new TaskJob(this, this.#source, maa.tasker_post_stop(this.handle))
|
|
142
127
|
}
|
|
143
128
|
|
|
144
129
|
get resource() {
|
|
@@ -211,8 +196,8 @@ export class TaskerBase {
|
|
|
211
196
|
}
|
|
212
197
|
}
|
|
213
198
|
|
|
214
|
-
latest_node(
|
|
215
|
-
return maa.tasker_get_latest_node(this.handle,
|
|
199
|
+
latest_node(node: string) {
|
|
200
|
+
return maa.tasker_get_latest_node(this.handle, node)
|
|
216
201
|
}
|
|
217
202
|
}
|
|
218
203
|
|