@oh-my-pi/pi-natives 17.4.2 → 18.0.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.
- package/native/index.d.ts +105 -1
- package/native/index.js +8 -1
- package/package.json +6 -6
package/native/index.d.ts
CHANGED
|
@@ -77,6 +77,24 @@ export declare class FileLock {
|
|
|
77
77
|
release(): void
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Stateful incremental syntax highlighter for streamed code.
|
|
82
|
+
*
|
|
83
|
+
* Carries syntect parser state across [`HighlightStream::push`] calls so
|
|
84
|
+
* chunked highlighting of a growing buffer is byte-identical to highlighting
|
|
85
|
+
* the concatenated text in one call. Feed newline-terminated complete lines;
|
|
86
|
+
* only the final push may omit the trailing newline. An unresolved language
|
|
87
|
+
* echoes input unchanged.
|
|
88
|
+
*/
|
|
89
|
+
export declare class HighlightStream {
|
|
90
|
+
/** Create a stream for `lang`; an unknown language yields a passthrough. */
|
|
91
|
+
constructor(lang: string | undefined | null, colors: HighlightColors)
|
|
92
|
+
/** Whether the language resolved to a grammar; `false` means passthrough. */
|
|
93
|
+
get supported(): boolean
|
|
94
|
+
/** Highlight the next chunk and advance parser state. */
|
|
95
|
+
push(chunk: string): string
|
|
96
|
+
}
|
|
97
|
+
|
|
80
98
|
/** WebRTC peer that accepts 16 kHz mono PCM and renders remote Opus audio. */
|
|
81
99
|
export declare class LiveWebRtcPeer {
|
|
82
100
|
/**
|
|
@@ -234,6 +252,48 @@ export declare class Shell {
|
|
|
234
252
|
liveBackgroundJobCount(): Promise<number>
|
|
235
253
|
}
|
|
236
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Dedicated writer thread for one terminal fd.
|
|
257
|
+
*
|
|
258
|
+
* Constructed by the TUI's `ProcessTerminal` around stdout. The fd is
|
|
259
|
+
* `dup(2)`'d at construction and closed on drop, so later manipulation of the
|
|
260
|
+
* original descriptor does not affect the pump.
|
|
261
|
+
*/
|
|
262
|
+
export declare class TtyWriter {
|
|
263
|
+
/**
|
|
264
|
+
* Start a pump thread for `fd` (typically 1). Fails on non-Unix hosts and
|
|
265
|
+
* when the descriptor cannot be duplicated.
|
|
266
|
+
*/
|
|
267
|
+
constructor(fd: number)
|
|
268
|
+
/**
|
|
269
|
+
* Enqueue terminal output; never blocks. Returns the total bytes now
|
|
270
|
+
* pending (including this chunk).
|
|
271
|
+
*
|
|
272
|
+
* Reads the JS string as UTF-16 through the thread's scratch arena and
|
|
273
|
+
* transcodes it with `xutf` straight into the shared back buffer, so a
|
|
274
|
+
* warm writer costs no per-call heap allocation.
|
|
275
|
+
*/
|
|
276
|
+
write(data: string): number
|
|
277
|
+
/** Bytes accepted but not yet written to the terminal. */
|
|
278
|
+
pending(): number
|
|
279
|
+
/** True once a write failed (dead PTY); queued output has been dropped. */
|
|
280
|
+
get dead(): boolean
|
|
281
|
+
/**
|
|
282
|
+
* Block the calling thread until the queue drains, the writer dies, or
|
|
283
|
+
* `timeout_ms` elapses. Returns true when fully drained. Exit paths only.
|
|
284
|
+
*/
|
|
285
|
+
flushSync(timeoutMs: number): boolean
|
|
286
|
+
/**
|
|
287
|
+
* Flush (bounded by `flush_timeout_ms`), stop the pump thread, and join it.
|
|
288
|
+
*
|
|
289
|
+
* A pump stuck in a blocked `write(2)` (stalled-but-alive PTY consumer)
|
|
290
|
+
* cannot be joined without freezing the caller: when the bounded flush
|
|
291
|
+
* times out the thread is detached instead and its dup'd fd is leaked —
|
|
292
|
+
* closing it under a blocked write would race kernel fd reuse.
|
|
293
|
+
*/
|
|
294
|
+
stop(flushTimeoutMs: number): void
|
|
295
|
+
}
|
|
296
|
+
|
|
237
297
|
/**
|
|
238
298
|
* Install the bounded Tokio runtime napi-rs adopts for async exports and the
|
|
239
299
|
* bounded Rayon global pool used by native parallel iterators.
|
|
@@ -279,7 +339,7 @@ export declare function __ompInstallTokioRuntime(): void
|
|
|
279
339
|
* `packages/natives/native/index.js` (which derives the name from
|
|
280
340
|
* `package.json#version`).
|
|
281
341
|
*/
|
|
282
|
-
export declare function
|
|
342
|
+
export declare function __piNativesV18_0_0(): void
|
|
283
343
|
|
|
284
344
|
/**
|
|
285
345
|
* Apply ast-grep rewrite rules to matching files; honors `dryRun` and returns
|
|
@@ -1399,6 +1459,31 @@ export declare enum MacOSAppearance {
|
|
|
1399
1459
|
Light = 'light'
|
|
1400
1460
|
}
|
|
1401
1461
|
|
|
1462
|
+
/**
|
|
1463
|
+
* Return the autocorrection macOS chooses for one completed-word range.
|
|
1464
|
+
*
|
|
1465
|
+
* Returns `null` when no confident correction exists or the service is
|
|
1466
|
+
* unavailable.
|
|
1467
|
+
* On macOS, the lookup runs on the dedicated spelling thread.
|
|
1468
|
+
*/
|
|
1469
|
+
export declare function macOSAutocorrectWord(text: string, start: number, length: number): Promise<string | null>
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Find every misspelled word using the active macOS dictionaries.
|
|
1473
|
+
*
|
|
1474
|
+
* Returns an empty list when Apple's spelling service is unavailable.
|
|
1475
|
+
* On macOS, the check runs on the dedicated spelling thread.
|
|
1476
|
+
*/
|
|
1477
|
+
export declare function macOSCheckSpelling(text: string): Promise<Array<SpellingRange>>
|
|
1478
|
+
|
|
1479
|
+
/**
|
|
1480
|
+
* Return macOS dictionary completions for one partial-word range.
|
|
1481
|
+
*
|
|
1482
|
+
* Returns an empty list when Apple's spelling service is unavailable.
|
|
1483
|
+
* On macOS, the lookup runs on the dedicated spelling thread.
|
|
1484
|
+
*/
|
|
1485
|
+
export declare function macOSCompleteWord(text: string, start: number, length: number): Promise<Array<string>>
|
|
1486
|
+
|
|
1402
1487
|
/**
|
|
1403
1488
|
* Options for starting a macOS power assertion.
|
|
1404
1489
|
*
|
|
@@ -1423,6 +1508,17 @@ export interface MacOSPowerAssertionOptions {
|
|
|
1423
1508
|
display?: boolean
|
|
1424
1509
|
}
|
|
1425
1510
|
|
|
1511
|
+
/** Whether the host can use Apple's native spelling service. */
|
|
1512
|
+
export declare function macOSSpellCheckerAvailable(): boolean
|
|
1513
|
+
|
|
1514
|
+
/**
|
|
1515
|
+
* Return macOS replacement guesses for one misspelled-word range.
|
|
1516
|
+
*
|
|
1517
|
+
* Returns an empty list when Apple's spelling service is unavailable.
|
|
1518
|
+
* On macOS, the lookup runs on the dedicated spelling thread.
|
|
1519
|
+
*/
|
|
1520
|
+
export declare function macOSSpellingGuesses(text: string, start: number, length: number): Promise<Array<string>>
|
|
1521
|
+
|
|
1426
1522
|
/** A single match in the content. */
|
|
1427
1523
|
export interface Match {
|
|
1428
1524
|
/** 1-indexed line number. */
|
|
@@ -1952,6 +2048,14 @@ export interface SnapcompactRenderOptions {
|
|
|
1952
2048
|
*/
|
|
1953
2049
|
export declare function snapcompactSupportedChars(font: string, chars: string): string
|
|
1954
2050
|
|
|
2051
|
+
/** A misspelled span measured in JavaScript/UTF-16 code units. */
|
|
2052
|
+
export interface SpellingRange {
|
|
2053
|
+
/** Inclusive UTF-16 start offset. */
|
|
2054
|
+
start: number
|
|
2055
|
+
/** UTF-16 length of the misspelled span. */
|
|
2056
|
+
length: number
|
|
2057
|
+
}
|
|
2058
|
+
|
|
1955
2059
|
/**
|
|
1956
2060
|
* Unified-diff hunks with jsdiff
|
|
1957
2061
|
* `structuredPatch(_, _, oldText, newText, _, _, { context }).hunks`
|
package/native/index.js
CHANGED
|
@@ -20,16 +20,18 @@ export const AudioCapture = nativeBindings.AudioCapture;
|
|
|
20
20
|
export const AudioPlayback = nativeBindings.AudioPlayback;
|
|
21
21
|
export const DesktopSession = nativeBindings.DesktopSession;
|
|
22
22
|
export const FileLock = nativeBindings.FileLock;
|
|
23
|
+
export const HighlightStream = nativeBindings.HighlightStream;
|
|
23
24
|
export const LiveWebRtcPeer = nativeBindings.LiveWebRtcPeer;
|
|
24
25
|
export const MacAppearanceObserver = nativeBindings.MacAppearanceObserver;
|
|
25
26
|
export const MacOSPowerAssertion = nativeBindings.MacOSPowerAssertion;
|
|
26
27
|
export const Process = nativeBindings.Process;
|
|
27
28
|
export const PtySession = nativeBindings.PtySession;
|
|
28
29
|
export const Shell = nativeBindings.Shell;
|
|
30
|
+
export const TtyWriter = nativeBindings.TtyWriter;
|
|
29
31
|
|
|
30
32
|
// functions
|
|
31
33
|
export const __ompInstallTokioRuntime = nativeBindings.__ompInstallTokioRuntime;
|
|
32
|
-
export const
|
|
34
|
+
export const __piNativesV18_0_0 = nativeBindings.__piNativesV18_0_0;
|
|
33
35
|
export const astEdit = nativeBindings.astEdit;
|
|
34
36
|
export const astGrep = nativeBindings.astGrep;
|
|
35
37
|
export const astMatch = nativeBindings.astMatch;
|
|
@@ -63,6 +65,11 @@ export const isoResolve = nativeBindings.isoResolve;
|
|
|
63
65
|
export const isoStart = nativeBindings.isoStart;
|
|
64
66
|
export const isoStop = nativeBindings.isoStop;
|
|
65
67
|
export const listWorkspace = nativeBindings.listWorkspace;
|
|
68
|
+
export const macOSAutocorrectWord = nativeBindings.macOSAutocorrectWord;
|
|
69
|
+
export const macOSCheckSpelling = nativeBindings.macOSCheckSpelling;
|
|
70
|
+
export const macOSCompleteWord = nativeBindings.macOSCompleteWord;
|
|
71
|
+
export const macOSSpellCheckerAvailable = nativeBindings.macOSSpellCheckerAvailable;
|
|
72
|
+
export const macOSSpellingGuesses = nativeBindings.macOSSpellingGuesses;
|
|
66
73
|
export const matchesKey = nativeBindings.matchesKey;
|
|
67
74
|
export const matchesKittySequence = nativeBindings.matchesKittySequence;
|
|
68
75
|
export const matchesLegacySequence = nativeBindings.matchesLegacySequence;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-natives",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
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",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"optionalDependencies": {
|
|
93
|
-
"@oh-my-pi/pi-natives-linux-x64": "
|
|
94
|
-
"@oh-my-pi/pi-natives-linux-arm64": "
|
|
95
|
-
"@oh-my-pi/pi-natives-darwin-x64": "
|
|
96
|
-
"@oh-my-pi/pi-natives-darwin-arm64": "
|
|
97
|
-
"@oh-my-pi/pi-natives-win32-x64": "
|
|
93
|
+
"@oh-my-pi/pi-natives-linux-x64": "18.0.0",
|
|
94
|
+
"@oh-my-pi/pi-natives-linux-arm64": "18.0.0",
|
|
95
|
+
"@oh-my-pi/pi-natives-darwin-x64": "18.0.0",
|
|
96
|
+
"@oh-my-pi/pi-natives-darwin-arm64": "18.0.0",
|
|
97
|
+
"@oh-my-pi/pi-natives-win32-x64": "18.0.0"
|
|
98
98
|
}
|
|
99
99
|
}
|