@opentui/core 0.5.16 → 0.6.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.
Files changed (91) hide show
  1. package/NativeScene.d.ts +185 -0
  2. package/NativeSession.d.ts +134 -0
  3. package/NativeSpanFeed.d.ts +1 -4
  4. package/README.md +5 -3
  5. package/Renderable.d.ts +162 -67
  6. package/animation/Timeline.d.ts +11 -1
  7. package/assets/typescriptreact/highlights.scm +758 -0
  8. package/assets/typescriptreact/tree-sitter-tsx.wasm +0 -0
  9. package/buffer.d.ts +76 -36
  10. package/chunk-bun-s01c2jyn.js +24914 -0
  11. package/chunk-bun-s01c2jyn.js.map +69 -0
  12. package/chunk-bun-tsc14mt5.js +12515 -0
  13. package/chunk-bun-tsc14mt5.js.map +35 -0
  14. package/chunk-node-df90qrqc.js +12495 -0
  15. package/chunk-node-df90qrqc.js.map +34 -0
  16. package/chunk-node-hjr2tm60.js +24913 -0
  17. package/chunk-node-hjr2tm60.js.map +69 -0
  18. package/edit-buffer.d.ts +18 -20
  19. package/editor-view.d.ts +13 -5
  20. package/image.d.ts +18 -7
  21. package/index.bun.js +2387 -2899
  22. package/index.bun.js.map +20 -22
  23. package/index.d.ts +6 -2
  24. package/index.node.js +2387 -2899
  25. package/index.node.js.map +20 -24
  26. package/lib/buffer-access.d.ts +6 -0
  27. package/lib/clipboard.d.ts +0 -9
  28. package/lib/extmarks.d.ts +4 -1
  29. package/lib/tree-sitter/parsers-config.d.ts +9 -9
  30. package/native-abi.generated.d.ts +5496 -0
  31. package/node-assets.js +6 -2
  32. package/node-assets.js.map +3 -3
  33. package/package.json +10 -10
  34. package/parser.worker.js +14 -2
  35. package/parser.worker.js.map +3 -3
  36. package/renderables/ASCIIFont.d.ts +5 -5
  37. package/renderables/Box.d.ts +8 -8
  38. package/renderables/Code.d.ts +6 -2
  39. package/renderables/Diff.d.ts +4 -2
  40. package/renderables/EditBufferRenderable.d.ts +8 -10
  41. package/renderables/EmbeddedTerminal.d.ts +4 -2
  42. package/renderables/FrameBuffer.d.ts +3 -1
  43. package/renderables/Image.d.ts +3 -1
  44. package/renderables/Input.d.ts +0 -5
  45. package/renderables/LineNumberRenderable.d.ts +3 -1
  46. package/renderables/Markdown.d.ts +5 -2
  47. package/renderables/ScrollBar.d.ts +7 -1
  48. package/renderables/ScrollBox.d.ts +4 -6
  49. package/renderables/Select.d.ts +2 -1
  50. package/renderables/Slider.d.ts +7 -5
  51. package/renderables/TabSelect.d.ts +2 -1
  52. package/renderables/Text.d.ts +5 -4
  53. package/renderables/TextBufferRenderable.d.ts +10 -9
  54. package/renderables/TextNode.d.ts +8 -0
  55. package/renderables/TextTable.d.ts +1 -1
  56. package/renderables/Textarea.d.ts +1 -1
  57. package/renderables/index.d.ts +1 -1
  58. package/renderer.d.ts +90 -67
  59. package/session-buffer.d.ts +4 -0
  60. package/syntax-style.d.ts +9 -7
  61. package/testing/harness.d.ts +33 -0
  62. package/testing/manual-clock.d.ts +2 -0
  63. package/testing/test-renderer.d.ts +3 -0
  64. package/testing/test-streams.d.ts +20 -2
  65. package/testing.bun.js +60 -49
  66. package/testing.bun.js.map +6 -6
  67. package/testing.js +60 -49
  68. package/testing.js.map +6 -6
  69. package/tests/native-log-worker-child.d.ts +1 -0
  70. package/tests/native-symbol-stubs.d.ts +5 -0
  71. package/tests/yoga-callback-boundary-child.d.ts +1 -0
  72. package/tests/yoga-default-config-worker-child.d.ts +1 -0
  73. package/text-buffer-view.d.ts +11 -4
  74. package/text-buffer.d.ts +24 -9
  75. package/types.d.ts +4 -4
  76. package/yoga.bun.js +6 -2
  77. package/yoga.bun.js.map +1 -1
  78. package/yoga.d.ts +91 -56
  79. package/yoga.internal.d.ts +78 -0
  80. package/yoga.js +6 -2
  81. package/yoga.js.map +1 -1
  82. package/zig-structs.d.ts +13 -98
  83. package/zig.d.ts +1304 -583
  84. package/chunk-bun-3qwevekk.js +0 -10531
  85. package/chunk-bun-3qwevekk.js.map +0 -32
  86. package/chunk-bun-6rvkxs1v.js +0 -18862
  87. package/chunk-bun-6rvkxs1v.js.map +0 -64
  88. package/chunk-node-f3yste6w.js +0 -10530
  89. package/chunk-node-f3yste6w.js.map +0 -32
  90. package/chunk-node-tfvyz31s.js +0 -18844
  91. package/chunk-node-tfvyz31s.js.map +0 -63
