restty 0.1.34 → 0.2.0

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 (194) hide show
  1. package/README.md +49 -318
  2. package/dist/chunk-30px21q2.js +0 -0
  3. package/dist/chunk-db9dt7pr.js +55226 -0
  4. package/dist/chunk-s26trws6.js +9136 -0
  5. package/dist/chunk-wdme6j9c.js +1776 -0
  6. package/dist/chunk-xykzfd81.js +0 -0
  7. package/dist/chunk-y6hfk43b.js +1690 -0
  8. package/dist/fonts/local-font-access.types.d.ts +19 -0
  9. package/dist/fonts/manager/entries.d.ts +7 -0
  10. package/dist/headless.d.ts +102 -0
  11. package/dist/headless.js +350 -0
  12. package/dist/ime/ime.d.ts +4 -4
  13. package/dist/index.d.ts +8 -2
  14. package/dist/input/keymap/default-mapping.d.ts +1 -0
  15. package/dist/input/mouse.d.ts +13 -0
  16. package/dist/input/types.d.ts +10 -1
  17. package/dist/internal/runtime.d.ts +4 -0
  18. package/dist/internal/runtime.js +12 -0
  19. package/dist/internal/surface.d.ts +6 -0
  20. package/dist/internal/surface.js +15 -0
  21. package/dist/internal.d.ts +2 -4
  22. package/dist/internal.js +23 -5
  23. package/dist/restty.esm.js +10949 -0
  24. package/dist/restty.js +8 -2
  25. package/dist/runtime/core/api.d.ts +112 -0
  26. package/dist/runtime/core/config.d.ts +133 -0
  27. package/dist/runtime/core/lifecycle.d.ts +1 -0
  28. package/dist/runtime/core/models.d.ts +124 -0
  29. package/dist/runtime/core/resources.d.ts +50 -0
  30. package/dist/runtime/core/runtime-events.d.ts +28 -0
  31. package/dist/runtime/core/session.d.ts +9 -0
  32. package/dist/runtime/{codepoint-utils.d.ts → create-runtime/codepoint-utils.d.ts} +1 -1
  33. package/dist/runtime/create-runtime/{color-glyph-atlas.d.ts → font-runtime/color-glyph-atlas.d.ts} +2 -2
  34. package/dist/runtime/create-runtime/font-runtime/grid.d.ts +6 -0
  35. package/dist/runtime/create-runtime/font-runtime/grid.types.d.ts +22 -0
  36. package/dist/runtime/create-runtime/font-runtime/index.d.ts +15 -0
  37. package/dist/runtime/create-runtime/font-runtime/text.d.ts +12 -0
  38. package/dist/runtime/create-runtime/font-runtime/text.types.d.ts +10 -0
  39. package/dist/runtime/create-runtime/{font-runtime-helpers.types.d.ts → font-runtime/types.d.ts} +6 -8
  40. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.d.ts +7 -0
  41. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.types.d.ts +23 -0
  42. package/dist/runtime/create-runtime/highlight-terminal-color-utils.d.ts +6 -0
  43. package/dist/runtime/create-runtime/highlight-terminal-color-utils.types.d.ts +9 -0
  44. package/dist/runtime/create-runtime/input-hooks.d.ts +2 -12
  45. package/dist/runtime/create-runtime/input-hooks.types.d.ts +10 -0
  46. package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +2 -1
  47. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +2 -3
  48. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +5 -10
  49. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +3 -2
  50. package/dist/runtime/create-runtime/interaction-runtime/desktop-word-selection.d.ts +8 -0
  51. package/dist/runtime/create-runtime/{interaction-runtime.d.ts → interaction-runtime/index.d.ts} +3 -2
  52. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +2 -17
  53. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.types.d.ts +17 -0
  54. package/dist/runtime/create-runtime/interaction-runtime/{types.d.ts → runtime.types.d.ts} +4 -50
  55. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +1 -29
  56. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.types.d.ts +23 -0
  57. package/dist/runtime/create-runtime/interaction-runtime/state.types.d.ts +47 -0
  58. package/dist/runtime/create-runtime/kitty-render-runtime.d.ts +2 -36
  59. package/dist/runtime/create-runtime/kitty-render-runtime.types.d.ts +33 -0
  60. package/dist/runtime/create-runtime/{lifecycle-theme-size-canvas.d.ts → lifecycle-theme-size/canvas.d.ts} +1 -1
  61. package/dist/runtime/create-runtime/{lifecycle-theme-size.d.ts → lifecycle-theme-size/index.d.ts} +3 -3
  62. package/dist/runtime/create-runtime/lifecycle-theme-size/theme.d.ts +6 -0
  63. package/dist/runtime/create-runtime/{lifecycle-theme-size.types.d.ts → lifecycle-theme-size/types.d.ts} +13 -7
  64. package/dist/runtime/create-runtime/ligature-runs.d.ts +52 -0
  65. package/dist/runtime/{max-scrollback.d.ts → create-runtime/max-scrollback.d.ts} +2 -5
  66. package/dist/runtime/create-runtime/max-scrollback.types.d.ts +4 -0
  67. package/dist/runtime/create-runtime/native-scrollbar-host.d.ts +2 -0
  68. package/dist/runtime/create-runtime/native-scrollbar-host.types.d.ts +13 -0
  69. package/dist/runtime/create-runtime/overlay-scrollbar.d.ts +6 -0
  70. package/dist/runtime/create-runtime/overlay-scrollbar.types.d.ts +12 -0
  71. package/dist/runtime/create-runtime/pty-input-runtime.d.ts +2 -46
  72. package/dist/runtime/create-runtime/pty-input-runtime.types.d.ts +41 -0
  73. package/dist/runtime/{render-color-utils.d.ts → create-runtime/render-color-utils.d.ts} +1 -1
  74. package/dist/runtime/{render-stage-runtime.d.ts → create-runtime/render-stage-runtime.d.ts} +2 -2
  75. package/dist/runtime/{create-app-types.d.ts → create-runtime/render-stage-runtime.types.d.ts} +1 -29
  76. package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +1 -1
  77. package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +1 -1
  78. package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +2 -5
  79. package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +1 -1
  80. package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +15 -11
  81. package/dist/runtime/create-runtime/runtime-controller.api.types.d.ts +96 -0
  82. package/dist/runtime/create-runtime/runtime-controller.clipboard.d.ts +10 -0
  83. package/dist/runtime/create-runtime/runtime-controller.d.ts +3 -0
  84. package/dist/runtime/create-runtime/runtime-controller.input.d.ts +24 -0
  85. package/dist/runtime/create-runtime/runtime-controller.keyboard.d.ts +19 -0
  86. package/dist/runtime/create-runtime/runtime-controller.lifecycle.d.ts +50 -0
  87. package/dist/runtime/create-runtime/runtime-controller.public-api.capabilities.d.ts +57 -0
  88. package/dist/runtime/create-runtime/runtime-controller.public-api.d.ts +28 -0
  89. package/dist/runtime/create-runtime/runtime-controller.render-loop.d.ts +20 -0
  90. package/dist/runtime/create-runtime/runtime-controller.state.types.d.ts +24 -0
  91. package/dist/runtime/create-runtime/runtime-reporting.d.ts +3 -21
  92. package/dist/runtime/create-runtime/runtime-reporting.types.d.ts +18 -0
  93. package/dist/runtime/{create-app-symbols.d.ts → create-runtime/runtime-symbols.d.ts} +2 -2
  94. package/dist/runtime/create-runtime/search-highlight-utils.d.ts +21 -0
  95. package/dist/runtime/create-runtime/search-runtime/index.d.ts +2 -0
  96. package/dist/runtime/create-runtime/search-runtime/types.d.ts +25 -0
  97. package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +2 -29
  98. package/dist/runtime/create-runtime/shader-stage-runtime.types.d.ts +27 -0
  99. package/dist/runtime/{text-decoration.d.ts → create-runtime/text-decoration.d.ts} +1 -1
  100. package/dist/runtime/create-runtime.d.ts +7 -7
  101. package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +1 -1
  102. package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +1 -1
  103. package/dist/runtime/{atlas-builder.d.ts → fonts/atlas-builder.d.ts} +1 -1
  104. package/dist/runtime/{font-resource-store.d.ts → fonts/font-resource-store.d.ts} +3 -2
  105. package/dist/runtime/fonts/font-sources.d.ts +4 -0
  106. package/dist/runtime/shader-stages.d.ts +1 -1
  107. package/dist/runtime/types.d.ts +6 -365
  108. package/dist/surface/{panes-context-menu.d.ts → panes/context-menu.d.ts} +1 -1
  109. package/dist/surface/panes/default-context-menu-items.d.ts +2 -2
  110. package/dist/surface/panes/layout.d.ts +1 -1
  111. package/dist/surface/panes/managed-pane-create.d.ts +3 -0
  112. package/dist/surface/panes/managed-pane-create.types.d.ts +17 -0
  113. package/dist/surface/panes/managed-pane-dom.d.ts +13 -0
  114. package/dist/surface/panes/managed-pane-manager.d.ts +6 -0
  115. package/dist/surface/panes/managed-pane-options.d.ts +6 -0
  116. package/dist/surface/panes/managed-pane-options.types.d.ts +7 -0
  117. package/dist/surface/panes/managed-pane-runtime-config.d.ts +3 -0
  118. package/dist/surface/panes/managed-pane-runtime-config.types.d.ts +9 -0
  119. package/dist/surface/panes/managed-pane-runtime.d.ts +3 -0
  120. package/dist/surface/panes/managed-pane-runtime.types.d.ts +10 -0
  121. package/dist/surface/panes/managed-pane-search-ui.d.ts +9 -0
  122. package/dist/surface/panes/managed-pane-types.d.ts +102 -0
  123. package/dist/surface/panes/manager.d.ts +1 -1
  124. package/dist/surface/panes/pane-interactions.d.ts +2 -2
  125. package/dist/surface/{panes-styles.d.ts → panes/styles.d.ts} +1 -1
  126. package/dist/surface/{panes-types.d.ts → panes/types.d.ts} +48 -7
  127. package/dist/surface/panes/window-events.d.ts +1 -1
  128. package/dist/surface/{restty-plugin-types.d.ts → plugins/context.types.d.ts} +32 -88
  129. package/dist/surface/{restty/plugin-dispatcher.d.ts → plugins/dispatcher.d.ts} +4 -13
  130. package/dist/surface/plugins/dispatcher.types.d.ts +6 -0
  131. package/dist/surface/{restty/plugin-ops.d.ts → plugins/host.d.ts} +4 -3
  132. package/dist/surface/plugins/runtime.d.ts +18 -0
  133. package/dist/surface/plugins/runtime.types.d.ts +47 -0
  134. package/dist/surface/plugins/types.d.ts +83 -0
  135. package/dist/surface/restty/active-pane-api.d.ts +34 -16
  136. package/dist/surface/restty/assembly.d.ts +23 -0
  137. package/dist/surface/restty/bootstrap.d.ts +21 -0
  138. package/dist/surface/restty/config.d.ts +46 -0
  139. package/dist/surface/restty/controller.d.ts +45 -0
  140. package/dist/surface/restty/events.d.ts +14 -0
  141. package/dist/surface/restty/manager-options.d.ts +4 -23
  142. package/dist/surface/restty/manager-options.types.d.ts +32 -0
  143. package/dist/surface/restty/pane-command-ops.d.ts +37 -0
  144. package/dist/surface/restty/pane-handle-ops.d.ts +24 -0
  145. package/dist/surface/restty/pane-handle.d.ts +107 -0
  146. package/dist/surface/restty/pane-lookup.d.ts +22 -0
  147. package/dist/surface/restty/pane-manager-assembly.d.ts +18 -0
  148. package/dist/surface/restty/pane-ops.d.ts +3 -42
  149. package/dist/surface/restty/pane-style-ops.d.ts +6 -0
  150. package/dist/surface/restty/plugin-surface.d.ts +5 -0
  151. package/dist/surface/restty/shader-ops.d.ts +6 -5
  152. package/dist/surface/restty.d.ts +30 -49
  153. package/dist/surface/search-ui/controller.d.ts +2 -0
  154. package/dist/surface/search-ui/index.d.ts +2 -0
  155. package/dist/surface/search-ui/styles.d.ts +5 -0
  156. package/dist/surface/search-ui/types.d.ts +96 -0
  157. package/dist/theme/ghostty.d.ts +13 -2
  158. package/dist/wasm/embedded.d.ts +1 -1
  159. package/dist/wasm/index.d.ts +1 -1
  160. package/dist/wasm/runtime/restty-wasm.d.ts +15 -1
  161. package/dist/wasm/runtime/types.d.ts +24 -6
  162. package/dist/xterm/compat-services.d.ts +2 -0
  163. package/dist/xterm.d.ts +4 -3
  164. package/dist/xterm.js +14 -8
  165. package/package.json +59 -24
  166. package/dist/chunk-meqn8xtd.js +0 -66867
  167. package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +0 -2
  168. package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +0 -2
  169. package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +0 -2
  170. package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +0 -1
  171. package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +0 -2
  172. package/dist/runtime/create-runtime/debug-tools/types.d.ts +0 -63
  173. package/dist/runtime/create-runtime/debug-tools.d.ts +0 -6
  174. package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +0 -30
  175. package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +0 -15
  176. package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +0 -21
  177. package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +0 -29
  178. package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +0 -6
  179. package/dist/runtime/create-runtime/runtime-app-api.d.ts +0 -105
  180. package/dist/runtime/create-runtime/runtime-logger.d.ts +0 -17
  181. package/dist/runtime/font-sources.d.ts +0 -5
  182. package/dist/runtime/overlay-scrollbar.d.ts +0 -24
  183. package/dist/runtime/pty-output-buffer.d.ts +0 -12
  184. package/dist/runtime/session.d.ts +0 -9
  185. package/dist/surface/app-factory.d.ts +0 -3
  186. package/dist/surface/pane-app-manager.d.ts +0 -89
  187. package/dist/surface/restty-pane-handle.d.ts +0 -70
  188. package/dist/surface/restty-plugin-runtime.d.ts +0 -57
  189. package/dist/xterm/app-options.d.ts +0 -2
  190. /package/dist/runtime/create-runtime/{atlas-debug-utils.d.ts → atlas-bitmap-utils.d.ts} +0 -0
  191. /package/dist/runtime/{clipboard-paste.d.ts → create-runtime/clipboard-paste.d.ts} +0 -0
  192. /package/dist/runtime/{render-stage-shaders.d.ts → create-runtime/render-stage-shaders.d.ts} +0 -0
  193. /package/dist/runtime/{create-app-io-utils.d.ts → create-runtime/runtime-io-utils.d.ts} +0 -0
  194. /package/dist/surface/{restty-plugin-utils.d.ts → plugins/utils.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ import type { Color } from "../../renderer";
2
+ export type RuntimeTerminalColor = {
3
+ kind: "color";
4
+ color: Color;
5
+ } | {
6
+ kind: "cell-foreground";
7
+ } | {
8
+ kind: "cell-background";
9
+ };
@@ -1,12 +1,2 @@
1
- import type { ResttyAppInputPayload } from "../types";
2
- type RuntimeInputHook = ((payload: ResttyAppInputPayload) => string | null | void) | null | undefined;
3
- export type CreateRuntimeInputHooksOptions = {
4
- beforeInputHook?: RuntimeInputHook;
5
- beforeRenderOutputHook?: RuntimeInputHook;
6
- };
7
- export type RuntimeInputHooks = {
8
- runBeforeInputHook: (text: string, source: string) => string | null;
9
- runBeforeRenderOutputHook: (text: string, source: string) => string | null;
10
- };
11
- export declare function createRuntimeInputHooks(options: CreateRuntimeInputHooksOptions): RuntimeInputHooks;
12
- export {};
1
+ import type { RuntimeInputHooks, RuntimeInputHooksOptions } from "./input-hooks.types";
2
+ export declare function createRuntimeInputHooks(options: RuntimeInputHooksOptions): RuntimeInputHooks;
@@ -0,0 +1,10 @@
1
+ import type { ResttyRuntimeInputPayload } from "../core/models";
2
+ export type RuntimeInputHook = ((payload: ResttyRuntimeInputPayload) => string | null | void) | null | undefined;
3
+ export type RuntimeInputHooksOptions = {
4
+ beforeInputHook?: RuntimeInputHook;
5
+ beforeRenderOutputHook?: RuntimeInputHook;
6
+ };
7
+ export type RuntimeInputHooks = {
8
+ runBeforeInputHook: (text: string, source: string) => string | null;
9
+ runBeforeRenderOutputHook: (text: string, source: string) => string | null;
10
+ };
@@ -1,4 +1,5 @@
1
- import type { BindCanvasEventsOptions, RuntimeImeState } from "./types";
1
+ import type { BindCanvasEventsOptions } from "./runtime.types";
2
+ import type { RuntimeImeState } from "./state.types";
2
3
  export type BindImeEventsOptions = {
3
4
  bindOptions: BindCanvasEventsOptions;
4
5
  imeInput: HTMLTextAreaElement;
@@ -1,9 +1,9 @@
1
1
  import type { InputHandler } from "../../../input";
2
- import type { RuntimeCell, RuntimeDesktopSelectionState, RuntimeGridState, RuntimeScrollbarDragState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./types";
2
+ import type { RuntimeCell, RuntimeDesktopSelectionState, RuntimeGridState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./state.types";
3
3
  type CreatePointerAuxHandlersOptions = {
4
4
  inputHandler: InputHandler;
5
5
  shouldRoutePointerToAppMouse: (shiftKey: boolean) => boolean;
6
- scrollViewportByLines: (lines: number) => void;
6
+ scrollViewportByWheel?: (event: WheelEvent) => void;
7
7
  getWasmReady: () => boolean;
8
8
  getWasmHandle: () => number;
9
9
  getGridState: () => RuntimeGridState;
@@ -14,7 +14,6 @@ type CreatePointerAuxHandlersOptions = {
14
14
  selectionState: RuntimeSelectionState;
15
15
  touchSelectionState: RuntimeTouchSelectionState;
16
16
  desktopSelectionState: RuntimeDesktopSelectionState;
17
- scrollbarDragState: RuntimeScrollbarDragState;
18
17
  updateCanvasCursor: () => void;
19
18
  markNeedsRender: () => void;
20
19
  };
@@ -1,5 +1,5 @@
1
- import { type OverlayScrollbarLayout } from "../../overlay-scrollbar";
2
- import type { BindCanvasEventsOptions, RuntimeCell, RuntimeDesktopSelectionState, RuntimeGridState, RuntimeLinkState, RuntimeScrollbarDragState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./types";
1
+ import type { BindCanvasEventsOptions } from "./runtime.types";
2
+ import type { RuntimeCell, RuntimeDesktopSelectionState, RuntimeGridState, RuntimeLinkState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./state.types";
3
3
  export type BindPointerEventsOptions = {
4
4
  canvas: HTMLCanvasElement;
5
5
  bindOptions: BindCanvasEventsOptions;
@@ -9,7 +9,6 @@ export type BindPointerEventsOptions = {
9
9
  selectionState: RuntimeSelectionState;
10
10
  touchSelectionState: RuntimeTouchSelectionState;
11
11
  desktopSelectionState: RuntimeDesktopSelectionState;
12
- scrollbarDragState: RuntimeScrollbarDragState;
13
12
  linkState: RuntimeLinkState;
14
13
  cleanupCanvasFns: Array<() => void>;
15
14
  isTouchPointer: (event: PointerEvent) => boolean;
@@ -17,13 +16,9 @@ export type BindPointerEventsOptions = {
17
16
  clearPendingDesktopSelection: () => void;
18
17
  tryActivatePendingTouchSelection: (pointerId: number) => boolean;
19
18
  beginSelectionDrag: (cell: RuntimeCell, pointerId: number) => void;
20
- noteScrollActivity: () => void;
21
- getOverlayScrollbarLayout: () => OverlayScrollbarLayout | null;
22
- pointerToCanvasPx: (event: PointerEvent) => {
23
- x: number;
24
- y: number;
25
- };
26
- setViewportScrollOffset: (nextOffset: number) => void;
19
+ selectWordAtCell?: (cell: RuntimeCell) => boolean;
20
+ selectLineAtCell?: (cell: RuntimeCell) => boolean;
21
+ scrollViewportByWheel?: (event: WheelEvent) => void;
27
22
  normalizeSelectionCell: (cell: RuntimeCell) => RuntimeCell;
28
23
  positionToCell: (event: {
29
24
  clientX: number;
@@ -1,10 +1,9 @@
1
1
  import type { InputHandler } from "../../../input";
2
- import type { RuntimeCell, RuntimeDesktopSelectionState, RuntimeLinkState, RuntimeScrollbarDragState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./types";
2
+ import type { RuntimeCell, RuntimeDesktopSelectionState, RuntimeLinkState, RuntimeSelectionState, RuntimeTouchSelectionState } from "./state.types";
3
3
  type CreatePointerUpHandlerOptions = {
4
4
  inputHandler: InputHandler;
5
5
  sendKeyInput: (text: string) => void;
6
6
  openLink: (url: string) => void;
7
- scrollbarDragState: RuntimeScrollbarDragState;
8
7
  isTouchPointer: (event: PointerEvent) => boolean;
9
8
  touchSelectionState: RuntimeTouchSelectionState;
10
9
  selectionState: RuntimeSelectionState;
@@ -17,6 +16,8 @@ type CreatePointerUpHandlerOptions = {
17
16
  clearPendingDesktopSelection: () => void;
18
17
  desktopSelectionState: RuntimeDesktopSelectionState;
19
18
  clearSelection: () => void;
19
+ selectWordAtCell?: (cell: RuntimeCell) => boolean;
20
+ selectLineAtCell?: (cell: RuntimeCell) => boolean;
20
21
  updateCanvasCursor: () => void;
21
22
  markNeedsRender: () => void;
22
23
  shouldRoutePointerToAppMouse: (shiftKey: boolean) => boolean;
@@ -0,0 +1,8 @@
1
+ import type { RenderState } from "../../../wasm";
2
+ import type { RuntimeCell } from "./types";
3
+ type DesktopWordSelectionRange = {
4
+ start: number;
5
+ end: number;
6
+ };
7
+ export declare function resolveDesktopWordSelectionRange(render: RenderState | null, cell: RuntimeCell): DesktopWordSelectionRange | null;
8
+ export {};
@@ -1,3 +1,4 @@
1
- import type { CreateRuntimeInteractionOptions, RuntimeInteraction } from "./interaction-runtime/types";
2
- export type { BindCanvasEventsOptions, CreateRuntimeInteractionOptions, RuntimeCell, RuntimeInteraction, } from "./interaction-runtime/types";
1
+ import type { CreateRuntimeInteractionOptions, RuntimeInteraction } from "./runtime.types";
2
+ export type { BindCanvasEventsOptions, CreateRuntimeInteractionOptions, RuntimeInteraction, } from "./runtime.types";
3
+ export type { RuntimeCell } from "./state.types";
3
4
  export declare function createRuntimeInteraction(options: CreateRuntimeInteractionOptions): RuntimeInteraction;
@@ -1,18 +1,3 @@
1
- import type { KittyPlacement, ResttyWasm } from "../../../wasm";
2
- export type KittyDecodedImage = {
3
- key: string;
4
- width: number;
5
- height: number;
6
- source: CanvasImageSource;
7
- pixels?: Uint8Array;
8
- };
9
- export type KittyImageCache = {
10
- resolveKittyImage: (placement: KittyPlacement) => KittyDecodedImage | null;
11
- clearKittyImageCache: () => void;
12
- pruneInactiveImages: (activeImageIds: Set<number>) => boolean;
13
- };
14
- export type CreateKittyImageCacheOptions = {
15
- getWasm: () => ResttyWasm | null;
16
- markNeedsRender: () => void;
17
- };
1
+ import type { CreateKittyImageCacheOptions, KittyImageCache } from "./kitty-image-cache.types";
2
+ export type { CreateKittyImageCacheOptions, KittyDecodedImage, KittyImageCache, } from "./kitty-image-cache.types";
18
3
  export declare function createKittyImageCache(options: CreateKittyImageCacheOptions): KittyImageCache;
@@ -0,0 +1,17 @@
1
+ import type { KittyPlacement, ResttyWasm } from "../../../wasm";
2
+ export type KittyDecodedImage = {
3
+ key: string;
4
+ width: number;
5
+ height: number;
6
+ source: CanvasImageSource;
7
+ pixels?: Uint8Array;
8
+ };
9
+ export type KittyImageCache = {
10
+ resolveKittyImage: (placement: KittyPlacement) => KittyDecodedImage | null;
11
+ clearKittyImageCache: () => void;
12
+ pruneInactiveImages: (activeImageIds: Set<number>) => boolean;
13
+ };
14
+ export type CreateKittyImageCacheOptions = {
15
+ getWasm: () => ResttyWasm | null;
16
+ markNeedsRender: () => void;
17
+ };
@@ -1,53 +1,6 @@
1
1
  import type { InputHandler } from "../../../input";
2
- import type { createSelectionState } from "../../../selection";
3
2
  import type { RenderState, ResttyWasm, ResttyWasmExports } from "../../../wasm";
4
- export type RuntimeCell = {
5
- row: number;
6
- col: number;
7
- };
8
- export type RuntimeGridState = {
9
- cols: number;
10
- rows: number;
11
- cellW: number;
12
- cellH: number;
13
- };
14
- export type RuntimeImeState = {
15
- composing: boolean;
16
- preedit: string;
17
- selectionStart: number;
18
- selectionEnd: number;
19
- };
20
- export type RuntimeTouchSelectionState = {
21
- pendingPointerId: number | null;
22
- activePointerId: number | null;
23
- panPointerId: number | null;
24
- pendingCell: RuntimeCell | null;
25
- pendingStartedAt: number;
26
- pendingStartX: number;
27
- pendingStartY: number;
28
- panLastY: number;
29
- pendingTimer: number;
30
- };
31
- export type RuntimeDesktopSelectionState = {
32
- pendingPointerId: number | null;
33
- pendingCell: RuntimeCell | null;
34
- startedWithActiveSelection: boolean;
35
- };
36
- export type RuntimeLinkState = {
37
- hoverId: number;
38
- hoverUri: string;
39
- };
40
- export type RuntimeScrollbarState = {
41
- lastInputAt: number;
42
- lastTotal: number;
43
- lastOffset: number;
44
- lastLen: number;
45
- };
46
- export type RuntimeScrollbarDragState = {
47
- pointerId: number | null;
48
- thumbGrabRatio: number;
49
- };
50
- export type RuntimeSelectionState = ReturnType<typeof createSelectionState>;
3
+ import type { RuntimeCell, RuntimeGridState, RuntimeImeState, RuntimeLinkState, RuntimeScrollbarState, RuntimeSelectionState } from "./state.types";
51
4
  export type BindCanvasEventsOptions = {
52
5
  inputHandler: InputHandler;
53
6
  sendKeyInput: (text: string) => void;
@@ -63,7 +16,6 @@ export type CreateRuntimeInteractionOptions = {
63
16
  touchSelectionMode: "off" | "drag" | "long-press";
64
17
  touchSelectionLongPressMs: number;
65
18
  touchSelectionMoveThresholdPx: number;
66
- showOverlayScrollbar: boolean;
67
19
  imeInput: HTMLTextAreaElement | null;
68
20
  cleanupCanvasFns: Array<() => void>;
69
21
  getCanvas: () => HTMLCanvasElement;
@@ -76,6 +28,7 @@ export type CreateRuntimeInteractionOptions = {
76
28
  getWasmExports: () => ResttyWasmExports | null;
77
29
  updateLinkHover: (cell: RuntimeCell | null) => void;
78
30
  markNeedsRender: () => void;
31
+ markSearchDirty?: () => void;
79
32
  };
80
33
  export type RuntimeInteraction = {
81
34
  selectionState: RuntimeSelectionState;
@@ -95,11 +48,12 @@ export type RuntimeInteraction = {
95
48
  x: number;
96
49
  y: number;
97
50
  };
51
+ selectWordAtClientPoint: (clientX: number, clientY: number) => boolean;
98
52
  clearSelection: () => void;
99
53
  updateImePosition: (cursor: {
100
54
  row: number;
101
55
  col: number;
102
56
  } | null | undefined, cellW: number, cellH: number) => void;
103
- appendOverlayScrollbar: (overlayData: number[], total: number, offset: number, len: number) => void;
57
+ syncScrollbar: (total: number, offset: number, len: number) => void;
104
58
  bindCanvasEvents: (bindOptions: BindCanvasEventsOptions) => void;
105
59
  };
@@ -1,30 +1,2 @@
1
- import { type OverlayScrollbarLayout } from "../../overlay-scrollbar";
2
- import type { RuntimeGridState, RuntimeLinkState, RuntimeScrollbarState, RuntimeSelectionState } from "./types";
3
- import type { ResttyWasm, ResttyWasmExports } from "../../../wasm";
4
- export type CreateScrollbarRuntimeOptions = {
5
- showOverlayScrollbar: boolean;
6
- scrollbarState: RuntimeScrollbarState;
7
- selectionState: RuntimeSelectionState;
8
- linkState: RuntimeLinkState;
9
- getCanvas: () => HTMLCanvasElement;
10
- getCurrentDpr: () => number;
11
- getGridState: () => RuntimeGridState;
12
- getWasmReady: () => boolean;
13
- getWasm: () => ResttyWasm | null;
14
- getWasmHandle: () => number;
15
- getWasmExports: () => ResttyWasmExports | null;
16
- updateLinkHover: (cell: null) => void;
17
- markNeedsRender: () => void;
18
- };
19
- export type ScrollbarRuntime = {
20
- noteScrollActivity: () => void;
21
- scrollViewportByLines: (lines: number) => void;
22
- setViewportScrollOffset: (nextOffset: number) => void;
23
- pointerToCanvasPx: (event: PointerEvent) => {
24
- x: number;
25
- y: number;
26
- };
27
- getOverlayScrollbarLayout: () => OverlayScrollbarLayout | null;
28
- appendOverlayScrollbar: (overlayData: number[], total: number, offset: number, len: number) => void;
29
- };
1
+ import type { CreateScrollbarRuntimeOptions, ScrollbarRuntime } from "./scrollbar-runtime.types";
30
2
  export declare function createScrollbarRuntime(options: CreateScrollbarRuntimeOptions): ScrollbarRuntime;
@@ -0,0 +1,23 @@
1
+ import type { ResttyWasm, ResttyWasmExports } from "../../../wasm";
2
+ import type { RuntimeGridState, RuntimeLinkState, RuntimeScrollbarState, RuntimeSelectionState } from "./state.types";
3
+ export type CreateScrollbarRuntimeOptions = {
4
+ scrollbarState: RuntimeScrollbarState;
5
+ selectionState: RuntimeSelectionState;
6
+ linkState: RuntimeLinkState;
7
+ getCanvas: () => HTMLCanvasElement;
8
+ getGridState: () => RuntimeGridState;
9
+ getWasmReady: () => boolean;
10
+ getWasm: () => ResttyWasm | null;
11
+ getWasmHandle: () => number;
12
+ getWasmExports: () => ResttyWasmExports | null;
13
+ updateLinkHover: (cell: null) => void;
14
+ markNeedsRender: () => void;
15
+ markSearchDirty?: () => void;
16
+ };
17
+ export type ScrollbarRuntime = {
18
+ destroy: () => void;
19
+ noteScrollActivity: () => void;
20
+ scrollViewportByLines: (lines: number) => void;
21
+ scrollViewportByWheel: (event: WheelEvent) => void;
22
+ syncScrollbar: (total: number, offset: number, len: number) => void;
23
+ };
@@ -0,0 +1,47 @@
1
+ import type { createSelectionState } from "../../../selection";
2
+ export type RuntimeCell = {
3
+ row: number;
4
+ col: number;
5
+ };
6
+ export type RuntimeGridState = {
7
+ cols: number;
8
+ rows: number;
9
+ cellW: number;
10
+ cellH: number;
11
+ };
12
+ export type RuntimeImeState = {
13
+ composing: boolean;
14
+ preedit: string;
15
+ selectionStart: number;
16
+ selectionEnd: number;
17
+ };
18
+ export type RuntimeTouchSelectionState = {
19
+ pendingPointerId: number | null;
20
+ activePointerId: number | null;
21
+ panPointerId: number | null;
22
+ pendingCell: RuntimeCell | null;
23
+ pendingStartedAt: number;
24
+ pendingStartX: number;
25
+ pendingStartY: number;
26
+ panLastY: number;
27
+ pendingTimer: number;
28
+ };
29
+ export type RuntimeDesktopSelectionState = {
30
+ pendingPointerId: number | null;
31
+ pendingCell: RuntimeCell | null;
32
+ startedWithActiveSelection: boolean;
33
+ lastPrimaryClickAt: number;
34
+ lastPrimaryClickCell: RuntimeCell | null;
35
+ lastPrimaryClickCount: number;
36
+ };
37
+ export type RuntimeLinkState = {
38
+ hoverId: number;
39
+ hoverUri: string;
40
+ };
41
+ export type RuntimeScrollbarState = {
42
+ lastInputAt: number;
43
+ lastTotal: number;
44
+ lastOffset: number;
45
+ lastLen: number;
46
+ };
47
+ export type RuntimeSelectionState = ReturnType<typeof createSelectionState>;
@@ -1,36 +1,2 @@
1
- import type { WebGPUState } from "../../renderer";
2
- import type { KittyPlacement, ResttyWasm } from "../../wasm";
3
- export type KittyDrawSlice = {
4
- imageId: number;
5
- key: string;
6
- source: CanvasImageSource;
7
- pixels?: Uint8Array;
8
- imageWidth: number;
9
- imageHeight: number;
10
- sx: number;
11
- sy: number;
12
- sw: number;
13
- sh: number;
14
- dx: number;
15
- dy: number;
16
- dw: number;
17
- dh: number;
18
- z: number;
19
- };
20
- export type KittyDrawPlan = {
21
- underlay: KittyDrawSlice[];
22
- overlay: KittyDrawSlice[];
23
- };
24
- type CreateKittyRenderRuntimeOptions = {
25
- getWasm: () => ResttyWasm | null;
26
- markNeedsRender: () => void;
27
- };
28
- export declare function createKittyRenderRuntime(options: CreateKittyRenderRuntimeOptions): {
29
- collectKittyDrawPlan: (placements: KittyPlacement[], cellW: number, cellH: number) => KittyDrawPlan;
30
- resolveKittyWebGLTexture: (gl: WebGL2RenderingContext, slice: KittyDrawSlice) => WebGLTexture | null;
31
- resolveKittyWebGPUBindGroup: (state: WebGPUState, slice: KittyDrawSlice, nearest?: boolean) => GPUBindGroup | null;
32
- clearWebGLKittyTextures: () => void;
33
- clearWebGPUKittyTextures: () => void;
34
- clearKittyRenderCaches: () => void;
35
- };
36
- export {};
1
+ import type { KittyRenderRuntime, KittyRenderRuntimeOptions } from "./kitty-render-runtime.types";
2
+ export declare function createKittyRenderRuntime(options: KittyRenderRuntimeOptions): KittyRenderRuntime;
@@ -0,0 +1,33 @@
1
+ import type { WebGPUState } from "../../renderer";
2
+ import type { KittyPlacement } from "../../wasm";
3
+ import type { CreateKittyImageCacheOptions } from "./interaction-runtime/kitty-image-cache.types";
4
+ export type KittyDrawSlice = {
5
+ imageId: number;
6
+ key: string;
7
+ source: CanvasImageSource;
8
+ pixels?: Uint8Array;
9
+ imageWidth: number;
10
+ imageHeight: number;
11
+ sx: number;
12
+ sy: number;
13
+ sw: number;
14
+ sh: number;
15
+ dx: number;
16
+ dy: number;
17
+ dw: number;
18
+ dh: number;
19
+ z: number;
20
+ };
21
+ export type KittyDrawPlan = {
22
+ underlay: KittyDrawSlice[];
23
+ overlay: KittyDrawSlice[];
24
+ };
25
+ export type KittyRenderRuntimeOptions = CreateKittyImageCacheOptions;
26
+ export type KittyRenderRuntime = {
27
+ collectKittyDrawPlan: (placements: KittyPlacement[], cellW: number, cellH: number) => KittyDrawPlan;
28
+ resolveKittyWebGLTexture: (gl: WebGL2RenderingContext, slice: KittyDrawSlice) => WebGLTexture | null;
29
+ resolveKittyWebGPUBindGroup: (state: WebGPUState, slice: KittyDrawSlice, nearest?: boolean) => GPUBindGroup | null;
30
+ clearWebGLKittyTextures: () => void;
31
+ clearWebGPUKittyTextures: () => void;
32
+ clearKittyRenderCaches: () => void;
33
+ };
@@ -1,4 +1,4 @@
1
- import type { LifecycleThemeSizeDeps } from "./lifecycle-theme-size.types";
1
+ import type { LifecycleThemeSizeDeps } from "./types";
2
2
  export declare function createLifecycleCanvasHandlers(deps: LifecycleThemeSizeDeps): {
3
3
  replaceCanvas: () => void;
4
4
  updateSize: (force?: boolean) => void;
@@ -1,6 +1,6 @@
1
- import type { LifecycleThemeSizeDeps } from "./lifecycle-theme-size.types";
1
+ import type { LifecycleThemeSizeDeps } from "./types";
2
2
  export declare function createRuntimeLifecycleThemeSize(deps: LifecycleThemeSizeDeps): {
3
- applyTheme: (theme: import("../..").GhosttyTheme | null | undefined, sourceLabel?: string) => void;
3
+ applyTheme: (theme: import("../../..").GhosttyTheme | null | undefined, _sourceLabel?: string) => void;
4
4
  resetTheme: () => void;
5
5
  replaceCanvas: () => void;
6
6
  updateSize: (force?: boolean) => void;
@@ -12,5 +12,5 @@ export declare function createRuntimeLifecycleThemeSize(deps: LifecycleThemeSize
12
12
  bindFocusEvents: () => void;
13
13
  bindAutoResizeEvents: () => void;
14
14
  cancelScheduledSizeUpdate: () => void;
15
- getActiveTheme: () => import("../..").GhosttyTheme | null;
15
+ getActiveTheme: () => GhosttyTheme | null;
16
16
  };
@@ -0,0 +1,6 @@
1
+ import { type GhosttyTheme } from "../../../theme";
2
+ import type { LifecycleThemeSizeDeps } from "./types";
3
+ export declare function createLifecycleThemeHandlers(deps: LifecycleThemeSizeDeps): {
4
+ applyTheme: (theme: GhosttyTheme | null | undefined, _sourceLabel?: string) => void;
5
+ resetTheme: () => void;
6
+ };
@@ -2,8 +2,8 @@ import type { InputHandler } from "../../input";
2
2
  import type { FontManagerState } from "../../fonts";
3
3
  import type { Color, WebGLState, WebGPUState } from "../../renderer";
4
4
  import type { GhosttyTheme } from "../../theme";
5
+ import type { RuntimeTerminalColor } from "./highlight-terminal-color-utils.types";
5
6
  import type { ResttyWasm } from "../../wasm";
6
- import type { ResttyAppCallbacks } from "../types";
7
7
  export type ActiveState = WebGPUState | WebGLState | null;
8
8
  export type GridStateRef = {
9
9
  cols: number;
@@ -34,9 +34,6 @@ export type LifecycleThemeSizeDeps = {
34
34
  attachWindowEvents: boolean;
35
35
  autoResize: boolean;
36
36
  imeInput: HTMLTextAreaElement | null;
37
- dprEl: HTMLElement | null;
38
- sizeEl: HTMLElement | null;
39
- callbacks: ResttyAppCallbacks | undefined;
40
37
  cleanupFns: Array<() => void>;
41
38
  cleanupCanvasFns: Array<() => void>;
42
39
  gridState: GridStateRef;
@@ -44,7 +41,12 @@ export type LifecycleThemeSizeDeps = {
44
41
  fontState: FontManagerState;
45
42
  defaultBgBase: Color;
46
43
  defaultFgBase: Color;
47
- selectionBase: Color;
44
+ selectionBackgroundBase: RuntimeTerminalColor;
45
+ selectionForegroundBase: RuntimeTerminalColor | null;
46
+ searchMatchBackgroundBase: RuntimeTerminalColor;
47
+ searchCurrentMatchBackgroundBase: RuntimeTerminalColor;
48
+ searchMatchTextBase: RuntimeTerminalColor;
49
+ searchCurrentMatchTextBase: RuntimeTerminalColor;
48
50
  cursorBase: Color;
49
51
  getCanvas: () => HTMLCanvasElement;
50
52
  setCanvas: (canvas: HTMLCanvasElement) => void;
@@ -58,12 +60,16 @@ export type LifecycleThemeSizeDeps = {
58
60
  setActiveTheme: (theme: GhosttyTheme | null) => void;
59
61
  setDefaultBg: (value: Color) => void;
60
62
  setDefaultFg: (value: Color) => void;
61
- setSelectionColor: (value: Color) => void;
63
+ setSelectionBackgroundColor: (value: RuntimeTerminalColor) => void;
64
+ setSelectionForegroundColor: (value: RuntimeTerminalColor | null) => void;
65
+ setSearchMatchBackgroundColor: (value: RuntimeTerminalColor) => void;
66
+ setSearchCurrentMatchBackgroundColor: (value: RuntimeTerminalColor) => void;
67
+ setSearchMatchTextColor: (value: RuntimeTerminalColor) => void;
68
+ setSearchCurrentMatchTextColor: (value: RuntimeTerminalColor) => void;
62
69
  setCursorFallback: (value: Color) => void;
63
70
  getWasmReady: () => boolean;
64
71
  getWasm: () => ResttyWasm | null;
65
72
  getWasmHandle: () => number;
66
- appendLog: (line: string) => void;
67
73
  bindCanvasEvents: () => void;
68
74
  computeCellMetrics: () => {
69
75
  cellW: number;
@@ -0,0 +1,52 @@
1
+ type CellCluster = {
2
+ cp: number;
3
+ text: string;
4
+ span: number;
5
+ };
6
+ type CursorCell = {
7
+ row: number;
8
+ col: number;
9
+ wide: boolean;
10
+ };
11
+ type ResolveLigatureRunOptions = {
12
+ idx: number;
13
+ row: number;
14
+ col: number;
15
+ cols: number;
16
+ contentTags: Uint8Array | null;
17
+ styleFlags: Uint16Array | null;
18
+ linkIds: Uint32Array | null;
19
+ fgBytes: Uint8Array;
20
+ bgBytes: Uint8Array | null;
21
+ ulBytes: Uint8Array | null;
22
+ ulStyle: Uint8Array | null;
23
+ cursorBlock: boolean;
24
+ cursorCell: CursorCell | null;
25
+ readCellCluster: (cellIndex: number) => CellCluster | null;
26
+ };
27
+ type LigatureRun = {
28
+ text: string;
29
+ span: number;
30
+ indices: number[];
31
+ };
32
+ type ShapedGlyphLike = {
33
+ glyphId: number;
34
+ xAdvance: number;
35
+ xOffset: number;
36
+ };
37
+ type ShapedClusterLike = {
38
+ glyphs: ShapedGlyphLike[];
39
+ advance: number;
40
+ };
41
+ type ResolveRenderableLigatureRunOptions<FontEntry> = {
42
+ ligatureRun: LigatureRun;
43
+ stylePreference: string;
44
+ fonts: FontEntry[];
45
+ pickFontIndexForText: (text: string, expectedSpan?: number, stylePreference?: string) => number;
46
+ shapeClusterWithFont: (entry: FontEntry, text: string) => ShapedClusterLike;
47
+ readCellCluster: (cellIndex: number) => CellCluster | null;
48
+ };
49
+ export declare function resolveLigatureRun(options: ResolveLigatureRunOptions): LigatureRun | null;
50
+ export declare function shouldUseLigatureShape(combined: ShapedClusterLike, singles: ShapedClusterLike[]): boolean;
51
+ export declare function resolveRenderableLigatureRun<FontEntry>(options: ResolveRenderableLigatureRunOptions<FontEntry>): LigatureRun | null;
52
+ export {};
@@ -1,9 +1,6 @@
1
+ import type { MaxScrollbackOptions } from "./max-scrollback.types";
1
2
  export declare const DEFAULT_MAX_SCROLLBACK_BYTES = 10000000;
2
3
  export declare const MAX_MAX_SCROLLBACK_BYTES = 256000000;
3
- type MaxScrollbackOptions = {
4
- maxScrollbackBytes?: number;
5
- maxScrollback?: number;
6
- };
4
+ export type { MaxScrollbackOptions } from "./max-scrollback.types";
7
5
  export declare function normalizeMaxScrollbackBytes(value: number | undefined): number;
8
6
  export declare function resolveMaxScrollbackBytes(options: MaxScrollbackOptions): number;
9
- export {};
@@ -0,0 +1,4 @@
1
+ export type MaxScrollbackOptions = {
2
+ maxScrollbackBytes?: number;
3
+ maxScrollback?: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ import type { NativeScrollbarHost, NativeScrollbarHostOptions } from "./native-scrollbar-host.types";
2
+ export declare function createNativeScrollbarHost(options: NativeScrollbarHostOptions): NativeScrollbarHost;
@@ -0,0 +1,13 @@
1
+ export type NativeScrollbarHostOptions = {
2
+ canvas: HTMLCanvasElement;
3
+ getGridState: () => {
4
+ cellH: number;
5
+ };
6
+ noteScrollActivity: () => void;
7
+ setViewportScrollOffset: (nextOffset: number) => void;
8
+ };
9
+ export type NativeScrollbarHost = {
10
+ flash: () => void;
11
+ sync: (total: number, offset: number, len: number) => void;
12
+ destroy: () => void;
13
+ };
@@ -0,0 +1,6 @@
1
+ import type { OverlayScrollbarLayout } from "./overlay-scrollbar.types";
2
+ export declare const OVERLAY_SCROLLBAR_WIDTH_CSS_PX = 7;
3
+ export declare const OVERLAY_SCROLLBAR_MARGIN_CSS_PX = 4;
4
+ export declare const OVERLAY_SCROLLBAR_INSET_Y_CSS_PX = 2;
5
+ export declare const OVERLAY_SCROLLBAR_MIN_THUMB_CSS_PX = 28;
6
+ export declare function computeOverlayScrollbarLayout(total: number, offset: number, len: number, canvasWidth: number, canvasHeight: number, currentDpr: number): OverlayScrollbarLayout | null;
@@ -0,0 +1,12 @@
1
+ export type OverlayScrollbarLayout = {
2
+ total: number;
3
+ offset: number;
4
+ len: number;
5
+ denom: number;
6
+ width: number;
7
+ trackX: number;
8
+ trackY: number;
9
+ trackH: number;
10
+ thumbY: number;
11
+ thumbH: number;
12
+ };