@opentui/core 0.5.3 → 0.5.6

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.
@@ -585,7 +585,7 @@ function toNodeFFIType(type, position) {
585
585
  case FFIType.napi_value:
586
586
  throw new Error(NODE_NAPI_UNSUPPORTED);
587
587
  case FFIType.buffer:
588
- return "buffer";
588
+ return "pointer";
589
589
  default:
590
590
  return unsupportedNodeFFIType(type);
591
591
  }
@@ -4554,6 +4554,7 @@ function createTextAttributes({
4554
4554
  dim = false,
4555
4555
  blink = false,
4556
4556
  inverse = false,
4557
+ reverse = false,
4557
4558
  hidden = false,
4558
4559
  strikethrough = false
4559
4560
  } = {}) {
@@ -4568,7 +4569,7 @@ function createTextAttributes({
4568
4569
  attributes |= TextAttributes.DIM;
4569
4570
  if (blink)
4570
4571
  attributes |= TextAttributes.BLINK;
4571
- if (inverse)
4572
+ if (inverse || reverse)
4572
4573
  attributes |= TextAttributes.INVERSE;
4573
4574
  if (hidden)
4574
4575
  attributes |= TextAttributes.HIDDEN;
@@ -11436,7 +11437,7 @@ class OptimizedBuffer {
11436
11437
  if (matrix.length !== 16)
11437
11438
  throw new RangeError(`colorMatrix matrix must have length 16, got ${matrix.length}`);
11438
11439
  const cellMaskCount = Math.floor(cellMask.length / 3);
11439
- this.lib.bufferColorMatrix(this.bufferPtr, ptr(matrix), ptr(cellMask), cellMaskCount, strength, target);
11440
+ this.lib.bufferColorMatrix(this.bufferPtr, matrix, cellMask, cellMaskCount, strength, target);
11440
11441
  }
11441
11442
  colorMatrixUniform(matrix, strength = 1, target = 3 /* Both */) {
11442
11443
  this.guard();
@@ -11444,7 +11445,7 @@ class OptimizedBuffer {
11444
11445
  throw new RangeError(`colorMatrixUniform matrix must have length 16, got ${matrix.length}`);
11445
11446
  if (strength === 0)
11446
11447
  return;
11447
- this.lib.bufferColorMatrixUniform(this.bufferPtr, ptr(matrix), strength, target);
11448
+ this.lib.bufferColorMatrixUniform(this.bufferPtr, matrix, strength, target);
11448
11449
  }
11449
11450
  drawFrameBuffer(destX, destY, frameBuffer, sourceX, sourceY, sourceWidth, sourceHeight) {
11450
11451
  this.guard();
@@ -11465,9 +11466,9 @@ class OptimizedBuffer {
11465
11466
  this.guard();
11466
11467
  this.lib.bufferDrawEditorView(this.bufferPtr, editorView.ptr, x, y);
11467
11468
  }
11468
- drawSuperSampleBuffer(x, y, pixelDataPtr, pixelDataLength, format, alignedBytesPerRow) {
11469
+ drawSuperSampleBuffer(x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
11469
11470
  this.guard();
11470
- this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, toPointer(pixelDataPtr), pixelDataLength, format, alignedBytesPerRow);
11471
+ this.lib.bufferDrawSuperSampleBuffer(this.bufferPtr, x, y, typeof pixelData === "number" || typeof pixelData === "bigint" ? toPointer(pixelData) : pixelData, pixelDataLength, format, alignedBytesPerRow);
11471
11472
  }
11472
11473
  drawImage(image, x, y, width, height, pixelWidth = 0, pixelHeight = 0, sourceX = 0, sourceY = 0, sourceWidth = image.width, sourceHeight = image.height, protocol = "auto") {
11473
11474
  this.guard();
@@ -11486,17 +11487,17 @@ class OptimizedBuffer {
11486
11487
  }
11487
11488
  return this.lib.bufferDrawImage(this.bufferPtr, image.ptr, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol);
11488
11489
  }
11489
- drawPackedBuffer(dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
11490
+ drawPackedBuffer(data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
11490
11491
  this.guard();
11491
- this.lib.bufferDrawPackedBuffer(this.bufferPtr, toPointer(dataPtr), dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
11492
+ this.lib.bufferDrawPackedBuffer(this.bufferPtr, typeof data === "number" || typeof data === "bigint" ? toPointer(data) : data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
11492
11493
  }
11493
11494
  drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11494
11495
  this.guard();
11495
- this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, ptr(intensities), srcWidth, srcHeight, fg2, bg2);
11496
+ this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11496
11497
  }
11497
11498
  drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11498
11499
  this.guard();
11499
- this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, ptr(intensities), srcWidth, srcHeight, fg2, bg2);
11500
+ this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11500
11501
  }
11501
11502
  resize(width, height) {
11502
11503
  this.guard();
@@ -13200,6 +13201,28 @@ var CursorStateStruct = defineStruct([
13200
13201
  ["b", "f32"],
13201
13202
  ["a", "f32"]
13202
13203
  ]);
13204
+ var EmbeddedTerminalCursorStruct = defineStruct([
13205
+ ["x", "u16"],
13206
+ ["y", "u16"],
13207
+ ["hasValue", "bool_u8"],
13208
+ ["visible", "bool_u8"],
13209
+ ["blinking", "bool_u8"],
13210
+ ["wideTail", "bool_u8"],
13211
+ ["style", "u8"],
13212
+ ["colorHasValue", "bool_u8"],
13213
+ ["colorR", "u8"],
13214
+ ["colorG", "u8"],
13215
+ ["colorB", "u8"],
13216
+ ["padding", "u8"]
13217
+ ]);
13218
+ var EmbeddedTerminalKeyOptionsStruct = defineStruct([
13219
+ ["action", "u8"],
13220
+ ["composing", "u8"],
13221
+ ["mods", "u16"],
13222
+ ["consumedMods", "u16"],
13223
+ ["padding", "u16"],
13224
+ ["unshiftedCodepoint", "u32"]
13225
+ ]);
13203
13226
  var CursorStyleOptionsStruct = defineStruct([
13204
13227
  ["style", "u8", { default: 255 }],
13205
13228
  ["blinking", "u8", { default: 255 }],
@@ -13516,14 +13539,50 @@ function toSafeFFIU32Length(value, label) {
13516
13539
  function isFFIU32(value) {
13517
13540
  return Number.isInteger(value) && value >= 0 && value <= MAX_FFI_U32;
13518
13541
  }
13519
- function ptrOrNull(value) {
13520
- return value.byteLength === 0 ? null : ptr(value);
13542
+ function viewOrNull(value) {
13543
+ return value.byteLength === 0 ? null : value;
13544
+ }
13545
+ function retainedPtrOrNull(value) {
13546
+ if (value.byteLength === 0)
13547
+ return null;
13548
+ value.buffer;
13549
+ return ptr(value);
13550
+ }
13551
+ var EMBEDDED_TERMINAL_ERRORS = {
13552
+ [-1]: "invalid value or handle",
13553
+ [-2]: "out of memory",
13554
+ [-3]: "embedded terminal support is unavailable",
13555
+ [-4]: "output buffer is too small",
13556
+ [-5]: "processing failed"
13557
+ };
13558
+ function embeddedTerminalResult(status, operation) {
13559
+ if (status >= 0)
13560
+ return status;
13561
+ throw new Error(`Embedded terminal ${operation} failed: ${EMBEDDED_TERMINAL_ERRORS[status] ?? `status ${status}`}`);
13562
+ }
13563
+ function embeddedTerminalDimension(value, name) {
13564
+ if (!Number.isInteger(value) || value < 1 || value > 65535) {
13565
+ throw new RangeError(`Embedded terminal ${name} must be an integer between 1 and 65535`);
13566
+ }
13567
+ return value;
13521
13568
  }
13522
- function rgbaPtr(value) {
13523
- return ptr(value.buffer);
13569
+ function embeddedTerminalI32(value, name) {
13570
+ if (!Number.isInteger(value) || value < -2147483648 || value > 2147483647) {
13571
+ throw new RangeError(`Embedded terminal ${name} must be a signed 32-bit integer`);
13572
+ }
13573
+ return value;
13524
13574
  }
13525
- function optionalRgbaPtr(value) {
13526
- return value ? rgbaPtr(value) : null;
13575
+ function embeddedTerminalF32(value, name) {
13576
+ if (!Number.isFinite(value) || Math.abs(value) > 340282346638528860000000000000000000000) {
13577
+ throw new RangeError(`Embedded terminal ${name} must be a finite 32-bit float`);
13578
+ }
13579
+ return value;
13580
+ }
13581
+ function rgbaBuffer(value) {
13582
+ return value.buffer;
13583
+ }
13584
+ function optionalRgbaBuffer(value) {
13585
+ return value ? rgbaBuffer(value) : null;
13527
13586
  }
13528
13587
  function getOpenTUILib(libPath) {
13529
13588
  const resolvedLibPath = libPath || targetLibPath;
@@ -13559,6 +13618,70 @@ function getOpenTUILib(libPath) {
13559
13618
  args: ["u32", "u32", "u32"],
13560
13619
  returns: "bool"
13561
13620
  },
13621
+ createEmbeddedTerminal: {
13622
+ args: ["u16", "u16", "u32", "ptr"],
13623
+ returns: "i32"
13624
+ },
13625
+ destroyEmbeddedTerminal: {
13626
+ args: ["u32"],
13627
+ returns: "void"
13628
+ },
13629
+ embeddedTerminalWrite: {
13630
+ args: ["u32", "ptr", "u32"],
13631
+ returns: "i32"
13632
+ },
13633
+ embeddedTerminalResize: {
13634
+ args: ["u32", "u16", "u16"],
13635
+ returns: "i32"
13636
+ },
13637
+ embeddedTerminalInvalidate: {
13638
+ args: ["u32"],
13639
+ returns: "i32"
13640
+ },
13641
+ embeddedTerminalScroll: {
13642
+ args: ["u32", "i32"],
13643
+ returns: "i32"
13644
+ },
13645
+ embeddedTerminalSetSelection: {
13646
+ args: ["u32", "u16", "u16", "u16", "u16"],
13647
+ returns: "i32"
13648
+ },
13649
+ embeddedTerminalClearSelection: {
13650
+ args: ["u32"],
13651
+ returns: "i32"
13652
+ },
13653
+ embeddedTerminalGetSelectedText: {
13654
+ args: ["u32", "buffer", "u32", "buffer"],
13655
+ returns: "i32"
13656
+ },
13657
+ embeddedTerminalCompose: {
13658
+ args: ["u32", "u32", "i32", "i32"],
13659
+ returns: "i32"
13660
+ },
13661
+ embeddedTerminalCursor: {
13662
+ args: ["u32", "ptr"],
13663
+ returns: "i32"
13664
+ },
13665
+ embeddedTerminalEncodeKey: {
13666
+ args: ["u32", "ptr", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
13667
+ returns: "i32"
13668
+ },
13669
+ embeddedTerminalEncodeMouse: {
13670
+ args: ["u32", "u8", "i8", "u16", "f32", "f32", "u8", "ptr", "u32"],
13671
+ returns: "i32"
13672
+ },
13673
+ embeddedTerminalEncodePaste: {
13674
+ args: ["u32", "ptr", "u32", "ptr", "u32"],
13675
+ returns: "i32"
13676
+ },
13677
+ embeddedTerminalEncodeFocus: {
13678
+ args: ["u32", "u8", "ptr", "u32"],
13679
+ returns: "i32"
13680
+ },
13681
+ embeddedTerminalDrainResponses: {
13682
+ args: ["u32", "ptr", "u32"],
13683
+ returns: "i32"
13684
+ },
13562
13685
  createRenderer: {
13563
13686
  args: ["u32", "u32", "u8", "u8", "ptr"],
13564
13687
  returns: "u32"
@@ -13568,7 +13691,7 @@ function getOpenTUILib(libPath) {
13568
13691
  returns: "bool"
13569
13692
  },
13570
13693
  destroyRenderer: {
13571
- args: ["u32"],
13694
+ args: ["u32", "bool"],
13572
13695
  returns: "void"
13573
13696
  },
13574
13697
  setUseThread: {
@@ -13580,7 +13703,7 @@ function getOpenTUILib(libPath) {
13580
13703
  returns: "void"
13581
13704
  },
13582
13705
  setBackgroundColor: {
13583
- args: ["u32", "ptr"],
13706
+ args: ["u32", "buffer"],
13584
13707
  returns: "void"
13585
13708
  },
13586
13709
  setRenderOffset: {
@@ -13640,7 +13763,7 @@ function getOpenTUILib(libPath) {
13640
13763
  returns: "u32"
13641
13764
  },
13642
13765
  rendererSetPaletteState: {
13643
- args: ["u32", "ptr", "u32", "ptr", "ptr", "u32"],
13766
+ args: ["u32", "buffer", "u32", "buffer", "buffer", "u32"],
13644
13767
  returns: "void"
13645
13768
  },
13646
13769
  queryPixelResolution: {
@@ -13652,7 +13775,7 @@ function getOpenTUILib(libPath) {
13652
13775
  returns: "void"
13653
13776
  },
13654
13777
  createOptimizedBuffer: {
13655
- args: ["u32", "u32", "bool", "u8", "ptr", "u32"],
13778
+ args: ["u32", "u32", "bool", "u8", "buffer", "u32"],
13656
13779
  returns: "u32"
13657
13780
  },
13658
13781
  destroyOptimizedBuffer: {
@@ -13672,7 +13795,7 @@ function getOpenTUILib(libPath) {
13672
13795
  returns: "u32"
13673
13796
  },
13674
13797
  bufferClear: {
13675
- args: ["u32", "ptr"],
13798
+ args: ["u32", "buffer"],
13676
13799
  returns: "void"
13677
13800
  },
13678
13801
  bufferGetCharPtr: {
@@ -13700,7 +13823,7 @@ function getOpenTUILib(libPath) {
13700
13823
  returns: "void"
13701
13824
  },
13702
13825
  bufferGetId: {
13703
- args: ["u32", "ptr", "u32"],
13826
+ args: ["u32", "buffer", "u32"],
13704
13827
  returns: "u32"
13705
13828
  },
13706
13829
  bufferGetRealCharSize: {
@@ -13712,19 +13835,19 @@ function getOpenTUILib(libPath) {
13712
13835
  returns: "u32"
13713
13836
  },
13714
13837
  bufferDrawText: {
13715
- args: ["u32", "ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
13838
+ args: ["u32", "ptr", "u32", "u32", "u32", "buffer", "ptr", "u32"],
13716
13839
  returns: "void"
13717
13840
  },
13718
13841
  bufferSetCellWithAlphaBlending: {
13719
- args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
13842
+ args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
13720
13843
  returns: "void"
13721
13844
  },
13722
13845
  bufferSetCell: {
13723
- args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
13846
+ args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
13724
13847
  returns: "void"
13725
13848
  },
13726
13849
  bufferFillRect: {
13727
- args: ["u32", "u32", "u32", "u32", "u32", "ptr"],
13850
+ args: ["u32", "u32", "u32", "u32", "u32", "buffer"],
13728
13851
  returns: "void"
13729
13852
  },
13730
13853
  bufferColorMatrix: {
@@ -13764,7 +13887,7 @@ function getOpenTUILib(libPath) {
13764
13887
  returns: "void"
13765
13888
  },
13766
13889
  setCursorColor: {
13767
- args: ["u32", "ptr"],
13890
+ args: ["u32", "buffer"],
13768
13891
  returns: "void"
13769
13892
  },
13770
13893
  getCursorState: {
@@ -13892,11 +14015,26 @@ function getOpenTUILib(libPath) {
13892
14015
  returns: "void"
13893
14016
  },
13894
14017
  bufferDrawGrid: {
13895
- args: ["u32", "ptr", "ptr", "ptr", "ptr", "u32", "ptr", "u32", "ptr"],
14018
+ args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
13896
14019
  returns: "void"
13897
14020
  },
13898
14021
  bufferDrawBox: {
13899
- args: ["u32", "i32", "i32", "u32", "u32", "ptr", "u32", "ptr", "ptr", "ptr", "ptr", "u32", "ptr", "u32"],
14022
+ args: [
14023
+ "u32",
14024
+ "i32",
14025
+ "i32",
14026
+ "u32",
14027
+ "u32",
14028
+ "buffer",
14029
+ "u32",
14030
+ "buffer",
14031
+ "buffer",
14032
+ "buffer",
14033
+ "ptr",
14034
+ "u32",
14035
+ "ptr",
14036
+ "u32"
14037
+ ],
13900
14038
  returns: "void"
13901
14039
  },
13902
14040
  bufferPushScissorRect: {
@@ -14228,7 +14366,7 @@ function getOpenTUILib(libPath) {
14228
14366
  returns: "void"
14229
14367
  },
14230
14368
  textBufferViewSetTabIndicatorColor: {
14231
- args: ["u32", "ptr"],
14369
+ args: ["u32", "buffer"],
14232
14370
  returns: "void"
14233
14371
  },
14234
14372
  textBufferViewSetTruncate: {
@@ -14264,7 +14402,7 @@ function getOpenTUILib(libPath) {
14264
14402
  returns: "void"
14265
14403
  },
14266
14404
  editorViewGetViewport: {
14267
- args: ["u32", "ptr", "ptr", "ptr", "ptr"],
14405
+ args: ["u32", "buffer", "buffer", "buffer", "buffer"],
14268
14406
  returns: "void"
14269
14407
  },
14270
14408
  editorViewSetScrollMargin: {
@@ -14488,7 +14626,7 @@ function getOpenTUILib(libPath) {
14488
14626
  returns: "u32"
14489
14627
  },
14490
14628
  editorViewGetCursor: {
14491
- args: ["u32", "ptr", "ptr"],
14629
+ args: ["u32", "buffer", "buffer"],
14492
14630
  returns: "void"
14493
14631
  },
14494
14632
  editorViewGetText: {
@@ -14544,7 +14682,7 @@ function getOpenTUILib(libPath) {
14544
14682
  returns: "void"
14545
14683
  },
14546
14684
  editorViewSetTabIndicatorColor: {
14547
- args: ["u32", "ptr"],
14685
+ args: ["u32", "buffer"],
14548
14686
  returns: "void"
14549
14687
  },
14550
14688
  getArenaAllocatedBytes: {
@@ -14583,21 +14721,21 @@ function getOpenTUILib(libPath) {
14583
14721
  imageRetainIccCache: { args: [], returns: "void" },
14584
14722
  imageReleaseIccCache: { args: [], returns: "void" },
14585
14723
  imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
14586
- imageDecode: { args: ["ptr", "u32", "ptr"], returns: "u32" },
14587
- imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "ptr"], returns: "u32" },
14724
+ imageDecode: { args: ["ptr", "u32", "buffer"], returns: "u32" },
14725
+ imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "buffer"], returns: "u32" },
14588
14726
  imageDestroy: { args: ["u32"], returns: "void" },
14589
- imageRetain: { args: ["u32", "ptr"], returns: "u32" },
14727
+ imageRetain: { args: ["u32", "buffer"], returns: "u32" },
14590
14728
  imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
14591
14729
  imageMaterialize: { args: ["u32"], returns: "u32" },
14592
14730
  imageEnsureEncodedPng: { args: ["u32"], returns: "u32" },
14593
14731
  imageGetPixelsPtr: { args: ["u32"], returns: "ptr" },
14594
- imageClone: { args: ["u32", "ptr"], returns: "u32" },
14732
+ imageClone: { args: ["u32", "buffer"], returns: "u32" },
14595
14733
  imageCopyPixels: { args: ["u32", "ptr", "u64", "u32", "u8"], returns: "u32" },
14596
- imageResize: { args: ["u32", "u32", "u32", "u32", "ptr"], returns: "u32" },
14597
- imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "ptr"], returns: "u32" },
14598
- imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "ptr", "ptr"], returns: "u32" },
14599
- imageTransform: { args: ["u32", "u32", "ptr"], returns: "u32" },
14600
- imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "ptr"], returns: "u32" },
14734
+ imageResize: { args: ["u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
14735
+ imageExtract: { args: ["u32", "u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
14736
+ imageExtend: { args: ["u32", "u32", "u32", "u32", "u32", "buffer", "buffer"], returns: "u32" },
14737
+ imageTransform: { args: ["u32", "u32", "buffer"], returns: "u32" },
14738
+ imageComposite: { args: ["u32", "u32", "i32", "i32", "u32", "u8", "buffer"], returns: "u32" },
14601
14739
  getTerminalCapabilities: {
14602
14740
  args: ["u32", "ptr"],
14603
14741
  returns: "void"
@@ -14615,7 +14753,7 @@ function getOpenTUILib(libPath) {
14615
14753
  returns: "void"
14616
14754
  },
14617
14755
  bufferDrawChar: {
14618
- args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
14756
+ args: ["u32", "u32", "u32", "u32", "buffer", "buffer", "u32"],
14619
14757
  returns: "void"
14620
14758
  },
14621
14759
  yogaConfigCreate: {
@@ -14835,7 +14973,7 @@ function getOpenTUILib(libPath) {
14835
14973
  returns: "u32"
14836
14974
  },
14837
14975
  audioGetPlaybackDeviceName: {
14838
- args: ["u32", "u32", "ptr", "u32"],
14976
+ args: ["u32", "u32", "buffer", "u32"],
14839
14977
  returns: "u32"
14840
14978
  },
14841
14979
  audioIsPlaybackDeviceDefault: {
@@ -14859,7 +14997,7 @@ function getOpenTUILib(libPath) {
14859
14997
  returns: "u32"
14860
14998
  },
14861
14999
  audioGetCaptureDeviceName: {
14862
- args: ["u32", "u32", "ptr", "u32"],
15000
+ args: ["u32", "u32", "buffer", "u32"],
14863
15001
  returns: "u32"
14864
15002
  },
14865
15003
  audioIsCaptureDeviceDefault: {
@@ -14887,7 +15025,7 @@ function getOpenTUILib(libPath) {
14887
15025
  returns: "bool"
14888
15026
  },
14889
15027
  audioReadCapture: {
14890
- args: ["u32", "ptr", "u32", "u32", "ptr"],
15028
+ args: ["u32", "buffer", "u32", "u32", "ptr"],
14891
15029
  returns: "i32"
14892
15030
  },
14893
15031
  audioGetCaptureStats: {
@@ -14943,7 +15081,7 @@ function getOpenTUILib(libPath) {
14943
15081
  returns: "i32"
14944
15082
  },
14945
15083
  audioLoad: {
14946
- args: ["u32", "ptr", "u32", "ptr"],
15084
+ args: ["u32", "buffer", "u32", "ptr"],
14947
15085
  returns: "i32"
14948
15086
  },
14949
15087
  audioUnload: {
@@ -14963,7 +15101,7 @@ function getOpenTUILib(libPath) {
14963
15101
  returns: "i32"
14964
15102
  },
14965
15103
  audioCreateGroup: {
14966
- args: ["u32", "ptr", "u32", "ptr"],
15104
+ args: ["u32", "buffer", "u32", "ptr"],
14967
15105
  returns: "i32"
14968
15106
  },
14969
15107
  audioSetGroupVolume: {
@@ -14975,7 +15113,7 @@ function getOpenTUILib(libPath) {
14975
15113
  returns: "i32"
14976
15114
  },
14977
15115
  audioMixToBuffer: {
14978
- args: ["u32", "ptr", "u32", "u8"],
15116
+ args: ["u32", "buffer", "u32", "u8"],
14979
15117
  returns: "i32"
14980
15118
  },
14981
15119
  audioEnableTap: {
@@ -14983,7 +15121,7 @@ function getOpenTUILib(libPath) {
14983
15121
  returns: "i32"
14984
15122
  },
14985
15123
  audioReadTap: {
14986
- args: ["u32", "ptr", "u32", "u8", "ptr"],
15124
+ args: ["u32", "buffer", "u32", "u8", "ptr"],
14987
15125
  returns: "i32"
14988
15126
  },
14989
15127
  audioGetStats: {
@@ -15011,7 +15149,7 @@ function getOpenTUILib(libPath) {
15011
15149
  returns: "i32"
15012
15150
  },
15013
15151
  streamDrainSpans: {
15014
- args: ["ptr", "ptr", "u32"],
15152
+ args: ["ptr", "buffer", "u32"],
15015
15153
  returns: "u32"
15016
15154
  },
15017
15155
  streamClose: {
@@ -15198,7 +15336,6 @@ class FFIRenderLib {
15198
15336
  opentui;
15199
15337
  iccCacheClient = false;
15200
15338
  yogaLayout = new Float32Array(6);
15201
- yogaLayoutPtr = ptr(this.yogaLayout);
15202
15339
  ffiStructStorage = {
15203
15340
  logicalCursor: {
15204
15341
  ...allocStruct(LogicalCursorStruct),
@@ -15218,6 +15355,8 @@ class FFIRenderLib {
15218
15355
  ...allocStruct(MeasureResultStruct),
15219
15356
  result: { lineCount: 0, widthColsMax: 0 }
15220
15357
  },
15358
+ embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
15359
+ embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
15221
15360
  audioStreamStats: {
15222
15361
  ...allocStruct(AudioStreamStatsStruct),
15223
15362
  result: {
@@ -15263,6 +15402,134 @@ class FFIRenderLib {
15263
15402
  nativeRenderableSetMeasureTarget(handle, kind, target) {
15264
15403
  return Boolean(this.opentui.symbols.nativeRenderableSetMeasureTarget(handle, kind, target));
15265
15404
  }
15405
+ createEmbeddedTerminal(options) {
15406
+ const cols = embeddedTerminalDimension(options.cols, "columns");
15407
+ const rows = embeddedTerminalDimension(options.rows, "rows");
15408
+ const maxScrollback = toSafeFFIU32Length(options.maxScrollback ?? 1e4, "Embedded terminal maxScrollback");
15409
+ const out = new Uint32Array(1);
15410
+ embeddedTerminalResult(this.opentui.symbols.createEmbeddedTerminal(cols, rows, maxScrollback, out), "creation");
15411
+ if (!out[0])
15412
+ throw new Error("Embedded terminal creation returned an invalid handle");
15413
+ return out[0];
15414
+ }
15415
+ destroyEmbeddedTerminal(handle) {
15416
+ this.opentui.symbols.destroyEmbeddedTerminal(handle);
15417
+ }
15418
+ embeddedTerminalWrite(handle, data) {
15419
+ const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
15420
+ const length = toSafeFFIU32Length(bytes.byteLength, "Embedded terminal write length");
15421
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalWrite(handle, length === 0 ? null : bytes, length), "write");
15422
+ }
15423
+ embeddedTerminalResize(handle, cols, rows) {
15424
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalResize(handle, embeddedTerminalDimension(cols, "columns"), embeddedTerminalDimension(rows, "rows")), "resize");
15425
+ }
15426
+ embeddedTerminalInvalidate(handle) {
15427
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalInvalidate(handle), "invalidation");
15428
+ }
15429
+ embeddedTerminalScroll(handle, delta) {
15430
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalScroll(handle, embeddedTerminalI32(delta, "scroll delta")), "scroll");
15431
+ }
15432
+ embeddedTerminalSetSelection(handle, start, end) {
15433
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalSetSelection(handle, embeddedTerminalDimension(start.x + 1, "selection start x") - 1, embeddedTerminalDimension(start.y + 1, "selection start y") - 1, embeddedTerminalDimension(end.x + 1, "selection end x") - 1, embeddedTerminalDimension(end.y + 1, "selection end y") - 1), "selection update");
15434
+ }
15435
+ embeddedTerminalClearSelection(handle) {
15436
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalClearSelection(handle), "selection clear");
15437
+ }
15438
+ embeddedTerminalGetSelectedText(handle) {
15439
+ const required = new Uint32Array(1);
15440
+ const read = (output2) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output2), output2.byteLength, required);
15441
+ const initial = new Uint8Array(256);
15442
+ const status = read(initial);
15443
+ if (status >= 0)
15444
+ return initial.slice(0, status);
15445
+ if (status !== -4 || required[0] <= initial.byteLength)
15446
+ embeddedTerminalResult(status, "selection query");
15447
+ const output = new Uint8Array(required[0]);
15448
+ const length = embeddedTerminalResult(read(output), "selection query");
15449
+ return output.slice(0, length);
15450
+ }
15451
+ embeddedTerminalCompose(handle, target, x, y) {
15452
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCompose(handle, target, embeddedTerminalI32(x, "composition x"), embeddedTerminalI32(y, "composition y")), "compose");
15453
+ }
15454
+ embeddedTerminalCursor(handle) {
15455
+ const storage = this.ffiStructStorage.embeddedTerminalCursor;
15456
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.buffer), "cursor query");
15457
+ const result = EmbeddedTerminalCursorStruct.unpack(storage.buffer);
15458
+ return {
15459
+ x: result.x,
15460
+ y: result.y,
15461
+ hasValue: result.hasValue,
15462
+ visible: result.visible,
15463
+ blinking: result.blinking,
15464
+ wideTail: result.wideTail,
15465
+ style: ["bar", "block", "underline", "block-hollow"][result.style] ?? "block",
15466
+ ...result.colorHasValue ? { color: { r: result.colorR, g: result.colorG, b: result.colorB } } : {}
15467
+ };
15468
+ }
15469
+ embeddedTerminalEncodeKey(handle, key) {
15470
+ const options = this.ffiStructStorage.embeddedTerminalKeyOptions;
15471
+ EmbeddedTerminalKeyOptionsStruct.packInto({
15472
+ action: { release: 0, press: 1, repeat: 2 }[key.action ?? "press"],
15473
+ composing: key.composing ? 1 : 0,
15474
+ mods: key.mods ?? 0,
15475
+ consumedMods: key.consumedMods ?? 0,
15476
+ padding: 0,
15477
+ unshiftedCodepoint: key.unshiftedCodepoint ?? 0
15478
+ }, options.view, 0);
15479
+ const keyCode = key.key ? this.encoder.encode(key.key) : new Uint8Array;
15480
+ const keyCodeLength = toSafeFFIU32Length(keyCode.byteLength, "Embedded terminal physical key length");
15481
+ const text = key.text ? this.encoder.encode(key.text) : new Uint8Array;
15482
+ const textLength = toSafeFFIU32Length(text.byteLength, "Embedded terminal key text length");
15483
+ const required = new Uint32Array(1);
15484
+ const encode = (output2) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.buffer, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output2, output2.byteLength, required);
15485
+ const initial = new Uint8Array(Math.max(64, textLength));
15486
+ const status = encode(initial);
15487
+ if (status >= 0)
15488
+ return initial.slice(0, status);
15489
+ if (status !== -4 || required[0] <= initial.byteLength)
15490
+ embeddedTerminalResult(status, "key encoding");
15491
+ const output = new Uint8Array(required[0]);
15492
+ const length = embeddedTerminalResult(encode(output), "key encoding");
15493
+ return output.slice(0, length);
15494
+ }
15495
+ embeddedTerminalEncodeMouse(handle, mouse) {
15496
+ const output = new Uint8Array(128);
15497
+ const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodeMouse(handle, { press: 0, release: 1, motion: 2 }[mouse.action], mouse.button ? { unknown: 0, left: 1, right: 2, middle: 3, four: 4, five: 5, six: 6, seven: 7 }[mouse.button] : -1, mouse.mods ?? 0, embeddedTerminalF32(mouse.x, "mouse x"), embeddedTerminalF32(mouse.y, "mouse y"), mouse.anyButtonPressed ? 1 : 0, output, output.byteLength), "mouse encoding");
15498
+ return output.slice(0, length);
15499
+ }
15500
+ embeddedTerminalEncodePaste(handle, input) {
15501
+ const inputLength = toSafeFFIU32Length(input.byteLength, "Embedded terminal paste length");
15502
+ const outputLength = toSafeFFIU32Length(inputLength + 16, "Embedded terminal paste output length");
15503
+ const output = new Uint8Array(outputLength);
15504
+ const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodePaste(handle, inputLength === 0 ? null : input, inputLength, output, output.byteLength), "paste encoding");
15505
+ return output.slice(0, length);
15506
+ }
15507
+ embeddedTerminalEncodeFocus(handle, focused) {
15508
+ const output = new Uint8Array(16);
15509
+ const length = embeddedTerminalResult(this.opentui.symbols.embeddedTerminalEncodeFocus(handle, focused ? 1 : 0, output, output.byteLength), "focus encoding");
15510
+ return output.slice(0, length);
15511
+ }
15512
+ embeddedTerminalDrainResponses(handle) {
15513
+ const chunks = [];
15514
+ while (true) {
15515
+ const output = new Uint8Array(64 * 1024);
15516
+ const status = this.opentui.symbols.embeddedTerminalDrainResponses(handle, output, output.byteLength);
15517
+ if (status === -4)
15518
+ continue;
15519
+ const length = embeddedTerminalResult(status, "response drain");
15520
+ if (length > 0)
15521
+ chunks.push(output.slice(0, length));
15522
+ if (length < output.byteLength)
15523
+ break;
15524
+ }
15525
+ const result = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.byteLength, 0));
15526
+ let offset = 0;
15527
+ for (const chunk of chunks) {
15528
+ result.set(chunk, offset);
15529
+ offset += chunk.byteLength;
15530
+ }
15531
+ return result;
15532
+ }
15266
15533
  constructor(libPath) {
15267
15534
  this.opentui = getOpenTUILib(libPath);
15268
15535
  this.imageRetainIccCache();
@@ -15416,10 +15683,10 @@ class FFIRenderLib {
15416
15683
  setTerminalEnvVar(renderer, key, value) {
15417
15684
  const keyBytes = this.encoder.encode(key);
15418
15685
  const valueBytes = this.encoder.encode(value);
15419
- return this.opentui.symbols.setTerminalEnvVar(renderer, ptrOrNull(keyBytes), keyBytes.byteLength, ptrOrNull(valueBytes), valueBytes.byteLength);
15686
+ return this.opentui.symbols.setTerminalEnvVar(renderer, viewOrNull(keyBytes), keyBytes.byteLength, viewOrNull(valueBytes), valueBytes.byteLength);
15420
15687
  }
15421
- destroyRenderer(renderer) {
15422
- this.opentui.symbols.destroyRenderer(renderer);
15688
+ destroyRenderer(renderer, flushInput = false) {
15689
+ this.opentui.symbols.destroyRenderer(renderer, ffiBool(flushInput));
15423
15690
  }
15424
15691
  setUseThread(renderer, useThread) {
15425
15692
  this.opentui.symbols.setUseThread(renderer, ffiBool(useThread));
@@ -15428,7 +15695,7 @@ class FFIRenderLib {
15428
15695
  this.opentui.symbols.setClearOnShutdown(renderer, ffiBool(clear));
15429
15696
  }
15430
15697
  setBackgroundColor(renderer, color) {
15431
- this.opentui.symbols.setBackgroundColor(renderer, rgbaPtr(color));
15698
+ this.opentui.symbols.setBackgroundColor(renderer, rgbaBuffer(color));
15432
15699
  }
15433
15700
  setRenderOffset(renderer, offset) {
15434
15701
  this.opentui.symbols.setRenderOffset(renderer, offset);
@@ -15456,7 +15723,7 @@ class FFIRenderLib {
15456
15723
  }
15457
15724
  getRenderStats(renderer) {
15458
15725
  const statsBuffer = new ArrayBuffer(NativeRenderStatsStruct.size);
15459
- this.opentui.symbols.getRenderStats(renderer, ptr(statsBuffer));
15726
+ this.opentui.symbols.getRenderStats(renderer, statsBuffer);
15460
15727
  const stats = NativeRenderStatsStruct.unpack(statsBuffer);
15461
15728
  return {
15462
15729
  nativeLastFrameTime: stats.lastFrameTime,
@@ -15491,7 +15758,7 @@ class FFIRenderLib {
15491
15758
  for (let index = 0;index < palette.length; index++) {
15492
15759
  paletteBuffer.set(palette[index].buffer, index * 4);
15493
15760
  }
15494
- this.opentui.symbols.rendererSetPaletteState(renderer, ptr(paletteBuffer), palette.length, rgbaPtr(defaultForeground), rgbaPtr(defaultBackground), paletteEpoch >>> 0);
15761
+ this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
15495
15762
  }
15496
15763
  bufferGetCharPtr(buffer) {
15497
15764
  const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
@@ -15530,14 +15797,14 @@ class FFIRenderLib {
15530
15797
  bufferGetId(buffer) {
15531
15798
  const maxLen = 256;
15532
15799
  const outBuffer = new Uint8Array(maxLen);
15533
- const actualLen = this.opentui.symbols.bufferGetId(buffer, ptr(outBuffer), maxLen);
15800
+ const actualLen = this.opentui.symbols.bufferGetId(buffer, outBuffer, maxLen);
15534
15801
  return this.decoder.decode(outBuffer.slice(0, actualLen));
15535
15802
  }
15536
15803
  bufferGetRealCharSize(buffer) {
15537
15804
  return this.opentui.symbols.bufferGetRealCharSize(buffer);
15538
15805
  }
15539
15806
  bufferWriteResolvedChars(buffer, outputBuffer, addLineBreaks) {
15540
- return this.opentui.symbols.bufferWriteResolvedChars(buffer, ptrOrNull(outputBuffer), outputBuffer.byteLength, ffiBool(addLineBreaks));
15807
+ return this.opentui.symbols.bufferWriteResolvedChars(buffer, viewOrNull(outputBuffer), outputBuffer.byteLength, ffiBool(addLineBreaks));
15541
15808
  }
15542
15809
  getBufferWidth(buffer) {
15543
15810
  return this.opentui.symbols.getBufferWidth(buffer);
@@ -15546,39 +15813,39 @@ class FFIRenderLib {
15546
15813
  return this.opentui.symbols.getBufferHeight(buffer);
15547
15814
  }
15548
15815
  bufferClear(buffer, color) {
15549
- this.opentui.symbols.bufferClear(buffer, rgbaPtr(color));
15816
+ this.opentui.symbols.bufferClear(buffer, rgbaBuffer(color));
15550
15817
  }
15551
15818
  bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
15552
15819
  const textBytes = this.encoder.encode(text);
15553
- const bg2 = optionalRgbaPtr(bgColor);
15554
- const fg2 = rgbaPtr(color);
15555
- this.opentui.symbols.bufferDrawText(buffer, ptrOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
15820
+ const bg2 = optionalRgbaBuffer(bgColor);
15821
+ const fg2 = rgbaBuffer(color);
15822
+ this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
15556
15823
  }
15557
15824
  bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
15558
15825
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15559
- const bg2 = rgbaPtr(bgColor);
15560
- const fg2 = rgbaPtr(color);
15826
+ const bg2 = rgbaBuffer(bgColor);
15827
+ const fg2 = rgbaBuffer(color);
15561
15828
  this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
15562
15829
  }
15563
15830
  bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
15564
15831
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15565
- const bg2 = rgbaPtr(bgColor);
15566
- const fg2 = rgbaPtr(color);
15832
+ const bg2 = rgbaBuffer(bgColor);
15833
+ const fg2 = rgbaBuffer(color);
15567
15834
  this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
15568
15835
  }
15569
15836
  bufferFillRect(buffer, x, y, width, height, color) {
15570
- const bg2 = rgbaPtr(color);
15837
+ const bg2 = rgbaBuffer(color);
15571
15838
  this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
15572
15839
  }
15573
- bufferColorMatrix(buffer, matrixPtr, cellMaskPtr, cellMaskCount, strength, target) {
15574
- this.opentui.symbols.bufferColorMatrix(buffer, matrixPtr, cellMaskPtr, cellMaskCount, strength, target);
15840
+ bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
15841
+ this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
15575
15842
  }
15576
- bufferColorMatrixUniform(buffer, matrixPtr, strength, target) {
15577
- this.opentui.symbols.bufferColorMatrixUniform(buffer, matrixPtr, strength, target);
15843
+ bufferColorMatrixUniform(buffer, matrix, strength, target) {
15844
+ this.opentui.symbols.bufferColorMatrixUniform(buffer, matrix, strength, target);
15578
15845
  }
15579
- bufferDrawSuperSampleBuffer(buffer, x, y, pixelDataPtr, pixelDataLength, format, alignedBytesPerRow) {
15846
+ bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, format, alignedBytesPerRow) {
15580
15847
  const formatId = format === "bgra8unorm" ? 0 : 1;
15581
- this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y, pixelDataPtr, pixelDataLength, formatId, alignedBytesPerRow);
15848
+ this.opentui.symbols.bufferDrawSuperSampleBuffer(buffer, x, y, pixelData, pixelDataLength, formatId, alignedBytesPerRow);
15582
15849
  }
15583
15850
  bufferDrawImage(buffer, image, x, y, width, height, pixelWidth, pixelHeight, sourceX, sourceY, sourceWidth, sourceHeight, protocol) {
15584
15851
  const protocolId = { auto: 0, kitty: 1, sixel: 2, blocks: 3 }[protocol];
@@ -15598,38 +15865,38 @@ class FFIRenderLib {
15598
15865
  }, storage.view, 0);
15599
15866
  return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
15600
15867
  }
15601
- bufferDrawPackedBuffer(buffer, dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
15602
- this.opentui.symbols.bufferDrawPackedBuffer(buffer, dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
15868
+ bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
15869
+ this.opentui.symbols.bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
15603
15870
  }
15604
- bufferDrawGrayscaleBuffer(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2, bg2) {
15605
- this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, optionalRgbaPtr(fg2), optionalRgbaPtr(bg2));
15871
+ bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15872
+ this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
15606
15873
  }
15607
- bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2, bg2) {
15608
- this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, optionalRgbaPtr(fg2), optionalRgbaPtr(bg2));
15874
+ bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15875
+ this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
15609
15876
  }
15610
15877
  bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
15611
15878
  GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
15612
- this.opentui.symbols.bufferDrawGrid(buffer, ptr(borderChars), rgbaPtr(borderFg), rgbaPtr(borderBg), ptr(columnOffsets), columnCount, ptr(rowOffsets), rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
15879
+ this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
15613
15880
  }
15614
15881
  bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
15615
15882
  const titleBytes = title ? this.encoder.encode(title) : null;
15616
15883
  const titleLen = titleBytes?.byteLength ?? 0;
15617
- const titlePtr = titleBytes ? ptr(titleBytes) : null;
15884
+ const titleBuffer = titleBytes ? titleBytes : null;
15618
15885
  const bottomTitleBytes = bottomTitle ? this.encoder.encode(bottomTitle) : null;
15619
15886
  const bottomTitleLen = bottomTitleBytes?.byteLength ?? 0;
15620
- const bottomTitlePtr = bottomTitleBytes ? ptr(bottomTitleBytes) : null;
15621
- this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, ptr(borderChars), packedOptions, rgbaPtr(borderColor), rgbaPtr(backgroundColor), rgbaPtr(titleColor), titlePtr, titleLen, bottomTitlePtr, bottomTitleLen);
15887
+ const bottomTitleBuffer = bottomTitleBytes ? bottomTitleBytes : null;
15888
+ this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, rgbaBuffer(borderColor), rgbaBuffer(backgroundColor), rgbaBuffer(titleColor), titleBuffer, titleLen, bottomTitleBuffer, bottomTitleLen);
15622
15889
  }
15623
15890
  bufferResize(buffer, width, height) {
15624
15891
  this.opentui.symbols.bufferResize(buffer, width, height);
15625
15892
  }
15626
15893
  linkAlloc(url) {
15627
15894
  const urlBytes = this.encoder.encode(url);
15628
- return this.opentui.symbols.linkAlloc(ptrOrNull(urlBytes), urlBytes.byteLength);
15895
+ return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
15629
15896
  }
15630
15897
  linkGetUrl(linkId, maxLen = 512) {
15631
15898
  const outBuffer = new Uint8Array(maxLen);
15632
- const actualLen = this.opentui.symbols.linkGetUrl(linkId, ptrOrNull(outBuffer), maxLen);
15899
+ const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
15633
15900
  return this.decoder.decode(outBuffer.slice(0, actualLen));
15634
15901
  }
15635
15902
  attributesWithLink(baseAttributes, linkId) {
@@ -15645,11 +15912,11 @@ class FFIRenderLib {
15645
15912
  this.opentui.symbols.setCursorPosition(renderer, x, y, ffiBool(visible));
15646
15913
  }
15647
15914
  setCursorColor(renderer, color) {
15648
- this.opentui.symbols.setCursorColor(renderer, rgbaPtr(color));
15915
+ this.opentui.symbols.setCursorColor(renderer, rgbaBuffer(color));
15649
15916
  }
15650
15917
  getCursorState(renderer) {
15651
15918
  const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
15652
- this.opentui.symbols.getCursorState(renderer, ptr(cursorBuffer));
15919
+ this.opentui.symbols.getCursorState(renderer, cursorBuffer);
15653
15920
  const struct = CursorStateStruct.unpack(cursorBuffer);
15654
15921
  return {
15655
15922
  x: struct.x,
@@ -15690,7 +15957,7 @@ class FFIRenderLib {
15690
15957
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
15691
15958
  const idToUse = id || "unnamed buffer";
15692
15959
  const idBytes = this.encoder.encode(idToUse);
15693
- const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode, ptr(idBytes), idBytes.byteLength);
15960
+ const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode, idBytes, idBytes.byteLength);
15694
15961
  if (!bufferPtr) {
15695
15962
  throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
15696
15963
  }
@@ -15714,12 +15981,12 @@ class FFIRenderLib {
15714
15981
  }
15715
15982
  setTerminalTitle(renderer, title) {
15716
15983
  const titleBytes = this.encoder.encode(title);
15717
- this.opentui.symbols.setTerminalTitle(renderer, ptrOrNull(titleBytes), titleBytes.byteLength);
15984
+ this.opentui.symbols.setTerminalTitle(renderer, viewOrNull(titleBytes), titleBytes.byteLength);
15718
15985
  }
15719
15986
  copyToClipboardOSC52(renderer, target, textUtf8) {
15720
15987
  if (textUtf8.byteLength > 4294967295)
15721
15988
  return false;
15722
- return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target, ptrOrNull(textUtf8), textUtf8.byteLength));
15989
+ return Boolean(this.opentui.symbols.copyToClipboardOSC52(renderer, target, viewOrNull(textUtf8), textUtf8.byteLength));
15723
15990
  }
15724
15991
  clearClipboardOSC52(renderer, target) {
15725
15992
  return Boolean(this.opentui.symbols.clearClipboardOSC52(renderer, target));
@@ -15894,7 +16161,7 @@ class FFIRenderLib {
15894
16161
  const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
15895
16162
  if (bytes.length === 0)
15896
16163
  return;
15897
- this.opentui.symbols.writeOut(renderer, ptrOrNull(bytes), bytes.byteLength);
16164
+ this.opentui.symbols.writeOut(renderer, viewOrNull(bytes), bytes.byteLength);
15898
16165
  }
15899
16166
  yogaConfigCreate() {
15900
16167
  const config = this.opentui.symbols.yogaConfigCreate();
@@ -16006,7 +16273,7 @@ class FFIRenderLib {
16006
16273
  }
16007
16274
  yogaNodeGetComputedLayout(node) {
16008
16275
  const layout = this.yogaLayout;
16009
- this.opentui.symbols.yogaNodeGetComputedLayout(node, this.yogaLayoutPtr);
16276
+ this.opentui.symbols.yogaNodeGetComputedLayout(node, this.yogaLayout);
16010
16277
  return {
16011
16278
  left: layout[0],
16012
16279
  top: layout[1],
@@ -16103,16 +16370,16 @@ class FFIRenderLib {
16103
16370
  this.opentui.symbols.textBufferClear(buffer);
16104
16371
  }
16105
16372
  textBufferSetDefaultFg(buffer, fg2) {
16106
- const fgPtr = optionalRgbaPtr(fg2);
16107
- this.opentui.symbols.textBufferSetDefaultFg(buffer, fgPtr);
16373
+ const fgBuffer = optionalRgbaBuffer(fg2);
16374
+ this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
16108
16375
  }
16109
16376
  textBufferSetDefaultBg(buffer, bg2) {
16110
- const bgPtr = optionalRgbaPtr(bg2);
16111
- this.opentui.symbols.textBufferSetDefaultBg(buffer, bgPtr);
16377
+ const bgBuffer = optionalRgbaBuffer(bg2);
16378
+ this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
16112
16379
  }
16113
16380
  textBufferSetDefaultAttributes(buffer, attributes) {
16114
16381
  const attrValue = attributes === null ? null : new Uint32Array([attributes]);
16115
- this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue ? ptr(attrValue) : null);
16382
+ this.opentui.symbols.textBufferSetDefaultAttributes(buffer, attrValue);
16116
16383
  }
16117
16384
  textBufferResetDefaults(buffer) {
16118
16385
  this.opentui.symbols.textBufferResetDefaults(buffer);
@@ -16124,14 +16391,14 @@ class FFIRenderLib {
16124
16391
  this.opentui.symbols.textBufferSetTabWidth(buffer, width);
16125
16392
  }
16126
16393
  textBufferRegisterMemBuffer(buffer, bytes, owned = false) {
16127
- const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer, ptrOrNull(bytes), bytes.byteLength, ffiBool(owned));
16394
+ const result = this.opentui.symbols.textBufferRegisterMemBuffer(buffer, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
16128
16395
  if (result === 65535) {
16129
16396
  throw new Error("Failed to register memory buffer");
16130
16397
  }
16131
16398
  return result;
16132
16399
  }
16133
16400
  textBufferReplaceMemBuffer(buffer, memId, bytes, owned = false) {
16134
- return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId, ptrOrNull(bytes), bytes.byteLength, ffiBool(owned));
16401
+ return this.opentui.symbols.textBufferReplaceMemBuffer(buffer, memId, retainedPtrOrNull(bytes), bytes.byteLength, ffiBool(owned));
16135
16402
  }
16136
16403
  textBufferClearMemRegistry(buffer) {
16137
16404
  this.opentui.symbols.textBufferClearMemRegistry(buffer);
@@ -16140,14 +16407,14 @@ class FFIRenderLib {
16140
16407
  this.opentui.symbols.textBufferSetTextFromMem(buffer, memId);
16141
16408
  }
16142
16409
  textBufferAppend(buffer, bytes) {
16143
- this.opentui.symbols.textBufferAppend(buffer, ptrOrNull(bytes), bytes.byteLength);
16410
+ this.opentui.symbols.textBufferAppend(buffer, retainedPtrOrNull(bytes), bytes.byteLength);
16144
16411
  }
16145
16412
  textBufferAppendFromMemId(buffer, memId) {
16146
16413
  this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
16147
16414
  }
16148
16415
  textBufferLoadFile(buffer, path3) {
16149
16416
  const pathBytes = this.encoder.encode(path3);
16150
- return this.opentui.symbols.textBufferLoadFile(buffer, ptrOrNull(pathBytes), pathBytes.byteLength);
16417
+ return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
16151
16418
  }
16152
16419
  textBufferSetStyledText(buffer, chunks) {
16153
16420
  if (chunks.length === 0) {
@@ -16160,12 +16427,12 @@ class FFIRenderLib {
16160
16427
  textBufferGetLineCount(buffer) {
16161
16428
  return this.opentui.symbols.textBufferGetLineCount(buffer);
16162
16429
  }
16163
- textBufferGetPlainText(buffer, outPtr, maxLen) {
16164
- return this.opentui.symbols.textBufferGetPlainText(buffer, outPtr, maxLen);
16430
+ textBufferGetPlainText(buffer, outBuffer, maxLen) {
16431
+ return this.opentui.symbols.textBufferGetPlainText(buffer, outBuffer, maxLen);
16165
16432
  }
16166
16433
  getPlainTextBytes(buffer, maxLength) {
16167
16434
  const outBuffer = new Uint8Array(maxLength);
16168
- const actualLen = this.textBufferGetPlainText(buffer, ptrOrNull(outBuffer), maxLength);
16435
+ const actualLen = this.textBufferGetPlainText(buffer, viewOrNull(outBuffer), maxLength);
16169
16436
  if (actualLen === 0) {
16170
16437
  return null;
16171
16438
  }
@@ -16173,7 +16440,7 @@ class FFIRenderLib {
16173
16440
  }
16174
16441
  textBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
16175
16442
  const outBuffer = new Uint8Array(maxLength);
16176
- const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, ptrOrNull(outBuffer), maxLength);
16443
+ const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
16177
16444
  const len = actualLen;
16178
16445
  if (len === 0) {
16179
16446
  return null;
@@ -16182,7 +16449,7 @@ class FFIRenderLib {
16182
16449
  }
16183
16450
  textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
16184
16451
  const outBuffer = new Uint8Array(maxLength);
16185
- const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptrOrNull(outBuffer), maxLength);
16452
+ const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
16186
16453
  const len = actualLen;
16187
16454
  if (len === 0) {
16188
16455
  return null;
@@ -16200,8 +16467,8 @@ class FFIRenderLib {
16200
16467
  this.opentui.symbols.destroyTextBufferView(view);
16201
16468
  }
16202
16469
  textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
16203
- const bg2 = optionalRgbaPtr(bgColor);
16204
- const fg2 = optionalRgbaPtr(fgColor);
16470
+ const bg2 = optionalRgbaBuffer(bgColor);
16471
+ const fg2 = optionalRgbaBuffer(fgColor);
16205
16472
  this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
16206
16473
  }
16207
16474
  textBufferViewResetSelection(view) {
@@ -16220,18 +16487,18 @@ class FFIRenderLib {
16220
16487
  return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
16221
16488
  }
16222
16489
  textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
16223
- const bg2 = optionalRgbaPtr(bgColor);
16224
- const fg2 = optionalRgbaPtr(fgColor);
16490
+ const bg2 = optionalRgbaBuffer(bgColor);
16491
+ const fg2 = optionalRgbaBuffer(fgColor);
16225
16492
  return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
16226
16493
  }
16227
16494
  textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
16228
- const bg2 = optionalRgbaPtr(bgColor);
16229
- const fg2 = optionalRgbaPtr(fgColor);
16495
+ const bg2 = optionalRgbaBuffer(bgColor);
16496
+ const fg2 = optionalRgbaBuffer(fgColor);
16230
16497
  this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
16231
16498
  }
16232
16499
  textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
16233
- const bg2 = optionalRgbaPtr(bgColor);
16234
- const fg2 = optionalRgbaPtr(fgColor);
16500
+ const bg2 = optionalRgbaBuffer(bgColor);
16501
+ const fg2 = optionalRgbaBuffer(fgColor);
16235
16502
  return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
16236
16503
  }
16237
16504
  textBufferViewResetLocalSelection(view) {
@@ -16255,7 +16522,7 @@ class FFIRenderLib {
16255
16522
  }
16256
16523
  textBufferViewGetLineInfo(view) {
16257
16524
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16258
- this.textBufferViewGetLineInfoDirect(view, ptr(outBuffer));
16525
+ this.textBufferViewGetLineInfoDirect(view, outBuffer);
16259
16526
  const struct = LineInfoStruct.unpack(outBuffer);
16260
16527
  const lineStartCols = struct.startCols;
16261
16528
  const lineWidthCols = struct.widthCols;
@@ -16270,7 +16537,7 @@ class FFIRenderLib {
16270
16537
  }
16271
16538
  textBufferViewGetLogicalLineInfo(view) {
16272
16539
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16273
- this.textBufferViewGetLogicalLineInfoDirect(view, ptr(outBuffer));
16540
+ this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
16274
16541
  const struct = LineInfoStruct.unpack(outBuffer);
16275
16542
  const lineStartCols = struct.startCols;
16276
16543
  const lineWidthCols = struct.widthCols;
@@ -16286,21 +16553,21 @@ class FFIRenderLib {
16286
16553
  textBufferViewGetVirtualLineCount(view) {
16287
16554
  return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
16288
16555
  }
16289
- textBufferViewGetLineInfoDirect(view, outPtr) {
16290
- this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outPtr);
16556
+ textBufferViewGetLineInfoDirect(view, outBuffer) {
16557
+ this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
16291
16558
  }
16292
- textBufferViewGetLogicalLineInfoDirect(view, outPtr) {
16293
- this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view, outPtr);
16559
+ textBufferViewGetLogicalLineInfoDirect(view, outBuffer) {
16560
+ this.opentui.symbols.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
16294
16561
  }
16295
- textBufferViewGetSelectedText(view, outPtr, maxLen) {
16296
- return this.opentui.symbols.textBufferViewGetSelectedText(view, outPtr, maxLen);
16562
+ textBufferViewGetSelectedText(view, outBuffer, maxLen) {
16563
+ return this.opentui.symbols.textBufferViewGetSelectedText(view, outBuffer, maxLen);
16297
16564
  }
16298
- textBufferViewGetPlainText(view, outPtr, maxLen) {
16299
- return this.opentui.symbols.textBufferViewGetPlainText(view, outPtr, maxLen);
16565
+ textBufferViewGetPlainText(view, outBuffer, maxLen) {
16566
+ return this.opentui.symbols.textBufferViewGetPlainText(view, outBuffer, maxLen);
16300
16567
  }
16301
16568
  textBufferViewGetSelectedTextBytes(view, maxLength) {
16302
16569
  const outBuffer = new Uint8Array(maxLength);
16303
- const actualLen = this.textBufferViewGetSelectedText(view, ptrOrNull(outBuffer), maxLength);
16570
+ const actualLen = this.textBufferViewGetSelectedText(view, viewOrNull(outBuffer), maxLength);
16304
16571
  if (actualLen === 0) {
16305
16572
  return null;
16306
16573
  }
@@ -16308,7 +16575,7 @@ class FFIRenderLib {
16308
16575
  }
16309
16576
  textBufferViewGetPlainTextBytes(view, maxLength) {
16310
16577
  const outBuffer = new Uint8Array(maxLength);
16311
- const actualLen = this.textBufferViewGetPlainText(view, ptrOrNull(outBuffer), maxLength);
16578
+ const actualLen = this.textBufferViewGetPlainText(view, viewOrNull(outBuffer), maxLength);
16312
16579
  if (actualLen === 0) {
16313
16580
  return null;
16314
16581
  }
@@ -16318,7 +16585,7 @@ class FFIRenderLib {
16318
16585
  this.opentui.symbols.textBufferViewSetTabIndicator(view, indicator);
16319
16586
  }
16320
16587
  textBufferViewSetTabIndicatorColor(view, color) {
16321
- this.opentui.symbols.textBufferViewSetTabIndicatorColor(view, rgbaPtr(color));
16588
+ this.opentui.symbols.textBufferViewSetTabIndicatorColor(view, rgbaBuffer(color));
16322
16589
  }
16323
16590
  textBufferViewSetTruncate(view, truncate) {
16324
16591
  this.opentui.symbols.textBufferViewSetTruncate(view, ffiBool(truncate));
@@ -16333,11 +16600,11 @@ class FFIRenderLib {
16333
16600
  }
16334
16601
  textBufferAddHighlightByCharRange(buffer, highlight) {
16335
16602
  const packedHighlight = HighlightStruct.pack(highlight);
16336
- this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, ptr(packedHighlight));
16603
+ this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, packedHighlight);
16337
16604
  }
16338
16605
  textBufferAddHighlight(buffer, lineIdx, highlight) {
16339
16606
  const packedHighlight = HighlightStruct.pack(highlight);
16340
- this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, ptr(packedHighlight));
16607
+ this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, packedHighlight);
16341
16608
  }
16342
16609
  textBufferRemoveHighlightsByRef(buffer, hlRef) {
16343
16610
  this.opentui.symbols.textBufferRemoveHighlightsByRef(buffer, hlRef);
@@ -16353,7 +16620,7 @@ class FFIRenderLib {
16353
16620
  }
16354
16621
  textBufferGetLineHighlights(buffer, lineIdx) {
16355
16622
  const outCountBuf = new Uint32Array(1);
16356
- const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, ptr(outCountBuf));
16623
+ const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, outCountBuf);
16357
16624
  if (!nativePtr)
16358
16625
  return [];
16359
16626
  const count = outCountBuf[0];
@@ -16372,7 +16639,7 @@ class FFIRenderLib {
16372
16639
  }
16373
16640
  getBuildOptions() {
16374
16641
  const optionsBuffer = new ArrayBuffer(BuildOptionsStruct.size);
16375
- this.opentui.symbols.getBuildOptions(ptr(optionsBuffer));
16642
+ this.opentui.symbols.getBuildOptions(optionsBuffer);
16376
16643
  const options = BuildOptionsStruct.unpack(optionsBuffer);
16377
16644
  return {
16378
16645
  gpaSafeStats: !!options.gpaSafeStats,
@@ -16381,7 +16648,7 @@ class FFIRenderLib {
16381
16648
  }
16382
16649
  getAllocatorStats() {
16383
16650
  const statsBuffer = new ArrayBuffer(AllocatorStatsStruct.size);
16384
- this.opentui.symbols.getAllocatorStats(ptr(statsBuffer));
16651
+ this.opentui.symbols.getAllocatorStats(statsBuffer);
16385
16652
  const stats = AllocatorStatsStruct.unpack(statsBuffer);
16386
16653
  return {
16387
16654
  totalRequestedBytes: toNumber(stats.totalRequestedBytes),
@@ -16418,7 +16685,7 @@ class FFIRenderLib {
16418
16685
  const y = new Uint32Array(1);
16419
16686
  const width = new Uint32Array(1);
16420
16687
  const height = new Uint32Array(1);
16421
- this.opentui.symbols.editorViewGetViewport(view, ptr(x), ptr(y), ptr(width), ptr(height));
16688
+ this.opentui.symbols.editorViewGetViewport(view, x, y, width, height);
16422
16689
  return {
16423
16690
  offsetX: x[0],
16424
16691
  offsetY: y[0],
@@ -16448,7 +16715,7 @@ class FFIRenderLib {
16448
16715
  }
16449
16716
  editorViewGetLineInfo(view) {
16450
16717
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16451
- this.opentui.symbols.editorViewGetLineInfoDirect(view, ptr(outBuffer));
16718
+ this.opentui.symbols.editorViewGetLineInfoDirect(view, outBuffer);
16452
16719
  const struct = LineInfoStruct.unpack(outBuffer);
16453
16720
  const lineStartCols = struct.startCols;
16454
16721
  const lineWidthCols = struct.widthCols;
@@ -16463,7 +16730,7 @@ class FFIRenderLib {
16463
16730
  }
16464
16731
  editorViewGetLogicalLineInfo(view) {
16465
16732
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16466
- this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, ptr(outBuffer));
16733
+ this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, outBuffer);
16467
16734
  const struct = LineInfoStruct.unpack(outBuffer);
16468
16735
  const lineStartCols = struct.startCols;
16469
16736
  const lineWidthCols = struct.widthCols;
@@ -16488,20 +16755,20 @@ class FFIRenderLib {
16488
16755
  this.opentui.symbols.destroyEditBuffer(buffer);
16489
16756
  }
16490
16757
  editBufferSetText(buffer, textBytes) {
16491
- this.opentui.symbols.editBufferSetText(buffer, ptrOrNull(textBytes), textBytes.byteLength);
16758
+ this.opentui.symbols.editBufferSetText(buffer, viewOrNull(textBytes), textBytes.byteLength);
16492
16759
  }
16493
16760
  editBufferSetTextFromMem(buffer, memId) {
16494
16761
  this.opentui.symbols.editBufferSetTextFromMem(buffer, memId);
16495
16762
  }
16496
16763
  editBufferReplaceText(buffer, textBytes) {
16497
- this.opentui.symbols.editBufferReplaceText(buffer, ptrOrNull(textBytes), textBytes.byteLength);
16764
+ this.opentui.symbols.editBufferReplaceText(buffer, viewOrNull(textBytes), textBytes.byteLength);
16498
16765
  }
16499
16766
  editBufferReplaceTextFromMem(buffer, memId) {
16500
16767
  this.opentui.symbols.editBufferReplaceTextFromMem(buffer, memId);
16501
16768
  }
16502
16769
  editBufferGetText(buffer, maxLength) {
16503
16770
  const outBuffer = new Uint8Array(maxLength);
16504
- const actualLen = this.opentui.symbols.editBufferGetText(buffer, ptrOrNull(outBuffer), maxLength);
16771
+ const actualLen = this.opentui.symbols.editBufferGetText(buffer, viewOrNull(outBuffer), maxLength);
16505
16772
  const len = actualLen;
16506
16773
  if (len === 0)
16507
16774
  return null;
@@ -16509,11 +16776,11 @@ class FFIRenderLib {
16509
16776
  }
16510
16777
  editBufferInsertChar(buffer, char) {
16511
16778
  const charBytes = this.encoder.encode(char);
16512
- this.opentui.symbols.editBufferInsertChar(buffer, ptrOrNull(charBytes), charBytes.byteLength);
16779
+ this.opentui.symbols.editBufferInsertChar(buffer, viewOrNull(charBytes), charBytes.byteLength);
16513
16780
  }
16514
16781
  editBufferInsertText(buffer, text) {
16515
16782
  const textBytes = this.encoder.encode(text);
16516
- this.opentui.symbols.editBufferInsertText(buffer, ptrOrNull(textBytes), textBytes.byteLength);
16783
+ this.opentui.symbols.editBufferInsertText(buffer, viewOrNull(textBytes), textBytes.byteLength);
16517
16784
  }
16518
16785
  editBufferDeleteChar(buffer) {
16519
16786
  this.opentui.symbols.editBufferDeleteChar(buffer);
@@ -16575,7 +16842,7 @@ class FFIRenderLib {
16575
16842
  }
16576
16843
  editBufferUndo(buffer, maxLength) {
16577
16844
  const outBuffer = new Uint8Array(maxLength);
16578
- const actualLen = this.opentui.symbols.editBufferUndo(buffer, ptrOrNull(outBuffer), maxLength);
16845
+ const actualLen = this.opentui.symbols.editBufferUndo(buffer, viewOrNull(outBuffer), maxLength);
16579
16846
  const len = actualLen;
16580
16847
  if (len === 0)
16581
16848
  return null;
@@ -16583,7 +16850,7 @@ class FFIRenderLib {
16583
16850
  }
16584
16851
  editBufferRedo(buffer, maxLength) {
16585
16852
  const outBuffer = new Uint8Array(maxLength);
16586
- const actualLen = this.opentui.symbols.editBufferRedo(buffer, ptrOrNull(outBuffer), maxLength);
16853
+ const actualLen = this.opentui.symbols.editBufferRedo(buffer, viewOrNull(outBuffer), maxLength);
16587
16854
  const len = actualLen;
16588
16855
  if (len === 0)
16589
16856
  return null;
@@ -16635,7 +16902,7 @@ class FFIRenderLib {
16635
16902
  }
16636
16903
  editBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
16637
16904
  const outBuffer = new Uint8Array(maxLength);
16638
- const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, ptrOrNull(outBuffer), maxLength);
16905
+ const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, viewOrNull(outBuffer), maxLength);
16639
16906
  const len = actualLen;
16640
16907
  if (len === 0)
16641
16908
  return null;
@@ -16643,15 +16910,15 @@ class FFIRenderLib {
16643
16910
  }
16644
16911
  editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
16645
16912
  const outBuffer = new Uint8Array(maxLength);
16646
- const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptrOrNull(outBuffer), maxLength);
16913
+ const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, viewOrNull(outBuffer), maxLength);
16647
16914
  const len = actualLen;
16648
16915
  if (len === 0)
16649
16916
  return null;
16650
16917
  return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
16651
16918
  }
16652
16919
  editorViewSetSelection(view, start, end, bgColor, fgColor) {
16653
- const bg2 = optionalRgbaPtr(bgColor);
16654
- const fg2 = optionalRgbaPtr(fgColor);
16920
+ const bg2 = optionalRgbaBuffer(bgColor);
16921
+ const fg2 = optionalRgbaBuffer(fgColor);
16655
16922
  this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
16656
16923
  }
16657
16924
  editorViewResetSelection(view) {
@@ -16667,18 +16934,18 @@ class FFIRenderLib {
16667
16934
  return { start, end };
16668
16935
  }
16669
16936
  editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
16670
- const bg2 = optionalRgbaPtr(bgColor);
16671
- const fg2 = optionalRgbaPtr(fgColor);
16937
+ const bg2 = optionalRgbaBuffer(bgColor);
16938
+ const fg2 = optionalRgbaBuffer(fgColor);
16672
16939
  return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
16673
16940
  }
16674
16941
  editorViewUpdateSelection(view, end, bgColor, fgColor) {
16675
- const bg2 = optionalRgbaPtr(bgColor);
16676
- const fg2 = optionalRgbaPtr(fgColor);
16942
+ const bg2 = optionalRgbaBuffer(bgColor);
16943
+ const fg2 = optionalRgbaBuffer(fgColor);
16677
16944
  this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
16678
16945
  }
16679
16946
  editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
16680
- const bg2 = optionalRgbaPtr(bgColor);
16681
- const fg2 = optionalRgbaPtr(fgColor);
16947
+ const bg2 = optionalRgbaBuffer(bgColor);
16948
+ const fg2 = optionalRgbaBuffer(fgColor);
16682
16949
  return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, ffiBool(updateCursor), ffiBool(followCursor)));
16683
16950
  }
16684
16951
  editorViewResetLocalSelection(view) {
@@ -16686,7 +16953,7 @@ class FFIRenderLib {
16686
16953
  }
16687
16954
  editorViewGetSelectedTextBytes(view, maxLength) {
16688
16955
  const outBuffer = new Uint8Array(maxLength);
16689
- const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, ptrOrNull(outBuffer), maxLength);
16956
+ const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, viewOrNull(outBuffer), maxLength);
16690
16957
  const len = actualLen;
16691
16958
  if (len === 0)
16692
16959
  return null;
@@ -16695,12 +16962,12 @@ class FFIRenderLib {
16695
16962
  editorViewGetCursor(view) {
16696
16963
  const row = new Uint32Array(1);
16697
16964
  const col = new Uint32Array(1);
16698
- this.opentui.symbols.editorViewGetCursor(view, ptr(row), ptr(col));
16965
+ this.opentui.symbols.editorViewGetCursor(view, row, col);
16699
16966
  return { row: row[0], col: col[0] };
16700
16967
  }
16701
16968
  editorViewGetText(view, maxLength) {
16702
16969
  const outBuffer = new Uint8Array(maxLength);
16703
- const actualLen = this.opentui.symbols.editorViewGetText(view, ptrOrNull(outBuffer), maxLength);
16970
+ const actualLen = this.opentui.symbols.editorViewGetText(view, viewOrNull(outBuffer), maxLength);
16704
16971
  const len = actualLen;
16705
16972
  if (len === 0)
16706
16973
  return null;
@@ -16777,7 +17044,7 @@ class FFIRenderLib {
16777
17044
  }
16778
17045
  getTerminalCapabilities(renderer) {
16779
17046
  const capsBuffer = new ArrayBuffer(TerminalCapabilitiesStruct.size);
16780
- this.opentui.symbols.getTerminalCapabilities(renderer, ptr(capsBuffer));
17047
+ this.opentui.symbols.getTerminalCapabilities(renderer, capsBuffer);
16781
17048
  const caps = TerminalCapabilitiesStruct.unpack(capsBuffer);
16782
17049
  return {
16783
17050
  kitty_keyboard: caps.kitty_keyboard,
@@ -16810,14 +17077,14 @@ class FFIRenderLib {
16810
17077
  }
16811
17078
  processCapabilityResponse(renderer, response) {
16812
17079
  const responseBytes = this.encoder.encode(response);
16813
- this.opentui.symbols.processCapabilityResponse(renderer, ptrOrNull(responseBytes), responseBytes.byteLength);
17080
+ this.opentui.symbols.processCapabilityResponse(renderer, viewOrNull(responseBytes), responseBytes.byteLength);
16814
17081
  }
16815
17082
  encodeUnicode(text, widthMethod) {
16816
17083
  const textBytes = this.encoder.encode(text);
16817
17084
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
16818
17085
  const outPtrBuffer = new ArrayBuffer(8);
16819
17086
  const outLenBuffer = new ArrayBuffer(8);
16820
- const success = this.opentui.symbols.encodeUnicode(ptrOrNull(textBytes), textBytes.byteLength, ptr(outPtrBuffer), ptr(outLenBuffer), widthMethodCode);
17087
+ const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode);
16821
17088
  if (!success) {
16822
17089
  return null;
16823
17090
  }
@@ -16837,11 +17104,11 @@ class FFIRenderLib {
16837
17104
  this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
16838
17105
  }
16839
17106
  bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
16840
- this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaPtr(fg2), rgbaPtr(bg2), attributes);
17107
+ this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
16841
17108
  }
16842
17109
  createAudioEngine(options) {
16843
17110
  const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
16844
- const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer ? ptr(optionsBuffer) : null);
17111
+ const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer);
16845
17112
  return engineHandle ? engineHandle : null;
16846
17113
  }
16847
17114
  destroyAudioEngine(engine) {
@@ -16855,7 +17122,7 @@ class FFIRenderLib {
16855
17122
  }
16856
17123
  audioGetPlaybackDeviceName(engine, index) {
16857
17124
  const outBuffer = new Uint8Array(512);
16858
- const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index, ptr(outBuffer), outBuffer.length));
17125
+ const bytesWritten = toNumber(this.opentui.symbols.audioGetPlaybackDeviceName(engine, index, outBuffer, outBuffer.length));
16859
17126
  const safeBytesWritten = Math.max(0, Math.min(outBuffer.length, bytesWritten));
16860
17127
  return this.decoder.decode(outBuffer.subarray(0, safeBytesWritten));
16861
17128
  }
@@ -16945,7 +17212,7 @@ class FFIRenderLib {
16945
17212
  } catch {
16946
17213
  return -1;
16947
17214
  }
16948
- return this.opentui.symbols.audioStart(engine, optionsBuffer ? ptr(optionsBuffer) : null);
17215
+ return this.opentui.symbols.audioStart(engine, optionsBuffer);
16949
17216
  }
16950
17217
  audioStartMixer(engine) {
16951
17218
  return this.opentui.symbols.audioStartMixer(engine);
@@ -17004,7 +17271,7 @@ class FFIRenderLib {
17004
17271
  audioLoad(engine, data) {
17005
17272
  const outBuffer = new ArrayBuffer(4);
17006
17273
  const dataLength = toSafeFFIU32Length(data.byteLength, "Audio data length");
17007
- const status = this.opentui.symbols.audioLoad(engine, ptr(data), dataLength, ptr(outBuffer));
17274
+ const status = this.opentui.symbols.audioLoad(engine, data, dataLength, outBuffer);
17008
17275
  if (status !== 0) {
17009
17276
  return { status, soundId: null };
17010
17277
  }
@@ -17019,7 +17286,7 @@ class FFIRenderLib {
17019
17286
  return { status: -1, voiceId: null };
17020
17287
  const outBuffer = new ArrayBuffer(4);
17021
17288
  const optionsBuffer = options ? AudioVoiceOptionsStruct.pack(options) : null;
17022
- const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer ? ptr(optionsBuffer) : null, ptr(outBuffer));
17289
+ const status = this.opentui.symbols.audioPlay(engine, soundId, optionsBuffer, outBuffer);
17023
17290
  if (status !== 0) {
17024
17291
  return { status, voiceId: null };
17025
17292
  }
@@ -17038,7 +17305,7 @@ class FFIRenderLib {
17038
17305
  const outBuffer = new ArrayBuffer(4);
17039
17306
  const nameBytes = this.encoder.encode(name);
17040
17307
  const nameLength = toSafeFFIU32Length(nameBytes.byteLength, "Audio group name length");
17041
- const status = this.opentui.symbols.audioCreateGroup(engine, ptr(nameBytes), nameLength, ptr(outBuffer));
17308
+ const status = this.opentui.symbols.audioCreateGroup(engine, nameBytes, nameLength, outBuffer);
17042
17309
  if (status !== 0) {
17043
17310
  return { status, groupId: null };
17044
17311
  }
@@ -17052,14 +17319,14 @@ class FFIRenderLib {
17052
17319
  return this.opentui.symbols.audioSetMasterVolume(engine, volume);
17053
17320
  }
17054
17321
  audioMixToBuffer(engine, outBuffer, frameCount, channels) {
17055
- return this.opentui.symbols.audioMixToBuffer(engine, ptr(outBuffer), frameCount, channels);
17322
+ return this.opentui.symbols.audioMixToBuffer(engine, outBuffer, frameCount, channels);
17056
17323
  }
17057
17324
  audioEnableTap(engine, enabled, capacityFrames) {
17058
17325
  return this.opentui.symbols.audioEnableTap(engine, ffiBool(enabled), capacityFrames);
17059
17326
  }
17060
17327
  audioReadTap(engine, outBuffer, frameCount, channels) {
17061
17328
  const outFramesReadBuffer = new ArrayBuffer(4);
17062
- const status = this.opentui.symbols.audioReadTap(engine, ptr(outBuffer), frameCount, channels, ptr(outFramesReadBuffer));
17329
+ const status = this.opentui.symbols.audioReadTap(engine, outBuffer, frameCount, channels, outFramesReadBuffer);
17063
17330
  if (status !== 0) {
17064
17331
  return { status, framesRead: 0 };
17065
17332
  }
@@ -17068,7 +17335,7 @@ class FFIRenderLib {
17068
17335
  }
17069
17336
  audioGetStats(engine) {
17070
17337
  const statsBuffer = new ArrayBuffer(AudioStatsStruct.size);
17071
- const status = this.opentui.symbols.audioGetStats(engine, ptr(statsBuffer));
17338
+ const status = this.opentui.symbols.audioGetStats(engine, statsBuffer);
17072
17339
  if (status !== 0) {
17073
17340
  return null;
17074
17341
  }
@@ -17093,7 +17360,7 @@ class FFIRenderLib {
17093
17360
  }
17094
17361
  createNativeSpanFeed(options) {
17095
17362
  const optionsBuffer = options == null ? null : NativeSpanFeedOptionsStruct.pack(options);
17096
- const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer ? ptr(optionsBuffer) : null);
17363
+ const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer);
17097
17364
  if (!streamPtr) {
17098
17365
  throw new Error("Failed to create stream");
17099
17366
  }
@@ -17108,13 +17375,13 @@ class FFIRenderLib {
17108
17375
  }
17109
17376
  streamWrite(stream, data) {
17110
17377
  const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
17111
- return this.opentui.symbols.streamWrite(stream, ptrOrNull(bytes), bytes.byteLength);
17378
+ return this.opentui.symbols.streamWrite(stream, viewOrNull(bytes), bytes.byteLength);
17112
17379
  }
17113
17380
  streamCommit(stream) {
17114
17381
  return this.opentui.symbols.streamCommit(stream);
17115
17382
  }
17116
17383
  streamDrainSpans(stream, outBuffer, maxSpans) {
17117
- const count = this.opentui.symbols.streamDrainSpans(stream, ptr(outBuffer), maxSpans);
17384
+ const count = this.opentui.symbols.streamDrainSpans(stream, outBuffer, maxSpans);
17118
17385
  return toNumber(count);
17119
17386
  }
17120
17387
  streamClose(stream) {
@@ -17122,11 +17389,11 @@ class FFIRenderLib {
17122
17389
  }
17123
17390
  streamSetOptions(stream, options) {
17124
17391
  const optionsBuffer = NativeSpanFeedOptionsStruct.pack(options);
17125
- return this.opentui.symbols.streamSetOptions(stream, ptr(optionsBuffer));
17392
+ return this.opentui.symbols.streamSetOptions(stream, optionsBuffer);
17126
17393
  }
17127
17394
  streamGetStats(stream) {
17128
17395
  const statsBuffer = new ArrayBuffer(NativeSpanFeedStatsStruct.size);
17129
- const status = this.opentui.symbols.streamGetStats(stream, ptr(statsBuffer));
17396
+ const status = this.opentui.symbols.streamGetStats(stream, statsBuffer);
17130
17397
  if (status !== 0) {
17131
17398
  return null;
17132
17399
  }
@@ -17140,7 +17407,7 @@ class FFIRenderLib {
17140
17407
  }
17141
17408
  streamReserve(stream, minLen) {
17142
17409
  const reserveBuffer = new ArrayBuffer(ReserveInfoStruct.size);
17143
- const status = this.opentui.symbols.streamReserve(stream, minLen, ptr(reserveBuffer));
17410
+ const status = this.opentui.symbols.streamReserve(stream, minLen, reserveBuffer);
17144
17411
  if (status !== 0) {
17145
17412
  return { status, info: null };
17146
17413
  }
@@ -17161,13 +17428,13 @@ class FFIRenderLib {
17161
17428
  }
17162
17429
  syntaxStyleRegister(style, name, fg2, bg2, attributes) {
17163
17430
  const nameBytes = this.encoder.encode(name);
17164
- const fgPtr = optionalRgbaPtr(fg2);
17165
- const bgPtr = optionalRgbaPtr(bg2);
17166
- return this.opentui.symbols.syntaxStyleRegister(style, ptrOrNull(nameBytes), nameBytes.byteLength, fgPtr, bgPtr, attributes);
17431
+ const fgBuffer = optionalRgbaBuffer(fg2);
17432
+ const bgBuffer = optionalRgbaBuffer(bg2);
17433
+ return this.opentui.symbols.syntaxStyleRegister(style, viewOrNull(nameBytes), nameBytes.byteLength, fgBuffer, bgBuffer, attributes);
17167
17434
  }
17168
17435
  syntaxStyleResolveByName(style, name) {
17169
17436
  const nameBytes = this.encoder.encode(name);
17170
- const id = this.opentui.symbols.syntaxStyleResolveByName(style, ptrOrNull(nameBytes), nameBytes.byteLength);
17437
+ const id = this.opentui.symbols.syntaxStyleResolveByName(style, viewOrNull(nameBytes), nameBytes.byteLength);
17171
17438
  return id === 0 ? null : id;
17172
17439
  }
17173
17440
  syntaxStyleGetStyleCount(style) {
@@ -17265,7 +17532,7 @@ class FFIRenderLib {
17265
17532
  this.opentui.symbols.editorViewSetTabIndicator(view, indicator);
17266
17533
  }
17267
17534
  editorViewSetTabIndicatorColor(view, color) {
17268
- this.opentui.symbols.editorViewSetTabIndicatorColor(view, rgbaPtr(color));
17535
+ this.opentui.symbols.editorViewSetTabIndicatorColor(view, rgbaBuffer(color));
17269
17536
  }
17270
17537
  onNativeEvent(name, handler) {
17271
17538
  this._nativeEvents.on(name, handler);
@@ -18268,5 +18535,5 @@ var yoga_default = Yoga;
18268
18535
 
18269
18536
  export { toArrayBuffer, singleton, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, sleep, stringWidth2 as stringWidth, resolveBundledFilePath, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, destroyTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, createHostClipboard, createClipboard, ClipboardTarget, createRendererClipboardAdapter, Clipboard, detectLinks, OptimizedBuffer, TextBuffer, SpanInfoStruct, NativeAudioStreamFormat, NativeAudioStreamState, NativeAudioStreamStateNames, NativeAudioStreamCloseReason, NativeAudioStreamState2 as NativeAudioStreamState1, NativeAudioStreamCloseReason2 as NativeAudioStreamCloseReason1, NativeAudioStreamFormat2 as NativeAudioStreamFormat1, NativeClipboardOperationStatus, NativeClipboardStartStatus, NativeClipboardCancelStatus, NativeClipboardCopyStatus, NativeClipboardDestroyStatus, NativeClipboardShutdownStatus, LogLevel2 as LogLevel, NativeMeasureTargetKind, setRenderLibPath, resolveRenderLib, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel as LogLevel1, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_BASELINE, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_AROUND, ALIGN_SPACE_EVENLY, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX, DIMENSION_WIDTH, DIMENSION_HEIGHT, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL, DISPLAY_FLEX, DISPLAY_NONE, DISPLAY_CONTENTS, EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_START, EDGE_END, EDGE_HORIZONTAL, EDGE_VERTICAL, EDGE_ALL, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ALL, ERRATA_CLASSIC, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, GUTTER_COLUMN, GUTTER_ROW, GUTTER_ALL, JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_EVENLY, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, LOG_LEVEL_FATAL, MEASURE_MODE_UNDEFINED, MEASURE_MODE_EXACTLY, MEASURE_MODE_AT_MOST, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT, OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, POSITION_TYPE_ABSOLUTE, UNIT_UNDEFINED, UNIT_POINT, UNIT_PERCENT, UNIT_AUTO, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE, Config, Node, exports_yoga, yoga_default };
18270
18537
 
18271
- //# debugId=B3125C50E879066564756E2164756E21
18272
- //# sourceMappingURL=chunk-bun-26r5c5w5.js.map
18538
+ //# debugId=353B3B712CF6E51464756E2164756E21
18539
+ //# sourceMappingURL=chunk-bun-9335djz2.js.map