restty 0.1.16 → 0.1.18

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 (53) hide show
  1. package/README.md +4 -9
  2. package/dist/app/atlas-builder.d.ts +38 -0
  3. package/dist/app/font-sources.d.ts +2 -0
  4. package/dist/app/pane-app-manager.d.ts +43 -0
  5. package/dist/app/panes-context-menu.d.ts +10 -0
  6. package/dist/app/panes-styles.d.ts +5 -0
  7. package/dist/app/panes-types.d.ts +89 -0
  8. package/dist/app/panes.d.ts +10 -0
  9. package/dist/app/restty.d.ts +20 -0
  10. package/dist/app/session.d.ts +6 -0
  11. package/dist/app/types.d.ts +123 -0
  12. package/dist/{app/index.js → chunk-53vdvhe3.js} +24014 -23787
  13. package/dist/fonts/manager.d.ts +24 -0
  14. package/dist/fonts/nerd-constraints.d.ts +4 -0
  15. package/dist/fonts/nerd-ranges.d.ts +2 -0
  16. package/dist/fonts/types.d.ts +51 -0
  17. package/dist/grid/grid.d.ts +22 -0
  18. package/dist/grid/types.d.ts +32 -0
  19. package/dist/ime/ime.d.ts +13 -0
  20. package/dist/ime/types.d.ts +8 -0
  21. package/dist/input/ansi.d.ts +3 -0
  22. package/dist/input/mouse.d.ts +10 -0
  23. package/dist/input/output.d.ts +11 -0
  24. package/dist/input/types.d.ts +7 -0
  25. package/dist/internal.js +105 -56213
  26. package/dist/pty/kitty-media.d.ts +3 -0
  27. package/dist/pty/pty.d.ts +11 -0
  28. package/dist/pty/types.d.ts +49 -0
  29. package/dist/renderer/box-drawing-map.d.ts +4 -0
  30. package/dist/renderer/shaders.d.ts +7 -0
  31. package/dist/renderer/shapes.d.ts +42 -1
  32. package/dist/renderer/types.d.ts +43 -0
  33. package/dist/renderer/webgpu.d.ts +11 -0
  34. package/dist/restty.js +20 -0
  35. package/dist/selection/selection.d.ts +24 -0
  36. package/dist/selection/types.d.ts +13 -0
  37. package/dist/theme/catalog.d.ts +5 -0
  38. package/dist/theme/ghostty.d.ts +18 -0
  39. package/dist/unicode/ghostty-symbol-ranges.d.ts +1 -0
  40. package/dist/unicode/symbols.d.ts +6 -0
  41. package/dist/wasm/embedded.d.ts +1 -0
  42. package/dist/wasm/runtime.d.ts +29 -0
  43. package/package.json +8 -61
  44. package/dist/fonts/index.js +0 -5332
  45. package/dist/grid/index.js +0 -71
  46. package/dist/ime/index.js +0 -84
  47. package/dist/index.js +0 -56210
  48. package/dist/input/index.js +0 -1047
  49. package/dist/pty/index.js +0 -338
  50. package/dist/renderer/index.js +0 -1612
  51. package/dist/selection/index.js +0 -226
  52. package/dist/theme/index.js +0 -11218
  53. package/dist/wasm/index.js +0 -6003
package/README.md CHANGED
@@ -170,10 +170,7 @@ Active-pane convenience:
170
170
 
171
171
  Use these only when you need lower-level control:
172
172
 
173
- - `restty/wasm`: low-level WASM ABI wrapper (`loadResttyWasm`, `ResttyWasm`)
174
- - `restty/input`: key/mouse/input encoding utilities
175
- - `restty/pty`: PTY transport helpers
176
- - `restty/internal`: full internal barrel (unstable)
173
+ - `restty/internal`: full internal barrel (unstable; includes low-level modules like WASM/input/pty helpers)
177
174
 
178
175
  ## Local Development
