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
@@ -1,46 +1,2 @@
1
- import type { InputHandler } from "../../input";
2
- import type { PtyResizeMeta, PtyTransport } from "../../pty";
3
- import type { PtyOutputBufferController } from "../pty-output-buffer";
4
- type CursorPosition = {
5
- row: number;
6
- col: number;
7
- };
8
- type SendInput = (text: string, source?: string, options?: {
9
- skipHooks?: boolean;
10
- }) => void;
11
- export type CreatePtyInputRuntimeOptions = {
12
- ptyTransport: PtyTransport;
13
- ptyOutputBuffer: PtyOutputBufferController;
14
- inputHandler: InputHandler;
15
- ptyStatusEl?: HTMLElement | null;
16
- mouseStatusEl?: HTMLElement | null;
17
- onPtyStatus?: ((status: string) => void) | null;
18
- onMouseStatus?: ((status: string) => void) | null;
19
- appendLog: (line: string) => void;
20
- getGridSize: () => {
21
- cols: number;
22
- rows: number;
23
- };
24
- getResizeMeta?: () => PtyResizeMeta | null;
25
- getCursorForCpr: () => CursorPosition;
26
- sendInput: SendInput;
27
- runBeforeInputHook: (text: string, source: string) => string | null;
28
- shouldClearSelection: () => boolean;
29
- clearSelection: () => void;
30
- syncOutputResetMs: number;
31
- syncOutputResetSeq: string;
32
- };
33
- export type PtyInputRuntime = {
34
- setPtyStatus: (text: string) => void;
35
- updateMouseStatus: () => void;
36
- scheduleSyncOutputReset: () => void;
37
- cancelSyncOutputReset: () => void;
38
- connectPty: (url?: string) => void;
39
- disconnectPty: () => void;
40
- sendKeyInput: (text: string, source?: string) => void;
41
- sendPasteText: (text: string) => void;
42
- sendPastePayloadFromDataTransfer: (dataTransfer: DataTransfer | null | undefined) => boolean;
43
- getCprPosition: () => CursorPosition;
44
- };
45
- export declare function createPtyInputRuntime(options: CreatePtyInputRuntimeOptions): PtyInputRuntime;
46
- export {};
1
+ import type { PtyInputRuntime, PtyInputRuntimeOptions } from "./pty-input-runtime.types";
2
+ export declare function createPtyInputRuntime(options: PtyInputRuntimeOptions): PtyInputRuntime;
@@ -0,0 +1,41 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { PtyResizeMeta, PtyTransport } from "../../pty";
3
+ import type { ResttyRuntimeEvent } from "../core/runtime-events";
4
+ export type CursorPosition = {
5
+ row: number;
6
+ col: number;
7
+ };
8
+ export type RuntimeSendInput = (text: string, source?: string, options?: {
9
+ skipHooks?: boolean;
10
+ }) => void;
11
+ export type PtyInputRuntimeOptions = {
12
+ ptyTransport: PtyTransport;
13
+ inputHandler: InputHandler;
14
+ emitRuntimeEvent?: (event: Extract<ResttyRuntimeEvent, {
15
+ type: "pty-status";
16
+ }>) => void;
17
+ getGridSize: () => {
18
+ cols: number;
19
+ rows: number;
20
+ };
21
+ getResizeMeta?: () => PtyResizeMeta | null;
22
+ getCursorForCpr: () => CursorPosition;
23
+ sendInput: RuntimeSendInput;
24
+ runBeforeInputHook: (text: string, source: string) => string | null;
25
+ shouldClearSelection: () => boolean;
26
+ clearSelection: () => void;
27
+ syncOutputResetMs: number;
28
+ syncOutputResetSeq: string;
29
+ };
30
+ export type PtyInputRuntime = {
31
+ setPtyStatus: (text: string) => void;
32
+ updateMouseStatus: () => void;
33
+ scheduleSyncOutputReset: () => void;
34
+ cancelSyncOutputReset: () => void;
35
+ connectPty: (url?: string) => void;
36
+ disconnectPty: () => void;
37
+ sendKeyInput: (text: string, source?: string) => void;
38
+ sendPasteText: (text: string) => void;
39
+ sendPastePayloadFromDataTransfer: (dataTransfer: DataTransfer | null | undefined) => boolean;
40
+ getCprPosition: () => CursorPosition;
41
+ };
@@ -1,4 +1,4 @@
1
- import type { Color } from "../renderer";
1
+ import type { Color } from "../../renderer";
2
2
  export declare function decodePackedRGBA(color: number): Color;
3
3
  export declare function decodeRGBAWithCache(bytes: Uint8Array, index: number, cache: Map<number, Color>): Color;
