@oh-my-pi/pi-natives 18.4.0 → 18.4.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 (2) hide show
  1. package/native/index.d.ts +15 -4
  2. package/package.json +7 -7
package/native/index.d.ts CHANGED
@@ -416,9 +416,9 @@ export declare class TextPredictor {
416
416
  /**
417
417
  * Dedicated writer thread for one terminal fd.
418
418
  *
419
- * Constructed by the TUI's `ProcessTerminal` around stdout. The fd is
420
- * `dup(2)`'d at construction and closed on drop, so later manipulation of the
421
- * original descriptor does not affect the pump.
419
+ * `dup(2)`'d at construction and closed on drop. The duplicate keeps the
420
+ * pump's fd alive if the original is closed or replaced; file-status flags
421
+ * such as `O_NONBLOCK` are shared and handled by polling for `POLLOUT`.
422
422
  */
423
423
  export declare class TtyWriter {
424
424
  /**
@@ -1739,7 +1739,8 @@ export interface GlobResult {
1739
1739
  *
1740
1740
  * # Arguments
1741
1741
  * - `options`: Pattern, path, filters, and output mode.
1742
- * - `on_match`: Optional callback invoked per match/result.
1742
+ * - `on_match`: Optional callback invoked per returned match/result, after the
1743
+ * search (never called when `options.onMatches` streams instead).
1743
1744
  *
1744
1745
  * # Returns
1745
1746
  * Aggregated results across matching files.
@@ -1816,6 +1817,16 @@ export interface GrepOptions {
1816
1817
  * absent).
1817
1818
  */
1818
1819
  filesystem?: ShellFilesystem
1820
+ /**
1821
+ * Stream results instead of returning them: called on the JS thread with
1822
+ * batches (at most 1024 entries, files in no particular order) of what
1823
+ * `matches` would hold, while the search runs. A slow callback pauses the
1824
+ * search instead of buffering, every call returns before the promise
1825
+ * settles, and the result then carries counts with empty `matches`.
1826
+ * A throw rejects the search with it. Incompatible with `maxCount` and
1827
+ * `offset`.
1828
+ */
1829
+ onMatches?: (matches: GrepMatch[]) => void
1819
1830
  }
1820
1831
 
1821
1832
  /** Output mode for [`search`] and [`grep`] (string values match JS callers). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "18.4.0",
3
+ "version": "18.4.1",
4
4
  "description": "Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API",
5
5
  "type": "module",
6
6
  "homepage": "https://omp.sh",
@@ -114,11 +114,11 @@
114
114
  }
115
115
  },
116
116
  "optionalDependencies": {
117
- "@oh-my-pi/pi-natives-linux-x64": "18.4.0",
118
- "@oh-my-pi/pi-natives-linux-arm64": "18.4.0",
119
- "@oh-my-pi/pi-natives-darwin-x64": "18.4.0",
120
- "@oh-my-pi/pi-natives-darwin-arm64": "18.4.0",
121
- "@oh-my-pi/pi-natives-win32-x64": "18.4.0",
122
- "@oh-my-pi/pi-natives-win32-arm64": "18.4.0"
117
+ "@oh-my-pi/pi-natives-linux-x64": "18.4.1",
118
+ "@oh-my-pi/pi-natives-linux-arm64": "18.4.1",
119
+ "@oh-my-pi/pi-natives-darwin-x64": "18.4.1",
120
+ "@oh-my-pi/pi-natives-darwin-arm64": "18.4.1",
121
+ "@oh-my-pi/pi-natives-win32-x64": "18.4.1",
122
+ "@oh-my-pi/pi-natives-win32-arm64": "18.4.1"
123
123
  }
124
124
  }