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.
- package/README.md +49 -343
- package/dist/chunk-30px21q2.js +0 -0
- package/dist/{chunk-zqscavsh.js → chunk-db9dt7pr.js} +48146 -63236
- 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/index.d.ts +8 -4
- 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 -5
- package/dist/internal.js +23 -5
- package/dist/restty.esm.js +32 -11368
- 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} +5 -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 +1 -8
- 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 +1 -1
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +2 -1
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +1 -1
- 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} +1 -47
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +1 -23
- 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} +1 -6
- 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 -15
- package/dist/runtime/create-runtime/native-scrollbar-host.types.d.ts +13 -0
- package/dist/runtime/{overlay-scrollbar.d.ts → create-runtime/overlay-scrollbar.d.ts} +1 -12
- 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 +5 -9
- 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 +1 -1
- package/dist/runtime/create-runtime/search-runtime/index.d.ts +2 -0
- package/dist/runtime/create-runtime/{search-runtime.d.ts → search-runtime/types.d.ts} +9 -6
- 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 -393
- 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/{pane-app-manager.d.ts → panes/managed-pane-types.d.ts} +34 -36
- 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 +33 -23
- 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 → restty/pane-handle.d.ts} +42 -40
- 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 -51
- 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 +28 -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/{pane-search-ui.d.ts → search-ui/types.d.ts} +22 -13
- package/dist/wasm/embedded.d.ts +1 -1
- package/dist/wasm/runtime/types.d.ts +0 -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 +52 -33
- package/dist/internal.esm.js +0 -22285
- 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 -31
- 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 -113
- package/dist/runtime/create-runtime/runtime-logger.d.ts +0 -17
- package/dist/runtime/font-sources.d.ts +0 -5
- 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/restty-plugin-runtime.d.ts +0 -57
- package/dist/xterm/app-options.d.ts +0 -2
- package/dist/xterm.esm.js +0 -12210
- /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,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
1
|
+
import type { ResttyPaneContextMenuOptions, ResttyPaneManager, ResttyPaneShortcutsOptions, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneWithManagedRuntime } from "./types";
|
|
2
|
+
import type { ResttyRuntimeServicesConfig, ResttyTerminalConfig } from "../../runtime/core/config";
|
|
3
|
+
import type { ResttyRuntimeSession } from "../../runtime/core/resources";
|
|
4
|
+
import type { ResttyPaneSearchUiCloseOptions, ResttyPaneSearchUiOpenOptions, ResttyPaneSearchUiOptions, ResttyPaneSearchUiStyleOptions } from "../search-ui";
|
|
4
5
|
/**
|
|
5
|
-
* A pane created by the
|
|
6
|
-
* with DOM elements needed by the terminal
|
|
6
|
+
* A pane created by the managed-pane manager, extending the base pane
|
|
7
|
+
* with DOM elements needed by the terminal runtime.
|
|
7
8
|
*/
|
|
8
|
-
export type
|
|
9
|
+
export type ResttyManagedPane = ResttyPaneWithManagedRuntime & {
|
|
9
10
|
/** The canvas element used for terminal rendering. */
|
|
10
11
|
canvas: HTMLCanvasElement;
|
|
11
12
|
/** Hidden textarea for IME composition input. */
|
|
12
13
|
imeInput: HTMLTextAreaElement;
|
|
13
|
-
/** Pre element for terminal debug / accessibility output. */
|
|
14
|
-
termDebugEl: HTMLPreElement;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
17
16
|
* Default CSS class names for pane DOM elements.
|
|
@@ -20,7 +19,6 @@ export type ResttyPaneDomDefaults = {
|
|
|
20
19
|
paneClassName?: string;
|
|
21
20
|
canvasClassName?: string;
|
|
22
21
|
imeInputClassName?: string;
|
|
23
|
-
termDebugClassName?: string;
|
|
24
22
|
};
|
|
25
23
|
/** Style options for managed panes (alias for ResttyPaneStyleOptions). */
|
|
26
24
|
export type ResttyManagedPaneStyleOptions = ResttyPaneStyleOptions;
|
|
@@ -30,9 +28,18 @@ export type ResttyManagedPaneStylesOptions = ResttyPaneStylesOptions;
|
|
|
30
28
|
export type ResttyManagedPaneSearchUiStyleOptions = ResttyPaneSearchUiStyleOptions;
|
|
31
29
|
/** Built-in pane search UI configuration. */
|
|
32
30
|
export type ResttyManagedPaneSearchUiOptions = ResttyPaneSearchUiOptions;
|
|
33
|
-
/**
|
|
34
|
-
export type
|
|
35
|
-
|
|
31
|
+
/** Pane context passed to per-pane config factories. */
|
|
32
|
+
export type ResttyPaneRuntimeContext = {
|
|
33
|
+
id: number;
|
|
34
|
+
sourcePane: ResttyManagedPane | null;
|
|
35
|
+
canvas: HTMLCanvasElement;
|
|
36
|
+
imeInput: HTMLTextAreaElement;
|
|
37
|
+
};
|
|
38
|
+
/** Static or factory terminal behavior config for one pane. */
|
|
39
|
+
export type ResttyTerminalConfigInput = ResttyTerminalConfig | ((context: ResttyPaneRuntimeContext) => ResttyTerminalConfig);
|
|
40
|
+
/** Static or factory runtime services config for one pane. */
|
|
41
|
+
export type ResttyRuntimeServicesConfigInput = ResttyRuntimeServicesConfig | ((context: ResttyPaneRuntimeContext) => ResttyRuntimeServicesConfig);
|
|
42
|
+
export type ResttyManagedPaneManager = ResttyPaneManager<ResttyManagedPane> & {
|
|
36
43
|
openPaneSearch: (id: number, options?: ResttyPaneSearchUiOpenOptions) => void;
|
|
37
44
|
closePaneSearch: (id: number, options?: ResttyPaneSearchUiCloseOptions) => void;
|
|
38
45
|
togglePaneSearch: (id: number, options?: ResttyPaneSearchUiOpenOptions & ResttyPaneSearchUiCloseOptions) => void;
|
|
@@ -47,32 +54,28 @@ export type ResttyDefaultPaneContextMenuOptions = {
|
|
|
47
54
|
/** Whether the default context menu is enabled (default true). */
|
|
48
55
|
enabled?: boolean;
|
|
49
56
|
/** Guard predicate; return false to suppress the menu for a given event. */
|
|
50
|
-
canOpen?: (event: MouseEvent, pane:
|
|
57
|
+
canOpen?: (event: MouseEvent, pane: ResttyPaneWithRuntime) => boolean;
|
|
51
58
|
/** Override the modifier key label shown in shortcut hints. */
|
|
52
59
|
modKeyLabel?: string;
|
|
53
60
|
/** Provide the PTY WebSocket URL for the connect/disconnect menu item. */
|
|
54
61
|
getPtyUrl?: () => string | null | undefined;
|
|
55
62
|
};
|
|
56
63
|
/**
|
|
57
|
-
* Options for creating
|
|
58
|
-
* elements, the terminal
|
|
64
|
+
* Options for creating a managed-pane manager that wires up DOM
|
|
65
|
+
* elements, the terminal runtime, and the shared session automatically.
|
|
59
66
|
*/
|
|
60
|
-
export type
|
|
67
|
+
export type CreateResttyManagedPaneManagerOptions = {
|
|
61
68
|
/** Root element that will contain all pane DOM trees. */
|
|
62
69
|
root: HTMLElement;
|
|
63
70
|
/** Shared session for WASM/WebGPU resources (defaults to the global session). */
|
|
64
|
-
session?:
|
|
65
|
-
/** Per-pane
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
canvas: HTMLCanvasElement;
|
|
70
|
-
imeInput: HTMLTextAreaElement;
|
|
71
|
-
termDebugEl: HTMLPreElement;
|
|
72
|
-
}) => ResttyPaneAppOptionsInput);
|
|
71
|
+
session?: ResttyRuntimeSession;
|
|
72
|
+
/** Per-pane terminal behavior config, static object or factory. */
|
|
73
|
+
terminal?: ResttyTerminalConfigInput;
|
|
74
|
+
/** Per-pane runtime services config, static object or factory. */
|
|
75
|
+
services?: ResttyRuntimeServicesConfigInput;
|
|
73
76
|
/** Override default CSS class names for pane DOM elements. */
|
|
74
77
|
paneDom?: ResttyPaneDomDefaults;
|
|
75
|
-
/** Automatically call
|
|
78
|
+
/** Automatically call runtime.lifecycle.init() after pane creation (default true). */
|
|
76
79
|
autoInit?: boolean;
|
|
77
80
|
/** Minimum pane size in pixels during split-resize (default 96). */
|
|
78
81
|
minPaneSize?: number;
|
|
@@ -83,22 +86,17 @@ export type CreateResttyAppPaneManagerOptions = {
|
|
|
83
86
|
/** Enable or configure keyboard shortcuts for splitting. */
|
|
84
87
|
shortcuts?: boolean | ResttyPaneShortcutsOptions;
|
|
85
88
|
/** Custom context menu implementation (overrides defaultContextMenu). */
|
|
86
|
-
contextMenu?: ResttyPaneContextMenuOptions<
|
|
89
|
+
contextMenu?: ResttyPaneContextMenuOptions<ResttyManagedPane> | null;
|
|
87
90
|
/** Enable or configure the built-in default context menu. */
|
|
88
91
|
defaultContextMenu?: boolean | ResttyDefaultPaneContextMenuOptions;
|
|
89
92
|
/** Called after a new pane is created. */
|
|
90
|
-
onPaneCreated?: (pane:
|
|
93
|
+
onPaneCreated?: (pane: ResttyManagedPane) => void;
|
|
91
94
|
/** Called after a pane is closed. */
|
|
92
|
-
onPaneClosed?: (pane:
|
|
95
|
+
onPaneClosed?: (pane: ResttyManagedPane) => void;
|
|
93
96
|
/** Called after a pane is split. */
|
|
94
|
-
onPaneSplit?: (sourcePane:
|
|
97
|
+
onPaneSplit?: (sourcePane: ResttyManagedPane, createdPane: ResttyManagedPane, direction: "vertical" | "horizontal") => void;
|
|
95
98
|
/** Called when the active pane changes (or becomes null). */
|
|
96
|
-
onActivePaneChange?: (pane:
|
|
99
|
+
onActivePaneChange?: (pane: ResttyManagedPane | null) => void;
|
|
97
100
|
/** Called when the layout changes (splits, closes, resizes). */
|
|
98
101
|
onLayoutChanged?: () => void;
|
|
99
102
|
};
|
|
100
|
-
/**
|
|
101
|
-
* Create an app-aware pane manager that automatically constructs
|
|
102
|
-
* canvas, IME input, and terminal app instances for each pane.
|
|
103
|
-
*/
|
|
104
|
-
export declare function createResttyAppPaneManager(options: CreateResttyAppPaneManagerOptions): ResttyAppPaneManager;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CreateResttyPaneManagerOptions, ResttyPaneDefinition, ResttyPaneManager } from "
|
|
1
|
+
import type { CreateResttyPaneManagerOptions, ResttyPaneDefinition, ResttyPaneManager } from "./types";
|
|
2
2
|
export declare function createResttyPaneManager<TPane extends ResttyPaneDefinition>(options: CreateResttyPaneManagerOptions<TPane>): ResttyPaneManager<TPane>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PaneContextMenuController } from "
|
|
2
|
-
import type { ResttyPaneContextMenuOptions, ResttyPaneDefinition, ResttyPaneManager } from "
|
|
1
|
+
import type { PaneContextMenuController } from "./context-menu";
|
|
2
|
+
import type { ResttyPaneContextMenuOptions, ResttyPaneDefinition, ResttyPaneManager } from "./types";
|
|
3
3
|
export declare function createPaneInteractions<TPane extends ResttyPaneDefinition>(options: {
|
|
4
4
|
contextMenu: ResttyPaneContextMenuOptions<TPane> | null | undefined;
|
|
5
5
|
contextMenuController: PaneContextMenuController<TPane> | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResttyPaneStyleOptions } from "./
|
|
1
|
+
import type { ResttyPaneStyleOptions } from "./types";
|
|
2
2
|
/** Default style options for pane layout and appearance. */
|
|
3
3
|
export declare const DEFAULT_RESTTY_PANE_STYLE_OPTIONS: Required<ResttyPaneStyleOptions>;
|
|
4
4
|
/** Validates and normalizes pane style options, clamping numeric values to safe ranges and applying defaults. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResttyRuntime, ResttyRuntimeInteractionApi, ResttyRuntimeIoApi, ResttyRuntimeRenderApi, ResttyRuntimeSearchApi, ResttyRuntimeTerminalApi } from "../runtime/core/api";
|
|
2
2
|
/**
|
|
3
3
|
* Direction for splitting a pane.
|
|
4
4
|
* - vertical: split left/right
|
|
@@ -65,6 +65,8 @@ export type ResttyPaneStyleOptions = {
|
|
|
65
65
|
activePaneOpacity?: number;
|
|
66
66
|
/** Duration in ms for opacity transitions between active/inactive states. */
|
|
67
67
|
opacityTransitionMs?: number;
|
|
68
|
+
/** CSS color for the visible split divider. */
|
|
69
|
+
dividerColor?: string;
|
|
68
70
|
/** Divider/gutter thickness in CSS pixels. */
|
|
69
71
|
dividerThicknessPx?: number;
|
|
70
72
|
};
|
|
@@ -150,20 +152,59 @@ export type ResttyPaneManager<TPane extends ResttyPaneDefinition> = {
|
|
|
150
152
|
destroy: () => void;
|
|
151
153
|
};
|
|
152
154
|
/**
|
|
153
|
-
* Pane definition extended with a
|
|
155
|
+
* Pane definition extended with a ResttyRuntime instance and pause control.
|
|
154
156
|
*/
|
|
155
|
-
export type
|
|
156
|
-
/** The terminal
|
|
157
|
-
|
|
157
|
+
export type ResttyPaneWithRuntime = ResttyPaneDefinition & {
|
|
158
|
+
/** The terminal runtime running inside this pane. */
|
|
159
|
+
runtime: ResttyRuntime;
|
|
158
160
|
/** Whether the pane's renderer is currently paused. */
|
|
159
161
|
paused?: boolean;
|
|
160
162
|
/** Pause or resume this pane's renderer. */
|
|
161
163
|
setPaused?: (value: boolean) => void;
|
|
162
164
|
};
|
|
165
|
+
export type ResttyPaneWithRuntimeActions = ResttyPaneWithRuntime & {
|
|
166
|
+
setRenderer: ResttyRuntimeTerminalApi["setRenderer"];
|
|
167
|
+
setPaused: ResttyRuntimeTerminalApi["setPaused"];
|
|
168
|
+
setFontSize: ResttyRuntimeTerminalApi["setFontSize"];
|
|
169
|
+
setLigatures: ResttyRuntimeTerminalApi["setLigatures"];
|
|
170
|
+
setFontHinting: ResttyRuntimeTerminalApi["setFontHinting"];
|
|
171
|
+
setFontHintTarget: ResttyRuntimeTerminalApi["setFontHintTarget"];
|
|
172
|
+
setFonts: ResttyRuntimeTerminalApi["setFonts"];
|
|
173
|
+
applyTheme: ResttyRuntimeTerminalApi["applyTheme"];
|
|
174
|
+
resetTheme: ResttyRuntimeTerminalApi["resetTheme"];
|
|
175
|
+
sendInput: ResttyRuntimeIoApi["sendInput"];
|
|
176
|
+
sendKeyInput: ResttyRuntimeIoApi["sendKeyInput"];
|
|
177
|
+
copySelectionToClipboard: () => Promise<boolean>;
|
|
178
|
+
pasteFromClipboard: () => Promise<boolean>;
|
|
179
|
+
clearScreen: () => void;
|
|
180
|
+
connectPty: (url?: string) => void;
|
|
181
|
+
disconnectPty: () => void;
|
|
182
|
+
isPtyConnected: () => boolean;
|
|
183
|
+
togglePause: () => void;
|
|
184
|
+
setMouseMode: ResttyRuntimeInteractionApi["setMouseMode"];
|
|
185
|
+
getMouseStatus: ResttyRuntimeInteractionApi["getMouseStatus"];
|
|
186
|
+
selectWordAtClientPoint: ResttyRuntimeInteractionApi["selectWordAtClientPoint"];
|
|
187
|
+
setSearchQuery: ResttyRuntimeSearchApi["setQuery"];
|
|
188
|
+
clearSearch: ResttyRuntimeSearchApi["clear"];
|
|
189
|
+
searchNext: ResttyRuntimeSearchApi["next"];
|
|
190
|
+
searchPrevious: ResttyRuntimeSearchApi["previous"];
|
|
191
|
+
getSearchState: ResttyRuntimeSearchApi["getState"];
|
|
192
|
+
resize: ResttyRuntimeInteractionApi["resize"];
|
|
193
|
+
focus: ResttyRuntimeInteractionApi["focus"];
|
|
194
|
+
blur: ResttyRuntimeInteractionApi["blur"];
|
|
195
|
+
updateSize: ResttyRuntimeInteractionApi["updateSize"];
|
|
196
|
+
getBackend: ResttyRuntimeRenderApi["getBackend"];
|
|
197
|
+
setShaderStages: ResttyRuntimeRenderApi["setShaderStages"];
|
|
198
|
+
getShaderStages: ResttyRuntimeRenderApi["getShaderStages"];
|
|
199
|
+
};
|
|
200
|
+
export type ResttyPaneWithManagedRuntime = ResttyPaneWithRuntimeActions & {
|
|
201
|
+
initRuntime: () => Promise<void>;
|
|
202
|
+
destroyRuntime: () => void;
|
|
203
|
+
};
|
|
163
204
|
/**
|
|
164
|
-
* Options for building the default set of context menu items for a pane with
|
|
205
|
+
* Options for building the default set of context menu items for a pane with a runtime.
|
|
165
206
|
*/
|
|
166
|
-
export type CreateDefaultResttyPaneContextMenuItemsOptions<TPane extends
|
|
207
|
+
export type CreateDefaultResttyPaneContextMenuItemsOptions<TPane extends ResttyPaneWithRuntimeActions> = {
|
|
167
208
|
/** The pane the context menu was opened on. */
|
|
168
209
|
pane: TPane;
|
|
169
210
|
/** Subset of the pane manager API needed for split/close actions. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResttyPaneShortcutsOptions, ResttyPaneSplitDirection } from "
|
|
1
|
+
import type { ResttyPaneShortcutsOptions, ResttyPaneSplitDirection } from "./types";
|
|
2
2
|
export declare function attachPaneManagerWindowEvents(options: {
|
|
3
3
|
contextMenuController?: {
|
|
4
4
|
isOpen: () => boolean;
|
|
@@ -1,87 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export declare const RESTTY_PLUGIN_API_VERSION = 1;
|
|
7
|
-
/** Plugin API version requirements. */
|
|
8
|
-
export type ResttyPluginApiRange = {
|
|
9
|
-
min: number;
|
|
10
|
-
max?: number;
|
|
11
|
-
};
|
|
12
|
-
/** Optional compatibility requirements declared by plugins. */
|
|
13
|
-
export type ResttyPluginRequires = {
|
|
14
|
-
pluginApi?: number | ResttyPluginApiRange;
|
|
15
|
-
};
|
|
16
|
-
/** Diagnostics snapshot for a plugin. */
|
|
17
|
-
export type ResttyPluginInfo = {
|
|
18
|
-
id: string;
|
|
19
|
-
version: string | null;
|
|
20
|
-
apiVersion: number | null;
|
|
21
|
-
requires: ResttyPluginRequires | null;
|
|
22
|
-
active: boolean;
|
|
23
|
-
activatedAt: number | null;
|
|
24
|
-
lastError: string | null;
|
|
25
|
-
listeners: number;
|
|
26
|
-
inputInterceptors: number;
|
|
27
|
-
outputInterceptors: number;
|
|
28
|
-
lifecycleHooks: number;
|
|
29
|
-
renderHooks: number;
|
|
30
|
-
renderStages: number;
|
|
31
|
-
};
|
|
32
|
-
/** Declarative plugin manifest entry for registry-based loading. */
|
|
33
|
-
export type ResttyPluginManifestEntry = {
|
|
34
|
-
id: string;
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
options?: unknown;
|
|
37
|
-
};
|
|
38
|
-
/** Provider entry for plugin registry lookups. */
|
|
39
|
-
export type ResttyPluginRegistryEntry = ResttyPlugin | (() => ResttyPlugin | Promise<ResttyPlugin>);
|
|
40
|
-
/** Registry shape accepted by loadPlugins. */
|
|
41
|
-
export type ResttyPluginRegistry = ReadonlyMap<string, ResttyPluginRegistryEntry> | Record<string, ResttyPluginRegistryEntry>;
|
|
42
|
-
/** Status for manifest-driven plugin load attempts. */
|
|
43
|
-
export type ResttyPluginLoadStatus = "loaded" | "skipped" | "missing" | "failed";
|
|
44
|
-
/** Result row returned by loadPlugins. */
|
|
45
|
-
export type ResttyPluginLoadResult = {
|
|
46
|
-
id: string;
|
|
47
|
-
status: ResttyPluginLoadStatus;
|
|
48
|
-
error: string | null;
|
|
49
|
-
};
|
|
50
|
-
/** Event payloads emitted by the Restty plugin host. */
|
|
51
|
-
export type ResttyPluginEvents = {
|
|
52
|
-
"plugin:activated": {
|
|
53
|
-
pluginId: string;
|
|
54
|
-
};
|
|
55
|
-
"plugin:deactivated": {
|
|
56
|
-
pluginId: string;
|
|
57
|
-
};
|
|
58
|
-
"pane:created": {
|
|
59
|
-
paneId: number;
|
|
60
|
-
};
|
|
61
|
-
"pane:closed": {
|
|
62
|
-
paneId: number;
|
|
63
|
-
};
|
|
64
|
-
"pane:split": {
|
|
65
|
-
sourcePaneId: number;
|
|
66
|
-
createdPaneId: number;
|
|
67
|
-
direction: ResttyPaneSplitDirection;
|
|
68
|
-
};
|
|
69
|
-
"pane:active-changed": {
|
|
70
|
-
paneId: number | null;
|
|
71
|
-
};
|
|
72
|
-
"layout:changed": {};
|
|
73
|
-
"pane:resized": {
|
|
74
|
-
paneId: number;
|
|
75
|
-
cols: number;
|
|
76
|
-
rows: number;
|
|
77
|
-
};
|
|
78
|
-
"pane:focused": {
|
|
79
|
-
paneId: number;
|
|
80
|
-
};
|
|
81
|
-
"pane:blurred": {
|
|
82
|
-
paneId: number;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
1
|
+
import type { ResttyShaderStage } from "../../runtime/core/models";
|
|
2
|
+
import type { ResttyManagedPaneSearchUiStyleOptions, ResttyManagedPaneStyleOptions } from "../panes/managed-pane-types";
|
|
3
|
+
import type { ResttyPaneSplitDirection } from "../panes/types";
|
|
4
|
+
import type { ResttyPaneApi, ResttyPaneHandle } from "../restty/pane-handle";
|
|
5
|
+
import type { ResttyPluginEvents, ResttyPluginRequires } from "./types";
|
|
85
6
|
/** A disposable resource returned by plugin APIs. */
|
|
86
7
|
export type ResttyPluginDisposable = {
|
|
87
8
|
dispose: () => void;
|
|
@@ -139,14 +60,37 @@ export type ResttyRenderStageHandle = {
|
|
|
139
60
|
setEnabled: (value: boolean) => void;
|
|
140
61
|
dispose: () => void;
|
|
141
62
|
};
|
|
142
|
-
|
|
143
|
-
export type ResttyPluginContext = {
|
|
144
|
-
restty: Restty;
|
|
145
|
-
options: unknown;
|
|
63
|
+
export type ResttyPluginHostApi = Omit<ResttyPaneApi, "id"> & {
|
|
146
64
|
panes: () => ResttyPaneHandle[];
|
|
147
65
|
pane: (id: number) => ResttyPaneHandle | null;
|
|
148
66
|
activePane: () => ResttyPaneHandle | null;
|
|
149
67
|
focusedPane: () => ResttyPaneHandle | null;
|
|
68
|
+
forEachPane: (visitor: (pane: ResttyPaneHandle) => void) => void;
|
|
69
|
+
createInitialPane: (options?: {
|
|
70
|
+
focus?: boolean;
|
|
71
|
+
}) => ResttyPaneHandle;
|
|
72
|
+
splitActivePane: (direction: ResttyPaneSplitDirection) => ResttyPaneHandle | null;
|
|
73
|
+
splitPane: (id: number, direction: ResttyPaneSplitDirection) => ResttyPaneHandle | null;
|
|
74
|
+
closePane: (id: number) => boolean;
|
|
75
|
+
getPaneStyleOptions: () => Readonly<Required<ResttyManagedPaneStyleOptions>>;
|
|
76
|
+
setPaneStyleOptions: (options: ResttyManagedPaneStyleOptions) => void;
|
|
77
|
+
getSearchUiStyleOptions: () => Readonly<Required<ResttyManagedPaneSearchUiStyleOptions>>;
|
|
78
|
+
setSearchUiStyleOptions: (options: ResttyManagedPaneSearchUiStyleOptions) => void;
|
|
79
|
+
setActivePane: (id: number, options?: {
|
|
80
|
+
focus?: boolean;
|
|
81
|
+
}) => void;
|
|
82
|
+
markPaneFocused: (id: number, options?: {
|
|
83
|
+
focus?: boolean;
|
|
84
|
+
}) => void;
|
|
85
|
+
requestLayoutSync: () => void;
|
|
86
|
+
hideContextMenu: () => void;
|
|
87
|
+
addShaderStage: (stage: ResttyShaderStage) => ResttyRenderStageHandle;
|
|
88
|
+
removeShaderStage: (id: string) => boolean;
|
|
89
|
+
};
|
|
90
|
+
/** Context object provided to each plugin on activation. */
|
|
91
|
+
export type ResttyPluginContext = {
|
|
92
|
+
restty: ResttyPluginHostApi;
|
|
93
|
+
options: unknown;
|
|
150
94
|
on: <E extends keyof ResttyPluginEvents>(event: E, listener: (payload: ResttyPluginEvents[E]) => void) => ResttyPluginDisposable;
|
|
151
95
|
addInputInterceptor: (interceptor: ResttyInputInterceptor, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
152
96
|
addOutputInterceptor: (interceptor: ResttyOutputInterceptor, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import { type ResttyLifecycleHookPayload, type ResttyPluginContext, type
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
4
|
-
import type {
|
|
5
|
-
import type { Restty } from "../restty";
|
|
6
|
-
export type ResttyPluginHostDeps = {
|
|
7
|
-
restty: Restty;
|
|
8
|
-
panes: () => ResttyPaneHandle[];
|
|
9
|
-
pane: (id: number) => ResttyPaneHandle | null;
|
|
10
|
-
activePane: () => ResttyPaneHandle | null;
|
|
11
|
-
focusedPane: () => ResttyPaneHandle | null;
|
|
12
|
-
addRenderStage: (stage: ResttyShaderStage, ownerPluginId: string | null) => ResttyRenderStageHandle;
|
|
13
|
-
};
|
|
1
|
+
import { type ResttyLifecycleHookPayload, type ResttyPluginContext, type ResttyRenderHookPayload } from "./context.types";
|
|
2
|
+
import type { ResttyPluginEvents } from "./types";
|
|
3
|
+
import { type ResttyPluginRuntime } from "./runtime";
|
|
4
|
+
import type { ResttyPluginHostDeps } from "./dispatcher.types";
|
|
14
5
|
export declare class ResttyPluginDispatcher {
|
|
15
6
|
private readonly deps;
|
|
16
7
|
private readonly pluginListeners;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResttyShaderStage } from "../../runtime/core/models";
|
|
2
|
+
import type { ResttyPluginHostApi, ResttyRenderStageHandle } from "./context.types";
|
|
3
|
+
export type ResttyPluginHostDeps = {
|
|
4
|
+
restty: ResttyPluginHostApi;
|
|
5
|
+
addRenderStage: (stage: ResttyShaderStage, ownerPluginId: string | null) => ResttyRenderStageHandle;
|
|
6
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { type ResttyPluginEvents, type ResttyPluginInfo, type ResttyPluginLoadResult, type ResttyPluginManifestEntry, type ResttyPluginRegistry } from "./types";
|
|
2
|
+
import type { ResttyLifecycleHookPayload, ResttyPlugin, ResttyRenderHookPayload } from "./context.types";
|
|
3
|
+
import type { ResttyPluginHostDeps } from "./dispatcher.types";
|
|
4
|
+
export declare class ResttyPluginHost {
|
|
4
5
|
private readonly pluginRuntimes;
|
|
5
6
|
private readonly pluginDiagnostics;
|
|
6
7
|
private readonly dispatcher;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ResttyPluginEvents, ResttyPluginInfo } from "./types";
|
|
2
|
+
import type { PluginDiagnosticMap, PluginListenersMap, PluginRuntimeMap, RegisterPluginInterceptorOptions, ResttyInterceptorSeq, ResttyPluginDiagnostic, ResttyPluginRuntime, ResttyPluginRuntimeDisposerKind, ResttyRegisteredInterceptor } from "./runtime.types";
|
|
3
|
+
export declare function registerPluginInterceptor<T extends (payload: unknown) => unknown>(bucket: Array<ResttyRegisteredInterceptor<T>>, pluginId: string, interceptor: T, options: RegisterPluginInterceptorOptions, seq: ResttyInterceptorSeq): {
|
|
4
|
+
dispose: () => void;
|
|
5
|
+
nextId: number;
|
|
6
|
+
nextOrder: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function applyPluginInterceptors<TPayload extends {
|
|
9
|
+
text: string;
|
|
10
|
+
}>(bucket: Array<ResttyRegisteredInterceptor<(payload: TPayload) => string | null | void>>, kind: "input" | "output", payload: TPayload): string | null;
|
|
11
|
+
export declare function runPluginHooks<TPayload>(bucket: Array<ResttyRegisteredInterceptor<(payload: TPayload) => void>>, kind: "lifecycle" | "render", payload: TPayload): void;
|
|
12
|
+
export declare function attachRuntimeDisposer(runtime: ResttyPluginRuntime, kind: ResttyPluginRuntimeDisposerKind, dispose: () => void): () => void;
|
|
13
|
+
export declare function teardownPluginRuntime(runtime: ResttyPluginRuntime): void;
|
|
14
|
+
export declare function setPluginLoadError(pluginDiagnostics: PluginDiagnosticMap, pluginId: string, message: string): void;
|
|
15
|
+
export declare function patchPluginDiagnostic(pluginDiagnostics: PluginDiagnosticMap, pluginId: string, patch: Partial<Pick<ResttyPluginDiagnostic, "active" | "activatedAt" | "lastError">>): void;
|
|
16
|
+
export declare function buildPluginInfo(pluginId: string, pluginDiagnostics: PluginDiagnosticMap, pluginRuntimes: PluginRuntimeMap): ResttyPluginInfo | null;
|
|
17
|
+
export declare function onPluginEvent<E extends keyof ResttyPluginEvents>(pluginListeners: PluginListenersMap, event: E, listener: (payload: ResttyPluginEvents[E]) => void): () => void;
|
|
18
|
+
export declare function emitPluginEvent<E extends keyof ResttyPluginEvents>(pluginListeners: PluginListenersMap, event: E, payload: ResttyPluginEvents[E]): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ResttyShaderStage } from "../../runtime/core/models";
|
|
2
|
+
import type { ResttyInterceptorOptions, ResttyPlugin } from "./context.types";
|
|
3
|
+
import type { ResttyPluginEvents, ResttyPluginInfo, ResttyPluginRequires } from "./types";
|
|
4
|
+
export type ResttyPluginRuntimeDisposerKind = "event" | "input-interceptor" | "output-interceptor" | "lifecycle-hook" | "render-hook" | "render-stage";
|
|
5
|
+
export type ResttyPluginRuntimeDisposer = {
|
|
6
|
+
kind: ResttyPluginRuntimeDisposerKind;
|
|
7
|
+
active: boolean;
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type ResttyPluginRuntime = {
|
|
11
|
+
plugin: ResttyPlugin;
|
|
12
|
+
cleanup: (() => void) | null;
|
|
13
|
+
activatedAt: number;
|
|
14
|
+
options: unknown;
|
|
15
|
+
disposers: Array<ResttyPluginRuntimeDisposer>;
|
|
16
|
+
};
|
|
17
|
+
export type ResttyPluginDiagnostic = {
|
|
18
|
+
id: string;
|
|
19
|
+
version: string | null;
|
|
20
|
+
apiVersion: number | null;
|
|
21
|
+
requires: ResttyPluginRequires | null;
|
|
22
|
+
active: boolean;
|
|
23
|
+
activatedAt: number | null;
|
|
24
|
+
lastError: string | null;
|
|
25
|
+
};
|
|
26
|
+
export type ResttyRegisteredInterceptor<T extends (payload: unknown) => unknown> = {
|
|
27
|
+
id: number;
|
|
28
|
+
pluginId: string;
|
|
29
|
+
priority: number;
|
|
30
|
+
order: number;
|
|
31
|
+
interceptor: T;
|
|
32
|
+
};
|
|
33
|
+
export type ResttyManagedShaderStage = {
|
|
34
|
+
id: string;
|
|
35
|
+
stage: ResttyShaderStage;
|
|
36
|
+
order: number;
|
|
37
|
+
ownerPluginId: string | null;
|
|
38
|
+
};
|
|
39
|
+
export type ResttyInterceptorSeq = {
|
|
40
|
+
nextId: number;
|
|
41
|
+
nextOrder: number;
|
|
42
|
+
};
|
|
43
|
+
export type PluginListenersMap = Map<keyof ResttyPluginEvents, Set<(payload: unknown) => void>>;
|
|
44
|
+
export type PluginDiagnosticMap = Map<string, ResttyPluginDiagnostic>;
|
|
45
|
+
export type PluginRuntimeMap = Map<string, ResttyPluginRuntime>;
|
|
46
|
+
export type BuildPluginInfoResult = ResttyPluginInfo | null;
|
|
47
|
+
export type RegisterPluginInterceptorOptions = ResttyInterceptorOptions | undefined;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ResttyPaneSplitDirection } from "../panes/types";
|
|
2
|
+
import type { ResttyPlugin } from "./context.types";
|
|
3
|
+
export type { ResttyPluginDisposable, ResttyPluginCleanup, ResttyInputInterceptorPayload, ResttyOutputInterceptorPayload, ResttyInputInterceptor, ResttyOutputInterceptor, ResttyLifecycleHookPayload, ResttyLifecycleHook, ResttyRenderHookPayload, ResttyRenderHook, ResttyInterceptorOptions, ResttyRenderStageHandle, ResttyPluginHostApi, ResttyPluginContext, ResttyPlugin, } from "./context.types";
|
|
4
|
+
/** Current Restty plugin API version. */
|
|
5
|
+
export declare const RESTTY_PLUGIN_API_VERSION = 1;
|
|
6
|
+
/** Plugin API version requirements. */
|
|
7
|
+
export type ResttyPluginApiRange = {
|
|
8
|
+
min: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
};
|
|
11
|
+
/** Optional compatibility requirements declared by plugins. */
|
|
12
|
+
export type ResttyPluginRequires = {
|
|
13
|
+
pluginApi?: number | ResttyPluginApiRange;
|
|
14
|
+
};
|
|
15
|
+
/** Diagnostics snapshot for a plugin. */
|
|
16
|
+
export type ResttyPluginInfo = {
|
|
17
|
+
id: string;
|
|
18
|
+
version: string | null;
|
|
19
|
+
apiVersion: number | null;
|
|
20
|
+
requires: ResttyPluginRequires | null;
|
|
21
|
+
active: boolean;
|
|
22
|
+
activatedAt: number | null;
|
|
23
|
+
lastError: string | null;
|
|
24
|
+
listeners: number;
|
|
25
|
+
inputInterceptors: number;
|
|
26
|
+
outputInterceptors: number;
|
|
27
|
+
lifecycleHooks: number;
|
|
28
|
+
renderHooks: number;
|
|
29
|
+
renderStages: number;
|
|
30
|
+
};
|
|
31
|
+
/** Declarative plugin manifest entry for registry-based loading. */
|
|
32
|
+
export type ResttyPluginManifestEntry = {
|
|
33
|
+
id: string;
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
options?: unknown;
|
|
36
|
+
};
|
|
37
|
+
/** Provider entry for plugin registry lookups. */
|
|
38
|
+
export type ResttyPluginRegistryEntry = ResttyPlugin | (() => ResttyPlugin | Promise<ResttyPlugin>);
|
|
39
|
+
/** Registry shape accepted by loadPlugins. */
|
|
40
|
+
export type ResttyPluginRegistry = ReadonlyMap<string, ResttyPluginRegistryEntry> | Record<string, ResttyPluginRegistryEntry>;
|
|
41
|
+
/** Status for manifest-driven plugin load attempts. */
|
|
42
|
+
export type ResttyPluginLoadStatus = "loaded" | "skipped" | "missing" | "failed";
|
|
43
|
+
/** Result row returned by loadPlugins. */
|
|
44
|
+
export type ResttyPluginLoadResult = {
|
|
45
|
+
id: string;
|
|
46
|
+
status: ResttyPluginLoadStatus;
|
|
47
|
+
error: string | null;
|
|
48
|
+
};
|
|
49
|
+
/** Event payloads emitted by the Restty plugin host. */
|
|
50
|
+
export type ResttyPluginEvents = {
|
|
51
|
+
"plugin:activated": {
|
|
52
|
+
pluginId: string;
|
|
53
|
+
};
|
|
54
|
+
"plugin:deactivated": {
|
|
55
|
+
pluginId: string;
|
|
56
|
+
};
|
|
57
|
+
"pane:created": {
|
|
58
|
+
paneId: number;
|
|
59
|
+
};
|
|
60
|
+
"pane:closed": {
|
|
61
|
+
paneId: number;
|
|
62
|
+
};
|
|
63
|
+
"pane:split": {
|
|
64
|
+
sourcePaneId: number;
|
|
65
|
+
createdPaneId: number;
|
|
66
|
+
direction: ResttyPaneSplitDirection;
|
|
67
|
+
};
|
|
68
|
+
"pane:active-changed": {
|
|
69
|
+
paneId: number | null;
|
|
70
|
+
};
|
|
71
|
+
"layout:changed": {};
|
|
72
|
+
"pane:resized": {
|
|
73
|
+
paneId: number;
|
|
74
|
+
cols: number;
|
|
75
|
+
rows: number;
|
|
76
|
+
};
|
|
77
|
+
"pane:focused": {
|
|
78
|
+
paneId: number;
|
|
79
|
+
};
|
|
80
|
+
"pane:blurred": {
|
|
81
|
+
paneId: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { ResttyPaneSearchUiCloseOptions, ResttyPaneSearchUiOpenOptions } from "../pane-search-ui";
|
|
5
|
-
import type { ResttyManagedPaneSearchUiStyleOptions } from "../pane-app-manager";
|
|
6
|
-
export declare abstract class ResttyActivePaneApi {
|
|
1
|
+
import type { ResttyPaneApi, ResttyPaneHandle } from "./pane-handle";
|
|
2
|
+
export type ResttyActivePaneSurfaceApi = Omit<ResttyPaneApi, "id" | "resize" | "focus" | "blur">;
|
|
3
|
+
export declare abstract class ResttyActivePaneApi implements ResttyActivePaneSurfaceApi {
|
|
7
4
|
protected abstract requireActivePaneHandle(): ResttyPaneHandle;
|
|
8
|
-
isPtyConnected():
|
|
9
|
-
setRenderer(value: "
|
|
10
|
-
setPaused(value:
|
|
5
|
+
isPtyConnected(): ReturnType<ResttyPaneApi["isPtyConnected"]>;
|
|
6
|
+
setRenderer(value: Parameters<ResttyPaneApi["setRenderer"]>[0]): void;
|
|
7
|
+
setPaused(value: Parameters<ResttyPaneApi["setPaused"]>[0]): void;
|
|
11
8
|
togglePause(): void;
|
|
12
|
-
setFontSize(value:
|
|
13
|
-
|
|
9
|
+
setFontSize(value: Parameters<ResttyPaneApi["setFontSize"]>[0]): void;
|
|
10
|
+
setLigatures(value: Parameters<ResttyPaneApi["setLigatures"]>[0]): void;
|
|
11
|
+
setFontHinting(value: Parameters<ResttyPaneApi["setFontHinting"]>[0]): void;
|
|
12
|
+
setFontHintTarget(value: Parameters<ResttyPaneApi["setFontHintTarget"]>[0]): void;
|
|
13
|
+
setFonts(fonts: Parameters<ResttyPaneApi["setFonts"]>[0]): ReturnType<ResttyPaneApi["setFonts"]>;
|
|
14
|
+
applyTheme(theme: Parameters<ResttyPaneApi["applyTheme"]>[0], sourceLabel?: Parameters<ResttyPaneApi["applyTheme"]>[1]): void;
|
|
14
15
|
resetTheme(): void;
|
|
15
|
-
sendInput(text:
|
|
16
|
-
sendKeyInput(text:
|
|
16
|
+
sendInput(text: Parameters<ResttyPaneApi["sendInput"]>[0], source?: Parameters<ResttyPaneApi["sendInput"]>[1]): void;
|
|
17
|
+
sendKeyInput(text: Parameters<ResttyPaneApi["sendKeyInput"]>[0], source?: Parameters<ResttyPaneApi["sendKeyInput"]>[1]): void;
|
|
17
18
|
clearScreen(): void;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
connectPty(url?: Parameters<ResttyPaneApi["connectPty"]>[0]): void;
|
|
20
|
+
disconnectPty(): void;
|
|
21
|
+
setMouseMode(value: Parameters<ResttyPaneApi["setMouseMode"]>[0]): void;
|
|
22
|
+
getMouseStatus(): ReturnType<ResttyPaneApi["getMouseStatus"]>;
|
|
23
|
+
copySelectionToClipboard(): ReturnType<ResttyPaneApi["copySelectionToClipboard"]>;
|
|
24
|
+
pasteFromClipboard(): ReturnType<ResttyPaneApi["pasteFromClipboard"]>;
|
|
25
|
+
selectWordAtClientPoint(clientX: Parameters<ResttyPaneApi["selectWordAtClientPoint"]>[0], clientY: Parameters<ResttyPaneApi["selectWordAtClientPoint"]>[1]): ReturnType<ResttyPaneApi["selectWordAtClientPoint"]>;
|
|
26
|
+
setSearchQuery(query: Parameters<ResttyPaneApi["setSearchQuery"]>[0]): void;
|
|
27
|
+
clearSearch(): void;
|
|
28
|
+
searchNext(): void;
|
|
29
|
+
searchPrevious(): void;
|
|
30
|
+
getSearchState(): ReturnType<ResttyPaneApi["getSearchState"]>;
|
|
31
|
+
openSearch(options?: Parameters<ResttyPaneApi["openSearch"]>[0]): void;
|
|
32
|
+
closeSearch(options?: Parameters<ResttyPaneApi["closeSearch"]>[0]): void;
|
|
33
|
+
toggleSearch(options?: Parameters<ResttyPaneApi["toggleSearch"]>[0]): void;
|
|
25
34
|
isSearchOpen(): boolean;
|
|
26
|
-
getSearchUiStyleOptions():
|
|
27
|
-
setSearchUiStyleOptions(options:
|
|
28
|
-
|
|
35
|
+
getSearchUiStyleOptions(): ReturnType<ResttyPaneApi["getSearchUiStyleOptions"]>;
|
|
36
|
+
setSearchUiStyleOptions(options: Parameters<ResttyPaneApi["setSearchUiStyleOptions"]>[0]): void;
|
|
37
|
+
setShaderStages(stages: Parameters<ResttyPaneApi["setShaderStages"]>[0]): void;
|
|
38
|
+
getShaderStages(): ReturnType<ResttyPaneApi["getShaderStages"]>;
|
|
29
39
|
updateSize(force?: boolean): void;
|
|
30
40
|
getBackend(): string;
|
|
31
41
|
}
|