@maaxyz/maa-node 5.3.0-beta.6 → 5.3.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.
@@ -125,39 +125,6 @@ declare global {
125
125
  ScreencapOrInputMethods
126
126
  >
127
127
  const DbgControllerType: Record<'CarouselImage' | 'ReplayRecording', Uint64>
128
- const RecognitionType: Record<
129
- | 'DirectHit'
130
- | 'TemplateMatch'
131
- | 'FeatureMatch'
132
- | 'ColorMatch'
133
- | 'OCR'
134
- | 'NeuralNetworkClassify'
135
- | 'NeuralNetworkDetect'
136
- | 'Custom',
137
- string
138
- >
139
- const ActionType: Record<
140
- | 'DoNothing'
141
- | 'Click'
142
- | 'LongPress'
143
- | 'Swipe'
144
- | 'MultiSwipe'
145
- | 'TouchDown'
146
- | 'TouchMove'
147
- | 'TouchUp'
148
- | 'ClickKey'
149
- | 'LongPressKey'
150
- | 'KeyDown'
151
- | 'KeyUp'
152
- | 'InputText'
153
- | 'StartApp'
154
- | 'StopApp'
155
- | 'StopTask'
156
- | 'Scroll'
157
- | 'Command'
158
- | 'Custom',
159
- string
160
- >
161
128
  }
162
129
  }
163
130
  export {}
@@ -24,7 +24,13 @@ declare global {
24
24
  ColorMatch: 'Horizontal' | 'Vertical' | 'Score' | 'Area' | 'Random'
25
25
  OCR: 'Horizontal' | 'Vertical' | 'Area' | 'Length' | 'Random' | 'Expected'
26
26
  NeuralNetworkClassify: 'Horizontal' | 'Vertical' | 'Score' | 'Random' | 'Expected'
27
- NeuralNetworkDetect: 'Horizontal' | 'Vertical' | 'Score' | 'Area' | 'Random' | 'Expected'
27
+ NeuralNetworkDetect:
28
+ | 'Horizontal'
29
+ | 'Vertical'
30
+ | 'Score'
31
+ | 'Area'
32
+ | 'Random'
33
+ | 'Expected'
28
34
  }
29
35
 
