@bigpixelrocket/uiok 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +569 -0
  4. package/README.md +44 -2
  5. package/dist/VisuallyHidden.d.ts +13 -0
  6. package/dist/VisuallyHidden.js +13 -0
  7. package/dist/activity/ActivityBar.d.ts +29 -0
  8. package/dist/activity/ActivityBar.js +21 -0
  9. package/dist/activity/activity.css +43 -0
  10. package/dist/activity/index.d.ts +2 -0
  11. package/dist/activity/index.js +2 -0
  12. package/dist/button/Button.d.ts +26 -0
  13. package/dist/button/Button.js +14 -0
  14. package/dist/button/IconButton.d.ts +18 -0
  15. package/dist/button/IconButton.js +14 -0
  16. package/dist/button/button.css +95 -0
  17. package/dist/button/index.d.ts +3 -0
  18. package/dist/button/index.js +3 -0
  19. package/dist/charts/Drawing.d.ts +27 -0
  20. package/dist/charts/Drawing.js +117 -0
  21. package/dist/charts/Drawing.logic.d.ts +2 -0
  22. package/dist/charts/Drawing.logic.js +22 -0
  23. package/dist/charts/Line.logic.d.ts +33 -0
  24. package/dist/charts/Line.logic.js +72 -0
  25. package/dist/charts/LineChart.d.ts +34 -0
  26. package/dist/charts/LineChart.js +100 -0
  27. package/dist/charts/Pie.logic.d.ts +16 -0
  28. package/dist/charts/Pie.logic.js +28 -0
  29. package/dist/charts/PieChart.d.ts +20 -0
  30. package/dist/charts/PieChart.js +16 -0
  31. package/dist/charts/ResultChart.d.ts +47 -0
  32. package/dist/charts/ResultChart.js +175 -0
  33. package/dist/charts/ResultChart.logic.d.ts +42 -0
  34. package/dist/charts/ResultChart.logic.js +165 -0
  35. package/dist/charts/Scatter.logic.d.ts +55 -0
  36. package/dist/charts/Scatter.logic.js +134 -0
  37. package/dist/charts/ScatterChart.d.ts +36 -0
  38. package/dist/charts/ScatterChart.js +99 -0
  39. package/dist/charts/charts.css +310 -0
  40. package/dist/charts/index.d.ts +14 -0
  41. package/dist/charts/index.js +11 -0
  42. package/dist/charts/seriesColour.d.ts +2 -0
  43. package/dist/charts/seriesColour.js +8 -0
  44. package/dist/clock/index.d.ts +2 -0
  45. package/dist/clock/index.js +2 -0
  46. package/dist/clock/useClock.d.ts +14 -0
  47. package/dist/clock/useClock.js +57 -0
  48. package/dist/datetime/DateTimePicker.d.ts +50 -0
  49. package/dist/datetime/DateTimePicker.js +98 -0
  50. package/dist/datetime/DateTimePicker.logic.d.ts +59 -0
  51. package/dist/datetime/DateTimePicker.logic.js +103 -0
  52. package/dist/datetime/datetime.css +115 -0
  53. package/dist/datetime/index.d.ts +7 -0
  54. package/dist/datetime/index.js +7 -0
  55. package/dist/dialog/ConfirmDialog.d.ts +73 -0
  56. package/dist/dialog/ConfirmDialog.js +30 -0
  57. package/dist/dialog/DialogLegend.d.ts +21 -0
  58. package/dist/dialog/DialogLegend.js +28 -0
  59. package/dist/dialog/DialogLegend.logic.d.ts +145 -0
  60. package/dist/dialog/DialogLegend.logic.js +71 -0
  61. package/dist/dialog/ModalDialog.d.ts +101 -0
  62. package/dist/dialog/ModalDialog.js +184 -0
  63. package/dist/dialog/dialog.css +283 -0
  64. package/dist/dialog/index.d.ts +8 -0
  65. package/dist/dialog/index.js +8 -0
  66. package/dist/filter/FilterEscape.d.ts +16 -0
  67. package/dist/filter/FilterEscape.js +15 -0
  68. package/dist/filter/FilterIcon.d.ts +8 -0
  69. package/dist/filter/FilterIcon.js +11 -0
  70. package/dist/filter/filter.css +42 -0
  71. package/dist/filter/index.d.ts +3 -0
  72. package/dist/filter/index.js +3 -0
  73. package/dist/grid/DataGrid.d.ts +149 -0
  74. package/dist/grid/DataGrid.js +373 -0
  75. package/dist/grid/DataGrid.logic.d.ts +57 -0
  76. package/dist/grid/DataGrid.logic.js +121 -0
  77. package/dist/grid/grid.css +206 -0
  78. package/dist/grid/index.d.ts +7 -0
  79. package/dist/grid/index.js +7 -0
  80. package/dist/index.d.ts +32 -0
  81. package/dist/index.js +32 -0
  82. package/dist/keyboard/BrowserKeys.d.ts +15 -0
  83. package/dist/keyboard/BrowserKeys.js +28 -0
  84. package/dist/keyboard/KeyChord.logic.d.ts +25 -0
  85. package/dist/keyboard/KeyChord.logic.js +50 -0
  86. package/dist/keyboard/Keyboard.logic.d.ts +84 -0
  87. package/dist/keyboard/Keyboard.logic.js +137 -0
  88. package/dist/keyboard/OverlayWatch.d.ts +28 -0
  89. package/dist/keyboard/OverlayWatch.js +119 -0
  90. package/dist/keyboard/PageSelectAll.d.ts +14 -0
  91. package/dist/keyboard/PageSelectAll.js +22 -0
  92. package/dist/keyboard/index.d.ts +9 -0
  93. package/dist/keyboard/index.js +9 -0
  94. package/dist/keychord/KeyChord.d.ts +16 -0
  95. package/dist/keychord/KeyChord.js +55 -0
  96. package/dist/keychord/index.d.ts +2 -0
  97. package/dist/keychord/index.js +2 -0
  98. package/dist/keychord/keychord.css +41 -0
  99. package/dist/labels/UiokLabels.d.ts +41 -0
  100. package/dist/labels/UiokLabels.js +31 -0
  101. package/dist/labels/UiokProvider.d.ts +44 -0
  102. package/dist/labels/UiokProvider.js +54 -0
  103. package/dist/labels/charts.d.ts +34 -0
  104. package/dist/labels/charts.js +15 -0
  105. package/dist/labels/dateTime.d.ts +32 -0
  106. package/dist/labels/dateTime.js +14 -0
  107. package/dist/labels/dialog.d.ts +18 -0
  108. package/dist/labels/dialog.js +6 -0
  109. package/dist/labels/index.d.ts +13 -0
  110. package/dist/labels/index.js +13 -0
  111. package/dist/labels/keys.d.ts +28 -0
  112. package/dist/labels/keys.js +53 -0
  113. package/dist/labels/legend.d.ts +21 -0
  114. package/dist/labels/legend.js +7 -0
  115. package/dist/labels/listing.d.ts +16 -0
  116. package/dist/labels/listing.js +8 -0
  117. package/dist/labels/pager.d.ts +32 -0
  118. package/dist/labels/pager.js +20 -0
  119. package/dist/labels/palette.d.ts +17 -0
  120. package/dist/labels/palette.js +6 -0
  121. package/dist/labels/selectAll.d.ts +15 -0
  122. package/dist/labels/selectAll.js +6 -0
  123. package/dist/labels/terminal.d.ts +25 -0
  124. package/dist/labels/terminal.js +9 -0
  125. package/dist/legend/KeyLegend.logic.d.ts +84 -0
  126. package/dist/legend/KeyLegend.logic.js +109 -0
  127. package/dist/legend/KeyLegendStrip.d.ts +36 -0
  128. package/dist/legend/KeyLegendStrip.js +82 -0
  129. package/dist/legend/index.d.ts +3 -0
  130. package/dist/legend/index.js +3 -0
  131. package/dist/legend/legend.css +148 -0
  132. package/dist/listing/CurrentDot.d.ts +15 -0
  133. package/dist/listing/CurrentDot.js +13 -0
  134. package/dist/listing/Listing.d.ts +230 -0
  135. package/dist/listing/Listing.js +265 -0
  136. package/dist/listing/PathParts.logic.d.ts +17 -0
  137. package/dist/listing/PathParts.logic.js +18 -0
  138. package/dist/listing/index.d.ts +10 -0
  139. package/dist/listing/index.js +10 -0
  140. package/dist/listing/listing.css +867 -0
  141. package/dist/menu/MenuQuery.logic.d.ts +69 -0
  142. package/dist/menu/MenuQuery.logic.js +75 -0
  143. package/dist/menu/fuzzyMatch.d.ts +31 -0
  144. package/dist/menu/fuzzyMatch.js +296 -0
  145. package/dist/menu/index.d.ts +9 -0
  146. package/dist/menu/index.js +9 -0
  147. package/dist/menu/menu.css +203 -0
  148. package/dist/menu/useBellBeat.d.ts +8 -0
  149. package/dist/menu/useBellBeat.js +26 -0
  150. package/dist/namecut/NameCut.d.ts +22 -0
  151. package/dist/namecut/NameCut.js +28 -0
  152. package/dist/namecut/NameCut.logic.d.ts +51 -0
  153. package/dist/namecut/NameCut.logic.js +120 -0
  154. package/dist/namecut/index.d.ts +3 -0
  155. package/dist/namecut/index.js +3 -0
  156. package/dist/namecut/namecut.css +67 -0
  157. package/dist/pager/Pager.d.ts +37 -0
  158. package/dist/pager/Pager.js +38 -0
  159. package/dist/pager/Pager.logic.d.ts +13 -0
  160. package/dist/pager/Pager.logic.js +63 -0
  161. package/dist/pager/index.d.ts +7 -0
  162. package/dist/pager/index.js +7 -0
  163. package/dist/pager/pager.css +62 -0
  164. package/dist/palette/Palette.d.ts +79 -0
  165. package/dist/palette/Palette.js +60 -0
  166. package/dist/palette/index.d.ts +6 -0
  167. package/dist/palette/index.js +6 -0
  168. package/dist/palette/palette.css +159 -0
  169. package/dist/pane/PaneActions.d.ts +104 -0
  170. package/dist/pane/PaneActions.js +62 -0
  171. package/dist/pane/PaneFrame.d.ts +51 -0
  172. package/dist/pane/PaneFrame.js +28 -0
  173. package/dist/pane/PaneKeys.d.ts +41 -0
  174. package/dist/pane/PaneKeys.js +104 -0
  175. package/dist/pane/PaneKeys.logic.d.ts +95 -0
  176. package/dist/pane/PaneKeys.logic.js +109 -0
  177. package/dist/pane/index.d.ts +11 -0
  178. package/dist/pane/index.js +11 -0
  179. package/dist/pane/usePaneKeys.d.ts +141 -0
  180. package/dist/pane/usePaneKeys.js +313 -0
  181. package/dist/run/RunHeader.d.ts +50 -0
  182. package/dist/run/RunHeader.js +31 -0
  183. package/dist/run/RunProgress.logic.d.ts +29 -0
  184. package/dist/run/RunProgress.logic.js +34 -0
  185. package/dist/run/index.d.ts +3 -0
  186. package/dist/run/index.js +3 -0
  187. package/dist/run/run.css +190 -0
  188. package/dist/segmented/SegmentedChoice.d.ts +22 -0
  189. package/dist/segmented/SegmentedChoice.js +31 -0
  190. package/dist/segmented/index.d.ts +2 -0
  191. package/dist/segmented/index.js +2 -0
  192. package/dist/segmented/segmented.css +49 -0
  193. package/dist/selectall/CheckRange.logic.d.ts +8 -0
  194. package/dist/selectall/CheckRange.logic.js +23 -0
  195. package/dist/selectall/SelectAllBar.d.ts +25 -0
  196. package/dist/selectall/SelectAllBar.js +24 -0
  197. package/dist/selectall/index.d.ts +7 -0
  198. package/dist/selectall/index.js +7 -0
  199. package/dist/selectall/selectall.css +31 -0
  200. package/dist/store/KeepUnchanged.logic.d.ts +19 -0
  201. package/dist/store/KeepUnchanged.logic.js +33 -0
  202. package/dist/store/SameProps.d.ts +15 -0
  203. package/dist/store/SameProps.js +46 -0
  204. package/dist/store/ValueStore.d.ts +17 -0
  205. package/dist/store/ValueStore.js +23 -0
  206. package/dist/store/index.d.ts +8 -0
  207. package/dist/store/index.js +8 -0
  208. package/dist/store/useStableHandlers.d.ts +13 -0
  209. package/dist/store/useStableHandlers.js +22 -0
  210. package/dist/styles.css +85 -0
  211. package/dist/tabs/PageTabs.d.ts +38 -0
  212. package/dist/tabs/PageTabs.js +33 -0
  213. package/dist/tabs/index.d.ts +2 -0
  214. package/dist/tabs/index.js +2 -0
  215. package/dist/tabs/tabs.css +64 -0
  216. package/dist/terminal/Terminal.d.ts +104 -0
  217. package/dist/terminal/Terminal.js +309 -0
  218. package/dist/terminal/Terminal.logic.d.ts +66 -0
  219. package/dist/terminal/Terminal.logic.js +156 -0
  220. package/dist/terminal/TerminalMenu.d.ts +36 -0
  221. package/dist/terminal/TerminalMenu.js +87 -0
  222. package/dist/terminal/TerminalMenu.logic.d.ts +78 -0
  223. package/dist/terminal/TerminalMenu.logic.js +68 -0
  224. package/dist/terminal/TerminalScrollback.d.ts +10 -0
  225. package/dist/terminal/TerminalScrollback.js +11 -0
  226. package/dist/terminal/ghostty/LICENSE +21 -0
  227. package/dist/terminal/ghostty/core.d.ts +315 -0
  228. package/dist/terminal/ghostty/core.js +1189 -0
  229. package/dist/terminal/ghostty/fallbackColors.d.ts +12 -0
  230. package/dist/terminal/ghostty/fallbackColors.js +23 -0
  231. package/dist/terminal/ghostty/fonts/LICENSE +21 -0
  232. package/dist/terminal/ghostty/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
  233. package/dist/terminal/ghostty/keyCodes.logic.d.ts +20 -0
  234. package/dist/terminal/ghostty/keyCodes.logic.js +249 -0
  235. package/dist/terminal/ghostty/links.logic.d.ts +39 -0
  236. package/dist/terminal/ghostty/links.logic.js +84 -0
  237. package/dist/terminal/ghostty/renderer.d.ts +98 -0
  238. package/dist/terminal/ghostty/renderer.js +481 -0
  239. package/dist/terminal/ghostty/runtime.d.ts +126 -0
  240. package/dist/terminal/ghostty/runtime.js +346 -0
  241. package/dist/terminal/ghostty/spriteGlyphs.logic.d.ts +64 -0
  242. package/dist/terminal/ghostty/spriteGlyphs.logic.js +546 -0
  243. package/dist/terminal/ghostty/surface.d.ts +285 -0
  244. package/dist/terminal/ghostty/surface.js +1565 -0
  245. package/dist/terminal/ghostty/surface.logic.d.ts +181 -0
  246. package/dist/terminal/ghostty/surface.logic.js +392 -0
  247. package/dist/terminal/ghostty/vendor/LICENSE +21 -0
  248. package/dist/terminal/ghostty/vendor/ghostty-effects.wasm +0 -0
  249. package/dist/terminal/ghostty/vendor/ghostty-vt.wasm +0 -0
  250. package/dist/terminal/index.d.ts +12 -0
  251. package/dist/terminal/index.js +12 -0
  252. package/dist/terminal/terminal.css +169 -0
  253. package/dist/text/MarkedText.d.ts +14 -0
  254. package/dist/text/MarkedText.js +11 -0
  255. package/dist/text/highlightSegments.d.ts +13 -0
  256. package/dist/text/highlightSegments.js +29 -0
  257. package/dist/text/index.d.ts +3 -0
  258. package/dist/text/index.js +3 -0
  259. package/dist/text/text.css +11 -0
  260. package/dist/themes/attributes.d.ts +21 -0
  261. package/dist/themes/attributes.js +41 -0
  262. package/dist/themes/catalog.d.ts +125 -0
  263. package/dist/themes/catalog.js +940 -0
  264. package/dist/themes/color.d.ts +29 -0
  265. package/dist/themes/color.js +52 -0
  266. package/dist/themes/ids.d.ts +139 -0
  267. package/dist/themes/ids.js +59 -0
  268. package/dist/themes/index.d.ts +12 -0
  269. package/dist/themes/index.js +12 -0
  270. package/dist/themes/themes.generated.css +1830 -0
  271. package/dist/themes/tokens.d.ts +189 -0
  272. package/dist/themes/tokens.js +462 -0
  273. package/dist/tooltip/Tooltip.d.ts +21 -0
  274. package/dist/tooltip/Tooltip.js +105 -0
  275. package/dist/tooltip/Tooltip.logic.d.ts +49 -0
  276. package/dist/tooltip/Tooltip.logic.js +50 -0
  277. package/dist/tooltip/index.d.ts +3 -0
  278. package/dist/tooltip/index.js +3 -0
  279. package/dist/tooltip/tooltip.css +45 -0
  280. package/package.json +91 -4