package/types.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { Selection } from "./lib/selection.js";
4
4
  import type { Renderable } from "./Renderable.js";
5
5
  import type { InternalKeyHandler, KeyHandler } from "./lib/KeyHandler.js";
6
6
  import type { EditBufferRenderable } from "./renderables/EditBufferRenderable.js";
7
+ import type { NativeScene } from "./NativeScene.js";
7
8
  export declare const TextAttributes: {
8
9
  NONE: number;
9
10
  BOLD: number;
@@ -100,10 +101,7 @@ export interface RendererEvents {
100
101
  theme_mode: (mode: ThemeMode) => void;
101
102
  }
102
103
  export interface RenderContext extends EventEmitter {
103
- addToHitGrid: (x: number, y: number, width: number, height: number, id: number) => void;
104
- pushHitGridScissorRect: (x: number, y: number, width: number, height: number) => void;
105
- popHitGridScissorRect: () => void;
106
- clearHitGridScissorRects: () => void;
104
+ readonly nativeScene: NativeScene;
107
105
  width: number;
108
106
  height: number;
109
107
  terminalWidth?: number;
@@ -115,6 +113,8 @@ export interface RenderContext extends EventEmitter {
115
113
  /** Monotonic, bumped once per `loop()` iteration. Lets renderables dedupe per-frame work. */
116
114
  frameId: number;
117
115
  requestRender: () => void;
116
+ requestAnimationFrame: (callback: FrameRequestCallback) => number;
117
+ cancelAnimationFrame: (handle: number) => void;
118
118
  setCursorPosition: (x: number, y: number, visible: boolean) => void;
119
119
  setCursorStyle: (options: CursorStyleOptions) => void;
120
120
  setCursorColor: (color: RGBA) => void;
package/yoga.bun.js CHANGED
@@ -90,10 +90,12 @@ import {
90
90
  WRAP_NO_WRAP2,
91
91
  WRAP_WRAP2,
92
92
  WRAP_WRAP_REVERSE2,
93
+ YogaStatus2,
94
+ YogaError2,
93
95
  Config2,
94
96
  Node2,
95
97
  yoga_default
96
- } from "./chunk-bun-6rvkxs1v.js";
98
+ } from "./chunk-bun-tsc14mt5.js";
97
99
  export {
98
100
  ALIGN_AUTO2 as ALIGN_AUTO,
99
101
  ALIGN_BASELINE2 as ALIGN_BASELINE,
@@ -187,8 +189,10 @@ export {
187
189
  WRAP_WRAP2 as WRAP_WRAP,
188
190
  WRAP_WRAP_REVERSE2 as WRAP_WRAP_REVERSE,
189
191
  Wrap2 as Wrap,
192
+ YogaError2 as YogaError,
193
+ YogaStatus2 as YogaStatus,
190
194
  yoga_default as default
191
195
  };
192
196
 
193
- //# debugId=2B80FC2E2ED0D79F64756E2164756E21
197
+ //# debugId=03BF22422AF9277064756E2164756E21
194
198
  //# sourceMappingURL=yoga.bun.js.map
package/yoga.bun.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "2B80FC2E2ED0D79F64756E2164756E21",
7
+ "debugId": "03BF22422AF9277064756E2164756E21",
8
8
  "names": []
9
9
  }
package/yoga.d.ts CHANGED
@@ -1,27 +1,29 @@
1
+ import { type RenderLib } from "./zig.js";
1
2
  import type { Pointer } from "./platform/ffi.js";
3
+ import { type ValueInput } from "./yoga.internal.js";
2
4
  export declare enum Align {
3
- Auto = 0,
4
- FlexStart = 1,
5
- Center = 2,
6
- FlexEnd = 3,
7
- Stretch = 4,
8
- Baseline = 5,
9
- SpaceBetween = 6,
10
- SpaceAround = 7,
11
- SpaceEvenly = 8
5
+ Auto,
6
+ FlexStart,
7
+ Center,
8
+ FlexEnd,
9
+ Stretch,
10
+ Baseline,
11
+ SpaceBetween,
12
+ SpaceAround,
13
+ SpaceEvenly
12
14
  }
13
15
  export declare enum BoxSizing {
14
- BorderBox = 0,
15
- ContentBox = 1
16
+ BorderBox,
17
+ ContentBox
16
18
  }
17
19
  export declare enum Dimension {
18
- Width = 0,
19
- Height = 1
20
+ Width,
21
+ Height
20
22
  }
21
23
  export declare enum Direction {
22
- Inherit = 0,
23
- LTR = 1,
24
- RTL = 2
24
+ Inherit,
25
+ LTR,
26
+ RTL
25
27
  }
26
28
  export declare enum Display {
27
29
  Flex = 0,
@@ -29,15 +31,15 @@ export declare enum Display {
29
31
  Contents = 2
30
32
  }
31
33
  export declare enum Edge {
32
- Left = 0,
33
- Top = 1,
34
- Right = 2,
35
- Bottom = 3,
36
- Start = 4,
37
- End = 5,
38
- Horizontal = 6,
39
- Vertical = 7,
40
- All = 8
34
+ Left,
35
+ Top,
36
+ Right,
37
+ Bottom,
38
+ Start,
39
+ End,
40
+ Horizontal,
41
+ Vertical,
42
+ All
41
43
  }
42
44
  export declare enum Errata {
43
45
  None = 0,
@@ -51,23 +53,23 @@ export declare enum ExperimentalFeature {
51
53
  WebFlexBasis = 0
52
54
  }
53
55
  export declare enum FlexDirection {
54
- Column = 0,
55
- ColumnReverse = 1,
56
- Row = 2,
57
- RowReverse = 3
56
+ Column,
57
+ ColumnReverse,
58
+ Row,
59
+ RowReverse
58
60
  }
59
61
  export declare enum Gutter {
60
- Column = 0,
61
- Row = 1,
62
- All = 2
62
+ Column,
63
+ Row,
64
+ All
63
65
  }
64
66
  export declare enum Justify {
65
- FlexStart = 0,
66
- Center = 1,
67
- FlexEnd = 2,
68
- SpaceBetween = 3,
69
- SpaceAround = 4,
70
- SpaceEvenly = 5
67
+ FlexStart,
68
+ Center,
69
+ FlexEnd,
70
+ SpaceBetween,
71
+ SpaceAround,
72
+ SpaceEvenly
71
73
  }
72
74
  export declare enum LogLevel {
73
75
  Error = 0,
@@ -78,34 +80,34 @@ export declare enum LogLevel {
78
80
  Fatal = 5
79
81
  }
80
82
  export declare enum MeasureMode {
81
- Undefined = 0,
82
- Exactly = 1,
83
- AtMost = 2
83
+ Undefined,
84
+ Exactly,
85
+ AtMost
84
86
  }
85
87
  export declare enum NodeType {
86
88
  Default = 0,
87
89
  Text = 1
88
90
  }
89
91
  export declare enum Overflow {
90
- Visible = 0,
91
- Hidden = 1,
92
- Scroll = 2
92
+ Visible,
93
+ Hidden,
94
+ Scroll
93
95
  }
94
96
  export declare enum PositionType {
95
- Static = 0,
96
- Relative = 1,
97
- Absolute = 2
97
+ Static,
98
+ Relative,
99
+ Absolute
98
100
  }
99
101
  export declare enum Unit {
100
- Undefined = 0,
101
- Point = 1,
102
- Percent = 2,
103
- Auto = 3
102
+ Undefined,
103
+ Point,
104
+ Percent,
105
+ Auto
104
106
  }
105
107
  export declare enum Wrap {
106
- NoWrap = 0,
107
- Wrap = 1,
108
- WrapReverse = 2
108
+ NoWrap,
109
+ Wrap,
110
+ WrapReverse
109
111
  }
110
112
  export declare const ALIGN_AUTO = Align.Auto;
111
113
  export declare const ALIGN_FLEX_START = Align.FlexStart;
@@ -197,15 +199,43 @@ export interface Value {
197
199
  }
198
200
  export type MeasureFunction = (width: number, widthMode: MeasureMode, height: number, heightMode: MeasureMode) => Size;
199
201
  export type DirtiedFunction = (node: Node) => void;
200
- type ValueInput = number | "auto" | `${number}%` | Value | undefined;
201
202
  type ValueInputNoAuto = number | `${number}%` | Value | undefined;
203
+ export declare enum YogaStatus {
204
+ Ok = 0,
205
+ InvalidArgument = 1,
206
+ OutOfMemory = 2,
207
+ Exception = 3,
208
+ Poisoned = 4,
209
+ Busy = 5,
210
+ DepthLimit = 6
211
+ }
212
+ export declare class YogaError extends Error {
213
+ readonly operation: string;
214
+ readonly status: YogaStatus;
215
+ readonly name = "YogaError";
216
+ constructor(operation: string, status: YogaStatus);
217
+ }
202
218
  export declare class Config {
219
+ readonly renderLib: RenderLib;
220
+ private readonly ownsConfig;
203
221
  readonly ptr: Pointer;
222
+ readonly nodes: Map<Pointer, Node>;
223
+ readonly measures: Map<Pointer, MeasureFunction>;
224
+ readonly dirtied: Map<Pointer, {
225
+ node: Node;
226
+ callback: DirtiedFunction;
227
+ }>;
204
228
  private freed;
229
+ private measureCallback?;
230
+ private dirtiedCallback?;
205
231
  private constructor();
206
- static create(): Config;
232
+ static create(renderLib?: RenderLib): Config;
233
+ static fromBorrowedPointer(ptr: Pointer, renderLib?: RenderLib): Config;
207
234
  static destroy(config: Config): void;
208
235
  free(): void;
236
+ assertUnused(): void;
237
+ assertAlive(): void;
238
+ ensureCallbacks(): void;
209
239
  setUseWebDefaults(useWebDefaults: boolean): void;
210
240
  useWebDefaults(): boolean;
211
241
  setPointScaleFactor(pointScaleFactor: number): void;
@@ -217,8 +247,10 @@ export declare class Config {
217
247
  }
218
248
  export declare class Node {
219
249
  readonly ptr: Pointer;
250
+ private readonly config;
220
251
  private freed;
221
252
  private constructor();
253
+ private get renderLib();
222
254
  static create(config?: Config): Node;
223
255
  static createForOpenTUI(): Node;
224
256
  static createDefault(): Node;
@@ -226,6 +258,8 @@ export declare class Node {
226
258
  static destroy(node: Node): void;
227
259
  private static fromPointer;
228
260
  isFreed(): boolean;
261
+ assertMutable(): void;
262
+ runMutation<T>(operation: () => T): T;
229
263
  free(): void;
230
264
  freeRecursive(): void;
231
265
  reset(): void;
@@ -339,6 +373,7 @@ export declare class Node {
339
373
  private collectSubtree;
340
374
  private unregisterCallbacks;
341
375
  private markFreed;
376
+ private assertSameLibrary;
342
377
  }
343
378
  declare const Yoga: {
344
379
  Config: typeof Config;
@@ -0,0 +1,78 @@
1
+ import type { NativeScene } from "./NativeScene.js";
2
+ import type { Pointer } from "./platform/ffi.js";
3
+ import { type RenderLib, type SceneNodeHandle } from "./zig.js";
4
+ import { Config, type Dimension, type Value } from "./yoga.js";
5
+ export type ValueInput = number | "auto" | `${number}%` | Value | undefined;
6
+ export declare const YogaEnumKind: {
7
+ readonly Direction: 0;
8
+ readonly FlexDirection: 1;
9
+ readonly JustifyContent: 2;
10
+ readonly AlignContent: 3;
11
+ readonly AlignItems: 4;
12
+ readonly AlignSelf: 5;
13
+ readonly PositionType: 6;
14
+ readonly FlexWrap: 7;
15
+ readonly Overflow: 8;
16
+ readonly Display: 9;
17
+ readonly BoxSizing: 10;
18
+ };
19
+ export declare const YogaFloatKind: {
20
+ readonly Flex: 0;
21
+ readonly FlexGrow: 1;
22
+ readonly FlexShrink: 2;
23
+ readonly AspectRatio: 3;
24
+ };
25
+ export declare const YogaValueKind: {
26
+ readonly Width: 0;
27
+ readonly Height: 1;
28
+ readonly MinWidth: 2;
29
+ readonly MinHeight: 3;
30
+ readonly MaxWidth: 4;
31
+ readonly MaxHeight: 5;
32
+ readonly FlexBasis: 6;
33
+ readonly Margin: 7;
34
+ readonly Padding: 8;
35
+ readonly Position: 9;
36
+ readonly Gap: 10;
37
+ };
38
+ export type YogaEnumKindId = (typeof YogaEnumKind)[keyof typeof YogaEnumKind];
39
+ export type YogaFloatKindId = (typeof YogaFloatKind)[keyof typeof YogaFloatKind];
40
+ export type YogaValueKindId = (typeof YogaValueKind)[keyof typeof YogaValueKind];
41
+ type SceneStyleNode = {
42
+ _getSceneHandle(owner: NativeScene): SceneNodeHandle;
43
+ };
44
+ export declare function sceneSetEnum(scene: NativeScene, node: SceneStyleNode, kind: YogaEnumKindId, value: number): void;
45
+ export declare function sceneGetEnum(scene: NativeScene, node: SceneStyleNode, kind: YogaEnumKindId): number;
46
+ export declare function sceneSetFloat(scene: NativeScene, node: SceneStyleNode, kind: YogaFloatKindId, value: number | undefined): void;
47
+ export declare function sceneGetFloat(scene: NativeScene, node: SceneStyleNode, kind: YogaFloatKindId): number;
48
+ export declare function sceneSetValue(scene: NativeScene, node: SceneStyleNode, kind: YogaValueKindId, edge: number, valueInput: ValueInput): void;
49
+ export declare function sceneGetValue(scene: NativeScene, node: SceneStyleNode, kind: YogaValueKindId, edge: number): Value;
50
+ export declare function sceneSetDimension(scene: NativeScene, node: SceneStyleNode, dimension: Dimension, input: ValueInput, disableFlexShrink?: boolean): void;
51
+ export declare const UNDEFINED_VALUE: Value;
52
+ /** Callback state owned by one loaded RenderLib, never by the process. */
53
+ export declare class YogaHost {
54
+ private readonly renderLib;
55
+ readonly configs: Map<Pointer, Config>;
56
+ private readonly pendingScenes;
57
+ private defaultConfig?;
58
+ private callbackDepth;
59
+ private mutationDepth;
60
+ private callbackError?;
61
+ constructor(renderLib: RenderLib);
62
+ getDefaultConfig(): Config;
63
+ assertMutable(): void;
64
+ stageScene(scene: NativeScene): void;
65
+ forgetScene(scene: NativeScene): void;
66
+ flushSceneMutations(): void;
67
+ /** Whether a Yoga callback is executing on this library's owner thread. */
68
+ get inCallback(): boolean;
69
+ invokeCallback(callback: () => unknown): void;
70
+ runMutation<T>(operation: () => T): T;
71
+ throwCallbackError(failure?: {
72
+ value: unknown;
73
+ }): void;
74
+ dispose(): void;
75
+ }
76
+ export declare function rejectAsyncCallback(value: unknown): void;
77
+ export declare function parseYogaValue(value: ValueInput): Value;
78
+ export {};
package/yoga.js CHANGED
@@ -89,10 +89,12 @@ import {
89
89
  WRAP_NO_WRAP2,
90
90
  WRAP_WRAP2,
91
91
  WRAP_WRAP_REVERSE2,
92
+ YogaStatus2,
93
+ YogaError2,
92
94
  Config2,
93
95
  Node2,
94
96
  yoga_default
95
- } from "./chunk-node-tfvyz31s.js";
97
+ } from "./chunk-node-df90qrqc.js";
96
98
  export {
97
99
  ALIGN_AUTO2 as ALIGN_AUTO,
98
100
  ALIGN_BASELINE2 as ALIGN_BASELINE,
@@ -186,8 +188,10 @@ export {
186
188
  WRAP_WRAP2 as WRAP_WRAP,
187
189
  WRAP_WRAP_REVERSE2 as WRAP_WRAP_REVERSE,
188
190
  Wrap2 as Wrap,
191
+ YogaError2 as YogaError,
192
+ YogaStatus2 as YogaStatus,
189
193
  yoga_default as default
190
194
  };
191
195
 
192
- //# debugId=ECFD06D1D602714E64756E2164756E21
196
+ //# debugId=6C2D2FE447E532E264756E2164756E21
193
197
  //# sourceMappingURL=yoga.js.map
package/yoga.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "ECFD06D1D602714E64756E2164756E21",
7
+ "debugId": "6C2D2FE447E532E264756E2164756E21",
8
8
  "names": []
9
9
  }
package/zig-structs.d.ts CHANGED
@@ -1,65 +1,4 @@
1
- import { type Pointer } from "./platform/ffi.js";
2
- import { RGBA } from "./lib/RGBA.js";
3
- type StyledChunkInput = {
4
- text: string;
5
- fg?: RGBA | null;
6
- bg?: RGBA | null;
7
- attributes?: number | null;
8
- link?: {
9
- url: string;
10
- } | string | null;
11
- };
12
- export declare const StyledChunkStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["text", "char*"], readonly ["text_len", "u64", {
13
- readonly lengthOf: "text";
14
- }], readonly ["fg", "pointer", {
15
- readonly optional: true;
16
- readonly packTransform: (rgba?: RGBA) => Uint16Array<ArrayBufferLike> | null;
17
- readonly unpackTransform: (ptr?: Pointer) => RGBA | undefined;
18
- }], readonly ["bg", "pointer", {
19
- readonly optional: true;
20
- readonly packTransform: (rgba?: RGBA) => Uint16Array<ArrayBufferLike> | null;
21
- readonly unpackTransform: (ptr?: Pointer) => RGBA | undefined;
22
- }], readonly ["attributes", "u32", {
23
- readonly default: 0;
24
- }], readonly ["link", "char*", {
25
- readonly default: "";
26
- }], readonly ["link_len", "u64", {
27
- readonly lengthOf: "link";
28
- }]], {
29
- readonly mapValue: (chunk: StyledChunkInput) => StyledChunkInput;
30
- }>;
31
- export declare const HighlightStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["start", "u32"], readonly ["end", "u32"], readonly ["styleId", "u32"], readonly ["priority", "u8", {
32
- readonly default: 0;
33
- }], readonly ["hlRef", "u16", {
34
- readonly default: 0;
35
- }]], {}>;
36
- export declare const LogicalCursorStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["row", "u32"], readonly ["col", "u32"], readonly ["offset", "u32"]], {}>;
37
- export declare const VisualCursorStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["visualRow", "u32"], readonly ["visualCol", "u32"], readonly ["logicalRow", "u32"], readonly ["logicalCol", "u32"], readonly ["offset", "u32"]], {}>;
38
- export declare const TerminalCapabilitiesStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["kitty_keyboard", "bool_u8"], readonly ["kitty_graphics", "bool_u8"], readonly ["rgb", "bool_u8"], readonly ["ansi256", "bool_u8"], readonly ["unicode", import("bun-ffi-structs").EnumDef<{
39
- wcwidth: number;
40
- unicode: number;
41
- "unicode-wide": number;
42
- }>], readonly ["sgr_pixels", "bool_u8"], readonly ["color_scheme_updates", "bool_u8"], readonly ["explicit_width", "bool_u8"], readonly ["scaled_text", "bool_u8"], readonly ["sixel", "bool_u8"], readonly ["focus_tracking", "bool_u8"], readonly ["sync", "bool_u8"], readonly ["bracketed_paste", "bool_u8"], readonly ["hyperlinks", "bool_u8"], readonly ["osc52", "bool_u8"], readonly ["notifications", "bool_u8"], readonly ["explicit_cursor_positioning", "bool_u8"], readonly ["remote", "bool_u8"], readonly ["multiplexer", import("bun-ffi-structs").EnumDef<{
43
- none: number;
44
- tmux: number;
45
- zellij: number;
46
- screen: number;
47
- unknown: number;
48
- }>], readonly ["image_protocol", import("bun-ffi-structs").EnumDef<{
49
- auto: number;
50
- kitty: number;
51
- sixel: number;
52
- blocks: number;
53
- }>], readonly ["term_name", "char*"], readonly ["term_name_len", "u64", {
54
- readonly lengthOf: "term_name";
55
- }], readonly ["term_version", "char*"], readonly ["term_version_len", "u64", {
56
- readonly lengthOf: "term_version";
57
- }], readonly ["term_from_xtversion", "bool_u8"], readonly ["osc52_support", import("bun-ffi-structs").EnumDef<{
58
- unknown: number;
59
- supported: number;
60
- unsupported: number;
61
- }>]], {}>;
62
- export declare const EncodedCharStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["width", "u8"], readonly ["char", "u32"]], {}>;
1
+ import type { Pointer } from "./platform/ffi.js";
63
2
  export interface NativeImageInfo {
64
3
  width: number;
65
4
  height: number;
@@ -70,37 +9,6 @@ export interface NativeImageInfo {
70
9
  orientation: number;
71
10
  hasAlpha: number;
72
11
  }
73
- export declare const NativeImageInfoStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["width", "u32"], readonly ["height", "u32"], readonly ["sourceWidth", "u32"], readonly ["sourceHeight", "u32"], readonly ["format", "u32"], readonly ["colorStatus", "u32"], readonly ["orientation", "u32"], readonly ["hasAlpha", "u32"]], {}>;
74
- export declare const ImageDrawOptionsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["x", "i32"], readonly ["y", "i32"], readonly ["width", "u32"], readonly ["height", "u32"], readonly ["pixelWidth", "u32"], readonly ["pixelHeight", "u32"], readonly ["sourceX", "u32"], readonly ["sourceY", "u32"], readonly ["sourceWidth", "u32"], readonly ["sourceHeight", "u32"], readonly ["protocol", "u32"]], {}>;
75
- export declare const LineInfoStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["startCols", readonly ["u32"]], readonly ["startColsLen", "u32", {
76
- readonly lengthOf: "startCols";
77
- }], readonly ["widthCols", readonly ["u32"]], readonly ["widthColsLen", "u32", {
78
- readonly lengthOf: "widthCols";
79
- }], readonly ["sources", readonly ["u32"]], readonly ["sourcesLen", "u32", {
80
- readonly lengthOf: "sources";
81
- }], readonly ["wraps", readonly ["u32"]], readonly ["wrapsLen", "u32", {
82
- readonly lengthOf: "wraps";
83
- }], readonly ["widthColsMax", "u32"]], {}>;
84
- export declare const MeasureResultStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["lineCount", "u32"], readonly ["widthColsMax", "u32"]], {}>;
85
- export declare const CursorStateStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["x", "u32"], readonly ["y", "u32"], readonly ["visible", "bool_u8"], readonly ["style", "u8"], readonly ["blinking", "bool_u8"], readonly ["r", "f32"], readonly ["g", "f32"], readonly ["b", "f32"], readonly ["a", "f32"]], {}>;
86
- export declare const EmbeddedTerminalCursorStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["x", "u16"], readonly ["y", "u16"], readonly ["hasValue", "bool_u8"], readonly ["visible", "bool_u8"], readonly ["blinking", "bool_u8"], readonly ["wideTail", "bool_u8"], readonly ["style", "u8"], readonly ["colorHasValue", "bool_u8"], readonly ["colorR", "u8"], readonly ["colorG", "u8"], readonly ["colorB", "u8"], readonly ["padding", "u8"]], {}>;
87
- export declare const EmbeddedTerminalKeyOptionsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["action", "u8"], readonly ["composing", "u8"], readonly ["mods", "u16"], readonly ["consumedMods", "u16"], readonly ["padding", "u16"], readonly ["unshiftedCodepoint", "u32"]], {}>;
88
- export declare const CursorStyleOptionsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["style", "u8", {
89
- readonly default: 255;
90
- }], readonly ["blinking", "u8", {
91
- readonly default: 255;
92
- }], readonly ["color", "pointer", {
93
- readonly optional: true;
94
- readonly packTransform: (rgba?: RGBA) => Uint16Array<ArrayBufferLike> | null;
95
- readonly unpackTransform: (ptr?: Pointer) => RGBA | undefined;
96
- }], readonly ["cursor", "u8", {
97
- readonly default: 255;
98
- }]], {}>;
99
- export declare const GridDrawOptionsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["drawInner", "bool_u8", {
100
- readonly default: true;
101
- }], readonly ["drawOuter", "bool_u8", {
102
- readonly default: true;
103
- }]], {}>;
104
12
  export type BuildOptions = {
105
13
  gpaSafeStats: boolean;
106
14
  gpaMemoryLimitTracking: boolean;
@@ -123,7 +31,6 @@ export type NativeRenderStats = {
123
31
  nativeRenderTime?: number;
124
32
  nativeStdoutWriteTime?: number;
125
33
  };
126
- export declare const NativeRenderStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["lastFrameTime", "f64"], readonly ["averageFrameTime", "f64"], readonly ["renderTime", "f64"], readonly ["stdoutWriteTime", "f64"], readonly ["frameCount", "u64"], readonly ["cellsUpdated", "u32"], readonly ["averageCellsUpdated", "u32"], readonly ["renderTimeValid", "bool_u8"], readonly ["stdoutWriteTimeValid", "bool_u8"]], {}>;
127
34
  export type GrowthPolicy = "grow" | "block";
