rust-rpa 0.2.1 → 0.2.2-beta.1

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.
Files changed (3) hide show
  1. package/README.md +17 -0
  2. package/index.d.ts +4 -0
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -35,6 +35,7 @@ npm install rust-rpa
35
35
  ### Windows
36
36
  - Windows 10 或更高版本 (x64 或 x86)
37
37
  - 某些操作可能需要管理员权限
38
+ - **编译需要**: Visual Studio Build Tools + LLVM (ocr-rs 依赖 bindgen,需要 libclang)
38
39
 
39
40
  ### macOS
40
41
  - macOS 10.13 或更高版本 (Intel 或 Apple Silicon)
@@ -205,6 +206,8 @@ const windows = Window.all();
205
206
  - `isMaximized(): boolean` - 是否最大化
206
207
  - `isFocused(): boolean` - 是否聚焦
207
208
  - `bringToFront(): Promise<void>` - 将窗口置于最前(激活并置顶)
209
+ - `maximize(): Promise<void>` - 最大化窗口
210
+ - `minimize(): Promise<void>` - 最小化窗口
208
211
  - `currentMonitor(): Monitor` - 获取窗口所在显示器
209
212
  - `currentMonitorId(): number` - 获取窗口所在显示器的 ID
210
213
  - `getBounds(): WindowBounds` - 获取窗口边界(位置和大小)
@@ -793,6 +796,7 @@ interface WaitOptions {
793
796
  - [x] 图像保存到文件
794
797
  - [x] 剪贴板操作
795
798
  - [x] 窗口操作(置顶、移动、调整大小、父进程查询)
799
+ - [x] 窗口最大化/最小化
796
800
  - [x] OCR 文字识别(基于 PP-OCRv5_mobile)
797
801
  - [x] 文字位置查找(findText)
798
802
  - [x] 等待文字、图标出现(waitText/waitIcon)
@@ -801,6 +805,19 @@ interface WaitOptions {
801
805
 
802
806
  ## 更新日志
803
807
 
808
+ ### 0.2.2
809
+ - **findText|waitText|clickText**匹配文字时,模糊匹配,例如o和0避免ocr识别不一致造成无法查找或者点击
810
+
811
+ #### 新功能
812
+
813
+ - **Window.maximize()**: 最大化窗口
814
+ - Windows 平台:使用 `ShowWindow(hwnd, SW_MAXIMIZE)` Win32 API
815
+ - macOS 平台:使用 AppleScript 点击窗口菜单中的"缩放"或"Zoom"菜单项
816
+ - **Window.minimize()**: 最小化窗口
817
+ - Windows 平台:使用 `ShowWindow(hwnd, SW_MINIMIZE)` Win32 API
818
+ - macOS 平台:使用 AppleScript 点击窗口菜单中的"最小化"或"Minimize"菜单项
819
+
820
+
804
821
  ### 0.2.1
805
822
 
806
823
  #### 新功能
package/index.d.ts CHANGED
@@ -821,6 +821,10 @@ export declare class Window {
821
821
  isFocused(): boolean
822
822
  /** 将窗口置于最前(激活并置顶) */
823
823
  bringToFront(): Promise<void>
824
+ /** 最大化窗口 */
825
+ maximize(): Promise<void>
826
+ /** 最小化窗口 */
827
+ minimize(): Promise<void>
824
828
  /** 转为 JSON 可序列化对象,便于 JSON.stringify(window.toJSON()) 输出 */
825
829
  toJSON(): WindowToJson
826
830
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-rpa",
3
- "version": "0.2.1",
3
+ "version": "0.2.2-beta.1",
4
4
  "description": "Rust-based RPA automation library for Node.js",
5
5
  "type": "commonjs",
6
6
  "main": "index.js",
@@ -69,9 +69,9 @@
69
69
  "commander": "^14.0.3"
70
70
  },
71
71
  "optionalDependencies": {
72
- "@alibot/rust-rpa-win32-x64-msvc": "0.2.1",
73
- "@alibot/rust-rpa-win32-ia32-msvc": "0.2.1",
74
- "@alibot/rust-rpa-darwin-x64": "0.2.1",
75
- "@alibot/rust-rpa-darwin-arm64": "0.2.1"
72
+ "@alibot/rust-rpa-win32-x64-msvc": "0.2.2-beta.1",
73
+ "@alibot/rust-rpa-win32-ia32-msvc": "0.2.2-beta.1",
74
+ "@alibot/rust-rpa-darwin-x64": "0.2.2-beta.1",
75
+ "@alibot/rust-rpa-darwin-arm64": "0.2.2-beta.1"
76
76
  }
77
77
  }