179
176
 
@@ -183,8 +180,6 @@ cd restty
183
180
  git submodule update --init --recursive
184
181
  bun install
185
182
  bun run build:themes
186
- bun run build:assets
187
- bun run pty
188
183
  bun run playground
189
184
  ```
190
185
 
@@ -198,9 +193,9 @@ bun run test # full tests
198
193
  bun run test:ci # CI-safe test target
199
194
  bun run lint # lint
200
195
  bun run format:check # formatting check
201
- bun run build:assets # playground bundles
202
- bun run pty # local PTY websocket server
203
- bun run playground # playground dev server
196
+ bun run build:assets # static playground bundle (playground/public/playground.js)
197
+ bun run playground # one-command local dev (PTY + playground dev server)
198
+ bun run pty # PTY websocket server only
204
199
  ```
205
200
 
206
201
  ## Documentation
@@ -1,9 +1,27 @@
1
+ /**
2
+ * Metadata for constrained glyph rendering.
3
+ * - cp: Unicode code point
4
+ * - constraintWidth: target cell width constraint
5
+ * - variable: whether glyph can render at multiple widths
6
+ * - widths: set of all required cell widths for this glyph
7
+ */
1
8
  export type GlyphConstraintMeta = {
2
9
  cp: number;
3
10
  constraintWidth: number;
4
11
  variable?: boolean;
5
12
  widths?: Set<number>;
6
13
  };
14
+ /**
15
+ * Context for constraint-based atlas building, primarily for Nerd Fonts symbol alignment.
16
+ * - cellW: cell width in pixels
17
+ * - cellH: cell height in pixels
18
+ * - yPad: vertical padding
19
+ * - baselineOffset: baseline offset adjustment
20
+ * - baselineAdjust: additional baseline adjustment
21
+ * - fontScale: scale factor for font rendering
22
+ * - nerdMetrics: Nerd Fonts specific layout metrics
23
+ * - fontEntry: reference to font entry object
24
+ */
7
25
  export type AtlasConstraintContext = {
8
26
  cellW: number;
9
27
  cellH: number;
@@ -60,6 +78,17 @@ type BuildAtlasDeps = {
60
78
  atlasScale: number;
61
79
  }) => boolean;
62
80
  };
