@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,285 @@
1
+ /**
2
+ * The browser side of one terminal: a Canvas 2D view over a libghostty-vt
3
+ * core plus everything a terminal needs from the DOM. It owns sizing (a
4
+ * ResizeObserver fit), frame scheduling, batched output parsing, keyboard and
5
+ * IME input through a hidden textarea, clipboard, selection, scrollback and
6
+ * its scrollbar, mouse reporting, web links, and cursor blinking. React never
7
+ * runs in its frame loop.
8
+ *
9
+ * A read-only surface creates no input element and draws no cursor; it keeps
10
+ * selection and copy, with the mount itself as the keyboard target.
11
+ *
12
+ * Copy and paste run through the DOM `copy` and `paste` events, because a
13
+ * host's Edit menu may answer Command-C and Command-V with the
14
+ * document's copy and paste commands whether or not the page saw the keydown. A settled
15
+ * selection is therefore always parked in a real DOM selection (the input
16
+ * element, or a hidden copy buffer when read-only) so the copy command has
17
+ * something to act on. The Edit menu's Cut does nothing here: its `cut`
18
+ * event is cancelled, so neither the clipboard nor the parked copy changes.
19
+ * `paste` is the same paste for a host that read the clipboard itself.
20
+ *
21
+ * A secondary click (the right button, or a Control-click) is the host's
22
+ * (`onContextMenu`): it never reaches a program tracking the mouse and leaves
23
+ * the selection as it was, and the browser's own menu never shows.
24
+ */
25
+ import { type GhosttyTheme } from './core.js';
26
+ /** Requested terminal font; omitted fields fall back to the defaults. */
27
+ interface GhosttyTerminalFont {
28
+ readonly family?: string;
29
+ readonly size?: number;
30
+ /** The line pitch in CSS pixels; 1.35 times the size when omitted (`terminalLineHeight`). */
31
+ readonly lineHeight?: number;
32
+ }
33
+ /**
34
+ * The font stack the canvas uses for a requested family: the family with the
35
+ * glyph fallbacks behind it, or the default stack when the family is empty or
36
+ * proportional (a ragged grid with a stranded cursor is worse than a
37
+ * different face). Exported for `surface.test.ts`, which checks the
38
+ * proportional-face guard against measured advances.
39
+ */
40
+ export declare function terminalFontFamily(family?: string): string;
41
+ /** What a surface draws and whom it tells about input, size, and parsed output. */
42
+ export interface GhosttyTerminalSurfaceOptions {
43
+ readonly theme: GhosttyTheme;
44
+ readonly font?: GhosttyTerminalFont;
45
+ /** Rows of history the terminal keeps above its screen until `setScrollbackLines` changes it. */
46
+ readonly scrollbackLines: number;
47
+ /** No input element, no cursor, no input sent anywhere; selection and copy remain. */
48
+ readonly readOnly?: boolean;
49
+ /** Accessible name of the input element of an interactive surface. */
50
+ readonly inputLabel?: string;
51
+ /** Accessible name of the scrollbar; `scrollbar` is public, so a host renames it in place. */
52
+ readonly scrollbackLabel?: string;
53
+ /** Keystrokes, pastes, IME text, mouse reports, and the terminal's own replies. */
54
+ readonly onData: (data: string) => void;
55
+ /** Settled grid size changes, debounced while a resize is in progress. */
56
+ readonly onResize: (cols: number, rows: number) => void;
57
+ /** Called with each `enqueue`d chunk's length in UTF-16 code units once it is parsed. */
58
+ readonly onParsed?: (units: number) => void;
59
+ /**
60
+ * Called after a parse in which the program rang the bell, once however
61
+ * many times it rang; never for a read-only surface or a replay.
62
+ */
63
+ readonly onBell?: () => void;
64
+ /** Sees every keydown first; returning false leaves the key to the host and the browser. */
65
+ readonly beforeKey?: (event: KeyboardEvent) => boolean;
66
+ /** Opens a web link Command-clicked in the terminal; links stay inert when absent. */
67
+ readonly onLinkActivate?: (url: string, event: MouseEvent) => void;
68
+ /**
69
+ * Asked for the terminal's menu by a secondary click on the screen, at the
70
+ * point it landed in window coordinates; read-only surfaces ask too.
71
+ */
72
+ readonly onContextMenu?: (point: {
73
+ readonly clientX: number;
74
+ readonly clientY: number;
75
+ }) => void;
76
+ }
77
+ /** One mounted terminal; create with `GhosttyTerminalSurface.create`, release with `dispose`. */
78
+ export declare class GhosttyTerminalSurface {
79
+ readonly canvas: HTMLCanvasElement;
80
+ /** The hidden IME textarea; null for a read-only surface. */
81
+ readonly input: HTMLTextAreaElement | null;
82
+ /** The read-only surface's hidden copy buffer, holding the selection as DOM text; null otherwise. */
83
+ private readonly copyBuffer;
84
+ readonly scrollbar: HTMLDivElement;
85
+ cols: number;
86
+ rows: number;
87
+ private readonly mount;
88
+ /** The element keyboard focus lives on: the textarea, or the mount when read-only. */
89
+ private readonly keyTarget;
90
+ private readonly readOnly;
91
+ private readonly context;
92
+ private readonly core;
93
+ private readonly options;
94
+ private hasSize;
95
+ private metrics;
96
+ private fontFamily;
97
+ private readonly requestedFontFamily;
98
+ private readonly fontSize;
99
+ private readonly lineHeight;
100
+ private readonly resizeObserver;
101
+ private readonly scrollbarThumb;
102
+ private snapshot;
103
+ private frame;
104
+ private cursorTimer;
105
+ private synchronizedRenderTimer;
106
+ private pendingOutput;
107
+ private pendingOutputTimer;
108
+ private compositionInputToSuppress;
109
+ private compositionSuppressionTimer;
110
+ private cursorOn;
111
+ private renderedCursorY;
112
+ private forceFullRender;
113
+ private scrollbarDirty;
114
+ private scrollbarState;
115
+ private scrollbarPointerId;
116
+ private scrollbarPointerOffset;
117
+ private disposed;
118
+ private resizeNotifyTimer;
119
+ private selectionEnd;
120
+ private selectionAnchorScreen;
121
+ private selectionMode;
122
+ private selectionBase;
123
+ private selectionScrollTimer;
124
+ private selectionScrollDelta;
125
+ private selectionPointer;
126
+ private mouseReportingPointerId;
127
+ private mouseReportingButton;
128
+ /** The secondary press under way, which belongs to the host's menu until its release. */
129
+ private secondaryPointerId;
130
+ private linkActivationPointerId;
131
+ private linkActivationLink;
132
+ private linkActivationOrigin;
133
+ private hoveredLink;
134
+ private hoverPointer;
135
+ private selectionClickSequence;
136
+ private selectionMoved;
137
+ private composing;
138
+ private focused;
139
+ private resizeNotified;
140
+ /** The canvas backing store installed; null until the first paint installs one. */
141
+ private canvasBacking;
142
+ /** A backing store a fit asked for, installed by the next paint (resizing clears the canvas). */
143
+ private pendingCanvasBacking;
144
+ private theme;
145
+ private readonly encodedKeyCodes;
146
+ private readonly textInk;
147
+ private primedCopySelection;
148
+ private wheelRemainder;
149
+ private lastMouseMotionData;
150
+ private mouseAnyEventTracking;
151
+ private dprMedia;
152
+ private readonly reducedMotionMedia;
153
+ private inputLeft;
154
+ private inputTop;
155
+ private constructor();
156
+ /** Builds the surface inside `mount`, replacing its children, once fonts and WASM are loaded. */
157
+ static create(mount: HTMLElement, options: GhosttyTerminalSurfaceOptions): Promise<GhosttyTerminalSurface>;
158
+ /** Parses output now and schedules its paint. */
159
+ write(data: string): void;
160
+ /**
161
+ * Queues output to parse in the next frame, right before it is painted, so
162
+ * a burst of chunks costs one parse and one paint. `onParsed` reports each
163
+ * chunk once it is parsed.
164
+ */
165
+ enqueue(data: string): void;
166
+ /** Resets every mode, the screen, and scrollback, then replays `data` without answering its queries. */
167
+ resetAndWrite(data: string): void;
168
+ /**
169
+ * Erases the scrollback and the rows above the cursor (Command-K). The
170
+ * program is not told; a shell keeps its prompt and line where they are.
171
+ */
172
+ clearToStart(): void;
173
+ /** Replaces the default colors and repaints. */
174
+ setTheme(theme: GhosttyTheme): void;
175
+ /**
176
+ * Keeps at least `lines` rows of history from now on; a shorter length
177
+ * drops the oldest rows at once, so the scrollbar and the view repaint.
178
+ */
179
+ setScrollbackLines(lines: number): void;
180
+ private parse;
181
+ private parseQueuedOutput;
182
+ private applyFontMetrics;
183
+ private readonly onReducedMotionChange;
184
+ private readonly onFontsLoaded;
185
+ /** Sizes the canvas and grid to the mount; false while the mount has no size. */
186
+ fit(): boolean;
187
+ /**
188
+ * The local grid reflows immediately, but the PTY only hears about settled
189
+ * dimensions: notifying on every drag step makes the shell reprint its
190
+ * prompt mid-drag, which reads as jitter. The first size goes out at once,
191
+ * since a session cannot start before it knows it.
192
+ */
193
+ private notifyResize;
194
+ /** Moves keyboard focus into the terminal. */
195
+ focus(): void;
196
+ /** Whether any text is selected. */
197
+ hasSelection(): boolean;
198
+ /** The selection as plain text. */
199
+ getSelection(): string;
200
+ /** Removes the selection and repaints. */
201
+ clearSelection(): void;
202
+ /**
203
+ * Pastes `text` as Command-V does: bracketed when the program asked for
204
+ * bracketed paste, and taking a reader in scrollback back to the live
205
+ * screen. Nothing happens on a read-only surface.
206
+ */
207
+ paste(text: string): void;
208
+ /** Returns the viewport from scrollback to the live screen. */
209
+ scrollToBottom(): void;
210
+ /** Stops every listener, timer, and frame and frees the terminal's WASM handles. */
211
+ dispose(): void;
212
+ /** Sends user input, bringing a reader in scrollback back to the live screen first. */
213
+ private sendInput;
214
+ private readonly onKeyDown;
215
+ private readonly onKeyUp;
216
+ private readonly onWindowKeyUp;
217
+ private readonly onWindowKeyDown;
218
+ private readonly onFocus;
219
+ private readonly onBlur;
220
+ private readonly onDevicePixelRatioChange;
221
+ private watchDevicePixelRatio;
222
+ private primeCopy;
223
+ private clearPrimedCopy;
224
+ /** Parks a settled selection where the copy command finds it. */
225
+ private primeSettledSelection;
226
+ /** The Edit menu's Copy, chosen with the pointer, arrives here rather than as a keydown. */
227
+ private readonly onCopyEvent;
228
+ private readonly onPaste;
229
+ /**
230
+ * Cut has no meaning in a terminal: the screen cannot give up its text,
231
+ * and the Edit menu's Cut would otherwise copy the parked selection and
232
+ * blank it. A cancelled cut that set no data leaves the clipboard alone.
233
+ */
234
+ private readonly onCut;
235
+ private readonly onCompositionStart;
236
+ private readonly onCompositionEnd;
237
+ private readonly onInput;
238
+ private clearCompositionInputSuppression;
239
+ private mouseTracking;
240
+ private readonly onPointerDown;
241
+ private recordSelectionClick;
242
+ private beginSelection;
243
+ private readonly onPointerMove;
244
+ private extendSelectionTo;
245
+ private setSelectionAutoscroll;
246
+ private updateHoverCursor;
247
+ private readonly onPointerLeave;
248
+ private clearHoveredLink;
249
+ private refreshHoveredLink;
250
+ private setHoveredLink;
251
+ private readonly onPointerUp;
252
+ private readonly onWheel;
253
+ private readonly onMouseDown;
254
+ private readonly onContextMenu;
255
+ private readonly onScrollbarPointerDown;
256
+ private readonly onScrollbarPointerMove;
257
+ private readonly onScrollbarPointerUp;
258
+ private readonly onScrollbarKeyDown;
259
+ private installEvents;
260
+ private removeEvents;
261
+ private scrollViewport;
262
+ private scrollbarToPointer;
263
+ private updateScrollbar;
264
+ private readScrollbarState;
265
+ private canRender;
266
+ private requestRender;
267
+ private cancelRender;
268
+ private cancelSynchronizedRenderTimer;
269
+ /**
270
+ * Whether painting must wait for an open synchronized update. The first
271
+ * check that finds one open starts its deadline, which ends the update and
272
+ * paints; the cursor holds its phase until then.
273
+ */
274
+ private deferSynchronizedRender;
275
+ private renderFrame;
276
+ private scheduleCursorBlink;
277
+ private blinkEnabled;
278
+ private positionInput;
279
+ private cellAt;
280
+ private linkAt;
281
+ private sendMouse;
282
+ private synchronizeMouseTrackingState;
283
+ private buttonFromButtons;
284
+ }
285
+ export {};