@maaxyz/maa-node 5.10.0-beta.1 → 5.10.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.
@@ -167,7 +167,6 @@ declare global {
167
167
  | 'PostToPid',
168
168
  ScreencapOrInputMethods
169
169
  >
170
- const DbgControllerType: Record<'CarouselImage' | 'ReplayRecording', Uint64>
171
170
  const GamepadType: Record<'Xbox360' | 'DualShock4', Uint64>
172
171
  }
173
172
  }
@@ -186,13 +186,13 @@ declare global {
186
186
  ): Job<CtrlId, Controller>
187
187
  post_touch_up(contact: number): Job<CtrlId, Controller>
188
188
  /**
189
- * Post a relative move action. Currently only supported by Win32 controller.
189
+ * Post a relative move action. Supported by Win32, MacOS, and custom controllers that implement relative_move.
190
190
  */
191
191
  post_relative_move(dx: number, dy: number): Job<CtrlId, Controller>
192
192
  post_key_down(keycode: number): Job<CtrlId, Controller>
193
193
  post_key_up(keycode: number): Job<CtrlId, Controller>
194
194
  /**
195
- * Post a scroll action. Supported by Win32 controller and custom controllers that implement scroll.
195
+ * Post a scroll action. Supported by Win32, MacOS, and custom controllers that implement scroll.
196
196
  * Using multiples of 120 (WHEEL_DELTA) is recommended for best compatibility.
197
197
  */
198
198
  post_scroll(dx: number, dy: number): Job<CtrlId, Controller>
@@ -263,11 +263,21 @@ declare global {
263
263
  }
264
264
 
265
265
  class DbgController extends Controller {
266
+ constructor(read_path: string)
267
+ }
268
+
269
+ class ReplayController extends Controller {
270
+ constructor(recording_path: string)
271
+ }
272
+
273
+ /**
274
+ * Proxy controller that wraps an existing controller and records all operations.
275
+ * The recorded file can be replayed using ReplayController.
276
+ */
277
+ class RecordController extends Controller {
266
278
  constructor(
267
- read_path: string,
268
- write_path: string,
269
- type: Uint64, // DbgControllerType
270
- config: string,
279
+ inner: Controller,
280
+ recording_path: string,
271
281
  )
272
282
  }
273
283
 
@@ -332,6 +342,8 @@ declare global {
332
342
  key_down?(keycode: number): maa.MaybePromise<boolean>
333
343
  key_up?(keycode: number): maa.MaybePromise<boolean>
334
344
  scroll?(dx: number, dy: number): maa.MaybePromise<boolean>
345
+ relative_move?(dx: number, dy: number): maa.MaybePromise<boolean>
346
+ shell?(cmd: string, timeout: number): maa.MaybePromise<string | null>
335
347
  inactive?(): maa.MaybePromise<boolean>
336
348
  get_info?(): maa.MaybePromise<string | null>
337
349
  }
package/package.json CHANGED
@@ -20,13 +20,13 @@
20
20
  "engines": {
21
21
  "node": ">= 20.0.0"
22
22
  },
23
- "version": "5.10.0-beta.1",
23
+ "version": "5.10.0-beta.2",
24
24
  "optionalDependencies": {
25
- "@maaxyz/maa-node-darwin-arm64": "5.10.0-beta.1",
26
- "@maaxyz/maa-node-darwin-x64": "5.10.0-beta.1",
27
- "@maaxyz/maa-node-linux-arm64": "5.10.0-beta.1",
28
- "@maaxyz/maa-node-linux-x64": "5.10.0-beta.1",
29
- "@maaxyz/maa-node-win32-arm64": "5.10.0-beta.1",
30
- "@maaxyz/maa-node-win32-x64": "5.10.0-beta.1"
25
+ "@maaxyz/maa-node-darwin-arm64": "5.10.0-beta.2",
26
+ "@maaxyz/maa-node-darwin-x64": "5.10.0-beta.2",
27
+ "@maaxyz/maa-node-linux-arm64": "5.10.0-beta.2",
28
+ "@maaxyz/maa-node-linux-x64": "5.10.0-beta.2",
29
+ "@maaxyz/maa-node-win32-arm64": "5.10.0-beta.2",
30
+ "@maaxyz/maa-node-win32-x64": "5.10.0-beta.2"
31
31
  }
32
32
  }