30
36
  type RecognitionDirectHit = {
@@ -142,25 +148,22 @@ declare global {
142
148
  Mode
143
149
  >
144
150
 
145
- type SubRecognition<Mode> = {
146
- sub_name?: string
147
- recognition?: string | { type: string; param?: unknown }
148
- roi?: Rect | NodeName
149
- roi_offset?: Rect
150
- template?: MaybeArray<string, Mode>
151
- threshold?: MaybeArray<number, Mode>
152
- expected?: MaybeArray<string | number, Mode>
153
- [key: string]: unknown
154
- }
155
-
156
- type RecognitionAnd<Mode> = {
157
- all_of: SubRecognition<Mode>[]
158
- box_index?: number
159
- }
151
+ type RecognitionAnd<Mode> = RequiredIfStrict<
152
+ {
153
+ all_of?: Recognition<Mode>['recognition'][]
154
+ box_index?: number
155
+ },
156
+ 'all_of',
157
+ Mode
158
+ >
160
159
 
161
- type RecognitionOr<Mode> = {
162
- any_of: SubRecognition<Mode>[]
163
- }
160
+ type RecognitionOr<Mode> = RequiredIfStrict<
161
+ {
162
+ any_of: Recognition<Mode>['recognition'][]
163
+ },
164
+ 'any_of',
165
+ Mode
166
+ >
164
167
 
165
168
  type MixReco<Type extends string, Param, Mode> =
166
169
  | {
@@ -176,6 +179,18 @@ declare global {
176
179
  Mode
177
180
  >
178
181
 
182
+ type RecognitionType =
183
+ | 'DirectHit'
184
+ | 'TemplateMatch'
185
+ | 'FeatureMatch'
186
+ | 'ColorMatch'
187
+ | 'OCR'
188
+ | 'NeuralNetworkClassify'
189
+ | 'NeuralNetworkDetect'
190
+ | 'And'
191
+ | 'Or'
192
+ | 'Custom'
193
+
179
194
  type Recognition<Mode> =
180
195
  | RemoveIfDump<
181
196
  {
@@ -322,6 +337,7 @@ declare global {
322
337
  args?: string[]
323
338
  detach?: boolean
324
339
  },
340
+ 'exec',
325
341
  Mode
326
342
  >
327
343
 
@@ -359,6 +375,29 @@ declare global {
359
375
  }
360
376
  }
361
377
 
378
+ type ActionType =
379
+ | 'DoNothing'
380
+ | 'Click'
381
+ | 'LongPress'
382
+ | 'Swipe'
383
+ | 'MultiSwipe'
384
+ | 'TouchDown'
385
+ | 'TouchMove'
386
+ | 'TouchUp'
387
+ | 'Key'
388
+ | 'ClickKey'
389
+ | 'LongPressKey'
390
+ | 'KeyDown'
391
+ | 'KeyUp'
392
+ | 'InputText'
393
+ | 'StartApp'
394
+ | 'StopApp'
395
+ | 'Scroll'
396
+ | 'StopTask'
397
+ | 'Command'
398
+ | 'Shell'
399
+ | 'Custom'
400
+
362
401
  type Action<Mode> =
363
402
  | RemoveIfDump<
364
403
  {
@@ -26,6 +26,9 @@ declare global {
26
26
  unregister_custom_action(name: string): void
27
27
  clear_custom_action(): void
28
28
  post_bundle(path: string): Job<ResId, Resource>
29
+ post_ocr_model(path: string): Job<ResId, Resource>
30
+ post_pipeline(path: string): Job<ResId, Resource>
31
+ post_image(path: string): Job<ResId, Resource>
29
32
  override_pipeline(
30
33
  pipeline_override: Record<string, unknown> | Record<string, unknown>[],
31
34
  ): void
package/dist/tasker.d.ts CHANGED
@@ -137,6 +137,17 @@ declare global {
137
137
  entry: string,
138
138
  pipeline_override?: Record<string, unknown> | Record<string, unknown>[],
139
139
  ): TaskJob
140
+ post_recognition(
141
+ reco_type: RecognitionType,
142
+ reco_param: Record<string, unknown> | Record<string, unknown>[],
143
+ image: ImageData,
144
+ ): TaskJob
145
+ post_action(
146
+ action_type: ActionType,
147
+ action_param: Record<string, unknown> | Record<string, unknown>[],
148
+ box: maa.Rect,
149
+ reco_detail?: string,
150
+ ): TaskJob
140
151
  post_stop(): TaskJob
141
152
  status(id: TaskId): Status
142
153
  wait(id: TaskId): Promise<Status>
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.3.0-beta.6",
31
+ "version": "5.3.0",
32
32
  "optionalDependencies": {
33
- "@maaxyz/maa-node-darwin-arm64": "5.3.0-beta.6",
34
- "@maaxyz/maa-node-darwin-x64": "5.3.0-beta.6",
35
- "@maaxyz/maa-node-linux-arm64": "5.3.0-beta.6",
36
- "@maaxyz/maa-node-linux-x64": "5.3.0-beta.6",
37
- "@maaxyz/maa-node-win32-arm64": "5.3.0-beta.6",
38
- "@maaxyz/maa-node-win32-x64": "5.3.0-beta.6"
33
+ "@maaxyz/maa-node-darwin-arm64": "5.3.0",
34
+ "@maaxyz/maa-node-darwin-x64": "5.3.0",
35
+ "@maaxyz/maa-node-linux-arm64": "5.3.0",
36
+ "@maaxyz/maa-node-linux-x64": "5.3.0",
37
+ "@maaxyz/maa-node-win32-arm64": "5.3.0",
38
+ "@maaxyz/maa-node-win32-x64": "5.3.0"
39
39
  }
40
40
  }