@@ -0,0 +1,481 @@
1
+ /**
2
+ * Canvas 2D drawing of a Ghostty render snapshot: backgrounds and selection
3
+ * in runs, text in same-style runs clipped to their cells, block elements and
4
+ * box drawing as shapes snapped to device pixels, decorations, and the cursor.
5
+ * Only dirty rows are repainted unless a full frame is forced.
6
+ */
7
+ import { GHOSTTY_CELL_WIDE, ghosttyColorsEqual } from './core.js';
8
+ import { DEFAULT_SELECTION_BACKGROUND } from './fallbackColors.js';
9
+ import { ghosttySpriteCodepoint, ghosttySpriteGlyph, ghosttySpriteThickness } from './spriteGlyphs.logic.js';
10
+ // The engine hands out one object per color, so its CSS text is built once.
11
+ const cssColors = new WeakMap();
12
+ function cssColor(color) {
13
+ let text = cssColors.get(color);
14
+ if (text === undefined) {
15
+ text = `rgb(${color.r}, ${color.g}, ${color.b})`;
16
+ cssColors.set(color, text);
17
+ }
18
+ return text;
19
+ }
20
+ function sameTextStyle(left, right) {
21
+ // Selection deliberately does not participate: it only tints the background
22
+ // overlay, and splitting a text run at a selection boundary visibly shifts
23
+ // glyph spacing whenever the face's true advance differs from the cell width.
24
+ return (ghosttyColorsEqual(left.foreground, right.foreground) &&
25
+ left.bold === right.bold &&
26
+ left.italic === right.italic &&
27
+ left.invisible === right.invisible);
28
+ }
29
+ /**
30
+ * The end (exclusive) of the text run starting at `start`, absorbing
31
+ * wide-glyph spacer tails. Exported for `renderer.test.ts`, which checks the
32
+ * run boundaries directly.
33
+ */
34
+ export function ghosttyTextRunEnd(cells, start, sameStyle) {
35
+ let end = start + 1;
36
+ while (end < cells.length) {
37
+ const next = cells[end];
38
+ if (!next)
39
+ break;
40
+ if (next.wide === GHOSTTY_CELL_WIDE.spacerTail) {
41
+ end += 1;
42
+ continue;
43
+ }
44
+ if (next.text.length === 0 || !sameStyle(next))
45
+ break;
46
+ end += 1;
47
+ }
48
+ return end;
49
+ }
50
+ // Sprite shapes depend only on the codepoint and three whole-pixel sizes, so
51
+ // each combination is built once. Cells in one grid take at most two widths and
52
+ // two heights at a fractional cell size, which keeps the cache small; it is
53
+ // dropped wholesale if font or zoom changes ever fill it.
54
+ const SPRITE_CACHE_LIMIT = 4096;
55
+ const spriteCache = new Map();
56
+ function cachedSpriteGlyph(codepoint, width, height, thickness) {
57
+ // Box Drawing and Block Elements span 160 codepoints; sizes stay well under
58
+ // the field widths, and the key stays an exact integer below 2^53.
59
+ const key = codepoint - 0x2500 + 160 * (thickness + 256 * (width + 4096 * height));
60
+ let glyph = spriteCache.get(key);
61
+ if (glyph === undefined) {
62
+ glyph = ghosttySpriteGlyph(codepoint, width, height, thickness);
63
+ if (spriteCache.size >= SPRITE_CACHE_LIMIT)
64
+ spriteCache.clear();
65
+ spriteCache.set(key, glyph);
66
+ }
67
+ return glyph;
68
+ }
69
+ /**
70
+ * Where a cell boundary lands on the device pixel grid: `index` cells of
71
+ * `size` CSS pixels past `padding`, scaled by `pixelRatio` and rounded. Every
72
+ * fill that meets a neighbouring cell (row and cell backgrounds, selection,
73
+ * the cursor, decorations, and the block and box shapes) takes its edges from
74
+ * here, so two cells always share an edge exactly, with no seam where a
75
+ * fractional edge would leave a pixel half covered.
76
+ */
77
+ function deviceGridEdge(index, size, padding, pixelRatio) {
78
+ return Math.round((padding + index * size) * pixelRatio);
79
+ }
80
+ /**
81
+ * Fills a rectangle given by device pixel edges in the current fill style. The
82
+ * context is scaled by `pixelRatio`, so the edges are divided back into CSS
83
+ * pixels and land on whole device pixels again.
84
+ */
85
+ function fillDeviceRect(context, left, top, right, bottom, pixelRatio) {
86
+ context.fillRect(left / pixelRatio, top / pixelRatio, (right - left) / pixelRatio, (bottom - top) / pixelRatio);
87
+ }
88
+ /**
89
+ * Paints one block or box-drawing cell in the current fill style, inside the
90
+ * cell's device pixel edges (`deviceGridEdge` for its column, and the row's
91
+ * `deviceTop` and `deviceBottom`).
92
+ */
93
+ function paintSpriteCell(context, codepoint, column, deviceTop, deviceBottom, padding, cellWidth, pixelRatio, thickness, color) {
94
+ const deviceLeft = deviceGridEdge(column, cellWidth, padding, pixelRatio);
95
+ const deviceRight = deviceGridEdge(column + 1, cellWidth, padding, pixelRatio);
96
+ const glyph = cachedSpriteGlyph(codepoint, deviceRight - deviceLeft, deviceBottom - deviceTop, thickness);
97
+ if (glyph === null)
98
+ return;
99
+ if (glyph.alpha !== 1)
100
+ context.globalAlpha = glyph.alpha;
101
+ for (const rect of glyph.rects) {
102
+ fillDeviceRect(context, deviceLeft + rect.left, deviceTop + rect.top, deviceLeft + rect.right, deviceTop + rect.bottom, pixelRatio);
103
+ }
104
+ if (glyph.alpha !== 1)
105
+ context.globalAlpha = 1;
106
+ const arc = glyph.arc;
107
+ if (arc !== null) {
108
+ // A corner's curve can reach past the cell's edge (as upstream's does at
109
+ // some sizes), so the stroke is clipped to the cell's device pixels, the
110
+ // same ones its neighbours' backgrounds fill. The restore drops the clip
111
+ // and the stroke state and keeps the run's fill style.
112
+ context.save();
113
+ context.beginPath();
114
+ context.rect(deviceLeft / pixelRatio, deviceTop / pixelRatio, (deviceRight - deviceLeft) / pixelRatio, (deviceBottom - deviceTop) / pixelRatio);
115
+ context.clip();
116
+ context.strokeStyle = color;
117
+ context.lineWidth = arc.lineWidth / pixelRatio;
118
+ context.lineCap = 'butt';
119
+ // Arc points are device pixels from the cell's corner, converted inline
120
+ // so a frame allocates nothing per cell.
121
+ context.beginPath();
122
+ context.moveTo((deviceLeft + arc.startX) / pixelRatio, (deviceTop + arc.startY) / pixelRatio);
123
+ context.lineTo((deviceLeft + arc.bendStartX) / pixelRatio, (deviceTop + arc.bendStartY) / pixelRatio);
124
+ context.bezierCurveTo((deviceLeft + arc.control1X) / pixelRatio, (deviceTop + arc.control1Y) / pixelRatio, (deviceLeft + arc.control2X) / pixelRatio, (deviceTop + arc.control2Y) / pixelRatio, (deviceLeft + arc.bendEndX) / pixelRatio, (deviceTop + arc.bendEndY) / pixelRatio);
125
+ context.lineTo((deviceLeft + arc.endX) / pixelRatio, (deviceTop + arc.endY) / pixelRatio);
126
+ context.stroke();
127
+ context.restore();
128
+ }
129
+ }
130
+ // Text repeats from frame to frame (a redraw, a scroll), so most runs measure
131
+ // once; a font's entries are dropped wholesale once it holds this many.
132
+ const TEXT_INK_CACHE_LIMIT = 4096;
133
+ /**
134
+ * Painted glyph pixels reach up to about 1.3 device pixels past the ink box
135
+ * `measureText` reports (antialiasing and the rasterizer's smoothing, measured
136
+ * in Chromium for SF Mono, Menlo, Fira Code, and Courier New in every style),
137
+ * so ink is judged with two device pixels to spare.
138
+ */
139
+ const INK_MARGIN_DEVICE_PIXELS = 2;
140
+ /**
141
+ * The ink of each run of text a surface draws, measured once per font and
142
+ * text, so the renderer knows which runs can share one clip with every other
143
+ * run of their font and colour.
144
+ */
145
+ export class GhosttyTextInkCache {
146
+ fonts = new Map();
147
+ /** The ink of `text` in `font`, which must be the context's current font. */
148
+ measure(context, font, text) {
149
+ let entries = this.fonts.get(font);
150
+ if (entries === undefined) {
151
+ // A surface draws in at most four fonts (bold and italic) until its
152
+ // family or size changes, which leaves the old ones unused.
153
+ if (this.fonts.size >= 8)
154
+ this.fonts.clear();
155
+ entries = new Map();
156
+ this.fonts.set(font, entries);
157
+ }
158
+ let ink = entries.get(text);
159
+ if (ink === undefined) {
160
+ const metrics = context.measureText(text);
161
+ ink = {
162
+ left: metrics.actualBoundingBoxLeft,
163
+ right: metrics.actualBoundingBoxRight,
164
+ ascent: metrics.actualBoundingBoxAscent,
165
+ descent: metrics.actualBoundingBoxDescent
166
+ };
167
+ if (entries.size >= TEXT_INK_CACHE_LIMIT)
168
+ entries.clear();
169
+ entries.set(text, ink);
170
+ }
171
+ return ink;
172
+ }
173
+ /** Forgets every measurement, for when a face loads and its glyphs change under the same font. */
174
+ clear() {
175
+ this.fonts.clear();
176
+ }
177
+ }
178
+ /**
179
+ * Whether text with this ink, drawn at (`x`, `y`), stays inside `box` with
180
+ * `margin` to spare on every side, so it paints no pixel outside the box.
181
+ * The canvas only ever squeezes text drawn wider than its maximum width, so
182
+ * the unsqueezed ink is the widest it can paint.
183
+ */
184
+ export function ghosttyInkInside(ink, x, y, box, margin) {
185
+ return (x - ink.left >= box.left + margin &&
186
+ x + ink.right <= box.right - margin &&
187
+ y - ink.ascent >= box.top + margin &&
188
+ y + ink.descent <= box.bottom - margin);
189
+ }
190
+ function fontForCell(cell, fontSize, fontFamily) {
191
+ const style = cell.italic ? 'italic' : 'normal';
192
+ const weight = cell.bold ? '700' : '400';
193
+ return `${style} ${weight} ${fontSize}px ${fontFamily}`;
194
+ }
195
+ /**
196
+ * Measures a cell for the face: the `M` advance, the requested line height
197
+ * (never shorter than the face's ascent plus descent), and a baseline that
198
+ * centres the glyphs in it.
199
+ */
200
+ export function measureGhosttyCell(context, fontSize, fontFamily, lineHeight) {
201
+ context.font = `normal 400 ${fontSize}px ${fontFamily}`;
202
+ const widthMeasurement = context.measureText('M');
203
+ const verticalMeasurement = context.measureText('Mg');
204
+ const ascent = verticalMeasurement.actualBoundingBoxAscent || fontSize;
205
+ const descent = verticalMeasurement.actualBoundingBoxDescent;
206
+ const glyphHeight = ascent + descent;
207
+ const height = Math.max(1, Math.round(lineHeight), Math.ceil(glyphHeight));
208
+ return {
209
+ width: Math.max(1, widthMeasurement.width),
210
+ height,
211
+ baseline: Math.round((height - glyphHeight) / 2 + ascent)
212
+ };
213
+ }
214
+ /** How many whole cells fit in a box after padding; never less than one by one. */
215
+ export function terminalGridSize(width, height, metrics, padding) {
216
+ return {
217
+ cols: Math.max(1, Math.floor((width - padding * 2) / metrics.width)),
218
+ rows: Math.max(1, Math.floor((height - padding * 2) / metrics.height))
219
+ };
220
+ }
221
+ /** Paints a snapshot onto the canvas context. */
222
+ export function renderGhosttySnapshot(options) {
223
+ const { context, snapshot, metrics, fontSize, fontFamily, padding, forceFull, cursorOn, previousCursorY } = options;
224
+ const focused = options.focused ?? true;
225
+ const selectionBackground = options.selectionBackground ?? DEFAULT_SELECTION_BACKGROUND;
226
+ const hoveredLinkRange = options.hoveredLinkRange ?? null;
227
+ const pixelRatio = options.pixelRatio ?? 1;
228
+ // A clip of several rectangles turns Chromium's GPU canvas to multisampling
229
+ // for the whole frame, which shades an edge that falls inside a device pixel
230
+ // differently. The bar, underline, and outline cursors, and the outline an
231
+ // unfocused terminal draws, have such edges, so a frame that draws one clips
232
+ // each run on its own.
233
+ const cursorOffDevicePixels = cursorOn &&
234
+ snapshot.cursorVisible &&
235
+ snapshot.cursorX >= 0 &&
236
+ snapshot.cursorY >= 0 &&
237
+ (!focused ||
238
+ snapshot.cursorStyle === 0 ||
239
+ snapshot.cursorStyle === 2 ||
240
+ snapshot.cursorStyle === 3);
241
+ const textInk = cursorOffDevicePixels ? null : (options.textInk ?? null);
242
+ const spriteThickness = ghosttySpriteThickness(fontSize, pixelRatio);
243
+ const rowsToDraw = forceFull
244
+ ? Array.from({ length: snapshot.rows }, (_, index) => index)
245
+ : [...snapshot.dirtyRows];
246
+ if (previousCursorY !== null &&
247
+ previousCursorY !== undefined &&
248
+ previousCursorY >= 0 &&
249
+ !rowsToDraw.includes(previousCursorY)) {
250
+ rowsToDraw.push(previousCursorY);
251
+ }
252
+ if (snapshot.cursorVisible && snapshot.cursorY >= 0 && !rowsToDraw.includes(snapshot.cursorY)) {
253
+ rowsToDraw.push(snapshot.cursorY);
254
+ }
255
+ if (forceFull) {
256
+ context.save();
257
+ context.resetTransform();
258
+ context.fillStyle = cssColor(snapshot.background);
259
+ context.fillRect(0, 0, context.canvas.width, context.canvas.height);
260
+ context.restore();
261
+ }
262
+ context.textBaseline = 'alphabetic';
263
+ // By font, then by color.
264
+ const textGroups = new Map();
265
+ // The four fonts a frame can draw in, by bold and italic.
266
+ const fonts = [false, true].flatMap((bold) => [false, true].map((italic) => fontForCell({ bold, italic }, fontSize, fontFamily)));
267
+ for (const rowIndex of rowsToDraw) {
268
+ const row = snapshot.rowData[rowIndex];
269
+ if (!row)
270
+ continue;
271
+ const top = padding + rowIndex * metrics.height;
272
+ const deviceTop = deviceGridEdge(rowIndex, metrics.height, padding, pixelRatio);
273
+ const deviceBottom = deviceGridEdge(rowIndex + 1, metrics.height, padding, pixelRatio);
274
+ const columnEdge = (column) => deviceGridEdge(column, metrics.width, padding, pixelRatio);
275
+ context.fillStyle = cssColor(snapshot.background);
276
+ fillDeviceRect(context, columnEdge(0), deviceTop, columnEdge(snapshot.cols), deviceBottom, pixelRatio);
277
+ let backgroundStart = 0;
278
+ while (backgroundStart < row.cells.length) {
279
+ const first = row.cells[backgroundStart];
280
+ if (!first)
281
+ break;
282
+ let backgroundEnd = backgroundStart + 1;
283
+ while (backgroundEnd < row.cells.length) {
284
+ const next = row.cells[backgroundEnd];
285
+ if (!next ||
286
+ next.selected !== first.selected ||
287
+ !ghosttyColorsEqual(next.background, first.background)) {
288
+ break;
289
+ }
290
+ backgroundEnd += 1;
291
+ }
292
+ if (first.selected || !ghosttyColorsEqual(first.background, snapshot.background)) {
293
+ const left = columnEdge(backgroundStart);
294
+ const right = columnEdge(backgroundEnd);
295
+ if (!ghosttyColorsEqual(first.background, snapshot.background)) {
296
+ context.fillStyle = cssColor(first.background);
297
+ fillDeviceRect(context, left, deviceTop, right, deviceBottom, pixelRatio);
298
+ }
299
+ if (first.selected) {
300
+ context.fillStyle = selectionBackground;
301
+ fillDeviceRect(context, left, deviceTop, right, deviceBottom, pixelRatio);
302
+ }
303
+ }
304
+ backgroundStart = backgroundEnd;
305
+ }
306
+ let runStart = 0;
307
+ while (runStart < row.cells.length) {
308
+ const first = row.cells[runStart];
309
+ if (!first)
310
+ break;
311
+ if (first.text.length === 0) {
312
+ runStart += 1;
313
+ continue;
314
+ }
315
+ if (ghosttySpriteCodepoint(first.text) >= 0) {
316
+ // Block and box-drawing cells leave the text batch and paint as
317
+ // shapes, a same-style stretch of them under one fill style.
318
+ let runEnd = runStart + 1;
319
+ while (runEnd < row.cells.length) {
320
+ const next = row.cells[runEnd];
321
+ if (!next || ghosttySpriteCodepoint(next.text) < 0 || !sameTextStyle(next, first))
322
+ break;
323
+ runEnd += 1;
324
+ }
325
+ if (!first.invisible) {
326
+ const color = cssColor(first.foreground);
327
+ context.fillStyle = color;
328
+ for (let column = runStart; column < runEnd; column += 1) {
329
+ paintSpriteCell(context, ghosttySpriteCodepoint(row.cells[column]?.text ?? ''), column, deviceTop, deviceBottom, padding, metrics.width, pixelRatio, spriteThickness, color);
330
+ }
331
+ }
332
+ runStart = runEnd;
333
+ continue;
334
+ }
335
+ const runEnd = ghosttyTextRunEnd(row.cells, runStart, (cell) => ghosttySpriteCodepoint(cell.text) < 0 && sameTextStyle(cell, first));
336
+ const text = runEnd === runStart + 1
337
+ ? first.text
338
+ : row.cells
339
+ .slice(runStart, runEnd)
340
+ .map((cell) => cell.text)
341
+ .join('');
342
+ if (!first.invisible && text.trim().length > 0) {
343
+ const font = fonts[(first.bold ? 2 : 0) + (first.italic ? 1 : 0)];
344
+ const color = cssColor(first.foreground);
345
+ const x = padding + runStart * metrics.width;
346
+ const y = top + metrics.baseline;
347
+ const maxWidth = (runEnd - runStart) * metrics.width;
348
+ // The clip shares the backgrounds' device edges, so a glyph never
349
+ // spills half a pixel into its neighbour's background.
350
+ const clipLeft = columnEdge(runStart);
351
+ const clipRight = columnEdge(runEnd);
352
+ context.font = font;
353
+ if (textInk !== null &&
354
+ ghosttyInkInside(textInk.measure(context, font, text), x, y, {
355
+ left: columnEdge(runStart - 1) / pixelRatio,
356
+ top: deviceTop / pixelRatio,
357
+ right: columnEdge(runEnd + 1) / pixelRatio,
358
+ bottom: deviceBottom / pixelRatio
359
+ }, INK_MARGIN_DEVICE_PIXELS / pixelRatio)) {
360
+ let groups = textGroups.get(font);
361
+ if (groups === undefined) {
362
+ groups = new Map();
363
+ textGroups.set(font, groups);
364
+ }
365
+ let group = groups.get(color);
366
+ if (group === undefined) {
367
+ group = { font, color, texts: [], geometry: [] };
368
+ groups.set(color, group);
369
+ }
370
+ group.texts.push(text);
371
+ group.geometry.push(x, y, maxWidth, clipLeft / pixelRatio, deviceTop / pixelRatio, (clipRight - clipLeft) / pixelRatio, (deviceBottom - deviceTop) / pixelRatio);
372
+ }
373
+ else {
374
+ context.fillStyle = color;
375
+ context.save();
376
+ context.beginPath();
377
+ context.rect(clipLeft / pixelRatio, deviceTop / pixelRatio, (clipRight - clipLeft) / pixelRatio, (deviceBottom - deviceTop) / pixelRatio);
378
+ context.clip();
379
+ context.fillText(text, x, y, maxWidth);
380
+ context.restore();
381
+ }
382
+ }
383
+ runStart = runEnd;
384
+ }
385
+ }
386
+ // Every run in a group is clipped to its own cells by one clip, so a frame
387
+ // changes canvas state once per font and colour rather than once per run.
388
+ // Text never shares a pixel with another row's backgrounds or another
389
+ // group's text, so drawing it after them paints the same frame.
390
+ for (const group of [...textGroups.values()].flatMap((groups) => [...groups.values()])) {
391
+ const { geometry, texts } = group;
392
+ context.font = group.font;
393
+ context.fillStyle = group.color;
394
+ context.save();
395
+ context.beginPath();
396
+ for (let index = 0; index < texts.length; index += 1) {
397
+ const at = index * 7;
398
+ context.rect(geometry[at + 3], geometry[at + 4], geometry[at + 5], geometry[at + 6]);
399
+ }
400
+ context.clip();
401
+ for (let index = 0; index < texts.length; index += 1) {
402
+ const at = index * 7;
403
+ context.fillText(texts[index], geometry[at], geometry[at + 1], geometry[at + 2]);
404
+ }
405
+ context.restore();
406
+ }
407
+ // Decorations paint over the text of their row, as they always have.
408
+ for (const rowIndex of rowsToDraw) {
409
+ const row = snapshot.rowData[rowIndex];
410
+ if (!row)
411
+ continue;
412
+ const top = padding + rowIndex * metrics.height;
413
+ const columnEdge = (column) => deviceGridEdge(column, metrics.width, padding, pixelRatio);
414
+ for (let column = 0; column < row.cells.length; column += 1) {
415
+ const cell = row.cells[column];
416
+ const hoveredLink = hoveredLinkRange !== null &&
417
+ rowIndex >= hoveredLinkRange.start.y &&
418
+ rowIndex <= hoveredLinkRange.end.y &&
419
+ (rowIndex > hoveredLinkRange.start.y || column >= hoveredLinkRange.start.x) &&
420
+ (rowIndex < hoveredLinkRange.end.y || column <= hoveredLinkRange.end.x);
421
+ if (!cell || (!cell.underline && !cell.strikethrough && !cell.overline && !hoveredLink)) {
422
+ continue;
423
+ }
424
+ context.fillStyle = cssColor(cell.foreground);
425
+ // Decorations span the cell's device edges so a decorated run is unbroken.
426
+ const left = columnEdge(column) / pixelRatio;
427
+ const width = (columnEdge(column + 1) - columnEdge(column)) / pixelRatio;
428
+ if (cell.underline || hoveredLink) {
429
+ context.fillRect(left, top + metrics.height - 2, width, 1);
430
+ }
431
+ if (cell.strikethrough) {
432
+ context.fillRect(left, top + Math.floor(metrics.height * 0.55), width, 1);
433
+ }
434
+ if (cell.overline)
435
+ context.fillRect(left, top + 1, width, 1);
436
+ }
437
+ }
438
+ if (cursorOn && snapshot.cursorVisible && snapshot.cursorX >= 0 && snapshot.cursorY >= 0) {
439
+ const left = padding + snapshot.cursorX * metrics.width;
440
+ const top = padding + snapshot.cursorY * metrics.height;
441
+ const deviceLeft = deviceGridEdge(snapshot.cursorX, metrics.width, padding, pixelRatio);
442
+ const deviceRight = deviceGridEdge(snapshot.cursorX + 1, metrics.width, padding, pixelRatio);
443
+ const deviceTop = deviceGridEdge(snapshot.cursorY, metrics.height, padding, pixelRatio);
444
+ const deviceBottom = deviceGridEdge(snapshot.cursorY + 1, metrics.height, padding, pixelRatio);
445
+ context.fillStyle = cssColor(snapshot.cursor);
446
+ if (!focused) {
447
+ // An unfocused terminal draws a hollow cursor so the active pane is obvious.
448
+ context.strokeStyle = cssColor(snapshot.cursor);
449
+ context.strokeRect(left + 0.5, top + 0.5, metrics.width - 1, metrics.height - 1);
450
+ }
451
+ else if (snapshot.cursorStyle === 0) {
452
+ context.fillRect(left, top, 2, metrics.height);
453
+ }
454
+ else if (snapshot.cursorStyle === 2) {
455
+ context.fillRect(left, top + metrics.height - 2, metrics.width, 2);
456
+ }
457
+ else if (snapshot.cursorStyle === 3) {
458
+ context.strokeStyle = cssColor(snapshot.cursor);
459
+ context.strokeRect(left + 0.5, top + 0.5, metrics.width - 1, metrics.height - 1);
460
+ }
461
+ else {
462
+ // The block covers exactly the cell's device pixels, the same ones its
463
+ // background and any block or box shape under it fill.
464
+ fillDeviceRect(context, deviceLeft, deviceTop, deviceRight, deviceBottom, pixelRatio);
465
+ // An invisible cell stays hidden under the block, as it is beside it.
466
+ const cell = snapshot.rowData[snapshot.cursorY]?.cells[snapshot.cursorX];
467
+ const shown = cell !== undefined && !cell.invisible;
468
+ const spriteCodepoint = shown ? ghosttySpriteCodepoint(cell.text) : -1;
469
+ if (spriteCodepoint >= 0) {
470
+ const background = cssColor(snapshot.background);
471
+ context.fillStyle = background;
472
+ paintSpriteCell(context, spriteCodepoint, snapshot.cursorX, deviceTop, deviceBottom, padding, metrics.width, pixelRatio, spriteThickness, background);
473
+ }
474
+ else if (shown && cell.text) {
475
+ context.font = fontForCell(cell, fontSize, fontFamily);
476
+ context.fillStyle = cssColor(snapshot.background);
477
+ context.fillText(cell.text, left, top + metrics.baseline, metrics.width);
478
+ }
479
+ }
480
+ }
481
+ }
@@ -0,0 +1,126 @@
1
+ /**
2
+ * The page's single libghostty-vt WebAssembly instance and its C ABI helpers:
3
+ * export calls, allocation, struct layouts read from the module's own type
4
+ * manifest, and the callback trampolines for a terminal's effects (its
5
+ * replies, its bell, and its color scheme). Every terminal shares this
6
+ * instance and owns (and frees) its own handles inside it.
7
+ */
8
+ interface TypeField {
9
+ readonly offset: number;
10
+ readonly size: number;
11
+ /** A scalar (`u8`, `i32`, ...), `pointer`, or the name of another manifest type. */
12
+ readonly type: string;
13
+ }
14
+ /** A C struct's size, alignment, and field offsets as libghostty-vt reports them. */
15
+ export interface TypeLayout {
16
+ readonly size: number;
17
+ readonly align: number;
18
+ readonly fields: Readonly<Record<string, TypeField>>;
19
+ }
20
+ /** `GhosttyColorScheme`, which the color scheme callback writes as an `i32`. */
21
+ declare const COLOR_SCHEME_VALUE: {
22
+ readonly light: 0;
23
+ readonly dark: 1;
24
+ };
25
+ /** Whether a terminal's colors read as light or dark, as `CSI ? 996 n` reports it. */
26
+ export type GhosttyColorScheme = keyof typeof COLOR_SCHEME_VALUE;
27
+ /**
28
+ * What one terminal does with the effects it reports while it parses. Each
29
+ * runs synchronously inside `ghostty_terminal_vt_write` and must not write to
30
+ * the terminal again.
31
+ */
32
+ export interface GhosttyTerminalEffects {
33
+ /** The terminal's own replies (device status, queries), for the program. */
34
+ readonly writePty: (data: string) => void;
35
+ /**
36
+ * A BEL the parser executed: in ground state or inside a control
37
+ * sequence, never one that ends an OSC string or sits in a DCS, APC, PM,
38
+ * or SOS payload.
39
+ */
40
+ readonly bell: () => void;
41
+ /** The scheme `CSI ? 996 n` reports. */
42
+ readonly colorScheme: () => GhosttyColorScheme;
43
+ }
44
+ /**
45
+ * The bytes of a base64 `data:` URL, or null for any other URL. A bundler
46
+ * may inline a small asset (the 244-byte trampoline module) as one, and a
47
+ * page's Content Security Policy rarely lets `fetch` read `data:`, so the
48
+ * bytes are decoded here instead of fetched.
49
+ */
50
+ export declare function wasmDataUrlBytes(url: URL): Uint8Array<ArrayBuffer> | null;
51
+ /** The loaded libghostty-vt module; obtain it through `loadGhosttyRuntime`. */
52
+ export declare class GhosttyRuntime {
53
+ readonly memory: WebAssembly.Memory;
54
+ private readonly types;
55
+ private readonly exports;
56
+ private memoryView;
57
+ private heap;
58
+ private readonly effects;
59
+ private nextEffectsId;
60
+ private writePtyFunctionIndex;
61
+ private bellFunctionIndex;
62
+ private colorSchemeFunctionIndex;
63
+ private constructor();
64
+ /** Fetches and instantiates both modules; prefer the memoized `loadGhosttyRuntime`. */
65
+ static load(): Promise<GhosttyRuntime>;
66
+ /** Calls a libghostty-vt export by name. */
67
+ call(name: string, ...args: Array<number | bigint>): number;
68
+ /**
69
+ * A libghostty-vt export by name, for a loop that calls it per cell without
70
+ * `call`'s lookup and argument array.
71
+ */
72
+ exportedFunction(name: string): (...args: number[]) => number;
73
+ /** Calls a libghostty-vt export that returns a pointer, as an unsigned address. */
74
+ callPointer(name: string, ...args: Array<number | bigint>): number;
75
+ /** The layout of a named C struct. */
76
+ layout(name: string): TypeLayout;
77
+ /** Allocates `size` zeroed bytes inside the module's memory; `size` must be positive. */
78
+ alloc(size: number): number;
79
+ /** Frees an `alloc` allocation; a null pointer is ignored. */
80
+ free(pointer: number, size: number): void;
81
+ /**
82
+ * Allocates a pointer slot for a `*_new` call to fill. The engine starts it
83
+ * null, so dispose paths that run after a partial initialization never free
84
+ * a garbage pointer.
85
+ */
86
+ allocOpaque(): number;
87
+ /** Frees an `allocOpaque` slot; a null pointer is ignored. */
88
+ freeOpaque(pointer: number): void;
89
+ /** Reads the pointer stored in a slot. */
90
+ readPointer(slot: number): number;
91
+ /**
92
+ * Routes a terminal's replies, its bell, and its color scheme queries to
93
+ * `effects`; returns the id that detaches them. The engine passes every
94
+ * callback the same userdata, so one id carries them all.
95
+ */
96
+ attachEffects(terminal: number, effects: GhosttyTerminalEffects): number;
97
+ /** Stops routing a terminal's effects. */
98
+ detachEffects(terminal: number, id: number): void;
99
+ /** A DataView over module memory; recreate it after any call that can grow memory. */
100
+ view(pointer: number, size?: number): DataView;
101
+ /** A byte view over module memory; recreate it after any call that can grow memory. */
102
+ bytes(pointer: number, size: number): Uint8Array;
103
+ /**
104
+ * Every byte of module memory as one view, kept until a grow detaches it,
105
+ * for loops that read many small values. Fetch it again after any call that
106
+ * can grow memory.
107
+ */
108
+ heapBytes(): Uint8Array;
109
+ /** Reuse scalar reads across cells, refreshing after any terminal grows shared WASM memory. */
110
+ private currentMemoryView;
111
+ /** Writes a scalar struct field by name. */
112
+ setField(pointer: number, structName: string, fieldName: string, value: number): void;
113
+ /** Reads a scalar struct field by name. */
114
+ readField(pointer: number, structName: string, fieldName: string): number;
115
+ /**
116
+ * A field's scalar type: an enum reads as its backing integer, an alias as
117
+ * the type it names, and a pointer as `u32`.
118
+ */
119
+ private scalarType;
120
+ private installEffectTrampolines;
121
+ /** Adds a trampoline to the module's callback table; returns its index for `ghostty_terminal_set`. */
122
+ private addCallback;
123
+ }
124
+ /** The page's shared runtime, loaded on first use; a failed load is retried by the next call. */
125
+ export declare function loadGhosttyRuntime(): Promise<GhosttyRuntime>;
126
+ export {};