@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.
- package/CHANGELOG.md +42 -0
- package/LICENSE +21 -0
- package/NOTICE +569 -0
- package/README.md +44 -2
- package/dist/VisuallyHidden.d.ts +13 -0
- package/dist/VisuallyHidden.js +13 -0
- package/dist/activity/ActivityBar.d.ts +29 -0
- package/dist/activity/ActivityBar.js +21 -0
- package/dist/activity/activity.css +43 -0
- package/dist/activity/index.d.ts +2 -0
- package/dist/activity/index.js +2 -0
- package/dist/button/Button.d.ts +26 -0
- package/dist/button/Button.js +14 -0
- package/dist/button/IconButton.d.ts +18 -0
- package/dist/button/IconButton.js +14 -0
- package/dist/button/button.css +95 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.js +3 -0
- package/dist/charts/Drawing.d.ts +27 -0
- package/dist/charts/Drawing.js +117 -0
- package/dist/charts/Drawing.logic.d.ts +2 -0
- package/dist/charts/Drawing.logic.js +22 -0
- package/dist/charts/Line.logic.d.ts +33 -0
- package/dist/charts/Line.logic.js +72 -0
- package/dist/charts/LineChart.d.ts +34 -0
- package/dist/charts/LineChart.js +100 -0
- package/dist/charts/Pie.logic.d.ts +16 -0
- package/dist/charts/Pie.logic.js +28 -0
- package/dist/charts/PieChart.d.ts +20 -0
- package/dist/charts/PieChart.js +16 -0
- package/dist/charts/ResultChart.d.ts +47 -0
- package/dist/charts/ResultChart.js +175 -0
- package/dist/charts/ResultChart.logic.d.ts +42 -0
- package/dist/charts/ResultChart.logic.js +165 -0
- package/dist/charts/Scatter.logic.d.ts +55 -0
- package/dist/charts/Scatter.logic.js +134 -0
- package/dist/charts/ScatterChart.d.ts +36 -0
- package/dist/charts/ScatterChart.js +99 -0
- package/dist/charts/charts.css +310 -0
- package/dist/charts/index.d.ts +14 -0
- package/dist/charts/index.js +11 -0
- package/dist/charts/seriesColour.d.ts +2 -0
- package/dist/charts/seriesColour.js +8 -0
- package/dist/clock/index.d.ts +2 -0
- package/dist/clock/index.js +2 -0
- package/dist/clock/useClock.d.ts +14 -0
- package/dist/clock/useClock.js +57 -0
- package/dist/datetime/DateTimePicker.d.ts +50 -0
- package/dist/datetime/DateTimePicker.js +98 -0
- package/dist/datetime/DateTimePicker.logic.d.ts +59 -0
- package/dist/datetime/DateTimePicker.logic.js +103 -0
- package/dist/datetime/datetime.css +115 -0
- package/dist/datetime/index.d.ts +7 -0
- package/dist/datetime/index.js +7 -0
- package/dist/dialog/ConfirmDialog.d.ts +73 -0
- package/dist/dialog/ConfirmDialog.js +30 -0
- package/dist/dialog/DialogLegend.d.ts +21 -0
- package/dist/dialog/DialogLegend.js +28 -0
- package/dist/dialog/DialogLegend.logic.d.ts +145 -0
- package/dist/dialog/DialogLegend.logic.js +71 -0
- package/dist/dialog/ModalDialog.d.ts +101 -0
- package/dist/dialog/ModalDialog.js +184 -0
- package/dist/dialog/dialog.css +283 -0
- package/dist/dialog/index.d.ts +8 -0
- package/dist/dialog/index.js +8 -0
- package/dist/filter/FilterEscape.d.ts +16 -0
- package/dist/filter/FilterEscape.js +15 -0
- package/dist/filter/FilterIcon.d.ts +8 -0
- package/dist/filter/FilterIcon.js +11 -0
- package/dist/filter/filter.css +42 -0
- package/dist/filter/index.d.ts +3 -0
- package/dist/filter/index.js +3 -0
- package/dist/grid/DataGrid.d.ts +149 -0
- package/dist/grid/DataGrid.js +373 -0
- package/dist/grid/DataGrid.logic.d.ts +57 -0
- package/dist/grid/DataGrid.logic.js +121 -0
- package/dist/grid/grid.css +206 -0
- package/dist/grid/index.d.ts +7 -0
- package/dist/grid/index.js +7 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +32 -0
- package/dist/keyboard/BrowserKeys.d.ts +15 -0
- package/dist/keyboard/BrowserKeys.js +28 -0
- package/dist/keyboard/KeyChord.logic.d.ts +25 -0
- package/dist/keyboard/KeyChord.logic.js +50 -0
- package/dist/keyboard/Keyboard.logic.d.ts +84 -0
- package/dist/keyboard/Keyboard.logic.js +137 -0
- package/dist/keyboard/OverlayWatch.d.ts +28 -0
- package/dist/keyboard/OverlayWatch.js +119 -0
- package/dist/keyboard/PageSelectAll.d.ts +14 -0
- package/dist/keyboard/PageSelectAll.js +22 -0
- package/dist/keyboard/index.d.ts +9 -0
- package/dist/keyboard/index.js +9 -0
- package/dist/keychord/KeyChord.d.ts +16 -0
- package/dist/keychord/KeyChord.js +55 -0
- package/dist/keychord/index.d.ts +2 -0
- package/dist/keychord/index.js +2 -0
- package/dist/keychord/keychord.css +41 -0
- package/dist/labels/UiokLabels.d.ts +41 -0
- package/dist/labels/UiokLabels.js +31 -0
- package/dist/labels/UiokProvider.d.ts +44 -0
- package/dist/labels/UiokProvider.js +54 -0
- package/dist/labels/charts.d.ts +34 -0
- package/dist/labels/charts.js +15 -0
- package/dist/labels/dateTime.d.ts +32 -0
- package/dist/labels/dateTime.js +14 -0
- package/dist/labels/dialog.d.ts +18 -0
- package/dist/labels/dialog.js +6 -0
- package/dist/labels/index.d.ts +13 -0
- package/dist/labels/index.js +13 -0
- package/dist/labels/keys.d.ts +28 -0
- package/dist/labels/keys.js +53 -0
- package/dist/labels/legend.d.ts +21 -0
- package/dist/labels/legend.js +7 -0
- package/dist/labels/listing.d.ts +16 -0
- package/dist/labels/listing.js +8 -0
- package/dist/labels/pager.d.ts +32 -0
- package/dist/labels/pager.js +20 -0
- package/dist/labels/palette.d.ts +17 -0
- package/dist/labels/palette.js +6 -0
- package/dist/labels/selectAll.d.ts +15 -0
- package/dist/labels/selectAll.js +6 -0
- package/dist/labels/terminal.d.ts +25 -0
- package/dist/labels/terminal.js +9 -0
- package/dist/legend/KeyLegend.logic.d.ts +84 -0
- package/dist/legend/KeyLegend.logic.js +109 -0
- package/dist/legend/KeyLegendStrip.d.ts +36 -0
- package/dist/legend/KeyLegendStrip.js +82 -0
- package/dist/legend/index.d.ts +3 -0
- package/dist/legend/index.js +3 -0
- package/dist/legend/legend.css +148 -0
- package/dist/listing/CurrentDot.d.ts +15 -0
- package/dist/listing/CurrentDot.js +13 -0
- package/dist/listing/Listing.d.ts +230 -0
- package/dist/listing/Listing.js +265 -0
- package/dist/listing/PathParts.logic.d.ts +17 -0
- package/dist/listing/PathParts.logic.js +18 -0
- package/dist/listing/index.d.ts +10 -0
- package/dist/listing/index.js +10 -0
- package/dist/listing/listing.css +867 -0
- package/dist/menu/MenuQuery.logic.d.ts +69 -0
- package/dist/menu/MenuQuery.logic.js +75 -0
- package/dist/menu/fuzzyMatch.d.ts +31 -0
- package/dist/menu/fuzzyMatch.js +296 -0
- package/dist/menu/index.d.ts +9 -0
- package/dist/menu/index.js +9 -0
- package/dist/menu/menu.css +203 -0
- package/dist/menu/useBellBeat.d.ts +8 -0
- package/dist/menu/useBellBeat.js +26 -0
- package/dist/namecut/NameCut.d.ts +22 -0
- package/dist/namecut/NameCut.js +28 -0
- package/dist/namecut/NameCut.logic.d.ts +51 -0
- package/dist/namecut/NameCut.logic.js +120 -0
- package/dist/namecut/index.d.ts +3 -0
- package/dist/namecut/index.js +3 -0
- package/dist/namecut/namecut.css +67 -0
- package/dist/pager/Pager.d.ts +37 -0
- package/dist/pager/Pager.js +38 -0
- package/dist/pager/Pager.logic.d.ts +13 -0
- package/dist/pager/Pager.logic.js +63 -0
- package/dist/pager/index.d.ts +7 -0
- package/dist/pager/index.js +7 -0
- package/dist/pager/pager.css +62 -0
- package/dist/palette/Palette.d.ts +79 -0
- package/dist/palette/Palette.js +60 -0
- package/dist/palette/index.d.ts +6 -0
- package/dist/palette/index.js +6 -0
- package/dist/palette/palette.css +159 -0
- package/dist/pane/PaneActions.d.ts +104 -0
- package/dist/pane/PaneActions.js +62 -0
- package/dist/pane/PaneFrame.d.ts +51 -0
- package/dist/pane/PaneFrame.js +28 -0
- package/dist/pane/PaneKeys.d.ts +41 -0
- package/dist/pane/PaneKeys.js +104 -0
- package/dist/pane/PaneKeys.logic.d.ts +95 -0
- package/dist/pane/PaneKeys.logic.js +109 -0
- package/dist/pane/index.d.ts +11 -0
- package/dist/pane/index.js +11 -0
- package/dist/pane/usePaneKeys.d.ts +141 -0
- package/dist/pane/usePaneKeys.js +313 -0
- package/dist/run/RunHeader.d.ts +50 -0
- package/dist/run/RunHeader.js +31 -0
- package/dist/run/RunProgress.logic.d.ts +29 -0
- package/dist/run/RunProgress.logic.js +34 -0
- package/dist/run/index.d.ts +3 -0
- package/dist/run/index.js +3 -0
- package/dist/run/run.css +190 -0
- package/dist/segmented/SegmentedChoice.d.ts +22 -0
- package/dist/segmented/SegmentedChoice.js +31 -0
- package/dist/segmented/index.d.ts +2 -0
- package/dist/segmented/index.js +2 -0
- package/dist/segmented/segmented.css +49 -0
- package/dist/selectall/CheckRange.logic.d.ts +8 -0
- package/dist/selectall/CheckRange.logic.js +23 -0
- package/dist/selectall/SelectAllBar.d.ts +25 -0
- package/dist/selectall/SelectAllBar.js +24 -0
- package/dist/selectall/index.d.ts +7 -0
- package/dist/selectall/index.js +7 -0
- package/dist/selectall/selectall.css +31 -0
- package/dist/store/KeepUnchanged.logic.d.ts +19 -0
- package/dist/store/KeepUnchanged.logic.js +33 -0
- package/dist/store/SameProps.d.ts +15 -0
- package/dist/store/SameProps.js +46 -0
- package/dist/store/ValueStore.d.ts +17 -0
- package/dist/store/ValueStore.js +23 -0
- package/dist/store/index.d.ts +8 -0
- package/dist/store/index.js +8 -0
- package/dist/store/useStableHandlers.d.ts +13 -0
- package/dist/store/useStableHandlers.js +22 -0
- package/dist/styles.css +85 -0
- package/dist/tabs/PageTabs.d.ts +38 -0
- package/dist/tabs/PageTabs.js +33 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/tabs.css +64 -0
- package/dist/terminal/Terminal.d.ts +104 -0
- package/dist/terminal/Terminal.js +309 -0
- package/dist/terminal/Terminal.logic.d.ts +66 -0
- package/dist/terminal/Terminal.logic.js +156 -0
- package/dist/terminal/TerminalMenu.d.ts +36 -0
- package/dist/terminal/TerminalMenu.js +87 -0
- package/dist/terminal/TerminalMenu.logic.d.ts +78 -0
- package/dist/terminal/TerminalMenu.logic.js +68 -0
- package/dist/terminal/TerminalScrollback.d.ts +10 -0
- package/dist/terminal/TerminalScrollback.js +11 -0
- package/dist/terminal/ghostty/LICENSE +21 -0
- package/dist/terminal/ghostty/core.d.ts +315 -0
- package/dist/terminal/ghostty/core.js +1189 -0
- package/dist/terminal/ghostty/fallbackColors.d.ts +12 -0
- package/dist/terminal/ghostty/fallbackColors.js +23 -0
- package/dist/terminal/ghostty/fonts/LICENSE +21 -0
- package/dist/terminal/ghostty/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
- package/dist/terminal/ghostty/keyCodes.logic.d.ts +20 -0
- package/dist/terminal/ghostty/keyCodes.logic.js +249 -0
- package/dist/terminal/ghostty/links.logic.d.ts +39 -0
- package/dist/terminal/ghostty/links.logic.js +84 -0
- package/dist/terminal/ghostty/renderer.d.ts +98 -0
- package/dist/terminal/ghostty/renderer.js +481 -0
- package/dist/terminal/ghostty/runtime.d.ts +126 -0
- package/dist/terminal/ghostty/runtime.js +346 -0
- package/dist/terminal/ghostty/spriteGlyphs.logic.d.ts +64 -0
- package/dist/terminal/ghostty/spriteGlyphs.logic.js +546 -0
- package/dist/terminal/ghostty/surface.d.ts +285 -0
- package/dist/terminal/ghostty/surface.js +1565 -0
- package/dist/terminal/ghostty/surface.logic.d.ts +181 -0
- package/dist/terminal/ghostty/surface.logic.js +392 -0
- package/dist/terminal/ghostty/vendor/LICENSE +21 -0
- package/dist/terminal/ghostty/vendor/ghostty-effects.wasm +0 -0
- package/dist/terminal/ghostty/vendor/ghostty-vt.wasm +0 -0
- package/dist/terminal/index.d.ts +12 -0
- package/dist/terminal/index.js +12 -0
- package/dist/terminal/terminal.css +169 -0
- package/dist/text/MarkedText.d.ts +14 -0
- package/dist/text/MarkedText.js +11 -0
- package/dist/text/highlightSegments.d.ts +13 -0
- package/dist/text/highlightSegments.js +29 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.js +3 -0
- package/dist/text/text.css +11 -0
- package/dist/themes/attributes.d.ts +21 -0
- package/dist/themes/attributes.js +41 -0
- package/dist/themes/catalog.d.ts +125 -0
- package/dist/themes/catalog.js +940 -0
- package/dist/themes/color.d.ts +29 -0
- package/dist/themes/color.js +52 -0
- package/dist/themes/ids.d.ts +139 -0
- package/dist/themes/ids.js +59 -0
- package/dist/themes/index.d.ts +12 -0
- package/dist/themes/index.js +12 -0
- package/dist/themes/themes.generated.css +1830 -0
- package/dist/themes/tokens.d.ts +189 -0
- package/dist/themes/tokens.js +462 -0
- package/dist/tooltip/Tooltip.d.ts +21 -0
- package/dist/tooltip/Tooltip.js +105 -0
- package/dist/tooltip/Tooltip.logic.d.ts +49 -0
- package/dist/tooltip/Tooltip.logic.js +50 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.js +3 -0
- package/dist/tooltip/tooltip.css +45 -0
- package/package.json +91 -4
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One terminal's libghostty-vt handles: VT parsing, render snapshots, key,
|
|
3
|
+
* paste, and mouse encoding, selection, and scrollback, translated from the C
|
|
4
|
+
* ABI into plain values. Every handle is freed by `dispose`.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* How many terminals one page's shared engine memory is budgeted for: sixteen
|
|
8
|
+
* interactive terminals and one read-only log. Every terminal on a page
|
|
9
|
+
* shares one WebAssembly memory, which wasm32 caps at 4 GiB, so each
|
|
10
|
+
* terminal's history ceiling is a share of it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const GHOSTTY_BUDGETED_TERMINALS = 17;
|
|
13
|
+
/** Ghostty's cell width classes: a wide glyph's second column is its spacer tail. */
|
|
14
|
+
export declare const GHOSTTY_CELL_WIDE: {
|
|
15
|
+
readonly narrow: 0;
|
|
16
|
+
readonly wide: 1;
|
|
17
|
+
readonly spacerTail: 2;
|
|
18
|
+
readonly spacerHead: 3;
|
|
19
|
+
};
|
|
20
|
+
/** An sRGB color with 8-bit channels. */
|
|
21
|
+
export interface GhosttyColor {
|
|
22
|
+
readonly r: number;
|
|
23
|
+
readonly g: number;
|
|
24
|
+
readonly b: number;
|
|
25
|
+
}
|
|
26
|
+
/** Default colors a terminal starts from; programs may still override them with OSC sequences. */
|
|
27
|
+
export interface GhosttyTheme {
|
|
28
|
+
readonly foreground: GhosttyColor;
|
|
29
|
+
readonly background: GhosttyColor;
|
|
30
|
+
readonly cursor: GhosttyColor;
|
|
31
|
+
/** CSS color the renderer overlays on selected cells; not sent to Ghostty. */
|
|
32
|
+
readonly selectionBackground?: string;
|
|
33
|
+
/** The full 256-color palette (16 ANSI colors, color cube, gray ramp); Ghostty's own when absent. */
|
|
34
|
+
readonly palette?: readonly GhosttyColor[];
|
|
35
|
+
}
|
|
36
|
+
/** One drawn cell of a render snapshot. */
|
|
37
|
+
export interface GhosttyCell {
|
|
38
|
+
readonly text: string;
|
|
39
|
+
readonly wide: number;
|
|
40
|
+
readonly foreground: GhosttyColor;
|
|
41
|
+
readonly background: GhosttyColor;
|
|
42
|
+
readonly bold: boolean;
|
|
43
|
+
readonly italic: boolean;
|
|
44
|
+
readonly invisible: boolean;
|
|
45
|
+
readonly strikethrough: boolean;
|
|
46
|
+
readonly overline: boolean;
|
|
47
|
+
readonly underline: boolean;
|
|
48
|
+
readonly selected: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** One viewport row of a render snapshot. */
|
|
51
|
+
export interface GhosttyRow {
|
|
52
|
+
readonly cells: readonly GhosttyCell[];
|
|
53
|
+
readonly text: string;
|
|
54
|
+
readonly isWrapContinuation: boolean;
|
|
55
|
+
/** Whether this row soft-wraps onto the next row. */
|
|
56
|
+
readonly wrapsToNext: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** The viewport as last rendered: grid, colors, cursor, and the rows that changed. */
|
|
59
|
+
export interface GhosttySnapshot {
|
|
60
|
+
readonly cols: number;
|
|
61
|
+
readonly rows: number;
|
|
62
|
+
readonly foreground: GhosttyColor;
|
|
63
|
+
readonly background: GhosttyColor;
|
|
64
|
+
readonly cursor: GhosttyColor;
|
|
65
|
+
readonly cursorX: number;
|
|
66
|
+
readonly cursorY: number;
|
|
67
|
+
readonly cursorVisible: boolean;
|
|
68
|
+
readonly cursorBlinking: boolean;
|
|
69
|
+
readonly cursorStyle: number;
|
|
70
|
+
readonly dirtyRows: ReadonlySet<number>;
|
|
71
|
+
readonly rowData: readonly GhosttyRow[];
|
|
72
|
+
}
|
|
73
|
+
/** A selection's endpoints in viewport and in screen (scrollback-inclusive) coordinates. */
|
|
74
|
+
export interface GhosttySelectionRange {
|
|
75
|
+
readonly viewport: {
|
|
76
|
+
readonly start: {
|
|
77
|
+
readonly x: number;
|
|
78
|
+
readonly y: number;
|
|
79
|
+
};
|
|
80
|
+
readonly end: {
|
|
81
|
+
readonly x: number;
|
|
82
|
+
readonly y: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
readonly screen: {
|
|
86
|
+
readonly start: {
|
|
87
|
+
readonly x: number;
|
|
88
|
+
readonly y: number;
|
|
89
|
+
};
|
|
90
|
+
readonly end: {
|
|
91
|
+
readonly x: number;
|
|
92
|
+
readonly y: number;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** Scrollback position in rows: total rows, the viewport's first row, and its height. */
|
|
97
|
+
export interface GhosttyScrollbar {
|
|
98
|
+
readonly total: number;
|
|
99
|
+
readonly offset: number;
|
|
100
|
+
readonly len: number;
|
|
101
|
+
}
|
|
102
|
+
/** Grid position tagged with its Ghostty coordinate space: 1 viewport, 2 screen. */
|
|
103
|
+
export interface GhosttyPointInput {
|
|
104
|
+
readonly x: number;
|
|
105
|
+
readonly y: number;
|
|
106
|
+
readonly tag?: 1 | 2;
|
|
107
|
+
}
|
|
108
|
+
/** A pointer event in the terms Ghostty's mouse encoder needs. */
|
|
109
|
+
export interface GhosttyMouseInput {
|
|
110
|
+
readonly action: 'press' | 'release' | 'motion';
|
|
111
|
+
readonly button: number | null;
|
|
112
|
+
readonly mods: number;
|
|
113
|
+
readonly x: number;
|
|
114
|
+
readonly y: number;
|
|
115
|
+
readonly screenWidth: number;
|
|
116
|
+
readonly screenHeight: number;
|
|
117
|
+
readonly cellWidth: number;
|
|
118
|
+
readonly cellHeight: number;
|
|
119
|
+
readonly paddingLeft: number;
|
|
120
|
+
readonly paddingRight: number;
|
|
121
|
+
readonly paddingTop: number;
|
|
122
|
+
readonly paddingBottom: number;
|
|
123
|
+
readonly anyButtonPressed: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A cell's codepoints as a string, converted in bounded chunks: JavaScript
|
|
127
|
+
* engines cap spread-call arguments, and a cell's cluster is only as short as
|
|
128
|
+
* the engine keeps it (64 combining marks since Ghostty `fb13fa9`; earlier
|
|
129
|
+
* revisions kept hundreds of thousands). Exported for `core.test.ts`, which
|
|
130
|
+
* feeds it clusters too large to build through a terminal.
|
|
131
|
+
*/
|
|
132
|
+
export declare function ghosttyCellText(codepointView: DataView, graphemeLength: number): string;
|
|
133
|
+
/**
|
|
134
|
+
* The rows one page of the engine's history holds at `cols` columns: as many
|
|
135
|
+
* as fit their headers, then their cells on a cache-line boundary, in a
|
|
136
|
+
* standard page's grid (`Capacity.adjust` in Ghostty's `page.zig`). A grid
|
|
137
|
+
* too wide for one standard row gets a larger page of 215 rows.
|
|
138
|
+
*/
|
|
139
|
+
export declare function ghosttyPageRows(cols: number): number;
|
|
140
|
+
/** A libghostty-vt terminal: create with `GhosttyTerminalCore.create`, release with `dispose`. */
|
|
141
|
+
export declare class GhosttyTerminalCore {
|
|
142
|
+
private readonly runtime;
|
|
143
|
+
private terminalSlot;
|
|
144
|
+
private terminal;
|
|
145
|
+
private renderStateSlot;
|
|
146
|
+
private renderState;
|
|
147
|
+
private rowIteratorSlot;
|
|
148
|
+
private rowCellsSlot;
|
|
149
|
+
private keyEncoderSlot;
|
|
150
|
+
private keyEncoder;
|
|
151
|
+
private keyEventSlot;
|
|
152
|
+
private keyEvent;
|
|
153
|
+
private mouseEncoderSlot;
|
|
154
|
+
private mouseEncoder;
|
|
155
|
+
private mouseEventSlot;
|
|
156
|
+
private mouseEvent;
|
|
157
|
+
private effectsId;
|
|
158
|
+
private effects;
|
|
159
|
+
private onBell;
|
|
160
|
+
/** Whether the bell rang during the write in progress, which reports it once it returns. */
|
|
161
|
+
private bellRang;
|
|
162
|
+
/** The scheme the theme's background reads as, which `CSI ? 996 n` reports. */
|
|
163
|
+
private colorScheme;
|
|
164
|
+
private scratch;
|
|
165
|
+
private graphemes;
|
|
166
|
+
private graphemeCapacity;
|
|
167
|
+
private style;
|
|
168
|
+
/** A zeroed `GhosttyStyle` with its size set, copied over `style` before each cell's read. */
|
|
169
|
+
private styleTemplate;
|
|
170
|
+
/** Byte offsets of the `GhosttyStyle` fields a cell reads. */
|
|
171
|
+
private styleOffsets;
|
|
172
|
+
private cellsNext;
|
|
173
|
+
private cellsGet;
|
|
174
|
+
/** One object per color a snapshot reads, so a cell's colors allocate nothing. */
|
|
175
|
+
private readonly colors;
|
|
176
|
+
private scrollbar;
|
|
177
|
+
private rows;
|
|
178
|
+
/** The rows of history kept above the screen, and the grid width the engine's limit is set for. */
|
|
179
|
+
private scrollbackLines;
|
|
180
|
+
private gridCols;
|
|
181
|
+
private disposed;
|
|
182
|
+
private keyboardLayoutMap;
|
|
183
|
+
private constructor();
|
|
184
|
+
/**
|
|
185
|
+
* Loads the shared runtime and allocates a terminal that keeps at least
|
|
186
|
+
* `scrollbackLines` rows of history above its screen at any width (see
|
|
187
|
+
* `setScrollbackLines`); `onPtyData` receives the terminal's replies, and
|
|
188
|
+
* `onBell` hears of the bell once per `write` in which the program rang it.
|
|
189
|
+
*/
|
|
190
|
+
static create(cols: number, rows: number, cellWidth: number, cellHeight: number, theme: GhosttyTheme, scrollbackLines: number, onPtyData: (data: string) => void, onBell?: () => void): Promise<GhosttyTerminalCore>;
|
|
191
|
+
private initialize;
|
|
192
|
+
/**
|
|
193
|
+
* Parses output from the program, then tells `onBell` if the program rang
|
|
194
|
+
* the bell in it, however many times. With `onSynchronizedOutputEnd`, a write
|
|
195
|
+
* that starts inside a synchronized update (DEC 2026) calls it as soon as
|
|
196
|
+
* that update ends, before any later byte can open the next one, so each
|
|
197
|
+
* update can be given its own paint deadline.
|
|
198
|
+
*/
|
|
199
|
+
write(data: string | Uint8Array, onSynchronizedOutputEnd?: () => void): void;
|
|
200
|
+
/**
|
|
201
|
+
* Resets every mode, the screen, and scrollback, then replays `data`
|
|
202
|
+
* without answering its queries or ringing its bells.
|
|
203
|
+
*/
|
|
204
|
+
resetAndWrite(data: string): void;
|
|
205
|
+
/**
|
|
206
|
+
* Resizes the grid in cells; the pixel cell size feeds pixel-based reports.
|
|
207
|
+
* The line limit follows the new width, since a page holds fewer rows the
|
|
208
|
+
* wider it is.
|
|
209
|
+
*/
|
|
210
|
+
resize(cols: number, rows: number, cellWidth: number, cellHeight: number): void;
|
|
211
|
+
/**
|
|
212
|
+
* Keeps at least `lines` rows of history above the screen from now on, and
|
|
213
|
+
* at most one page more. A shorter length drops the oldest history at once.
|
|
214
|
+
*/
|
|
215
|
+
setScrollbackLines(lines: number): void;
|
|
216
|
+
/** Sets the engine's line limit for the chosen length at `cols` columns. */
|
|
217
|
+
private applyScrollbackLimit;
|
|
218
|
+
/** Sets a terminal option that takes a `size_t*`. */
|
|
219
|
+
private setSizeOption;
|
|
220
|
+
/**
|
|
221
|
+
* Ghostty's built-in default cursor is steady, while a macOS terminal's
|
|
222
|
+
* cursor blinks. Option 23 is the embedder's
|
|
223
|
+
* default blink, which is the state a session starts in and returns to on
|
|
224
|
+
* DECSCUSR reset (CSI 0 q), so programs that ask for a specific cursor
|
|
225
|
+
* through DECSCUSR or DEC mode 12 still win.
|
|
226
|
+
*/
|
|
227
|
+
private applyDefaultCursorBlink;
|
|
228
|
+
/**
|
|
229
|
+
* Sets the default colors; colors a program set through OSC sequences stay
|
|
230
|
+
* in force. The background decides the scheme `CSI ? 996 n` reports, light
|
|
231
|
+
* where Ghostty's perceived luminance exceeds one half, and a change of
|
|
232
|
+
* scheme is reported to a program that enabled DEC mode 2031.
|
|
233
|
+
*/
|
|
234
|
+
setTheme(theme: GhosttyTheme): void;
|
|
235
|
+
/**
|
|
236
|
+
* Erases the scrollback and the rows above the cursor, moving the cursor's
|
|
237
|
+
* row to the top: Terminal.app's Clear to Start. The alternate screen (a
|
|
238
|
+
* full-screen program) is left alone. The erase runs through the VT parser,
|
|
239
|
+
* so it assumes the program is idle between sequences, as a prompt is.
|
|
240
|
+
*/
|
|
241
|
+
clearToStart(): void;
|
|
242
|
+
/** Scrolls the viewport through scrollback by whole rows. */
|
|
243
|
+
scroll(deltaRows: number): void;
|
|
244
|
+
/** Returns the viewport to the live screen. */
|
|
245
|
+
scrollToBottom(): void;
|
|
246
|
+
/** Whether the viewport shows the live screen rather than scrollback. */
|
|
247
|
+
isViewportActive(): boolean;
|
|
248
|
+
/** The scrollback position, or null when Ghostty cannot report it. */
|
|
249
|
+
scrollbarState(): GhosttyScrollbar | null;
|
|
250
|
+
/** Whether the program asked for mouse reports. */
|
|
251
|
+
isMouseTracking(): boolean;
|
|
252
|
+
/** Whether the program asked for motion reports without a pressed button (DEC 1003). */
|
|
253
|
+
isMouseAnyEventTracking(): boolean;
|
|
254
|
+
/** Whether the program has a synchronized update open (DEC 2026): its frame is still being drawn. */
|
|
255
|
+
isSynchronizedOutput(): boolean;
|
|
256
|
+
/** Ends an open synchronized update, as a program that never closes one would have. */
|
|
257
|
+
endSynchronizedOutput(): void;
|
|
258
|
+
/** Whether a full-screen program switched to the alternate screen. */
|
|
259
|
+
isAlternateScreen(): boolean;
|
|
260
|
+
/** Whether cursor keys send application sequences (DECCKM). */
|
|
261
|
+
isApplicationCursorKeys(): boolean;
|
|
262
|
+
/** Encodes a key event under the terminal's current keyboard modes; empty when it sends nothing. */
|
|
263
|
+
encodeKey(event: KeyboardEvent, action?: 'press' | 'release'): string;
|
|
264
|
+
/** Encodes pasted text, bracketed when the program enabled bracketed paste (mode 2004). */
|
|
265
|
+
encodePaste(data: string): string;
|
|
266
|
+
/** Encodes a pointer event under the program's mouse modes; empty when it sends nothing. */
|
|
267
|
+
encodeMouse(input: GhosttyMouseInput): string;
|
|
268
|
+
/** Selects the cells between two grid points. */
|
|
269
|
+
setSelection(anchor: GhosttyPointInput, end: GhosttyPointInput): void;
|
|
270
|
+
/** Selects the word at a viewport cell. */
|
|
271
|
+
selectWord(col: number, row: number): GhosttySelectionRange | null;
|
|
272
|
+
/** Selects the line at a viewport cell. */
|
|
273
|
+
selectLine(col: number, row: number): GhosttySelectionRange | null;
|
|
274
|
+
/** The OSC 8 hyperlink at a viewport cell, if any. */
|
|
275
|
+
hyperlinkAt(col: number, row: number): string | null;
|
|
276
|
+
/** Removes the selection. */
|
|
277
|
+
clearSelection(): void;
|
|
278
|
+
/** Reads the viewport, re-reading only the rows Ghostty marked dirty since the last call. */
|
|
279
|
+
snapshot(): GhosttySnapshot;
|
|
280
|
+
/** The selection as plain text with Ghostty's copy semantics (soft wraps joined, trailing blanks trimmed). */
|
|
281
|
+
selectionText(): string;
|
|
282
|
+
/** Converts a viewport cell to screen coordinates. */
|
|
283
|
+
viewportPointToScreen(col: number, row: number): {
|
|
284
|
+
x: number;
|
|
285
|
+
y: number;
|
|
286
|
+
} | null;
|
|
287
|
+
private convertPoint;
|
|
288
|
+
/** Frees every handle and allocation; the core is unusable afterwards. */
|
|
289
|
+
dispose(): void;
|
|
290
|
+
private encodeOutput;
|
|
291
|
+
private readRow;
|
|
292
|
+
/** A cell's color, or `fallback` when the cell has none of its own. */
|
|
293
|
+
private readCellColor;
|
|
294
|
+
private gridRef;
|
|
295
|
+
private selectAt;
|
|
296
|
+
private pointFromGridRef;
|
|
297
|
+
/** Whether a DEC private mode is set. */
|
|
298
|
+
private getMode;
|
|
299
|
+
/** Fills the scratch buffer with a `GhosttyTerminalModeConfig` for a DEC private mode. */
|
|
300
|
+
private writeModeConfig;
|
|
301
|
+
private getU16;
|
|
302
|
+
private getU32;
|
|
303
|
+
private getBool;
|
|
304
|
+
private getColor;
|
|
305
|
+
private getRowBool;
|
|
306
|
+
private getCellU32;
|
|
307
|
+
private getCellBool;
|
|
308
|
+
private getCellColor;
|
|
309
|
+
private readColor;
|
|
310
|
+
private emptyCell;
|
|
311
|
+
private assertSuccess;
|
|
312
|
+
private ensureActive;
|
|
313
|
+
}
|
|
314
|
+
/** Whether two colors are the same. */
|
|
315
|
+
export declare function ghosttyColorsEqual(left: GhosttyColor, right: GhosttyColor): boolean;
|