restty 0.1.35 → 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 (186) hide show
  1. package/README.md +49 -343
  2. package/dist/chunk-30px21q2.js +0 -0
  3. package/dist/{chunk-zqscavsh.js → chunk-db9dt7pr.js} +48146 -63236
  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/index.d.ts +8 -4
  13. package/dist/input/keymap/default-mapping.d.ts +1 -0
  14. package/dist/input/mouse.d.ts +13 -0
  15. package/dist/input/types.d.ts +10 -1
  16. package/dist/internal/runtime.d.ts +4 -0
  17. package/dist/internal/runtime.js +12 -0
  18. package/dist/internal/surface.d.ts +6 -0
  19. package/dist/internal/surface.js +15 -0
  20. package/dist/internal.d.ts +2 -5
  21. package/dist/internal.js +23 -5
  22. package/dist/restty.esm.js +32 -11368
  23. package/dist/restty.js +8 -2
  24. package/dist/runtime/core/api.d.ts +112 -0
  25. package/dist/runtime/core/config.d.ts +133 -0
  26. package/dist/runtime/core/lifecycle.d.ts +1 -0
  27. package/dist/runtime/core/models.d.ts +124 -0
  28. package/dist/runtime/core/resources.d.ts +50 -0
  29. package/dist/runtime/core/runtime-events.d.ts +28 -0
  30. package/dist/runtime/core/session.d.ts +9 -0
  31. package/dist/runtime/{codepoint-utils.d.ts → create-runtime/codepoint-utils.d.ts} +1 -1
  32. package/dist/runtime/create-runtime/{color-glyph-atlas.d.ts → font-runtime/color-glyph-atlas.d.ts} +2 -2
  33. package/dist/runtime/create-runtime/font-runtime/grid.d.ts +6 -0
  34. package/dist/runtime/create-runtime/font-runtime/grid.types.d.ts +22 -0
  35. package/dist/runtime/create-runtime/font-runtime/index.d.ts +15 -0
  36. package/dist/runtime/create-runtime/font-runtime/text.d.ts +12 -0
  37. package/dist/runtime/create-runtime/font-runtime/text.types.d.ts +10 -0
  38. package/dist/runtime/create-runtime/{font-runtime-helpers.types.d.ts → font-runtime/types.d.ts} +5 -8
  39. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.d.ts +7 -0
  40. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.types.d.ts +23 -0
  41. package/dist/runtime/create-runtime/highlight-terminal-color-utils.d.ts +1 -8
  42. package/dist/runtime/create-runtime/highlight-terminal-color-utils.types.d.ts +9 -0
  43. package/dist/runtime/create-runtime/input-hooks.d.ts +2 -12
  44. package/dist/runtime/create-runtime/input-hooks.types.d.ts +10 -0
  45. package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +2 -1
  46. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +1 -1
  47. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +2 -1
  48. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +1 -1
  49. package/dist/runtime/create-runtime/{interaction-runtime.d.ts → interaction-runtime/index.d.ts} +3 -2
  50. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +2 -17
  51. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.types.d.ts +17 -0
  52. package/dist/runtime/create-runtime/interaction-runtime/{types.d.ts → runtime.types.d.ts} +1 -47
  53. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +1 -23
  54. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.types.d.ts +23 -0
  55. package/dist/runtime/create-runtime/interaction-runtime/state.types.d.ts +47 -0
  56. package/dist/runtime/create-runtime/kitty-render-runtime.d.ts +2 -36
  57. package/dist/runtime/create-runtime/kitty-render-runtime.types.d.ts +33 -0
  58. package/dist/runtime/create-runtime/{lifecycle-theme-size-canvas.d.ts → lifecycle-theme-size/canvas.d.ts} +1 -1
  59. package/dist/runtime/create-runtime/{lifecycle-theme-size.d.ts → lifecycle-theme-size/index.d.ts} +3 -3
  60. package/dist/runtime/create-runtime/lifecycle-theme-size/theme.d.ts +6 -0
  61. package/dist/runtime/create-runtime/{lifecycle-theme-size.types.d.ts → lifecycle-theme-size/types.d.ts} +1 -6
  62. package/dist/runtime/{max-scrollback.d.ts → create-runtime/max-scrollback.d.ts} +2 -5
  63. package/dist/runtime/create-runtime/max-scrollback.types.d.ts +4 -0
  64. package/dist/runtime/create-runtime/native-scrollbar-host.d.ts +2 -15
  65. package/dist/runtime/create-runtime/native-scrollbar-host.types.d.ts +13 -0
  66. package/dist/runtime/{overlay-scrollbar.d.ts → create-runtime/overlay-scrollbar.d.ts} +1 -12
  67. package/dist/runtime/create-runtime/overlay-scrollbar.types.d.ts +12 -0
  68. package/dist/runtime/create-runtime/pty-input-runtime.d.ts +2 -46
  69. package/dist/runtime/create-runtime/pty-input-runtime.types.d.ts +41 -0
  70. package/dist/runtime/{render-color-utils.d.ts → create-runtime/render-color-utils.d.ts} +1 -1
  71. package/dist/runtime/{render-stage-runtime.d.ts → create-runtime/render-stage-runtime.d.ts} +2 -2
  72. package/dist/runtime/{create-app-types.d.ts → create-runtime/render-stage-runtime.types.d.ts} +1 -29
  73. package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +1 -1
  74. package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +1 -1
  75. package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +2 -5
  76. package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +1 -1
  77. package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +5 -9
  78. package/dist/runtime/create-runtime/runtime-controller.api.types.d.ts +96 -0
  79. package/dist/runtime/create-runtime/runtime-controller.clipboard.d.ts +10 -0
  80. package/dist/runtime/create-runtime/runtime-controller.d.ts +3 -0
  81. package/dist/runtime/create-runtime/runtime-controller.input.d.ts +24 -0
  82. package/dist/runtime/create-runtime/runtime-controller.keyboard.d.ts +19 -0
  83. package/dist/runtime/create-runtime/runtime-controller.lifecycle.d.ts +50 -0
  84. package/dist/runtime/create-runtime/runtime-controller.public-api.capabilities.d.ts +57 -0
  85. package/dist/runtime/create-runtime/runtime-controller.public-api.d.ts +28 -0
  86. package/dist/runtime/create-runtime/runtime-controller.render-loop.d.ts +20 -0
  87. package/dist/runtime/create-runtime/runtime-controller.state.types.d.ts +24 -0
  88. package/dist/runtime/create-runtime/runtime-reporting.d.ts +3 -21
  89. package/dist/runtime/create-runtime/runtime-reporting.types.d.ts +18 -0
  90. package/dist/runtime/{create-app-symbols.d.ts → create-runtime/runtime-symbols.d.ts} +2 -2
  91. package/dist/runtime/create-runtime/search-highlight-utils.d.ts +1 -1
  92. package/dist/runtime/create-runtime/search-runtime/index.d.ts +2 -0
  93. package/dist/runtime/create-runtime/{search-runtime.d.ts → search-runtime/types.d.ts} +9 -6
  94. package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +2 -29
  95. package/dist/runtime/create-runtime/shader-stage-runtime.types.d.ts +27 -0
  96. package/dist/runtime/{text-decoration.d.ts → create-runtime/text-decoration.d.ts} +1 -1
  97. package/dist/runtime/create-runtime.d.ts +7 -7
  98. package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +1 -1
  99. package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +1 -1
  100. package/dist/runtime/{atlas-builder.d.ts → fonts/atlas-builder.d.ts} +1 -1
  101. package/dist/runtime/{font-resource-store.d.ts → fonts/font-resource-store.d.ts} +3 -2
  102. package/dist/runtime/fonts/font-sources.d.ts +4 -0
  103. package/dist/runtime/shader-stages.d.ts +1 -1
  104. package/dist/runtime/types.d.ts +6 -393
  105. package/dist/surface/{panes-context-menu.d.ts → panes/context-menu.d.ts} +1 -1
  106. package/dist/surface/panes/default-context-menu-items.d.ts +2 -2
  107. package/dist/surface/panes/layout.d.ts +1 -1
  108. package/dist/surface/panes/managed-pane-create.d.ts +3 -0
  109. package/dist/surface/panes/managed-pane-create.types.d.ts +17 -0
  110. package/dist/surface/panes/managed-pane-dom.d.ts +13 -0
  111. package/dist/surface/panes/managed-pane-manager.d.ts +6 -0
  112. package/dist/surface/panes/managed-pane-options.d.ts +6 -0
  113. package/dist/surface/panes/managed-pane-options.types.d.ts +7 -0
  114. package/dist/surface/panes/managed-pane-runtime-config.d.ts +3 -0
  115. package/dist/surface/panes/managed-pane-runtime-config.types.d.ts +9 -0
  116. package/dist/surface/panes/managed-pane-runtime.d.ts +3 -0
  117. package/dist/surface/panes/managed-pane-runtime.types.d.ts +10 -0
  118. package/dist/surface/panes/managed-pane-search-ui.d.ts +9 -0
  119. package/dist/surface/{pane-app-manager.d.ts → panes/managed-pane-types.d.ts} +34 -36
  120. package/dist/surface/panes/manager.d.ts +1 -1
  121. package/dist/surface/panes/pane-interactions.d.ts +2 -2
  122. package/dist/surface/{panes-styles.d.ts → panes/styles.d.ts} +1 -1
  123. package/dist/surface/{panes-types.d.ts → panes/types.d.ts} +48 -7
  124. package/dist/surface/panes/window-events.d.ts +1 -1
  125. package/dist/surface/{restty-plugin-types.d.ts → plugins/context.types.d.ts} +32 -88
  126. package/dist/surface/{restty/plugin-dispatcher.d.ts → plugins/dispatcher.d.ts} +4 -13
  127. package/dist/surface/plugins/dispatcher.types.d.ts +6 -0
  128. package/dist/surface/{restty/plugin-ops.d.ts → plugins/host.d.ts} +4 -3
  129. package/dist/surface/plugins/runtime.d.ts +18 -0
  130. package/dist/surface/plugins/runtime.types.d.ts +47 -0
  131. package/dist/surface/plugins/types.d.ts +83 -0
  132. package/dist/surface/restty/active-pane-api.d.ts +33 -23
  133. package/dist/surface/restty/assembly.d.ts +23 -0
  134. package/dist/surface/restty/bootstrap.d.ts +21 -0
  135. package/dist/surface/restty/config.d.ts +46 -0
  136. package/dist/surface/restty/controller.d.ts +45 -0
  137. package/dist/surface/restty/events.d.ts +14 -0
  138. package/dist/surface/restty/manager-options.d.ts +4 -23
  139. package/dist/surface/restty/manager-options.types.d.ts +32 -0
  140. package/dist/surface/restty/pane-command-ops.d.ts +37 -0
  141. package/dist/surface/restty/pane-handle-ops.d.ts +24 -0
  142. package/dist/surface/{restty-pane-handle.d.ts → restty/pane-handle.d.ts} +42 -40
  143. package/dist/surface/restty/pane-lookup.d.ts +22 -0
  144. package/dist/surface/restty/pane-manager-assembly.d.ts +18 -0
  145. package/dist/surface/restty/pane-ops.d.ts +3 -51
  146. package/dist/surface/restty/pane-style-ops.d.ts +6 -0
  147. package/dist/surface/restty/plugin-surface.d.ts +5 -0
  148. package/dist/surface/restty/shader-ops.d.ts +6 -5
  149. package/dist/surface/restty.d.ts +28 -49
  150. package/dist/surface/search-ui/controller.d.ts +2 -0
  151. package/dist/surface/search-ui/index.d.ts +2 -0
  152. package/dist/surface/search-ui/styles.d.ts +5 -0
  153. package/dist/surface/{pane-search-ui.d.ts → search-ui/types.d.ts} +22 -13
  154. package/dist/wasm/embedded.d.ts +1 -1
  155. package/dist/wasm/runtime/types.d.ts +0 -6
  156. package/dist/xterm/compat-services.d.ts +2 -0
  157. package/dist/xterm.d.ts +4 -3
  158. package/dist/xterm.js +14 -8
  159. package/package.json +52 -33
  160. package/dist/internal.esm.js +0 -22285
  161. package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +0 -2
  162. package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +0 -2
  163. package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +0 -2
  164. package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +0 -1
  165. package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +0 -2
  166. package/dist/runtime/create-runtime/debug-tools/types.d.ts +0 -63
  167. package/dist/runtime/create-runtime/debug-tools.d.ts +0 -6
  168. package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +0 -31
  169. package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +0 -15
  170. package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +0 -21
  171. package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +0 -29
  172. package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +0 -6
  173. package/dist/runtime/create-runtime/runtime-app-api.d.ts +0 -113
  174. package/dist/runtime/create-runtime/runtime-logger.d.ts +0 -17
  175. package/dist/runtime/font-sources.d.ts +0 -5
  176. package/dist/runtime/pty-output-buffer.d.ts +0 -12
  177. package/dist/runtime/session.d.ts +0 -9
  178. package/dist/surface/app-factory.d.ts +0 -3
  179. package/dist/surface/restty-plugin-runtime.d.ts +0 -57
  180. package/dist/xterm/app-options.d.ts +0 -2
  181. package/dist/xterm.esm.js +0 -12210
  182. /package/dist/runtime/create-runtime/{atlas-debug-utils.d.ts → atlas-bitmap-utils.d.ts} +0 -0
  183. /package/dist/runtime/{clipboard-paste.d.ts → create-runtime/clipboard-paste.d.ts} +0 -0
  184. /package/dist/runtime/{render-stage-shaders.d.ts → create-runtime/render-stage-shaders.d.ts} +0 -0
  185. /package/dist/runtime/{create-app-io-utils.d.ts → create-runtime/runtime-io-utils.d.ts} +0 -0
  186. /package/dist/surface/{restty-plugin-utils.d.ts → plugins/utils.d.ts} +0 -0