128
35
  export type NativeSpanFeedOptions = {
129
36
  chunkSize?: number;
@@ -138,12 +45,16 @@ export type NativeSpanFeedStats = {
138
45
  spansCommitted: bigint;
139
46
  chunks: number;
140
47
  pendingSpans: number;
48
+ outstandingSpans: number;
49
+ outstandingBytes: bigint;
141
50
  };
142
51
  export type SpanInfo = {
143
52
  chunkPtr: Pointer;
144
53
  offset: number;
145
54
  len: number;
146
55
  chunkIndex: number;
56
+ slotIndex: number;
57
+ releaseId: bigint;
147
58
  };
148
59
  export type ReserveInfo = {
149
60
  ptr: Pointer;
@@ -165,18 +76,23 @@ export declare const NativeSpanFeedOptionsStruct: import("bun-ffi-structs").Defi
165
76
  }], readonly ["spanQueueCapacity", "u32", {
166
77
  readonly default: 0;
167
78
  }]], {}>;
168
- export declare const NativeSpanFeedStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["bytesWritten", "u64"], readonly ["spansCommitted", "u64"], readonly ["chunks", "u32"], readonly ["pendingSpans", "u32"]], {}>;
79
+ export declare const NativeSpanFeedStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["bytesWritten", "u64"], readonly ["spansCommitted", "u64"], readonly ["chunks", "u32"], readonly ["pendingSpans", "u32"], readonly ["outstandingSpans", "u32"], readonly ["reserved", "u32", {
80
+ readonly default: 0;
81
+ }], readonly ["outstandingBytes", "u64"]], {}>;
169
82
  export declare const SpanInfoStruct: import("bun-ffi-structs").StructDef<{
170
83
  chunkPtr: Pointer;
171
84
  offset: number;
172
85
  len: number;
173
86
  chunkIndex: number;
87
+ slotIndex: number;
88
+ releaseId: bigint;
174
89
  }, {
175
- offset: number;
176
90
  chunkPtr: ArrayBufferLike | import("bun-ffi-structs").Pointer | ArrayBufferView<ArrayBufferLike>;
91
+ offset: number;
177
92
  len: number;
178
93
  chunkIndex: number;
179
- reserved?: number | null | undefined;
94
+ slotIndex?: number | null | undefined;
95
+ releaseId?: number | bigint | null | undefined;
180
96
  }>;