81
+ /**
82
+ * Parameters for font atlas building.
83
+ * - entry: font entry containing the font object and cached atlas
84
+ * - neededGlyphIds: set of glyph IDs required in the atlas
85
+ * - glyphMeta: optional constraint metadata for symbol font glyphs
86
+ * - fontSizePx: base font size in pixels
87
+ * - atlasScale: scaling factor for high-DPI rendering
88
+ * - fontIndex: index in the font fallback chain (0 = primary font)
89
+ * - constraintContext: optional constraint context for symbol alignment
90
+ * - deps: external dependencies for atlas building
91
+ */
63
92
  export type BuildFontAtlasParams = {
64
93
  entry: any;
65
94
  neededGlyphIds: Set<number>;
@@ -70,6 +99,14 @@ export type BuildFontAtlasParams = {
70
99
  constraintContext?: AtlasConstraintContext | null;
71
100
  deps: BuildAtlasDeps;
72
101
  };
102
+ /**
103
+ * Result from font atlas building.
104
+ * - rebuilt: true if a new atlas was generated
105
+ * - atlas: the atlas object containing glyph metrics and bitmap
106
+ * - rgba: RGBA pixel data ready for WebGL upload
107
+ * - colorGlyphs: set of glyph IDs that are color emoji
108
+ * - preferNearest: whether to use nearest-neighbor texture filtering
109
+ */
73
110
  export type BuildFontAtlasResult = {
74
111
  rebuilt: boolean;
75
112
  atlas: any | null;
@@ -77,5 +114,6 @@ export type BuildFontAtlasResult = {
77
114
  colorGlyphs?: Set<number>;
78
115
  preferNearest: boolean;
79
116
  };
117
+ /** Builds or reuses a font atlas, detecting when rebuild is needed based on glyph requirements, size changes, or constraint updates. */
80
118
  export declare function buildFontAtlasIfNeeded(params: BuildFontAtlasParams): BuildFontAtlasResult;
81
119
  export {};
@@ -1,3 +1,5 @@
1
1
  import type { ResttyFontPreset, ResttyFontSource } from "./types";
2
+ /** Default font fallback chain with JetBrains Mono, Nerd Fonts symbols, Noto symbols, color emoji, black emoji, and CJK support. */
2
3
  export declare const DEFAULT_FONT_SOURCES: ResttyFontSource[];
4
+ /** Validates user-provided font sources or returns defaults based on preset (none returns empty array, otherwise default CDN fonts). */
3
5
  export declare function normalizeFontSources(sources: ResttyFontSource[] | undefined, preset: ResttyFontPreset | undefined): ResttyFontSource[];
@@ -1,28 +1,55 @@
1
1
  import { type ResttyPaneStyleOptions, type ResttyPaneStylesOptions, type ResttyPaneContextMenuOptions, type ResttyPaneManager, type ResttyPaneShortcutsOptions, type ResttyPaneWithApp } from "./panes";
2
2
  import type { ResttyAppOptions, ResttyAppSession } from "./types";
3
+ /**
4
+ * A pane created by the app pane manager, extending the base pane
5
+ * with DOM elements needed by the terminal app.
6
+ */
3
7
  export type ResttyManagedAppPane = ResttyPaneWithApp & {
8
+ /** The canvas element used for terminal rendering. */
4
9
  canvas: HTMLCanvasElement;
10
+ /** Hidden textarea for IME composition input. */
5
11
  imeInput: HTMLTextAreaElement;
12
+ /** Pre element for terminal debug / accessibility output. */
6
13
  termDebugEl: HTMLPreElement;
7
14
  };
15
+ /**
16
+ * Default CSS class names for pane DOM elements.
17
+ */
8
18
  export type ResttyPaneDomDefaults = {
9
19
  paneClassName?: string;
10
20
  canvasClassName?: string;
11
21
  imeInputClassName?: string;
12
22
  termDebugClassName?: string;
13
23
  };
24
+ /** Style options for managed panes (alias for ResttyPaneStyleOptions). */
14
25
  export type ResttyManagedPaneStyleOptions = ResttyPaneStyleOptions;
26
+ /** Style configuration including enabled flag (alias for ResttyPaneStylesOptions). */
15
27
  export type ResttyManagedPaneStylesOptions = ResttyPaneStylesOptions;
28
+ /** App options minus the DOM/session fields that the pane manager provides. */
16
29
  export type ResttyPaneAppOptionsInput = Omit<ResttyAppOptions, "canvas" | "imeInput" | "session">;
30
+ /**
31
+ * Configuration for the built-in default context menu.
32
+ */
17
33
  export type ResttyDefaultPaneContextMenuOptions = {
34
+ /** Whether the default context menu is enabled (default true). */
18
35
  enabled?: boolean;
36
+ /** Guard predicate; return false to suppress the menu for a given event. */
19
37
  canOpen?: (event: MouseEvent, pane: ResttyManagedAppPane) => boolean;
38
+ /** Override the modifier key label shown in shortcut hints. */
20
39
  modKeyLabel?: string;
40
+ /** Provide the PTY WebSocket URL for the connect/disconnect menu item. */
21
41
  getPtyUrl?: () => string | null | undefined;
22
42
  };
43
+ /**
44
+ * Options for creating an app-level pane manager that wires up DOM
45
+ * elements, the terminal app, and the shared session automatically.
46
+ */
23
47
  export type CreateResttyAppPaneManagerOptions = {
48
+ /** Root element that will contain all pane DOM trees. */
24
49
  root: HTMLElement;
50
+ /** Shared session for WASM/WebGPU resources (defaults to the global session). */
25
51
  session?: ResttyAppSession;
52
+ /** Per-pane app options, static object or factory receiving pane context. */
26
53
  appOptions?: ResttyPaneAppOptionsInput | ((context: {
27
54
  id: number;
28
55
  sourcePane: ResttyManagedAppPane | null;
@@ -30,17 +57,33 @@ export type CreateResttyAppPaneManagerOptions = {
30
57
  imeInput: HTMLTextAreaElement;
31
58
  termDebugEl: HTMLPreElement;
32
59
  }) => ResttyPaneAppOptionsInput);
60
+ /** Override default CSS class names for pane DOM elements. */
33
61
  paneDom?: ResttyPaneDomDefaults;
62
+ /** Automatically call app.init() after pane creation (default true). */
34
63
  autoInit?: boolean;
64
+ /** Minimum pane size in pixels during split-resize (default 96). */
35
65
  minPaneSize?: number;
66
+ /** Enable or configure built-in pane CSS styles. */
36
67
  paneStyles?: boolean | ResttyManagedPaneStylesOptions;
68
+ /** Enable or configure keyboard shortcuts for splitting. */
37
69
  shortcuts?: boolean | ResttyPaneShortcutsOptions;
70
+ /** Custom context menu implementation (overrides defaultContextMenu). */
38
71
  contextMenu?: ResttyPaneContextMenuOptions<ResttyManagedAppPane> | null;
72
+ /** Enable or configure the built-in default context menu. */
39
73
  defaultContextMenu?: boolean | ResttyDefaultPaneContextMenuOptions;
74
+ /** Called after a new pane is created. */
40
75
  onPaneCreated?: (pane: ResttyManagedAppPane) => void;
76
+ /** Called after a pane is closed. */
41
77
  onPaneClosed?: (pane: ResttyManagedAppPane) => void;
78
+ /** Called after a pane is split. */
42
79
  onPaneSplit?: (sourcePane: ResttyManagedAppPane, createdPane: ResttyManagedAppPane, direction: "vertical" | "horizontal") => void;
80
+ /** Called when the active pane changes (or becomes null). */
43
81
  onActivePaneChange?: (pane: ResttyManagedAppPane | null) => void;
82
+ /** Called when the layout changes (splits, closes, resizes). */
44
83
  onLayoutChanged?: () => void;
45
84
  };
85
+ /**
86
+ * Create an app-aware pane manager that automatically constructs
87
+ * canvas, IME input, and terminal app instances for each pane.
88
+ */
46
89
  export declare function createResttyAppPaneManager(options: CreateResttyAppPaneManagerOptions): ResttyPaneManager<ResttyManagedAppPane>;
@@ -1,4 +1,13 @@
1
1
  import type { ResttyPaneContextMenuOptions, ResttyPaneDefinition, ResttyPaneManager } from "./panes-types";
2
+ /**
3
+ * Context menu controller for pane right-click interactions.
4
+ * - element: the menu DOM node
5
+ * - isOpen: returns true if menu is currently visible
6
+ * - containsTarget: checks if an event target is inside the menu
7
+ * - show: displays the menu at client coordinates for a given pane
8
+ * - hide: hides the menu
9
+ * - destroy: removes the menu from the DOM
10
+ */
2
11
  export type PaneContextMenuController<TPane extends ResttyPaneDefinition> = {
3
12
  element: HTMLDivElement;
4
13
  isOpen: () => boolean;
@@ -7,6 +16,7 @@ export type PaneContextMenuController<TPane extends ResttyPaneDefinition> = {
7
16
  hide: () => void;
8
17
  destroy: () => void;
9
18
  };
19
+ /** Creates a context menu controller that renders menu items, handles positioning within viewport bounds, and manages click-to-hide behavior. */
10
20
  export declare function createPaneContextMenuController<TPane extends ResttyPaneDefinition>(options: {
11
21
  contextMenu: ResttyPaneContextMenuOptions<TPane>;
12
22
  doc: Document;
@@ -1,6 +1,11 @@
1
1
  import type { ResttyPaneStyleOptions } from "./panes-types";
2
+ /** Default style options for pane layout and appearance. */
2
3
  export declare const DEFAULT_RESTTY_PANE_STYLE_OPTIONS: Required<ResttyPaneStyleOptions>;
4
+ /** Validates and normalizes pane style options, clamping numeric values to safe ranges and applying defaults. */
3
5
  export declare function normalizePaneStyleOptions(options: ResttyPaneStyleOptions): Required<ResttyPaneStyleOptions>;
6
+ /** Injects the pane stylesheet into the document if not already present. */
4
7
  export declare function ensureResttyPaneStylesDocument(doc: Document): void;
8
+ /** Applies pane style options to a root element via CSS custom properties. */
5
9
  export declare function applyPaneStyleOptionsToRoot(root: HTMLElement, options: Readonly<Required<ResttyPaneStyleOptions>>): void;
10
+ /** Removes pane style class and custom properties from a root element. */
6
11
  export declare function clearPaneStyleOptionsFromRoot(root: HTMLElement): void;
@@ -1,86 +1,175 @@
1
1
  import type { ResttyApp } from "./types";
2
+ /**
3
+ * Direction for splitting a pane.
4
+ * - vertical: split left/right
5
+ * - horizontal: split top/bottom
6
+ */
2
7
  export type ResttyPaneSplitDirection = "vertical" | "horizontal";
8
+ /**
9
+ * A single item in a pane context menu.
10
+ */
3
11
  export type ResttyPaneContextMenuItem = {
12
+ /** Display text for the menu item. */
4
13
  label: string;
14
+ /** Keyboard shortcut hint shown alongside the label. */
5
15
  shortcut?: string;
16
+ /** Whether the item is interactive (default true). */
6
17
  enabled?: boolean;
18
+ /** Render the item with destructive/warning styling. */
7
19
  danger?: boolean;
20
+ /** Callback invoked when the item is selected. */
8
21
  action: () => void | Promise<void>;
9
22
  };
23
+ /**
24
+ * Minimum definition of a pane managed by the pane manager.
25
+ */
10
26
  export type ResttyPaneDefinition = {
27
+ /** Unique numeric identifier for this pane. */
11
28
  id: number;
29
+ /** DOM container element that holds the pane content. */
12
30
  container: HTMLDivElement;
31
+ /** Element to receive focus when the pane is activated. */
13
32
  focusTarget?: HTMLElement | null;
14
33
  };
34
+ /**
35
+ * Configuration for pane keyboard shortcuts.
36
+ */
15
37
  export type ResttyPaneShortcutsOptions = {
38
+ /** Enable or disable shortcut handling (default true). */
16
39
  enabled?: boolean;
40
+ /** Guard that determines whether a keyboard event should be handled. */
17
41
  canHandleEvent?: (event: KeyboardEvent) => boolean;
42
+ /** Guard that determines whether the event target is an allowed input element. */
18
43
  isAllowedInputTarget?: (target: HTMLElement) => boolean;
19
44
  };
45
+ /**
46
+ * Configuration for the pane right-click context menu.
47
+ */
20
48
  export type ResttyPaneContextMenuOptions<TPane extends ResttyPaneDefinition> = {
49
+ /** Guard that determines whether the context menu may open for a given event and pane. */
21
50
  canOpen?: (event: MouseEvent, pane: TPane) => boolean;
51
+ /** Build the list of menu items and separators for a pane. */
22
52
  getItems: (pane: TPane, manager: ResttyPaneManager<TPane>) => Array<ResttyPaneContextMenuItem | "separator">;
23
53
  };
54
+ /**
55
+ * Visual styling options for pane layout and dividers.
56
+ */
24
57
  export type ResttyPaneStyleOptions = {
58
+ /** CSS background color for the split container. */
25
59
  splitBackground?: string;
60
+ /** CSS background color for individual panes. */
26
61
  paneBackground?: string;
62
+ /** Opacity applied to inactive panes (0-1). */
27
63
  inactivePaneOpacity?: number;
64
+ /** Opacity applied to the active pane (0-1). */
28
65
  activePaneOpacity?: number;
66
+ /** Duration in ms for opacity transitions between active/inactive states. */
29
67
  opacityTransitionMs?: number;
68
+ /** Divider/gutter thickness in CSS pixels. */
30
69
  dividerThicknessPx?: number;
31
70
  };
71
+ /**
72
+ * Pane style options with an enable/disable toggle.
73
+ */
32
74
  export type ResttyPaneStylesOptions = ResttyPaneStyleOptions & {
75
+ /** Enable or disable automatic pane styling (default true). */
33
76
  enabled?: boolean;
34
77
  };
78
+ /**
79
+ * Options for creating a pane manager instance.
80
+ */
35
81
  export type CreateResttyPaneManagerOptions<TPane extends ResttyPaneDefinition> = {
82
+ /** Root DOM element that contains all pane containers. */
36
83
  root: HTMLElement;
84
+ /** Factory function called to create a new pane. */
37
85
  createPane: (context: {
38
86
  id: number;
39
87
  sourcePane: TPane | null;
40
88
  manager: ResttyPaneManager<TPane>;
41
89
  }) => TPane;
90
+ /** Cleanup function called when a pane is removed. */
42
91
  destroyPane?: (pane: TPane) => void;
92
+ /** Called after a new pane has been created and inserted into the layout. */
43
93
  onPaneCreated?: (pane: TPane) => void;
94
+ /** Called after a pane has been closed and removed from the layout. */
44
95
  onPaneClosed?: (pane: TPane) => void;
96
+ /** Called after a pane has been split into two. */
45
97
  onPaneSplit?: (sourcePane: TPane, createdPane: TPane, direction: ResttyPaneSplitDirection) => void;
98
+ /** Called when the active pane changes (null when all panes are closed). */
46
99
  onActivePaneChange?: (pane: TPane | null) => void;
100
+ /** Called after any layout change (split, close, resize). */
47
101
  onLayoutChanged?: () => void;
102
+ /** Minimum pane size in CSS pixels before further splits are rejected. */
48
103
  minPaneSize?: number;
104
+ /** Context menu configuration, or null to disable. */
49
105
  contextMenu?: ResttyPaneContextMenuOptions<TPane> | null;
106
+ /** Keyboard shortcut configuration, or a boolean to enable/disable with defaults. */
50
107
  shortcuts?: boolean | ResttyPaneShortcutsOptions;
108
+ /** Pane styling configuration, or a boolean to enable/disable with defaults. */
51
109
  styles?: boolean | ResttyPaneStylesOptions;
52
110
  };
111
+ /**
112
+ * Public API for managing a split-pane layout.
113
+ */
53
114
  export type ResttyPaneManager<TPane extends ResttyPaneDefinition> = {
115
+ /** Return all currently open panes. */
54
116
  getPanes: () => TPane[];
117
+ /** Look up a pane by its numeric ID, or null if not found. */
55
118
  getPaneById: (id: number) => TPane | null;
119
+ /** Return the currently active pane, or null if none. */
56
120
  getActivePane: () => TPane | null;
121
+ /** Return the pane that currently has DOM focus, or null if none. */
57
122
  getFocusedPane: () => TPane | null;
123
+ /** Create the first pane in an empty layout. */
58
124
  createInitialPane: (options?: {
59
125
  focus?: boolean;
60
126
  }) => TPane;
127
+ /** Set a pane as active by ID, optionally moving DOM focus to it. */
61
128
  setActivePane: (id: number, options?: {
62
129
  focus?: boolean;
63
130
  }) => void;
131
+ /** Mark a pane as focused by ID without necessarily changing the active pane. */
64
132
  markPaneFocused: (id: number, options?: {
65
133
  focus?: boolean;
66
134
  }) => void;
135
+ /** Split an existing pane by ID in the given direction, returning the new pane or null on failure. */
67
136
  splitPane: (id: number, direction: ResttyPaneSplitDirection) => TPane | null;
137
+ /** Split the currently active pane, returning the new pane or null on failure. */
68
138
  splitActivePane: (direction: ResttyPaneSplitDirection) => TPane | null;
139
+ /** Close a pane by ID, returning true if it was found and removed. */
69
140
  closePane: (id: number) => boolean;
141
+ /** Return the current resolved style options. */
70
142
  getStyleOptions: () => Readonly<Required<ResttyPaneStyleOptions>>;
143
+ /** Update style options and reapply them to the layout. */
71
144
  setStyleOptions: (options: ResttyPaneStyleOptions) => void;
145
+ /** Schedule an asynchronous layout recalculation. */
72
146
  requestLayoutSync: () => void;
147
+ /** Dismiss any open context menu. */
73
148
  hideContextMenu: () => void;
149
+ /** Tear down all panes, event listeners, and DOM structures. */
74
150
  destroy: () => void;
75
151
  };
152
+ /**
153
+ * Pane definition extended with a ResttyApp instance and pause control.
154
+ */
76
155
  export type ResttyPaneWithApp = ResttyPaneDefinition & {
156
+ /** The terminal app running inside this pane. */
77
157
  app: ResttyApp;
158
+ /** Whether the pane's renderer is currently paused. */
78
159
  paused?: boolean;
160
+ /** Pause or resume this pane's renderer. */
79
161
  setPaused?: (value: boolean) => void;
80
162
  };
163
+ /**
164
+ * Options for building the default set of context menu items for a pane with an app.
165
+ */
81
166
  export type CreateDefaultResttyPaneContextMenuItemsOptions<TPane extends ResttyPaneWithApp> = {
167
+ /** The pane the context menu was opened on. */
82
168
  pane: TPane;
169
+ /** Subset of the pane manager API needed for split/close actions. */
83
170
  manager: Pick<ResttyPaneManager<TPane>, "splitPane" | "closePane" | "getPanes">;
171
+ /** Platform modifier key label (e.g. "Cmd" or "Ctrl") shown in shortcut hints. */
84
172
  modKeyLabel?: string;
173
+ /** Provider for the current PTY URL, used for reconnect/copy-URL items. */
85
174
  getPtyUrl?: () => string | null | undefined;
86
175
  };
@@ -1,5 +1,15 @@
1
1
  import type { CreateDefaultResttyPaneContextMenuItemsOptions, CreateResttyPaneManagerOptions, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneManager, ResttyPaneWithApp } from "./panes-types";
2
2
  export type { CreateDefaultResttyPaneContextMenuItemsOptions, CreateResttyPaneManagerOptions, ResttyPaneContextMenuItem, ResttyPaneContextMenuOptions, ResttyPaneDefinition, ResttyPaneManager, ResttyPaneShortcutsOptions, ResttyPaneSplitDirection, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneWithApp, } from "./panes-types";
3
+ /** Return the platform-appropriate shortcut modifier label ("Cmd" on macOS, "Ctrl" elsewhere). */
3
4
  export declare function getResttyShortcutModifierLabel(): "Cmd" | "Ctrl";
5
+ /**
6
+ * Build the standard right-click context menu items for a pane
7
+ * (copy, paste, split, close, clear, PTY toggle, pause toggle).
8
+ */
4
9
  export declare function createDefaultResttyPaneContextMenuItems<TPane extends ResttyPaneWithApp>(options: CreateDefaultResttyPaneContextMenuItemsOptions<TPane>): Array<ResttyPaneContextMenuItem | "separator">;
10
+ /**
11
+ * Create a pane manager that owns a split-pane layout inside a root
12
+ * element. Handles pane creation, splitting, resizing, focus
13
+ * tracking, keyboard shortcuts, and context menus.
14
+ */
5
15
  export declare function createResttyPaneManager<TPane extends ResttyPaneDefinition>(options: CreateResttyPaneManagerOptions<TPane>): ResttyPaneManager<TPane>;
@@ -3,13 +3,22 @@ import type { GhosttyTheme } from "../theme";
3
3
  import { type CreateResttyAppPaneManagerOptions, type ResttyManagedAppPane, type ResttyManagedPaneStyleOptions, type ResttyPaneAppOptionsInput } from "./pane-app-manager";
4
4
  import type { ResttyPaneManager, ResttyPaneSplitDirection } from "./panes";
5
5
  import type { ResttyFontSource } from "./types";
6
+ /**
7
+ * Top-level configuration for creating a Restty instance.
8
+ */
6
9
  export type ResttyOptions = Omit<CreateResttyAppPaneManagerOptions, "appOptions"> & {
10
+ /** Per-pane app options, static or factory. */
7
11
  appOptions?: CreateResttyAppPaneManagerOptions["appOptions"];
12
+ /** Font sources applied to every pane. */
8
13
  fontSources?: ResttyPaneAppOptionsInput["fontSources"];
14
+ /** Whether to create the first pane automatically (default true). */
9
15
  createInitialPane?: boolean | {
10
16
  focus?: boolean;
11
17
  };
12
18
  };
19
+ /**
20
+ * Public API surface exposed by each pane handle.
21
+ */
13
22
  export type ResttyPaneApi = {
14
23
  id: number;
15
24
  setRenderer: (value: "auto" | "webgpu" | "webgl2") => void;
@@ -33,6 +42,11 @@ export type ResttyPaneApi = {
33
42
  getBackend: () => string;
34
43
  getRawPane: () => ResttyManagedAppPane;
35
44
  };
45
+ /**
46
+ * Thin wrapper around a managed pane that delegates calls to the
47
+ * underlying app. Resolves the pane lazily so it stays valid across
48
+ * layout changes.
49
+ */
36
50
  export declare class ResttyPaneHandle implements ResttyPaneApi {
37
51
  private readonly resolvePane;
38
52
  constructor(resolvePane: () => ResttyManagedAppPane);
@@ -58,6 +72,11 @@ export declare class ResttyPaneHandle implements ResttyPaneApi {
58
72
  getBackend(): string;
59
73
  getRawPane(): ResttyManagedAppPane;
60
74
  }
75
+ /**
76
+ * Main entry point for the restty terminal widget. Manages a set of
77
+ * split panes, each running its own terminal app, and exposes
78
+ * convenience methods that operate on the active pane.
79
+ */
61
80
  export declare class Restty {
62
81
  readonly paneManager: ResttyPaneManager<ResttyManagedAppPane>;
63
82
  private fontSources;
@@ -112,4 +131,5 @@ export declare class Restty {
112
131
  private requirePaneById;
113
132
  private requireActivePaneHandle;
114
133
  }
134
+ /** Create a new Restty instance with the given options. */
115
135
  export declare function createRestty(options: ResttyOptions): Restty;
@@ -1,3 +1,9 @@
1
1
  import type { ResttyAppSession } from "./types";
2
+ /**
3
+ * Create a new app session that lazily loads the WASM module and
4
+ * initializes the WebGPU core on first use. Multiple panes can
5
+ * share a single session to avoid duplicate resource loading.
6
+ */
2
7
  export declare function createResttyAppSession(): ResttyAppSession;
8
+ /** Return the global default session, creating it on first call. */
3
9
  export declare function getDefaultResttyAppSession(): ResttyAppSession;