4
4
  export declare function clamp01(value: number): number;
@@ -1,5 +1,5 @@
1
- import type { CompiledWebGPUShaderStage, WebGPUStageTargets, CompiledWebGLShaderStage, WebGLStageTargets } from "./create-app-types";
2
- import type { ResttyShaderStage } from "./types";
1
+ import type { CompiledWebGPUShaderStage, WebGPUStageTargets, CompiledWebGLShaderStage, WebGLStageTargets } from "./render-stage-runtime.types";
2
+ import type { ResttyShaderStage } from "../core/models";
3
3
  export declare function compileShaderStageProgram(options: {
4
4
  gl: WebGL2RenderingContext;
5
5
  stage: ResttyShaderStage;
@@ -1,32 +1,4 @@
1
- import type { ResttyShaderStage } from "./types";
2
- export type LocalFontsPermissionDescriptor = PermissionDescriptor & {
3
- name: "local-fonts";
4
- };
5
- export type LocalFontFaceData = {
6
- family?: string;
7
- fullName?: string;
8
- postscriptName?: string;
9
- blob: () => Promise<Blob>;
10
- };
11
- export type NavigatorWithLocalFontAccess = Navigator & {
12
- queryLocalFonts?: () => Promise<LocalFontFaceData[]>;
13
- permissions?: {
14
- query?: (permissionDesc: LocalFontsPermissionDescriptor) => Promise<PermissionStatus>;
15
- };
16
- };
17
- export type GlobalWithLocalFontAccess = typeof globalThis & {
18
- queryLocalFonts?: () => Promise<LocalFontFaceData[]>;
19
- navigator?: NavigatorWithLocalFontAccess;
20
- };
21
- export type ResttyDebugWindow = Window & typeof globalThis & {
22
- diagnoseCodepoint?: (cp: number) => void;
23
- dumpGlyphMetrics?: (cp: number) => {
24
- fontIndex: number;
25
- glyphId: number;
26
- } | null;
27
- dumpAtlasRegion?: (fontIndex: number, x: number, y: number, width: number, height: number) => Promise<ImageData | null>;
28
- dumpGlyphRender?: (cp: number, constraintWidth?: number) => Promise<unknown>;
29
- };
1
+ import type { ResttyShaderStage } from "../core/models";
30
2
  export type CompiledWebGPUShaderStage = {
31
3
  stage: ResttyShaderStage;
32
4
  pipeline: GPURenderPipeline;
@@ -1,2 +1,2 @@
1
- import type { WebGLTickContext } from "./render-tick-webgl-context";
1
+ import type { WebGLTickContext } from "./render-tick-webgl.types";
2
2
  export declare function populateWebGLOverlays(ctx: WebGLTickContext): void;
@@ -1,2 +1,2 @@
1
- import type { WebGLTickContext } from "./render-tick-webgl-context";
1
+ import type { WebGLTickContext } from "./render-tick-webgl.types";
2
2
  export declare function populateWebGLSceneData(ctx: WebGLTickContext): void;
@@ -1,8 +1,8 @@
1
1
  import type { FontEntry } from "../../fonts";
2
2
  import type { Color, WebGLState } from "../../renderer";
3
3
  import type { CursorInfo, RenderState, ResttyWasmExports } from "../../wasm";
4
- import type { CompiledWebGLShaderStage, WebGLStageTargets } from "../create-app-types";
5
- import type { BuildFontAtlasParams, BuildFontAtlasResult, GlyphConstraintMeta } from "../atlas-builder";
4
+ import type { CompiledWebGLShaderStage, WebGLStageTargets } from "./render-stage-runtime.types";
5
+ import type { BuildFontAtlasParams, BuildFontAtlasResult, GlyphConstraintMeta } from "../fonts/atlas-builder";
6
6
  import type { AlphaBlendingMode } from "./blend-utils";
7
7
  import type { CursorPosition, GlyphQueueItem, NerdMetrics, SharedTickDeps, WebGPURenderInput } from "./render-tick-webgpu.types";
8
8
  type AtlasBuilderDeps = BuildFontAtlasParams["deps"];
@@ -12,9 +12,6 @@ export type WebGLTickDeps = SharedTickDeps & {
12
12
  setShaderStagesDirty: (value: boolean) => void;
13
13
  getCompiledWebGLShaderStages: () => CompiledWebGLShaderStage[];
14
14
  ensureWebGLStageTargets: (state: WebGLState) => WebGLStageTargets | null;
15
- fontError: Error | null;
16
- termDebug: HTMLElement | null;
17
- reportDebugText: (text: string) => void;
18
15
  updateGrid: () => void;
19
16
  getRenderState: () => RenderState | null;
20
17
  resolveBlendFlags: (alphaMode: AlphaBlendingMode, backend: "webgl2") => {
@@ -1,4 +1,4 @@
1
- import type { GlyphConstraintMeta } from "../atlas-builder";
1
+ import type { GlyphConstraintMeta } from "../fonts/atlas-builder";
2
2
  import type { CollectWebGPUCellPassParams, GlyphQueueItem } from "./render-tick-webgpu.types";
3
3
  export declare function collectWebGPUCellPass(params: CollectWebGPUCellPassParams): {
4
4
  bgData: number[];
@@ -1,11 +1,12 @@
1
1
  import type { FontEntry, FontManagerState } from "../../fonts";
2
2
  import type { NerdConstraint } from "../../fonts/nerd-constraints";
3
3
  import type { Color, WebGPUState } from "../../renderer";
4
- import type { CompiledWebGPUShaderStage, WebGPUStageTargets } from "../create-app-types";
5
- import type { GlyphConstraintMeta } from "../atlas-builder";
6
- import type { KittyPlacement, RenderState, ResttyWasm, ResttyWasmExports } from "../../wasm";
7
- import type { KittyDrawPlan, KittyDrawSlice } from "./kitty-render-runtime";
8
- import type { ResttyFontHintTarget } from "../types";
4
+ import type { RuntimeTerminalColor } from "./highlight-terminal-color-utils.types";
5
+ import type { CompiledWebGPUShaderStage, WebGPUStageTargets } from "./render-stage-runtime.types";
6
+ import type { GlyphConstraintMeta } from "../fonts/atlas-builder";
7
+ import type { KittyPlacement, RenderState, ResttyWasm, ResttyWasmExports, SearchViewportMatch } from "../../wasm";
8
+ import type { KittyDrawPlan, KittyDrawSlice } from "./kitty-render-runtime.types";
9
+ import type { ResttyFontHintTarget } from "../core/models";
9
10
  export type CursorPosition = {
10
11
  col: number;
11
12
  row: number;
@@ -99,6 +100,7 @@ export type SharedTickDeps = {
99
100
  match: RegExp;
100
101
  scale: number;
101
102
  }>;
103
+ getLigatures: () => boolean;
102
104
  getFontHinting: () => boolean;
103
105
  getFontHintTarget: () => ResttyFontHintTarget;
104
106
  isSymbolFont: (entry: FontEntry) => boolean;
@@ -117,9 +119,15 @@ export type SharedTickDeps = {
117
119
  start: number;
118
120
  end: number;
119
121
  } | null;
122
+ getSearchViewportMatches: () => readonly SearchViewportMatch[];
120
123
  pushRect: (target: number[], x: number, y: number, width: number, height: number, color: Color) => void;
121
124
  pushRectBox: (target: number[], x: number, y: number, width: number, height: number, color: Color) => void;
122
- selectionColor: Color;
125
+ selectionBackgroundColor: RuntimeTerminalColor;
126
+ selectionForegroundColor: RuntimeTerminalColor | null;
127
+ searchMatchBackgroundColor: RuntimeTerminalColor;
128
+ searchCurrentMatchBackgroundColor: RuntimeTerminalColor;
129
+ searchMatchTextColor: RuntimeTerminalColor;
130
+ searchCurrentMatchTextColor: RuntimeTerminalColor;
123
131
  STYLE_BOLD: number;
124
132
  STYLE_ITALIC: number;
125
133
  STYLE_FAINT: number;
@@ -197,7 +205,7 @@ export type SharedTickDeps = {
197
205
  lastOffset: number;
198
206
  lastLen: number;
199
207
  };
200
- appendOverlayScrollbar: (target: number[], total: number, offset: number, len: number) => void;
208
+ syncScrollbar: (total: number, offset: number, len: number) => void;
201
209
  webgpuUniforms: Float32Array;
202
210
  ensureInstanceBuffer: (state: WebGPUState, kind: "rect" | "glyph", minBytes: number) => void;
203
211
  GLYPH_INSTANCE_FLOATS: number;
@@ -244,9 +252,6 @@ export type RuntimeTickDeps = SharedTickDeps & {
244
252
  setShaderStagesDirty: (value: boolean) => void;
245
253
  getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
246
254
  ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
247
- fontError: Error | null;
248
- termDebug: HTMLElement | null;
249
- reportDebugText: (text: string) => void;
250
255
  updateGrid: () => void;
251
256
  getRenderState: () => RenderState | null;
252
257
  resolveBlendFlags: (alphaMode: string, backend: "webgpu", state: WebGPUState) => {
@@ -279,7 +284,6 @@ export type RuntimeTickDeps = SharedTickDeps & {
279
284
  row: number;
280
285
  col: number;
281
286
  } | null;
282
- dbgEl: HTMLElement | null;
283
287
  wasmExports: ResttyWasmExports | null;
284
288
  wasmHandle: number;
285
289
  gridState: {
@@ -0,0 +1,96 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { PtyTransport } from "../../pty";
3
+ import type { WebGPUState, WebGLState } from "../../renderer";
4
+ import type { GhosttyTheme } from "../../theme";
5
+ import type { ResttyRuntime, ResttyRuntimeInteractionApi, ResttyRuntimeRenderApi, ResttyRuntimeSearchApi, ResttyRuntimeTerminalApi } from "../core/api";
6
+ import type { ResttyRuntimeEventHub } from "../core/runtime-events";
7
+ import type { ResttyRuntimeSession } from "../core/resources";
8
+ import type { RuntimeInteraction } from "./interaction-runtime/runtime.types";
9
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
10
+ import type { PreferredRenderer, RuntimeControllerSharedState } from "./runtime-controller.state.types";
11
+ export type RuntimeSendInput = (text: string, source?: string, options?: {
12
+ skipHooks?: boolean;
13
+ }) => void;
14
+ export type RuntimeControllerPublicCapabilities = {
15
+ terminal: Pick<ResttyRuntimeTerminalApi, "setFontSize" | "setLigatures" | "setFontHinting" | "setFontHintTarget" | "setFonts" | "resetTheme">;
16
+ search: ResttyRuntimeSearchApi;
17
+ interaction: Pick<ResttyRuntimeInteractionApi, "resize" | "focus" | "blur" | "updateSize">;
18
+ render: Pick<ResttyRuntimeRenderApi, "setShaderStages" | "getShaderStages">;
19
+ };
20
+ export type RuntimeController = {
21
+ sendInput: RuntimeSendInput;
22
+ createPublicApi: (capabilities: RuntimeControllerPublicCapabilities) => ResttyRuntime;
23
+ };
24
+ export type LifecycleThemeRuntime = {
25
+ cancelScheduledSizeUpdate: () => void;
26
+ getActiveTheme: () => GhosttyTheme | null;
27
+ };
28
+ export type RuntimeControllerRuntimeDeps = {
29
+ session: ResttyRuntimeSession;
30
+ ptyTransport: PtyTransport;
31
+ forwardTerminalReplies?: boolean;
32
+ inputHandler: InputHandler;
33
+ ptyInputRuntime: PtyInputRuntime;
34
+ interaction: RuntimeInteraction;
35
+ lifecycleThemeSizeRuntime: LifecycleThemeRuntime;
36
+ };
37
+ export type RuntimeControllerStateDeps = {
38
+ readState: () => RuntimeControllerSharedState;
39
+ writeState: (patch: Partial<RuntimeControllerSharedState>) => void;
40
+ resizeState: {
41
+ lastAt: number;
42
+ };
43
+ gridState: {
44
+ cols: number;
45
+ rows: number;
46
+ };
47
+ getCanvas: () => HTMLCanvasElement;
48
+ };
49
+ export type RuntimeControllerPlatformDeps = {
50
+ imeInput: HTMLTextAreaElement | null;
51
+ attachWindowEvents: boolean;
52
+ isMacPlatform: boolean;
53
+ KITTY_FLAG_REPORT_EVENTS: number;
54
+ };
55
+ export type RuntimeControllerHookDeps = {
56
+ runBeforeInputHook: (text: string, source: string) => string | null;
57
+ runBeforeRenderOutputHook: (text: string, source: string) => string | null;
58
+ getSelectionText: () => string;
59
+ markSearchDirty: () => void;
60
+ handleSearchWasmReset: () => void;
61
+ };
62
+ export type RuntimeControllerRenderDeps = {
63
+ initialPreferredRenderer: PreferredRenderer;
64
+ CURSOR_BLINK_MS: number;
65
+ RESIZE_ACTIVE_MS: number;
66
+ BACKGROUND_RENDER_FPS: number;
67
+ tickWebGPU: (state: WebGPUState) => void;
68
+ tickWebGL: (state: WebGLState) => void;
69
+ };
70
+ export type RuntimeControllerLifecycleDeps = {
71
+ cleanupFns: Array<() => void>;
72
+ cleanupCanvasFns: Array<() => void>;
73
+ updateGrid: () => void;
74
+ applyTheme: ResttyRuntimeTerminalApi["applyTheme"];
75
+ ensureFont: () => Promise<void>;
76
+ updateSize: ResttyRuntimeInteractionApi["updateSize"];
77
+ replaceCanvas: () => void;
78
+ rebuildWebGPUShaderStages: (state: WebGPUState) => void;
79
+ rebuildWebGLShaderStages: (state: WebGLState) => void;
80
+ setShaderStagesDirty: (dirty: boolean) => void;
81
+ clearWebGPUShaderStages: () => void;
82
+ destroyWebGPUStageTargets: () => void;
83
+ clearWebGLShaderStages: (state?: WebGLState) => void;
84
+ destroyWebGLStageTargets: (state?: WebGLState) => void;
85
+ maxScrollbackBytes?: number;
86
+ maxScrollback?: number;
87
+ };
88
+ export type RuntimeControllerOptions = {
89
+ runtimeEvents: ResttyRuntimeEventHub;
90
+ runtime: RuntimeControllerRuntimeDeps;
91
+ state: RuntimeControllerStateDeps;
92
+ platform: RuntimeControllerPlatformDeps;
93
+ hooks: RuntimeControllerHookDeps;
94
+ render: RuntimeControllerRenderDeps;
95
+ lifecycle: RuntimeControllerLifecycleDeps;
96
+ };
@@ -0,0 +1,10 @@
1
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
2
+ type CreateRuntimeControllerClipboardOptions = {
3
+ getSelectionText: () => string;
4
+ ptyInputRuntime: Pick<PtyInputRuntime, "sendPasteText">;
5
+ };
6
+ export declare function createRuntimeControllerClipboard(options: CreateRuntimeControllerClipboardOptions): {
7
+ copySelectionToClipboard: () => Promise<boolean>;
8
+ pasteFromClipboard: () => Promise<boolean>;
9
+ };
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { RuntimeController, RuntimeControllerOptions } from "./runtime-controller.api.types";
2
+ export type { RuntimeControllerSharedState } from "./runtime-controller.state.types";
3
+ export declare function createRuntimeController(options: RuntimeControllerOptions): RuntimeController;
@@ -0,0 +1,24 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { PtyTransport } from "../../pty";
3
+ import type { RuntimeInteraction } from "./interaction-runtime/runtime.types";
4
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
5
+ import type { RuntimeSendInput } from "./runtime-controller.api.types";
6
+ import type { RuntimeControllerSharedState } from "./runtime-controller.state.types";
7
+ type CreateRuntimeControllerInputOptions = {
8
+ ptyTransport: PtyTransport;
9
+ inputHandler: InputHandler;
10
+ ptyInputRuntime: PtyInputRuntime;
11
+ interaction: RuntimeInteraction;
12
+ readState: () => RuntimeControllerSharedState;
13
+ writeState: (patch: Partial<RuntimeControllerSharedState>) => void;
14
+ getCanvas: () => HTMLCanvasElement;
15
+ forwardTerminalReplies?: boolean;
16
+ markSearchDirty: () => void;
17
+ runBeforeInputHook: (text: string, source: string) => string | null;
18
+ runBeforeRenderOutputHook: (text: string, source: string) => string | null;
19
+ };
20
+ export declare function createRuntimeControllerInput(options: CreateRuntimeControllerInputOptions): {
21
+ clearScreen: () => void;
22
+ sendInput: RuntimeSendInput;
23
+ };
24
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { RuntimeInteraction } from "./interaction-runtime/runtime.types";
3
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
4
+ import type { RuntimeControllerSharedState } from "./runtime-controller.state.types";
5
+ type CreateRuntimeControllerKeyboardOptions = {
6
+ cleanupFns: Array<() => void>;
7
+ imeInput: HTMLTextAreaElement | null;
8
+ isMacPlatform: boolean;
9
+ inputHandler: InputHandler;
10
+ ptyInputRuntime: PtyInputRuntime;
11
+ interaction: RuntimeInteraction;
12
+ readState: () => RuntimeControllerSharedState;
13
+ writeState: (patch: Partial<RuntimeControllerSharedState>) => void;
14
+ getCanvas: () => HTMLCanvasElement;
15
+ copySelectionToClipboard: () => Promise<boolean>;
16
+ KITTY_FLAG_REPORT_EVENTS: number;
17
+ };
18
+ export declare function attachRuntimeControllerKeyboardEvents(options: CreateRuntimeControllerKeyboardOptions): void;
19
+ export {};
@@ -0,0 +1,50 @@
1
+ import { type WebGPUState, type WebGLState } from "../../renderer";
2
+ import type { PtyTransport } from "../../pty";
3
+ import type { ResttyRuntimeTerminalApi } from "../core/api";
4
+ import type { ResttyRuntimeLifecycleState } from "../core/lifecycle";
5
+ import type { ResttyRuntimeEventHub } from "../core/runtime-events";
6
+ import type { ResttyRuntimeSession } from "../core/resources";
7
+ import type { LifecycleThemeRuntime } from "./runtime-controller.api.types";
8
+ import type { RuntimeControllerInternalState, RuntimeControllerSharedState } from "./runtime-controller.state.types";
9
+ type RuntimeControllerLifecycleOptions = {
10
+ runtimeEvents: ResttyRuntimeEventHub;
11
+ session: ResttyRuntimeSession;
12
+ ptyTransport: Pick<PtyTransport, "destroy">;
13
+ ptyInputRuntime: {
14
+ cancelSyncOutputReset: () => void;
15
+ disconnectPty: () => void;
16
+ };
17
+ lifecycleThemeSizeRuntime: LifecycleThemeRuntime;
18
+ cleanupFns: Array<() => void>;
19
+ cleanupCanvasFns: Array<() => void>;
20
+ readState: () => RuntimeControllerSharedState;
21
+ writeState: (patch: Partial<RuntimeControllerSharedState>) => void;
22
+ gridState: {
23
+ cols: number;
24
+ rows: number;
25
+ };
26
+ getCanvas: () => HTMLCanvasElement;
27
+ applyTheme: ResttyRuntimeTerminalApi["applyTheme"];
28
+ ensureFont: () => Promise<void>;
29
+ updateSize: () => void;
30
+ updateGrid: () => void;
31
+ replaceCanvas: () => void;
32
+ rebuildWebGPUShaderStages: (state: WebGPUState) => void;
33
+ rebuildWebGLShaderStages: (state: WebGLState) => void;
34
+ setShaderStagesDirty: (dirty: boolean) => void;
35
+ clearWebGPUShaderStages: () => void;
36
+ destroyWebGPUStageTargets: () => void;
37
+ clearWebGLShaderStages: (state?: WebGLState) => void;
38
+ destroyWebGLStageTargets: (state?: WebGLState) => void;
39
+ handleSearchWasmReset: () => void;
40
+ internalState: RuntimeControllerInternalState;
41
+ maxScrollbackBytes: number;
42
+ loop: (state: WebGPUState | WebGLState) => void;
43
+ };
44
+ type RuntimeControllerLifecycle = {
45
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
46
+ init: () => Promise<void>;
47
+ destroy: () => void;
48
+ };
49
+ export declare function createRuntimeControllerLifecycle(options: RuntimeControllerLifecycleOptions): RuntimeControllerLifecycle;
50
+ export {};
@@ -0,0 +1,57 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { PtyTransport } from "../../pty";
3
+ import type { ResttyRuntimeEventsView, ResttyRuntimeInteractionApi, ResttyRuntimeIoApi, ResttyRuntimeLifecycleView, ResttyRuntimeRenderApi, ResttyRuntimeSearchApi, ResttyRuntimeTerminalApi } from "../core/api";
4
+ import type { ResttyRuntimeLifecycleState } from "../core/lifecycle";
5
+ import type { ResttyRuntimeEventHub } from "../core/runtime-events";
6
+ import type { RuntimeInteraction } from "./interaction-runtime/runtime.types";
7
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
8
+ import type { RuntimeControllerPublicCapabilities, RuntimeSendInput } from "./runtime-controller.api.types";
9
+ import type { RuntimeControllerInternalState } from "./runtime-controller.state.types";
10
+ type RuntimeLifecycleDeps = {
11
+ init: () => Promise<void>;
12
+ destroy: () => void;
13
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
14
+ };
15
+ type RuntimeEventsDeps = {
16
+ runtimeEvents: ResttyRuntimeEventHub;
17
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
18
+ };
19
+ type RuntimeTerminalDeps = {
20
+ init: () => Promise<void>;
21
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
22
+ internalState: RuntimeControllerInternalState;
23
+ applyTheme: ResttyRuntimeTerminalApi["applyTheme"];
24
+ clearScreen: () => void;
25
+ terminalCapabilities: RuntimeControllerPublicCapabilities["terminal"];
26
+ };
27
+ type RuntimeIoDeps = {
28
+ runtimeEvents: Pick<ResttyRuntimeEventHub, "subscribe">;
29
+ init: () => Promise<void>;
30
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
31
+ sendInput: RuntimeSendInput;
32
+ ptyInputRuntime: PtyInputRuntime;
33
+ ptyTransport: Pick<PtyTransport, "isConnected">;
34
+ };
35
+ type RuntimeInteractionDeps = {
36
+ inputHandler: InputHandler;
37
+ ptyInputRuntime: PtyInputRuntime;
38
+ interaction: Pick<RuntimeInteraction, "selectWordAtClientPoint">;
39
+ interactionCapabilities: RuntimeControllerPublicCapabilities["interaction"];
40
+ copySelectionToClipboard: ResttyRuntimeInteractionApi["copySelectionToClipboard"];
41
+ pasteFromClipboard: ResttyRuntimeInteractionApi["pasteFromClipboard"];
42
+ };
43
+ type RuntimeSearchDeps = {
44
+ searchCapabilities: RuntimeControllerPublicCapabilities["search"];
45
+ };
46
+ type RuntimeRenderDeps = {
47
+ internalState: RuntimeControllerInternalState;
48
+ renderCapabilities: RuntimeControllerPublicCapabilities["render"];
49
+ };
50
+ export declare function createRuntimeLifecycleView({ init, destroy, getLifecycleState, }: RuntimeLifecycleDeps): ResttyRuntimeLifecycleView;
51
+ export declare function createRuntimeEventsView({ runtimeEvents, getLifecycleState, }: RuntimeEventsDeps): ResttyRuntimeEventsView;
52
+ export declare function createRuntimeTerminalView({ init, getLifecycleState, internalState, applyTheme, clearScreen, terminalCapabilities, }: RuntimeTerminalDeps): ResttyRuntimeTerminalApi;
53
+ export declare function createRuntimeIoView({ runtimeEvents, init, getLifecycleState, sendInput, ptyInputRuntime, ptyTransport, }: RuntimeIoDeps): ResttyRuntimeIoApi;
54
+ export declare function createRuntimeInteractionView({ inputHandler, ptyInputRuntime, interaction, interactionCapabilities, copySelectionToClipboard, pasteFromClipboard, }: RuntimeInteractionDeps): ResttyRuntimeInteractionApi;
55
+ export declare function createRuntimeSearchView({ searchCapabilities, }: RuntimeSearchDeps): ResttyRuntimeSearchApi;
56
+ export declare function createRuntimeRenderView({ internalState, renderCapabilities, }: RuntimeRenderDeps): ResttyRuntimeRenderApi;
57
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { InputHandler } from "../../input";
2
+ import type { PtyTransport } from "../../pty";
3
+ import type { ResttyRuntime, ResttyRuntimeInteractionApi, ResttyRuntimeTerminalApi } from "../core/api";
4
+ import type { ResttyRuntimeLifecycleState } from "../core/lifecycle";
5
+ import type { ResttyRuntimeEventHub } from "../core/runtime-events";
6
+ import type { RuntimeInteraction } from "./interaction-runtime/runtime.types";
7
+ import type { PtyInputRuntime } from "./pty-input-runtime.types";
8
+ import type { RuntimeControllerPublicCapabilities, RuntimeSendInput } from "./runtime-controller.api.types";
9
+ import type { RuntimeControllerInternalState } from "./runtime-controller.state.types";
10
+ type RuntimeControllerPublicApiDeps = {
11
+ runtimeEvents: ResttyRuntimeEventHub;
12
+ getLifecycleState: () => ResttyRuntimeLifecycleState;
13
+ internalState: RuntimeControllerInternalState;
14
+ inputHandler: InputHandler;
15
+ ptyInputRuntime: PtyInputRuntime;
16
+ ptyTransport: Pick<PtyTransport, "isConnected">;
17
+ interaction: Pick<RuntimeInteraction, "selectWordAtClientPoint">;
18
+ init: () => Promise<void>;
19
+ destroy: () => void;
20
+ applyTheme: ResttyRuntimeTerminalApi["applyTheme"];
21
+ clearScreen: () => void;
22
+ sendInput: RuntimeSendInput;
23
+ copySelectionToClipboard: ResttyRuntimeInteractionApi["copySelectionToClipboard"];
24
+ pasteFromClipboard: ResttyRuntimeInteractionApi["pasteFromClipboard"];
25
+ publicApiCapabilities: RuntimeControllerPublicCapabilities;
26
+ };
27
+ export declare function createRuntimePublicApi(deps: RuntimeControllerPublicApiDeps): ResttyRuntime;
28
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { WebGPUState, WebGLState } from "../../renderer";
2
+ import type { RuntimeControllerInternalState, RuntimeControllerSharedState } from "./runtime-controller.state.types";
3
+ type CreateRuntimeControllerRenderLoopOptions = {
4
+ internalState: RuntimeControllerInternalState;
5
+ readState: () => RuntimeControllerSharedState;
6
+ writeState: (patch: Partial<RuntimeControllerSharedState>) => void;
7
+ resizeState: {
8
+ lastAt: number;
9
+ };
10
+ CURSOR_BLINK_MS: number;
11
+ RESIZE_ACTIVE_MS: number;
12
+ BACKGROUND_RENDER_FPS: number;
13
+ isSynchronizedOutput: () => boolean;
14
+ tickWebGPU: (state: WebGPUState) => void;
15
+ tickWebGL: (state: WebGLState) => void;
16
+ };
17
+ export declare function createRuntimeControllerRenderLoop(options: CreateRuntimeControllerRenderLoopOptions): {
18
+ loop: (state: WebGPUState | WebGLState) => void;
19
+ };
20
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { WebGPUState, WebGLState } from "../../renderer";
2
+ import type { ResttyWasm, ResttyWasmExports } from "../../wasm";
3
+ export type RuntimeControllerSharedState = {
4
+ wasm: ResttyWasm | null;
5
+ wasmExports: ResttyWasmExports | null;
6
+ wasmHandle: number;
7
+ wasmReady: boolean;
8
+ activeState: WebGPUState | WebGLState | null;
9
+ needsRender: boolean;
10
+ lastRenderTime: number;
11
+ currentContextType: "webgpu" | "webgl2" | null;
12
+ isFocused: boolean;
13
+ lastKeydownSeq: string;
14
+ lastKeydownSeqAt: number;
15
+ };
16
+ export type RuntimeBackend = "none" | "webgpu" | "webgl2";
17
+ export type PreferredRenderer = "auto" | "webgpu" | "webgl2";
18
+ export type RuntimeControllerInternalState = {
19
+ paused: boolean;
20
+ backend: RuntimeBackend;
21
+ preferredRenderer: PreferredRenderer;
22
+ rafId: number;
23
+ nextBlinkTime: number;
24
+ };
@@ -1,23 +1,6 @@
1
- import type { CursorInfo, RenderState, ResttyWasm, ResttyWasmExports } from "../../wasm";
2
- import type { ResttyAppCallbacks } from "../types";
3
- import type { RuntimeSelectionState } from "./interaction-runtime/types";
4
- export type CreateRuntimeReportingOptions = {
5
- selectionState: RuntimeSelectionState;
6
- getLastRenderState: () => RenderState | null;
7
- getWasmReady: () => boolean;
8
- getWasm: () => ResttyWasm | null;
9
- getWasmHandle: () => number;
10
- getWasmExports: () => ResttyWasmExports | null;
11
- callbacks?: ResttyAppCallbacks;
12
- termSizeEl: HTMLElement | null;
13
- cursorPosEl: HTMLElement | null;
14
- dbgEl: HTMLElement | null;
15
- setCursorForCpr: (pos: {
16
- row: number;
17
- col: number;
18
- }) => void;
19
- };
20
- export declare function createRuntimeReporting(options: CreateRuntimeReportingOptions): {
1
+ import type { CursorInfo, RenderState } from "../../wasm";
2
+ import type { RuntimeReportingOptions } from "./runtime-reporting.types";
3
+ export declare function createRuntimeReporting(options: RuntimeReportingOptions): {
21
4
  selectionForRow: (row: number, cols: number) => import("../../selection").SelectionRange;
22
5
  getSelectionText: () => string;
23
6
  getRenderState: () => RenderState | null;
@@ -36,5 +19,4 @@ export declare function createRuntimeReporting(options: CreateRuntimeReportingOp
36
19
  col: number;
37
20
  row: number;
38
21
  } | null) => void;
39
- reportDebugText: (text: string) => void;
40
22
  };
@@ -0,0 +1,18 @@
1
+ import type { RenderState, ResttyWasm, ResttyWasmExports } from "../../wasm";
2
+ import type { ResttyRuntimeEvent } from "../core/runtime-events";
3
+ import type { RuntimeSelectionState } from "./interaction-runtime/state.types";
4
+ export type RuntimeReportingOptions = {
5
+ selectionState: RuntimeSelectionState;
6
+ getLastRenderState: () => RenderState | null;
7
+ getWasmReady: () => boolean;
8
+ getWasm: () => ResttyWasm | null;
9
+ getWasmHandle: () => number;
10
+ getWasmExports: () => ResttyWasmExports | null;
11
+ emitRuntimeEvent?: (event: Extract<ResttyRuntimeEvent, {
12
+ type: "term-size";
13
+ }>) => void;
14
+ setCursorForCpr: (pos: {
15
+ row: number;
16
+ col: number;
17
+ }) => void;
18
+ };