181
97
  export declare const ReserveInfoStruct: import("bun-ffi-structs").StructDef<{
182
98
  ptr: Pointer;
@@ -331,4 +247,3 @@ export declare const AudioStreamCreateOptionsStruct: import("bun-ffi-structs").D
331
247
  export declare const AudioStreamStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["bytesReceived", "u64"], readonly ["framesDecoded", "u64"], readonly ["framesPlayed", "u64"], readonly ["state", "u32"], readonly ["sampleRate", "u32"], readonly ["channels", "u32"], readonly ["bufferedFrames", "u32"], readonly ["capacityFrames", "u32"], readonly ["underruns", "u32"], readonly ["errorCode", "i32"], readonly ["readyGeneration", "u32"]], {}>;
332
248
  export declare const AudioCaptureStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["framesReceived", "u64"], readonly ["framesRead", "u64"], readonly ["framesDropped", "u64"], readonly ["sampleRate", "u32"], readonly ["channels", "u32"], readonly ["bufferedFrames", "u32"], readonly ["capacityFrames", "u32"]], {}>;
333
249
  export declare const AudioStatsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["soundsLoaded", "u32"], readonly ["voicesActive", "u32"], readonly ["framesMixed", "u64"], readonly ["lockMisses", "u32"], readonly ["lastPeak", "f32"], readonly ["lastRms", "f32"]], {}>;
334
- export {};