@opentui/core 0.1.79 → 0.1.81
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/3d.js +1 -1
- package/NativeSpanFeed.d.ts +41 -0
- package/README.md +5 -2
- package/{index-zrvzvh6r.js → index-ve2seej0.js} +519 -209
- package/{index-zrvzvh6r.js.map → index-ve2seej0.js.map} +8 -8
- package/index.d.ts +1 -0
- package/index.js +367 -58
- package/index.js.map +10 -9
- package/lib/parse.mouse.d.ts +7 -0
- package/package.json +9 -9
- package/renderables/Diff.d.ts +7 -0
- package/renderables/LineNumberRenderable.d.ts +2 -0
- package/renderables/Textarea.d.ts +1 -1
- package/renderer.d.ts +6 -3
- package/testing.js +1 -1
- package/types.d.ts +7 -3
- package/zig-structs.d.ts +79 -0
- package/zig.d.ts +20 -2
package/3d.js
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Pointer } from "bun:ffi";
|
|
2
|
+
import type { NativeSpanFeedOptions } from "./zig-structs";
|
|
3
|
+
export type { GrowthPolicy, NativeSpanFeedOptions, NativeSpanFeedStats } from "./zig-structs";
|
|
4
|
+
export type DataHandler = (data: Uint8Array) => void | Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Zero-copy wrapper over Zig memory; not a full stream interface.
|
|
7
|
+
*/
|
|
8
|
+
export declare class NativeSpanFeed {
|
|
9
|
+
static create(options?: NativeSpanFeedOptions): NativeSpanFeed;
|
|
10
|
+
static attach(streamPtr: bigint | number, _options?: NativeSpanFeedOptions): NativeSpanFeed;
|
|
11
|
+
readonly streamPtr: Pointer;
|
|
12
|
+
private readonly lib;
|
|
13
|
+
private readonly eventHandler;
|
|
14
|
+
private chunkMap;
|
|
15
|
+
private chunkSizes;
|
|
16
|
+
private dataHandlers;
|
|
17
|
+
private errorHandlers;
|
|
18
|
+
private drainBuffer;
|
|
19
|
+
private stateBuffer;
|
|
20
|
+
private closed;
|
|
21
|
+
private destroyed;
|
|
22
|
+
private draining;
|
|
23
|
+
private pendingDataAvailable;
|
|
24
|
+
private pendingClose;
|
|
25
|
+
private closing;
|
|
26
|
+
private pendingAsyncHandlers;
|
|
27
|
+
private inCallback;
|
|
28
|
+
private closeQueued;
|
|
29
|
+
private constructor();
|
|
30
|
+
private ensureDrainBuffer;
|
|
31
|
+
onData(handler: DataHandler): () => void;
|
|
32
|
+
onError(handler: (code: number) => void): () => void;
|
|
33
|
+
close(): void;
|
|
34
|
+
private processPendingClose;
|
|
35
|
+
private performClose;
|
|
36
|
+
private finalizeDestroy;
|
|
37
|
+
private handleEvent;
|
|
38
|
+
private decrementRefcount;
|
|
39
|
+
private drainOnce;
|
|
40
|
+
drainAll(): void;
|
|
41
|
+
}
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# OpenTUI Core
|
|
2
2
|
|
|
3
|
-
OpenTUI
|
|
4
|
-
development and is not ready for production use.
|
|
3
|
+
OpenTUI is a native terminal UI core written in Zig with TypeScript bindings. The native core exposes a C ABI and can be used from any language. OpenTUI powers OpenCode in production today and will also power terminal.shop. It is an extensible core with a focus on correctness, stability, and high performance. It provides a component-based architecture with flexible layout capabilities, allowing you to create complex terminal applications.
|
|
5
4
|
|
|
6
5
|
## Documentation
|
|
7
6
|
|
|
@@ -42,6 +41,10 @@ bun run bench:native
|
|
|
42
41
|
|
|
43
42
|
See [src/zig/bench.zig](src/zig/bench.zig) for available options like `--filter` and `--mem`.
|
|
44
43
|
|
|
44
|
+
NativeSpanFeed TypeScript benchmarks:
|
|
45
|
+
|
|
46
|
+
- [src/benchmark/native-span-feed-benchmark.md](src/benchmark/native-span-feed-benchmark.md)
|
|
47
|
+
|
|
45
48
|
## CLI Renderer
|
|
46
49
|
|
|
47
50
|
### Renderables
|