@@ -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,12 +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 { RuntimeTerminalColor } from "./highlight-terminal-color-utils";
5
- import type { CompiledWebGPUShaderStage, WebGPUStageTargets } from "../create-app-types";
6
- import type { GlyphConstraintMeta } from "../atlas-builder";
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
7
  import type { KittyPlacement, RenderState, ResttyWasm, ResttyWasmExports, SearchViewportMatch } from "../../wasm";
8
- import type { KittyDrawPlan, KittyDrawSlice } from "./kitty-render-runtime";
9
- import type { ResttyFontHintTarget } from "../types";
8
+ import type { KittyDrawPlan, KittyDrawSlice } from "./kitty-render-runtime.types";
9
+ import type { ResttyFontHintTarget } from "../core/models";
10
10
  export type CursorPosition = {
11
11
  col: number;
12
12
  row: number;
@@ -252,9 +252,6 @@ export type RuntimeTickDeps = SharedTickDeps & {
252
252
  setShaderStagesDirty: (value: boolean) => void;
253
253
  getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
254
254
  ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
255
- fontError: Error | null;
256
- termDebug: HTMLElement | null;
257
- reportDebugText: (text: string) => void;
258
255
  updateGrid: () => void;
259
256
  getRenderState: () => RenderState | null;
260
257
  resolveBlendFlags: (alphaMode: string, backend: "webgpu", state: WebGPUState) => {
@@ -287,7 +284,6 @@ export type RuntimeTickDeps = SharedTickDeps & {
287
284
  row: number;
288
285
  col: number;
289
286
  } | null;
290
- dbgEl: HTMLElement | null;
291
287
  wasmExports: ResttyWasmExports | null;
292
288
  wasmHandle: number;
293
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
+ };
@@ -1,5 +1,5 @@
1
- import { type NerdConstraint } from "../fonts";
2
- import type { ResttyTouchSelectionMode } from "./types";
1
+ import { type NerdConstraint } from "../../fonts";
2
+ import type { ResttyTouchSelectionMode } from "../core/models";
3
3
  export declare const DEFAULT_SYMBOL_CONSTRAINT: NerdConstraint;
4
4
  export declare const DEFAULT_APPLE_SYMBOLS_CONSTRAINT: NerdConstraint;
5
5
  export declare const DEFAULT_EMOJI_CONSTRAINT: NerdConstraint;
@@ -1,5 +1,5 @@
1
1
  import type { Color } from "../../renderer";
2
- import type { ResttySearchViewportMatch } from "../types";
2
+ import type { ResttySearchViewportMatch } from "../core/models";
3
3
  export type SearchCellHighlightKind = 0 | 1 | 2;
4
4
  type AppendSearchHighlightsOptions = {
5
5
  target: number[];
@@ -0,0 +1,2 @@
1
+ import type { RuntimeSearch, RuntimeSearchOptions } from "./types";
2
+ export declare function createRuntimeSearch(options: RuntimeSearchOptions): RuntimeSearch;
@@ -1,14 +1,19 @@
1
1
  import type { ResttyWasm, SearchViewportMatch } from "../../wasm";
2
- import type { ResttyAppCallbacks, ResttySearchState } from "../types";
3
- type CreateRuntimeSearchOptions = {
4
- callbacks?: ResttyAppCallbacks;
2
+ import type { ResttySearchState } from "../core/models";
3
+ import type { ResttyRuntimeCallbacks } from "../core/resources";
4
+ import type { ResttyRuntimeEvent } from "../core/runtime-events";
5
+ export type RuntimeSearchOptions = {
6
+ callbacks?: ResttyRuntimeCallbacks;
5
7
  cleanupFns: Array<() => void>;
8
+ emitRuntimeEvent?: (event: Extract<ResttyRuntimeEvent, {
9
+ type: "search-state";
10
+ }>) => void;
6
11
  getWasmReady: () => boolean;
7
12
  getWasm: () => ResttyWasm | null;
8
13
  getWasmHandle: () => number;
9
14
  markNeedsRender: () => void;
10
15
  };
11
- type RuntimeSearch = {
16
+ export type RuntimeSearch = {
12
17
  setQuery: (query: string) => void;
13
18
  clear: () => void;
14
19
  next: () => void;
@@ -18,5 +23,3 @@ type RuntimeSearch = {
18
23
  markDirty: () => void;
19
24
  handleWasmReset: () => void;
20
25
  };
21
- export declare function createRuntimeSearch(options: CreateRuntimeSearchOptions): RuntimeSearch;
22
- export {};
@@ -1,29 +1,2 @@
1
- import type { WebGPUState, WebGLState } from "../../renderer";
2
- import type { CompiledWebGPUShaderStage, WebGPUStageTargets, CompiledWebGLShaderStage, WebGLStageTargets } from "../create-app-types";
3
- import type { ResttyShaderStage } from "../types";
4
- export type CreateShaderStageRuntimeOptions = {
5
- appendLog: (line: string) => void;
6
- getCanvasSize: () => {
7
- width: number;
8
- height: number;
9
- };
10
- getActiveWebGLState: () => WebGLState | null;
11
- onShaderStagesChanged: () => void;
12
- };
13
- export type ShaderStageRuntime = {
14
- setShaderStages: (stages: ResttyShaderStage[]) => void;
15
- getShaderStages: () => ResttyShaderStage[];
16
- isShaderStagesDirty: () => boolean;
17
- setShaderStagesDirty: (value: boolean) => void;
18
- getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
19
- getCompiledWebGLShaderStages: () => CompiledWebGLShaderStage[];
20
- clearWebGPUShaderStages: () => void;
21
- clearWebGLShaderStages: (state?: WebGLState | null) => void;
22
- destroyWebGPUStageTargets: () => void;
23
- destroyWebGLStageTargets: (state?: WebGLState | null) => void;
24
- ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
25
- ensureWebGLStageTargets: (state: WebGLState) => WebGLStageTargets | null;
26
- rebuildWebGPUShaderStages: (state: WebGPUState) => void;
27
- rebuildWebGLShaderStages: (state: WebGLState) => void;
28
- };
29
- export declare function createShaderStageRuntime(options: CreateShaderStageRuntimeOptions): ShaderStageRuntime;
1
+ import type { ShaderStageRuntime, ShaderStageRuntimeOptions } from "./shader-stage-runtime.types";
2
+ export declare function createShaderStageRuntime(options: ShaderStageRuntimeOptions): ShaderStageRuntime;
@@ -0,0 +1,27 @@
1
+ import type { WebGPUState, WebGLState } from "../../renderer";
2
+ import type { CompiledWebGLShaderStage, CompiledWebGPUShaderStage, WebGLStageTargets, WebGPUStageTargets } from "./render-stage-runtime.types";
3
+ import type { ResttyShaderStage } from "../core/models";
4
+ export type ShaderStageRuntimeOptions = {
5
+ getCanvasSize: () => {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ getActiveWebGLState: () => WebGLState | null;
10
+ onShaderStagesChanged: () => void;
11
+ };
12
+ export type ShaderStageRuntime = {
13
+ setShaderStages: (stages: ResttyShaderStage[]) => void;
14
+ getShaderStages: () => ResttyShaderStage[];
15
+ isShaderStagesDirty: () => boolean;
16
+ setShaderStagesDirty: (value: boolean) => void;
17
+ getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
18
+ getCompiledWebGLShaderStages: () => CompiledWebGLShaderStage[];
19
+ clearWebGPUShaderStages: () => void;
20
+ clearWebGLShaderStages: (state?: WebGLState | null) => void;
21
+ destroyWebGPUStageTargets: () => void;
22
+ destroyWebGLStageTargets: (state?: WebGLState | null) => void;
23
+ ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
24
+ ensureWebGLStageTargets: (state: WebGLState) => WebGLStageTargets | null;
25
+ rebuildWebGPUShaderStages: (state: WebGPUState) => void;
26
+ rebuildWebGLShaderStages: (state: WebGLState) => void;
27
+ };
@@ -1,4 +1,4 @@
1
- import { type Color } from "../renderer";
1
+ import { type Color } from "../../renderer";
2
2
  export declare function drawUnderlineStyle(underlineData: number[], style: number, x: number, rowY: number, cellW: number, cellH: number, baseY: number, underlineOffsetPx: number, underlineThicknessPx: number, color: Color): void;
3
3
  export declare function drawStrikethrough(underlineData: number[], x: number, rowY: number, cellW: number, cellH: number, color: Color): void;
4
4
  export declare function drawOverline(underlineData: number[], x: number, rowY: number, cellW: number, color: Color): void;
@@ -1,7 +1,7 @@
1
- import type { ResttyApp, ResttyAppOptions } from "./types";
2
- export { createResttyAppSession, getDefaultResttyAppSession } from "./session";
3
- export { createResttyPaneManager } from "../surface/panes/manager";
4
- export { createDefaultResttyPaneContextMenuItems, getResttyShortcutModifierLabel, } from "../surface/panes/default-context-menu-items";
5
- export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyFontHintTarget, ResttyFontSource, ResttyTouchSelectionMode, ResttyUrlFontSource, ResttyBufferFontSource, ResttyLocalFontSource, ResttyWasmLogListener, ResttyAppSession, ResttyAppInputPayload, ResttyShaderStage, ResttyShaderStageMode, ResttyShaderStageBackend, ResttyShaderStageSource, ResttyAppOptions, ResttyApp, } from "./types";
6
- export type { ResttyPaneSplitDirection, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneShortcutsOptions, ResttyPaneContextMenuOptions, CreateResttyPaneManagerOptions, ResttyPaneManager, ResttyPaneWithApp, CreateDefaultResttyPaneContextMenuItemsOptions, } from "../surface/panes-types";
7
- export declare function createResttyApp(options: ResttyAppOptions): ResttyApp;
1
+ import type { ResttyRuntime } from "./core/api";
2
+ import type { ResttyRuntimeConfig } from "./core/config";
3
+ export { createResttyRuntimeSession, getDefaultResttyRuntimeSession } from "./core/session";
4
+ export type { ResttyRuntime } from "./core/api";
5
+ export type { ResttyRuntimeConfig } from "./core/config";
6
+ export type { ResttyRuntimeCallbacks, ResttyFontData, ResttyFontInput, ResttyFontUrlInput, ResttyFontPathInput, ResttyFontBufferInput, ResttyFontFamilyInput, ResttyFontFallbackInput, ResttyFontStyle, ResttyLocalFontMode, ResttyFontHintTarget, ResttyTouchSelectionMode, ResttyWasmLogListener, ResttyRuntimeSession, ResttyRuntimeInputPayload, ResttyShaderStage, ResttyShaderStageMode, ResttyShaderStageBackend, ResttyShaderStageSource, ResttyRuntimeEvent, ResttyRuntimeLifecycleState, } from "./types";
7
+ export declare function createResttyRuntime(options: ResttyRuntimeConfig): ResttyRuntime;
@@ -1,5 +1,5 @@
1
1
  import { type Font, type FontAtlas, type FontSizeMode } from "../../fonts";
2
- import type { GlyphConstraintMeta, AtlasConstraintContext } from "../atlas-builder";
2
+ import type { GlyphConstraintMeta, AtlasConstraintContext } from "../fonts/atlas-builder";
3
3
  import type { GlyphRasterizeOptions, Matrix2D, Matrix3x3, RasterizedGlyph } from "text-shaper";
4
4
  export type RasterizeGlyphTransformOptions = GlyphRasterizeOptions & {
5
5
  offsetX26?: number;
@@ -1,5 +1,5 @@
1
1
  import type { Font } from "../../fonts";
2
- import type { GlyphConstraintMeta, AtlasConstraintContext } from "../atlas-builder";
2
+ import type { GlyphConstraintMeta, AtlasConstraintContext } from "../fonts/atlas-builder";
3
3
  export declare function resolveFontScaleForAtlas(font: Font | null | undefined, fontSize: number, sizeMode?: "em" | "height" | null): number;
4
4
  export declare function fontCapHeightUnits(font: Font | null | undefined): number;
5
5
  export declare function buildNerdMetrics(cellW: number, cellH: number, lineHeight: number, primaryFont: Font | null | undefined, primaryScale: number, iconScale: number): {
@@ -1,4 +1,4 @@
1
- import type { Font, FontAtlas, FontEntry, FontSizeMode } from "../fonts";
1
+ import type { Font, FontAtlas, FontEntry, FontSizeMode } from "../../fonts";
2
2
  import type { AtlasOptions, GlyphRasterizeOptions, Matrix2D, Matrix3x3, RasterizedGlyph } from "text-shaper";
3
3
  /**
4
4
  * Metadata for constrained glyph rendering.