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.
- package/README.md +49 -318
- package/dist/chunk-30px21q2.js +0 -0
- package/dist/chunk-db9dt7pr.js +55226 -0
- package/dist/chunk-s26trws6.js +9136 -0
- package/dist/chunk-wdme6j9c.js +1776 -0
- package/dist/chunk-xykzfd81.js +0 -0
- package/dist/chunk-y6hfk43b.js +1690 -0
- package/dist/fonts/local-font-access.types.d.ts +19 -0
- package/dist/fonts/manager/entries.d.ts +7 -0
- package/dist/headless.d.ts +102 -0
- package/dist/headless.js +350 -0
- package/dist/ime/ime.d.ts +4 -4
- package/dist/index.d.ts +8 -2
- package/dist/input/keymap/default-mapping.d.ts +1 -0
- package/dist/input/mouse.d.ts +13 -0
- package/dist/input/types.d.ts +10 -1
- package/dist/internal/runtime.d.ts +4 -0
- package/dist/internal/runtime.js +12 -0
- package/dist/internal/surface.d.ts +6 -0
- package/dist/internal/surface.js +15 -0
- package/dist/internal.d.ts +2 -4
- package/dist/internal.js +23 -5
- package/dist/restty.esm.js +10949 -0
- package/dist/restty.js +8 -2
- package/dist/runtime/core/api.d.ts +112 -0
- package/dist/runtime/core/config.d.ts +133 -0
- package/dist/runtime/core/lifecycle.d.ts +1 -0
- package/dist/runtime/core/models.d.ts +124 -0
- package/dist/runtime/core/resources.d.ts +50 -0
- package/dist/runtime/core/runtime-events.d.ts +28 -0
- package/dist/runtime/core/session.d.ts +9 -0
- package/dist/runtime/{codepoint-utils.d.ts → create-runtime/codepoint-utils.d.ts} +1 -1
- package/dist/runtime/create-runtime/{color-glyph-atlas.d.ts → font-runtime/color-glyph-atlas.d.ts} +2 -2
- package/dist/runtime/create-runtime/font-runtime/grid.d.ts +6 -0
- package/dist/runtime/create-runtime/font-runtime/grid.types.d.ts +22 -0
- package/dist/runtime/create-runtime/font-runtime/index.d.ts +15 -0
- package/dist/runtime/create-runtime/font-runtime/text.d.ts +12 -0
- package/dist/runtime/create-runtime/font-runtime/text.types.d.ts +10 -0
- package/dist/runtime/create-runtime/{font-runtime-helpers.types.d.ts → font-runtime/types.d.ts} +6 -8
- package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.d.ts +7 -0
- package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.types.d.ts +23 -0
- package/dist/runtime/create-runtime/highlight-terminal-color-utils.d.ts +6 -0
- package/dist/runtime/create-runtime/highlight-terminal-color-utils.types.d.ts +9 -0
- package/dist/runtime/create-runtime/input-hooks.d.ts +2 -12
- package/dist/runtime/create-runtime/input-hooks.types.d.ts +10 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +2 -1
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +2 -3
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +5 -10
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +3 -2
- package/dist/runtime/create-runtime/interaction-runtime/desktop-word-selection.d.ts +8 -0
- package/dist/runtime/create-runtime/{interaction-runtime.d.ts → interaction-runtime/index.d.ts} +3 -2
- package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +2 -17
- package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.types.d.ts +17 -0
- package/dist/runtime/create-runtime/interaction-runtime/{types.d.ts → runtime.types.d.ts} +4 -50
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +1 -29
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.types.d.ts +23 -0
- package/dist/runtime/create-runtime/interaction-runtime/state.types.d.ts +47 -0
- package/dist/runtime/create-runtime/kitty-render-runtime.d.ts +2 -36
- package/dist/runtime/create-runtime/kitty-render-runtime.types.d.ts +33 -0
- package/dist/runtime/create-runtime/{lifecycle-theme-size-canvas.d.ts → lifecycle-theme-size/canvas.d.ts} +1 -1
- package/dist/runtime/create-runtime/{lifecycle-theme-size.d.ts → lifecycle-theme-size/index.d.ts} +3 -3
- package/dist/runtime/create-runtime/lifecycle-theme-size/theme.d.ts +6 -0
- package/dist/runtime/create-runtime/{lifecycle-theme-size.types.d.ts → lifecycle-theme-size/types.d.ts} +13 -7
- package/dist/runtime/create-runtime/ligature-runs.d.ts +52 -0
- package/dist/runtime/{max-scrollback.d.ts → create-runtime/max-scrollback.d.ts} +2 -5
- package/dist/runtime/create-runtime/max-scrollback.types.d.ts +4 -0
- package/dist/runtime/create-runtime/native-scrollbar-host.d.ts +2 -0
- package/dist/runtime/create-runtime/native-scrollbar-host.types.d.ts +13 -0
- package/dist/runtime/create-runtime/overlay-scrollbar.d.ts +6 -0
- package/dist/runtime/create-runtime/overlay-scrollbar.types.d.ts +12 -0
- package/dist/runtime/create-runtime/pty-input-runtime.d.ts +2 -46
- package/dist/runtime/create-runtime/pty-input-runtime.types.d.ts +41 -0
- package/dist/runtime/{render-color-utils.d.ts → create-runtime/render-color-utils.d.ts} +1 -1
- package/dist/runtime/{render-stage-runtime.d.ts → create-runtime/render-stage-runtime.d.ts} +2 -2
- package/dist/runtime/{create-app-types.d.ts → create-runtime/render-stage-runtime.types.d.ts} +1 -29
- package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +1 -1
- package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +1 -1
- package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +2 -5
- package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +1 -1
- package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +15 -11
- package/dist/runtime/create-runtime/runtime-controller.api.types.d.ts +96 -0
- package/dist/runtime/create-runtime/runtime-controller.clipboard.d.ts +10 -0
- package/dist/runtime/create-runtime/runtime-controller.d.ts +3 -0
- package/dist/runtime/create-runtime/runtime-controller.input.d.ts +24 -0
- package/dist/runtime/create-runtime/runtime-controller.keyboard.d.ts +19 -0
- package/dist/runtime/create-runtime/runtime-controller.lifecycle.d.ts +50 -0
- package/dist/runtime/create-runtime/runtime-controller.public-api.capabilities.d.ts +57 -0
- package/dist/runtime/create-runtime/runtime-controller.public-api.d.ts +28 -0
- package/dist/runtime/create-runtime/runtime-controller.render-loop.d.ts +20 -0
- package/dist/runtime/create-runtime/runtime-controller.state.types.d.ts +24 -0
- package/dist/runtime/create-runtime/runtime-reporting.d.ts +3 -21
- package/dist/runtime/create-runtime/runtime-reporting.types.d.ts +18 -0
- package/dist/runtime/{create-app-symbols.d.ts → create-runtime/runtime-symbols.d.ts} +2 -2
- package/dist/runtime/create-runtime/search-highlight-utils.d.ts +21 -0
- package/dist/runtime/create-runtime/search-runtime/index.d.ts +2 -0
- package/dist/runtime/create-runtime/search-runtime/types.d.ts +25 -0
- package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +2 -29
- package/dist/runtime/create-runtime/shader-stage-runtime.types.d.ts +27 -0
- package/dist/runtime/{text-decoration.d.ts → create-runtime/text-decoration.d.ts} +1 -1
- package/dist/runtime/create-runtime.d.ts +7 -7
- package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +1 -1
- package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +1 -1
- package/dist/runtime/{atlas-builder.d.ts → fonts/atlas-builder.d.ts} +1 -1
- package/dist/runtime/{font-resource-store.d.ts → fonts/font-resource-store.d.ts} +3 -2
- package/dist/runtime/fonts/font-sources.d.ts +4 -0
- package/dist/runtime/shader-stages.d.ts +1 -1
- package/dist/runtime/types.d.ts +6 -365
- package/dist/surface/{panes-context-menu.d.ts → panes/context-menu.d.ts} +1 -1
- package/dist/surface/panes/default-context-menu-items.d.ts +2 -2
- package/dist/surface/panes/layout.d.ts +1 -1
- package/dist/surface/panes/managed-pane-create.d.ts +3 -0
- package/dist/surface/panes/managed-pane-create.types.d.ts +17 -0
- package/dist/surface/panes/managed-pane-dom.d.ts +13 -0
- package/dist/surface/panes/managed-pane-manager.d.ts +6 -0
- package/dist/surface/panes/managed-pane-options.d.ts +6 -0
- package/dist/surface/panes/managed-pane-options.types.d.ts +7 -0
- package/dist/surface/panes/managed-pane-runtime-config.d.ts +3 -0
- package/dist/surface/panes/managed-pane-runtime-config.types.d.ts +9 -0
- package/dist/surface/panes/managed-pane-runtime.d.ts +3 -0
- package/dist/surface/panes/managed-pane-runtime.types.d.ts +10 -0
- package/dist/surface/panes/managed-pane-search-ui.d.ts +9 -0
- package/dist/surface/panes/managed-pane-types.d.ts +102 -0
- package/dist/surface/panes/manager.d.ts +1 -1
- package/dist/surface/panes/pane-interactions.d.ts +2 -2
- package/dist/surface/{panes-styles.d.ts → panes/styles.d.ts} +1 -1
- package/dist/surface/{panes-types.d.ts → panes/types.d.ts} +48 -7
- package/dist/surface/panes/window-events.d.ts +1 -1
- package/dist/surface/{restty-plugin-types.d.ts → plugins/context.types.d.ts} +32 -88
- package/dist/surface/{restty/plugin-dispatcher.d.ts → plugins/dispatcher.d.ts} +4 -13
- package/dist/surface/plugins/dispatcher.types.d.ts +6 -0
- package/dist/surface/{restty/plugin-ops.d.ts → plugins/host.d.ts} +4 -3
- package/dist/surface/plugins/runtime.d.ts +18 -0
- package/dist/surface/plugins/runtime.types.d.ts +47 -0
- package/dist/surface/plugins/types.d.ts +83 -0
- package/dist/surface/restty/active-pane-api.d.ts +34 -16
- package/dist/surface/restty/assembly.d.ts +23 -0
- package/dist/surface/restty/bootstrap.d.ts +21 -0
- package/dist/surface/restty/config.d.ts +46 -0
- package/dist/surface/restty/controller.d.ts +45 -0
- package/dist/surface/restty/events.d.ts +14 -0
- package/dist/surface/restty/manager-options.d.ts +4 -23
- package/dist/surface/restty/manager-options.types.d.ts +32 -0
- package/dist/surface/restty/pane-command-ops.d.ts +37 -0
- package/dist/surface/restty/pane-handle-ops.d.ts +24 -0
- package/dist/surface/restty/pane-handle.d.ts +107 -0
- package/dist/surface/restty/pane-lookup.d.ts +22 -0
- package/dist/surface/restty/pane-manager-assembly.d.ts +18 -0
- package/dist/surface/restty/pane-ops.d.ts +3 -42
- package/dist/surface/restty/pane-style-ops.d.ts +6 -0
- package/dist/surface/restty/plugin-surface.d.ts +5 -0
- package/dist/surface/restty/shader-ops.d.ts +6 -5
- package/dist/surface/restty.d.ts +30 -49
- package/dist/surface/search-ui/controller.d.ts +2 -0
- package/dist/surface/search-ui/index.d.ts +2 -0
- package/dist/surface/search-ui/styles.d.ts +5 -0
- package/dist/surface/search-ui/types.d.ts +96 -0
- package/dist/theme/ghostty.d.ts +13 -2
- package/dist/wasm/embedded.d.ts +1 -1
- package/dist/wasm/index.d.ts +1 -1
- package/dist/wasm/runtime/restty-wasm.d.ts +15 -1
- package/dist/wasm/runtime/types.d.ts +24 -6
- package/dist/xterm/compat-services.d.ts +2 -0
- package/dist/xterm.d.ts +4 -3
- package/dist/xterm.js +14 -8
- package/package.json +59 -24
- package/dist/chunk-meqn8xtd.js +0 -66867
- package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +0 -2
- package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +0 -2
- package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +0 -2
- package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +0 -1
- package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +0 -2
- package/dist/runtime/create-runtime/debug-tools/types.d.ts +0 -63
- package/dist/runtime/create-runtime/debug-tools.d.ts +0 -6
- package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +0 -30
- package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +0 -15
- package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +0 -21
- package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +0 -29
- package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +0 -6
- package/dist/runtime/create-runtime/runtime-app-api.d.ts +0 -105
- package/dist/runtime/create-runtime/runtime-logger.d.ts +0 -17
- package/dist/runtime/font-sources.d.ts +0 -5
- package/dist/runtime/overlay-scrollbar.d.ts +0 -24
- package/dist/runtime/pty-output-buffer.d.ts +0 -12
- package/dist/runtime/session.d.ts +0 -9
- package/dist/surface/app-factory.d.ts +0 -3
- package/dist/surface/pane-app-manager.d.ts +0 -89
- package/dist/surface/restty-pane-handle.d.ts +0 -70
- package/dist/surface/restty-plugin-runtime.d.ts +0 -57
- package/dist/xterm/app-options.d.ts +0 -2
- /package/dist/runtime/create-runtime/{atlas-debug-utils.d.ts → atlas-bitmap-utils.d.ts} +0 -0
- /package/dist/runtime/{clipboard-paste.d.ts → create-runtime/clipboard-paste.d.ts} +0 -0
- /package/dist/runtime/{render-stage-shaders.d.ts → create-runtime/render-stage-shaders.d.ts} +0 -0
- /package/dist/runtime/{create-app-io-utils.d.ts → create-runtime/runtime-io-utils.d.ts} +0 -0
- /package/dist/surface/{restty-plugin-utils.d.ts → plugins/utils.d.ts} +0 -0
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
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 "
|
|
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 "./
|
|
2
|
-
import type { ResttyShaderStage } from "
|
|
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;
|
package/dist/runtime/{create-app-types.d.ts → create-runtime/render-stage-runtime.types.d.ts}
RENAMED
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import type { ResttyShaderStage } from "
|
|
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
|
|
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
|
|
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 "
|
|
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 {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import type {
|
|
3
|
-
|
|
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
|
+
};
|