rust-rpa 0.2.0-beta.4 → 0.2.0-beta.7

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 (2) hide show
  1. package/index.d.ts +15 -1
  2. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -39,6 +39,11 @@ export interface FindTextOptions {
39
39
  /** 查找区域列表,若为空则在全图查找 */
40
40
  regions?: Array<MatchRegion>
41
41
  }
42
+ /** 文字识别选项 */
43
+ export interface RecognizeTextOptions {
44
+ /** 识别区域列表,若为空则识别全图 */
45
+ regions?: Array<MatchRegion>
46
+ }
42
47
  /** 等待选项 */
43
48
  export interface WaitOptions {
44
49
  /** 查找区域列表,若为空则在全图查找 */
@@ -425,6 +430,10 @@ export declare class ImageData {
425
430
  *
426
431
  * 使用 PP-OCRv5 模型进行文字检测和识别,支持中文、英文、日文
427
432
  *
433
+ * # Arguments
434
+ *
435
+ * * `options` - 识别选项(可选),可指定识别区域以提升速度
436
+ *
428
437
  * # Example
429
438
  *
430
439
  * ```javascript
@@ -433,9 +442,14 @@ export declare class ImageData {
433
442
  * for (const result of results) {
434
443
  * console.log(`Text: ${result.text}, Position: (${result.x}, ${result.y})`);
435
444
  * }
445
+ *
446
+ * // 在指定区域中识别
447
+ * const results2 = await image.recognizeText({
448
+ * regions: [{ x: 100, y: 100, width: 200, height: 200 }]
449
+ * });
436
450
  * ```
437
451
  */
438
- recognizeText(): Promise<Array<TextRecognitionResult>>
452
+ recognizeText(options?: RecognizeTextOptions | null): Promise<Array<TextRecognitionResult>>
439
453
  /**
440
454
  * 在图片中查找指定文字(异步)
441
455
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rust-rpa",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0-beta.7",
4
4
  "description": "Rust-based RPA automation library for Node.js",
5
5
  "type": "commonjs",
6
6
  "main": "index.js",
@@ -43,7 +43,7 @@
43
43
  "build:windows-x86": "napi build --platform --release --target i686-pc-windows-msvc --cross-compile --manifest-path crates/bindings/Cargo.toml && npm run postbuild",
44
44
  "build:windows-all": "npm run build:windows-x64 && npm run build:windows-x86",
45
45
  "build:all": "npm run build:macos-universal && npm run build:windows-all",
46
- "postbuild": "node scripts/postbuild.js",
46
+ "postbuild": "node scripts/postbuild.cjs",
47
47
  "download-models": "bash scripts/download-models.sh",
48
48
  "download-charset": "bash scripts/download-charset.sh",
49
49
  "download-paddle-models": "bash scripts/download-paddle-models.sh",
@@ -69,9 +69,9 @@
69
69
  "commander": "^14.0.3"
70
70
  },
71
71
  "optionalDependencies": {
72
- "@alibot/rust-rpa-win32-x64-msvc": "0.2.0-beta.4",
73
- "@alibot/rust-rpa-win32-ia32-msvc": "0.2.0-beta.4",
74
- "@alibot/rust-rpa-darwin-x64": "0.2.0-beta.4",
75
- "@alibot/rust-rpa-darwin-arm64": "0.2.0-beta.4"
72
+ "@alibot/rust-rpa-win32-x64-msvc": "0.2.0-beta.7",
73
+ "@alibot/rust-rpa-win32-ia32-msvc": "0.2.0-beta.7",
74
+ "@alibot/rust-rpa-darwin-x64": "0.2.0-beta.7",
75
+ "@alibot/rust-rpa-darwin-arm64": "0.2.0-beta.7"
76
76
  }
77
77
  }