restty 0.1.23 → 0.1.25
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/dist/{chunk-mkkhfg0z.js → chunk-pab3ge3d.js} +11446 -7806
- package/dist/fonts/index.d.ts +4 -1
- package/dist/fonts/manager/classification.d.ts +13 -0
- package/dist/fonts/manager/entries.d.ts +13 -0
- package/dist/fonts/manager/picker.d.ts +6 -0
- package/dist/fonts/manager/sources.d.ts +16 -0
- package/dist/fonts/types.d.ts +20 -10
- package/dist/grid/grid.d.ts +5 -3
- package/dist/ime/ime.d.ts +13 -0
- package/dist/index.d.ts +3 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/keymap/before-input.d.ts +4 -0
- package/dist/input/keymap/constants.d.ts +13 -0
- package/dist/input/keymap/control.d.ts +2 -0
- package/dist/input/keymap/default-mapping.d.ts +1 -0
- package/dist/input/keymap/kitty.d.ts +1 -0
- package/dist/input/keymap/normalization.d.ts +4 -0
- package/dist/input/keymap/pty-map.d.ts +4 -0
- package/dist/input/keymap.d.ts +2 -11
- package/dist/input/output/csi.d.ts +33 -0
- package/dist/input/{output.d.ts → output/index.d.ts} +6 -9
- package/dist/input/output/osc.d.ts +15 -0
- package/dist/input/output/prompt.d.ts +11 -0
- package/dist/input/types.d.ts +13 -0
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +13 -150
- package/dist/renderer/index.d.ts +7 -2
- package/dist/renderer/shaders/glyph-gl.d.ts +4 -0
- package/dist/renderer/{shaders.d.ts → shaders/glyph-wgsl.d.ts} +0 -10
- package/dist/renderer/shaders/rect.d.ts +6 -0
- package/dist/renderer/shapes/block-elements.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/dashed-lines.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/diagonal.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/draw-box-drawing.d.ts +6 -0
- package/dist/renderer/shapes/box-drawing/fallback.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/mapped.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/rounded-corner.d.ts +2 -0
- package/dist/renderer/shapes/braille.d.ts +3 -0
- package/dist/renderer/shapes/classify.d.ts +18 -0
- package/dist/renderer/shapes/geometry.d.ts +9 -0
- package/dist/renderer/shapes/glyph-box.d.ts +7 -0
- package/dist/renderer/shapes/powerline.d.ts +3 -0
- package/dist/renderer/shapes/types.d.ts +38 -0
- package/dist/renderer/shapes.d.ts +8 -81
- package/dist/renderer/webgpu/buffers.d.ts +7 -0
- package/dist/renderer/webgpu/setup.d.ts +10 -0
- package/dist/renderer/webgpu/state.d.ts +15 -0
- package/dist/renderer/webgpu/webgl.d.ts +3 -0
- package/dist/restty.js +1 -1
- package/dist/{app → runtime}/atlas-builder.d.ts +53 -18
- package/dist/runtime/codepoint-utils.d.ts +12 -0
- package/dist/runtime/create-app-io-utils.d.ts +9 -0
- package/dist/runtime/create-app-symbols.d.ts +11 -0
- package/dist/runtime/create-app-types.d.ts +72 -0
- package/dist/runtime/create-runtime/atlas-debug-utils.d.ts +5 -0
- package/dist/runtime/create-runtime/blend-utils.d.ts +11 -0
- package/dist/runtime/create-runtime/color-glyph-atlas.d.ts +11 -0
- package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +1 -0
- package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/types.d.ts +63 -0
- package/dist/runtime/create-runtime/debug-tools.d.ts +6 -0
- package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +39 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +20 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.types.d.ts +108 -0
- package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +21 -0
- package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +26 -0
- package/dist/runtime/create-runtime/format-utils.d.ts +2 -0
- package/dist/runtime/create-runtime/input-hooks.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +41 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +18 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-overlay-runtime.d.ts +15 -0
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +30 -0
- package/dist/runtime/create-runtime/interaction-runtime/types.d.ts +110 -0
- package/dist/runtime/create-runtime/interaction-runtime.d.ts +3 -0
- package/dist/runtime/create-runtime/kitty-overlay-utils.d.ts +26 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-canvas.d.ts +13 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +6 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.d.ts +16 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.types.d.ts +85 -0
- package/dist/runtime/create-runtime/pty-input-runtime.d.ts +45 -0
- package/dist/runtime/create-runtime/render-tick-webgl-context.d.ts +4 -0
- package/dist/runtime/create-runtime/render-tick-webgl-glyph-pipeline.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +162 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +25 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-draw-pass.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-emit-glyphs.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-overlays-atlas.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +386 -0
- package/dist/runtime/create-runtime/render-ticks.d.ts +9 -0
- package/dist/runtime/create-runtime/runtime-app-api.d.ts +103 -0
- package/dist/runtime/create-runtime/runtime-logger.d.ts +17 -0
- package/dist/runtime/create-runtime/runtime-reporting.d.ts +40 -0
- package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +29 -0
- package/dist/runtime/create-runtime.d.ts +7 -0
- package/dist/runtime/font-atlas-utils/bitmap-utils.d.ts +5 -0
- package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +29 -0
- package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +25 -0
- package/dist/runtime/font-atlas-utils/packing-utils.d.ts +13 -0
- package/dist/runtime/overlay-scrollbar.d.ts +24 -0
- package/dist/runtime/pty-output-buffer.d.ts +12 -0
- package/dist/runtime/render-color-utils.d.ts +6 -0
- package/dist/runtime/render-stage-runtime.d.ts +18 -0
- package/dist/runtime/render-stage-shaders.d.ts +6 -0
- package/dist/runtime/shader-stages.d.ts +9 -0
- package/dist/runtime/text-decoration.d.ts +4 -0
- package/dist/{app → runtime}/types.d.ts +39 -1
- package/dist/selection/clipboard.d.ts +4 -0
- package/dist/selection/{selection.d.ts → core.d.ts} +0 -11
- package/dist/selection/index.d.ts +3 -1
- package/dist/selection/text.d.ts +8 -0
- package/dist/surface/app-factory.d.ts +3 -0
- package/dist/{app → surface}/pane-app-manager.d.ts +2 -2
- package/dist/surface/panes/default-context-menu-items.d.ts +8 -0
- package/dist/surface/panes/layout.d.ts +9 -0
- package/dist/surface/panes/manager.d.ts +2 -0
- package/dist/surface/panes/pane-interactions.d.ts +11 -0
- package/dist/surface/panes/window-events.d.ts +10 -0
- package/dist/{app → surface}/panes-types.d.ts +1 -1
- package/dist/surface/restty/active-pane-api.d.ts +23 -0
- package/dist/surface/restty/manager-options.d.ts +24 -0
- package/dist/surface/restty/pane-ops.d.ts +42 -0
- package/dist/surface/restty/plugin-dispatcher.d.ts +39 -0
- package/dist/surface/restty/plugin-ops.d.ts +24 -0
- package/dist/surface/restty/shader-ops.d.ts +27 -0
- package/dist/surface/restty-pane-handle.d.ts +70 -0
- package/dist/surface/restty-plugin-runtime.d.ts +57 -0
- package/dist/surface/restty-plugin-types.d.ts +164 -0
- package/dist/surface/restty-plugin-utils.d.ts +22 -0
- package/dist/surface/restty.d.ts +93 -0
- package/dist/utils/base64.d.ts +12 -0
- package/dist/wasm/index.d.ts +2 -1
- package/dist/wasm/runtime/abi.d.ts +7 -0
- package/dist/wasm/runtime/kitty.d.ts +2 -0
- package/dist/wasm/runtime/render-state.d.ts +2 -0
- package/dist/wasm/runtime/restty-wasm.d.ts +42 -0
- package/dist/wasm/{runtime.d.ts → runtime/types.d.ts} +48 -41
- package/dist/wasm/runtime/view-cache.d.ts +4 -0
- package/dist/xterm/app-options.d.ts +2 -0
- package/dist/xterm/dimensions.d.ts +1 -0
- package/dist/xterm/listeners.d.ts +5 -0
- package/dist/xterm.d.ts +1 -6
- package/dist/xterm.js +61 -63
- package/package.json +1 -1
- package/dist/app/index.d.ts +0 -9
- package/dist/app/panes.d.ts +0 -15
- package/dist/app/restty.d.ts +0 -336
- package/dist/fonts/manager.d.ts +0 -45
- package/dist/renderer/webgpu.d.ts +0 -33
- package/dist/restty-input.d.ts +0 -1
- /package/dist/{app → runtime}/clipboard-paste.d.ts +0 -0
- /package/dist/{app → runtime}/font-sources.d.ts +0 -0
- /package/dist/{app → runtime}/session.d.ts +0 -0
- /package/dist/{app → surface}/panes-context-menu.d.ts +0 -0
- /package/dist/{app → surface}/panes-styles.d.ts +0 -0
package/package.json
CHANGED
package/dist/app/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ResttyApp, ResttyAppOptions } from "./types";
|
|
2
|
-
export { createResttyAppSession, getDefaultResttyAppSession } from "./session";
|
|
3
|
-
export { createResttyPaneManager, createDefaultResttyPaneContextMenuItems, getResttyShortcutModifierLabel, } from "./panes";
|
|
4
|
-
export { Restty } from "./restty";
|
|
5
|
-
export { RESTTY_PLUGIN_API_VERSION } from "./restty";
|
|
6
|
-
export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyFontSource, ResttyTouchSelectionMode, ResttyUrlFontSource, ResttyBufferFontSource, ResttyLocalFontSource, ResttyWasmLogListener, ResttyAppSession, ResttyAppInputPayload, ResttyAppOptions, ResttyApp, } from "./types";
|
|
7
|
-
export type { ResttyPaneSplitDirection, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneShortcutsOptions, ResttyPaneContextMenuOptions, CreateResttyPaneManagerOptions, ResttyPaneManager, ResttyPaneWithApp, CreateDefaultResttyPaneContextMenuItemsOptions, } from "./panes";
|
|
8
|
-
export type { ResttyOptions, ResttyPluginApiRange, ResttyPlugin, ResttyPluginCleanup, ResttyPluginContext, ResttyPluginDisposable, ResttyPluginEvents, ResttyPluginInfo, ResttyPluginRequires, ResttyInputInterceptor, ResttyInputInterceptorPayload, ResttyInterceptorOptions, ResttyLifecycleHook, ResttyLifecycleHookPayload, ResttyPluginLoadResult, ResttyPluginLoadStatus, ResttyPluginManifestEntry, ResttyPluginRegistry, ResttyPluginRegistryEntry, ResttyRenderHook, ResttyRenderHookPayload, ResttyOutputInterceptor, ResttyOutputInterceptorPayload, } from "./restty";
|
|
9
|
-
export declare function createResttyApp(options: ResttyAppOptions): ResttyApp;
|
package/dist/app/panes.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CreateDefaultResttyPaneContextMenuItemsOptions, CreateResttyPaneManagerOptions, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneManager, ResttyPaneWithApp } from "./panes-types";
|
|
2
|
-
export type { CreateDefaultResttyPaneContextMenuItemsOptions, CreateResttyPaneManagerOptions, ResttyPaneContextMenuItem, ResttyPaneContextMenuOptions, ResttyPaneDefinition, ResttyPaneManager, ResttyPaneShortcutsOptions, ResttyPaneSplitDirection, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneWithApp, } from "./panes-types";
|
|
3
|
-
/** Return the platform-appropriate shortcut modifier label ("Cmd" on macOS, "Ctrl" elsewhere). */
|
|
4
|
-
export declare function getResttyShortcutModifierLabel(): "Cmd" | "Ctrl";
|
|
5
|
-
/**
|
|
6
|
-
* Build the standard right-click context menu items for a pane
|
|
7
|
-
* (copy, paste, split, close, clear, PTY toggle, pause toggle).
|
|
8
|
-
*/
|
|
9
|
-
export declare function createDefaultResttyPaneContextMenuItems<TPane extends ResttyPaneWithApp>(options: CreateDefaultResttyPaneContextMenuItemsOptions<TPane>): Array<ResttyPaneContextMenuItem | "separator">;
|
|
10
|
-
/**
|
|
11
|
-
* Create a pane manager that owns a split-pane layout inside a root
|
|
12
|
-
* element. Handles pane creation, splitting, resizing, focus
|
|
13
|
-
* tracking, keyboard shortcuts, and context menus.
|
|
14
|
-
*/
|
|
15
|
-
export declare function createResttyPaneManager<TPane extends ResttyPaneDefinition>(options: CreateResttyPaneManagerOptions<TPane>): ResttyPaneManager<TPane>;
|
package/dist/app/restty.d.ts
DELETED
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import type { InputHandler, MouseMode } from "../input";
|
|
2
|
-
import type { GhosttyTheme } from "../theme";
|
|
3
|
-
import { type CreateResttyAppPaneManagerOptions, type ResttyManagedAppPane, type ResttyManagedPaneStyleOptions, type ResttyPaneAppOptionsInput } from "./pane-app-manager";
|
|
4
|
-
import type { ResttyPaneManager, ResttyPaneSplitDirection } from "./panes";
|
|
5
|
-
import type { ResttyFontSource } from "./types";
|
|
6
|
-
/**
|
|
7
|
-
* Top-level configuration for creating a Restty instance.
|
|
8
|
-
*/
|
|
9
|
-
export type ResttyOptions = Omit<CreateResttyAppPaneManagerOptions, "appOptions"> & {
|
|
10
|
-
/** Per-pane app options, static or factory. */
|
|
11
|
-
appOptions?: CreateResttyAppPaneManagerOptions["appOptions"];
|
|
12
|
-
/** Font sources applied to every pane. */
|
|
13
|
-
fontSources?: ResttyPaneAppOptionsInput["fontSources"];
|
|
14
|
-
/** Whether to create the first pane automatically (default true). */
|
|
15
|
-
createInitialPane?: boolean | {
|
|
16
|
-
focus?: boolean;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
/** Current Restty plugin API version. */
|
|
20
|
-
export declare const RESTTY_PLUGIN_API_VERSION = 1;
|
|
21
|
-
/** Plugin API version requirements. */
|
|
22
|
-
export type ResttyPluginApiRange = {
|
|
23
|
-
min: number;
|
|
24
|
-
max?: number;
|
|
25
|
-
};
|
|
26
|
-
/** Optional compatibility requirements declared by plugins. */
|
|
27
|
-
export type ResttyPluginRequires = {
|
|
28
|
-
pluginApi?: number | ResttyPluginApiRange;
|
|
29
|
-
};
|
|
30
|
-
/** Diagnostics snapshot for a plugin. */
|
|
31
|
-
export type ResttyPluginInfo = {
|
|
32
|
-
id: string;
|
|
33
|
-
version: string | null;
|
|
34
|
-
apiVersion: number | null;
|
|
35
|
-
requires: ResttyPluginRequires | null;
|
|
36
|
-
active: boolean;
|
|
37
|
-
activatedAt: number | null;
|
|
38
|
-
lastError: string | null;
|
|
39
|
-
listeners: number;
|
|
40
|
-
inputInterceptors: number;
|
|
41
|
-
outputInterceptors: number;
|
|
42
|
-
lifecycleHooks: number;
|
|
43
|
-
renderHooks: number;
|
|
44
|
-
};
|
|
45
|
-
/** Declarative plugin manifest entry for registry-based loading. */
|
|
46
|
-
export type ResttyPluginManifestEntry = {
|
|
47
|
-
id: string;
|
|
48
|
-
enabled?: boolean;
|
|
49
|
-
options?: unknown;
|
|
50
|
-
};
|
|
51
|
-
/** Provider entry for plugin registry lookups. */
|
|
52
|
-
export type ResttyPluginRegistryEntry = ResttyPlugin | (() => ResttyPlugin | Promise<ResttyPlugin>);
|
|
53
|
-
/** Registry shape accepted by loadPlugins. */
|
|
54
|
-
export type ResttyPluginRegistry = ReadonlyMap<string, ResttyPluginRegistryEntry> | Record<string, ResttyPluginRegistryEntry>;
|
|
55
|
-
/** Status for manifest-driven plugin load attempts. */
|
|
56
|
-
export type ResttyPluginLoadStatus = "loaded" | "skipped" | "missing" | "failed";
|
|
57
|
-
/** Result row returned by loadPlugins. */
|
|
58
|
-
export type ResttyPluginLoadResult = {
|
|
59
|
-
id: string;
|
|
60
|
-
status: ResttyPluginLoadStatus;
|
|
61
|
-
error: string | null;
|
|
62
|
-
};
|
|
63
|
-
/** Event payloads emitted by the Restty plugin host. */
|
|
64
|
-
export type ResttyPluginEvents = {
|
|
65
|
-
"plugin:activated": {
|
|
66
|
-
pluginId: string;
|
|
67
|
-
};
|
|
68
|
-
"plugin:deactivated": {
|
|
69
|
-
pluginId: string;
|
|
70
|
-
};
|
|
71
|
-
"pane:created": {
|
|
72
|
-
paneId: number;
|
|
73
|
-
};
|
|
74
|
-
"pane:closed": {
|
|
75
|
-
paneId: number;
|
|
76
|
-
};
|
|
77
|
-
"pane:split": {
|
|
78
|
-
sourcePaneId: number;
|
|
79
|
-
createdPaneId: number;
|
|
80
|
-
direction: ResttyPaneSplitDirection;
|
|
81
|
-
};
|
|
82
|
-
"pane:active-changed": {
|
|
83
|
-
paneId: number | null;
|
|
84
|
-
};
|
|
85
|
-
"layout:changed": {};
|
|
86
|
-
"pane:resized": {
|
|
87
|
-
paneId: number;
|
|
88
|
-
cols: number;
|
|
89
|
-
rows: number;
|
|
90
|
-
};
|
|
91
|
-
"pane:focused": {
|
|
92
|
-
paneId: number;
|
|
93
|
-
};
|
|
94
|
-
"pane:blurred": {
|
|
95
|
-
paneId: number;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
/** A disposable resource returned by plugin APIs. */
|
|
99
|
-
export type ResttyPluginDisposable = {
|
|
100
|
-
dispose: () => void;
|
|
101
|
-
};
|
|
102
|
-
/** Optional cleanup return supported by plugin activation. */
|
|
103
|
-
export type ResttyPluginCleanup = void | (() => void) | ResttyPluginDisposable;
|
|
104
|
-
/** Payload passed to input interceptors before terminal/program input is written. */
|
|
105
|
-
export type ResttyInputInterceptorPayload = {
|
|
106
|
-
paneId: number;
|
|
107
|
-
text: string;
|
|
108
|
-
source: string;
|
|
109
|
-
};
|
|
110
|
-
/** Payload passed to output interceptors before PTY data is rendered. */
|
|
111
|
-
export type ResttyOutputInterceptorPayload = {
|
|
112
|
-
paneId: number;
|
|
113
|
-
text: string;
|
|
114
|
-
source: string;
|
|
115
|
-
};
|
|
116
|
-
/** Input interceptor contract. */
|
|
117
|
-
export type ResttyInputInterceptor = (payload: ResttyInputInterceptorPayload) => string | null | void;
|
|
118
|
-
/** Output interceptor contract. */
|
|
119
|
-
export type ResttyOutputInterceptor = (payload: ResttyOutputInterceptorPayload) => string | null | void;
|
|
120
|
-
/** Payload passed to lifecycle hooks registered by plugins. */
|
|
121
|
-
export type ResttyLifecycleHookPayload = {
|
|
122
|
-
phase: "before" | "after";
|
|
123
|
-
action: "create-initial-pane" | "split-active-pane" | "split-pane" | "close-pane" | "set-active-pane" | "mark-pane-focused" | "connect-pty" | "disconnect-pty" | "resize" | "focus" | "blur";
|
|
124
|
-
paneId?: number | null;
|
|
125
|
-
sourcePaneId?: number;
|
|
126
|
-
createdPaneId?: number | null;
|
|
127
|
-
direction?: ResttyPaneSplitDirection;
|
|
128
|
-
cols?: number;
|
|
129
|
-
rows?: number;
|
|
130
|
-
ok?: boolean;
|
|
131
|
-
error?: string | null;
|
|
132
|
-
};
|
|
133
|
-
/** Lifecycle hook contract. */
|
|
134
|
-
export type ResttyLifecycleHook = (payload: ResttyLifecycleHookPayload) => void;
|
|
135
|
-
/** Payload passed to render hooks registered by plugins. */
|
|
136
|
-
export type ResttyRenderHookPayload = {
|
|
137
|
-
phase: "before" | "after";
|
|
138
|
-
paneId: number;
|
|
139
|
-
text: string;
|
|
140
|
-
source: string;
|
|
141
|
-
dropped: boolean;
|
|
142
|
-
};
|
|
143
|
-
/** Render hook contract. */
|
|
144
|
-
export type ResttyRenderHook = (payload: ResttyRenderHookPayload) => void;
|
|
145
|
-
/** Shared options for interceptor ordering. */
|
|
146
|
-
export type ResttyInterceptorOptions = {
|
|
147
|
-
priority?: number;
|
|
148
|
-
};
|
|
149
|
-
/** Context object provided to each plugin on activation. */
|
|
150
|
-
export type ResttyPluginContext = {
|
|
151
|
-
restty: Restty;
|
|
152
|
-
options: unknown;
|
|
153
|
-
panes: () => ResttyPaneHandle[];
|
|
154
|
-
pane: (id: number) => ResttyPaneHandle | null;
|
|
155
|
-
activePane: () => ResttyPaneHandle | null;
|
|
156
|
-
focusedPane: () => ResttyPaneHandle | null;
|
|
157
|
-
on: <E extends keyof ResttyPluginEvents>(event: E, listener: (payload: ResttyPluginEvents[E]) => void) => ResttyPluginDisposable;
|
|
158
|
-
addInputInterceptor: (interceptor: ResttyInputInterceptor, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
159
|
-
addOutputInterceptor: (interceptor: ResttyOutputInterceptor, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
160
|
-
addLifecycleHook: (hook: ResttyLifecycleHook, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
161
|
-
addRenderHook: (hook: ResttyRenderHook, options?: ResttyInterceptorOptions) => ResttyPluginDisposable;
|
|
162
|
-
};
|
|
163
|
-
/** Plugin contract for extending Restty behavior. */
|
|
164
|
-
export type ResttyPlugin = {
|
|
165
|
-
id: string;
|
|
166
|
-
version?: string;
|
|
167
|
-
apiVersion?: number;
|
|
168
|
-
requires?: ResttyPluginRequires;
|
|
169
|
-
activate: (context: ResttyPluginContext, options?: unknown) => ResttyPluginCleanup | Promise<ResttyPluginCleanup>;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Public API surface exposed by each pane handle.
|
|
173
|
-
*/
|
|
174
|
-
export type ResttyPaneApi = {
|
|
175
|
-
id: number;
|
|
176
|
-
setRenderer: (value: "auto" | "webgpu" | "webgl2") => void;
|
|
177
|
-
setPaused: (value: boolean) => void;
|
|
178
|
-
togglePause: () => void;
|
|
179
|
-
setFontSize: (value: number) => void;
|
|
180
|
-
applyTheme: (theme: GhosttyTheme, sourceLabel?: string) => void;
|
|
181
|
-
resetTheme: () => void;
|
|
182
|
-
sendInput: (text: string, source?: string) => void;
|
|
183
|
-
sendKeyInput: (text: string, source?: string) => void;
|
|
184
|
-
clearScreen: () => void;
|
|
185
|
-
connectPty: (url?: string) => void;
|
|
186
|
-
disconnectPty: () => void;
|
|
187
|
-
isPtyConnected: () => boolean;
|
|
188
|
-
setMouseMode: (value: MouseMode) => void;
|
|
189
|
-
getMouseStatus: () => ReturnType<InputHandler["getMouseStatus"]>;
|
|
190
|
-
copySelectionToClipboard: () => Promise<boolean>;
|
|
191
|
-
pasteFromClipboard: () => Promise<boolean>;
|
|
192
|
-
dumpAtlasForCodepoint: (cp: number) => void;
|
|
193
|
-
resize: (cols: number, rows: number) => void;
|
|
194
|
-
focus: () => void;
|
|
195
|
-
blur: () => void;
|
|
196
|
-
updateSize: (force?: boolean) => void;
|
|
197
|
-
getBackend: () => string;
|
|
198
|
-
getRawPane: () => ResttyManagedAppPane;
|
|
199
|
-
};
|
|
200
|
-
/**
|
|
201
|
-
* Thin wrapper around a managed pane that delegates calls to the
|
|
202
|
-
* underlying app. Resolves the pane lazily so it stays valid across
|
|
203
|
-
* layout changes.
|
|
204
|
-
*/
|
|
205
|
-
export declare class ResttyPaneHandle implements ResttyPaneApi {
|
|
206
|
-
private readonly resolvePane;
|
|
207
|
-
constructor(resolvePane: () => ResttyManagedAppPane);
|
|
208
|
-
get id(): number;
|
|
209
|
-
setRenderer(value: "auto" | "webgpu" | "webgl2"): void;
|
|
210
|
-
setPaused(value: boolean): void;
|
|
211
|
-
togglePause(): void;
|
|
212
|
-
setFontSize(value: number): void;
|
|
213
|
-
applyTheme(theme: GhosttyTheme, sourceLabel?: string): void;
|
|
214
|
-
resetTheme(): void;
|
|
215
|
-
sendInput(text: string, source?: string): void;
|
|
216
|
-
sendKeyInput(text: string, source?: string): void;
|
|
217
|
-
clearScreen(): void;
|
|
218
|
-
connectPty(url?: string): void;
|
|
219
|
-
disconnectPty(): void;
|
|
220
|
-
isPtyConnected(): boolean;
|
|
221
|
-
setMouseMode(value: MouseMode): void;
|
|
222
|
-
getMouseStatus(): ReturnType<InputHandler["getMouseStatus"]>;
|
|
223
|
-
copySelectionToClipboard(): Promise<boolean>;
|
|
224
|
-
pasteFromClipboard(): Promise<boolean>;
|
|
225
|
-
dumpAtlasForCodepoint(cp: number): void;
|
|
226
|
-
resize(cols: number, rows: number): void;
|
|
227
|
-
focus(): void;
|
|
228
|
-
blur(): void;
|
|
229
|
-
updateSize(force?: boolean): void;
|
|
230
|
-
getBackend(): string;
|
|
231
|
-
getRawPane(): ResttyManagedAppPane;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Main entry point for the restty terminal widget. Manages a set of
|
|
235
|
-
* split panes, each running its own terminal app, and exposes
|
|
236
|
-
* convenience methods that operate on the active pane.
|
|
237
|
-
*/
|
|
238
|
-
export declare class Restty {
|
|
239
|
-
readonly paneManager: ResttyPaneManager<ResttyManagedAppPane>;
|
|
240
|
-
private fontSources;
|
|
241
|
-
private readonly pluginListeners;
|
|
242
|
-
private readonly pluginRuntimes;
|
|
243
|
-
private readonly pluginDiagnostics;
|
|
244
|
-
private readonly inputInterceptors;
|
|
245
|
-
private readonly outputInterceptors;
|
|
246
|
-
private readonly lifecycleHooks;
|
|
247
|
-
private readonly renderHooks;
|
|
248
|
-
private nextInterceptorId;
|
|
249
|
-
private nextInterceptorOrder;
|
|
250
|
-
constructor(options: ResttyOptions);
|
|
251
|
-
getPanes(): ResttyManagedAppPane[];
|
|
252
|
-
getPaneById(id: number): ResttyManagedAppPane | null;
|
|
253
|
-
getActivePane(): ResttyManagedAppPane | null;
|
|
254
|
-
getFocusedPane(): ResttyManagedAppPane | null;
|
|
255
|
-
panes(): ResttyPaneHandle[];
|
|
256
|
-
pane(id: number): ResttyPaneHandle | null;
|
|
257
|
-
activePane(): ResttyPaneHandle | null;
|
|
258
|
-
focusedPane(): ResttyPaneHandle | null;
|
|
259
|
-
forEachPane(visitor: (pane: ResttyPaneHandle) => void): void;
|
|
260
|
-
setFontSources(sources: ResttyFontSource[]): Promise<void>;
|
|
261
|
-
createInitialPane(options?: {
|
|
262
|
-
focus?: boolean;
|
|
263
|
-
}): ResttyManagedAppPane;
|
|
264
|
-
splitActivePane(direction: ResttyPaneSplitDirection): ResttyManagedAppPane | null;
|
|
265
|
-
splitPane(id: number, direction: ResttyPaneSplitDirection): ResttyManagedAppPane | null;
|
|
266
|
-
closePane(id: number): boolean;
|
|
267
|
-
getPaneStyleOptions(): Readonly<Required<ResttyManagedPaneStyleOptions>>;
|
|
268
|
-
setPaneStyleOptions(options: ResttyManagedPaneStyleOptions): void;
|
|
269
|
-
setActivePane(id: number, options?: {
|
|
270
|
-
focus?: boolean;
|
|
271
|
-
}): void;
|
|
272
|
-
markPaneFocused(id: number, options?: {
|
|
273
|
-
focus?: boolean;
|
|
274
|
-
}): void;
|
|
275
|
-
requestLayoutSync(): void;
|
|
276
|
-
hideContextMenu(): void;
|
|
277
|
-
use(plugin: ResttyPlugin, options?: unknown): Promise<void>;
|
|
278
|
-
loadPlugins(manifest: ReadonlyArray<ResttyPluginManifestEntry>, registry: ResttyPluginRegistry): Promise<ResttyPluginLoadResult[]>;
|
|
279
|
-
unuse(pluginId: string): boolean;
|
|
280
|
-
plugins(): string[];
|
|
281
|
-
pluginInfo(pluginId: string): ResttyPluginInfo | null;
|
|
282
|
-
pluginInfo(): ResttyPluginInfo[];
|
|
283
|
-
destroy(): void;
|
|
284
|
-
connectPty(url?: string): void;
|
|
285
|
-
disconnectPty(): void;
|
|
286
|
-
isPtyConnected(): boolean;
|
|
287
|
-
setRenderer(value: "auto" | "webgpu" | "webgl2"): void;
|
|
288
|
-
setPaused(value: boolean): void;
|
|
289
|
-
togglePause(): void;
|
|
290
|
-
setFontSize(value: number): void;
|
|
291
|
-
applyTheme(theme: GhosttyTheme, sourceLabel?: string): void;
|
|
292
|
-
resetTheme(): void;
|
|
293
|
-
sendInput(text: string, source?: string): void;
|
|
294
|
-
sendKeyInput(text: string, source?: string): void;
|
|
295
|
-
clearScreen(): void;
|
|
296
|
-
setMouseMode(value: MouseMode): void;
|
|
297
|
-
getMouseStatus(): ReturnType<InputHandler["getMouseStatus"]>;
|
|
298
|
-
copySelectionToClipboard(): Promise<boolean>;
|
|
299
|
-
pasteFromClipboard(): Promise<boolean>;
|
|
300
|
-
dumpAtlasForCodepoint(cp: number): void;
|
|
301
|
-
resize(cols: number, rows: number): void;
|
|
302
|
-
focus(): void;
|
|
303
|
-
blur(): void;
|
|
304
|
-
updateSize(force?: boolean): void;
|
|
305
|
-
getBackend(): string;
|
|
306
|
-
private makePaneHandle;
|
|
307
|
-
private requirePaneById;
|
|
308
|
-
private requireActivePaneHandle;
|
|
309
|
-
private createPluginContext;
|
|
310
|
-
private attachRuntimeDisposer;
|
|
311
|
-
private addInputInterceptor;
|
|
312
|
-
private addOutputInterceptor;
|
|
313
|
-
private addLifecycleHook;
|
|
314
|
-
private addRenderHook;
|
|
315
|
-
private registerInterceptor;
|
|
316
|
-
private applyInputInterceptors;
|
|
317
|
-
private applyOutputInterceptors;
|
|
318
|
-
private runLifecycleHooks;
|
|
319
|
-
private runRenderHooks;
|
|
320
|
-
private applyInterceptors;
|
|
321
|
-
private runHooks;
|
|
322
|
-
private normalizePluginMetadata;
|
|
323
|
-
private assertPluginCompatibility;
|
|
324
|
-
private lookupPluginRegistryEntry;
|
|
325
|
-
private resolvePluginRegistryEntry;
|
|
326
|
-
private setPluginLoadError;
|
|
327
|
-
private updatePluginDiagnostic;
|
|
328
|
-
private buildPluginInfo;
|
|
329
|
-
private errorToMessage;
|
|
330
|
-
private onPluginEvent;
|
|
331
|
-
private emitPluginEvent;
|
|
332
|
-
private teardownPluginRuntime;
|
|
333
|
-
private normalizePluginCleanup;
|
|
334
|
-
}
|
|
335
|
-
/** Create a new Restty instance with the given options. */
|
|
336
|
-
export declare function createRestty(options: ResttyOptions): Restty;
|
package/dist/fonts/manager.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { FontEntry, FontManagerState, ShapedCluster, FallbackFontSource, FontScaleOverride } from "./types";
|
|
2
|
-
/** Check whether a font entry is a symbol/icon font based on its label. */
|
|
3
|
-
export declare function isSymbolFont(entry: FontEntry | null | undefined): boolean;
|
|
4
|
-
/** Check whether a font entry is a Nerd Font symbols font. */
|
|
5
|
-
export declare function isNerdSymbolFont(entry: FontEntry | null | undefined): boolean;
|
|
6
|
-
/** Check whether a font entry is a color emoji font. */
|
|
7
|
-
export declare function isColorEmojiFont(entry: FontEntry | null | undefined): boolean;
|
|
8
|
-
/** Return the maximum cell span for a font (2 for CJK/emoji, 1 otherwise). */
|
|
9
|
-
export declare function fontMaxCellSpan(entry: FontEntry | null | undefined): number;
|
|
10
|
-
/** Return the scale multiplier for a font entry by matching its label against overrides. */
|
|
11
|
-
export declare function fontScaleOverride(entry: FontEntry | null | undefined, overrides?: FontScaleOverride[]): number;
|
|
12
|
-
/** Compute the atlas raster scale for a font, applying symbol atlas scaling for fallback symbol fonts. */
|
|
13
|
-
export declare function fontRasterScale(entry: FontEntry | null | undefined, fontIndex: number, maxSymbolAtlasScale: number, overrides?: FontScaleOverride[]): number;
|
|
14
|
-
/** Create a new FontEntry with empty caches and default metadata. */
|
|
15
|
-
export declare function createFontEntry(font: any, label: string): FontEntry;
|
|
16
|
-
/** Clear all caches and reset rendering metadata on a font entry. */
|
|
17
|
-
export declare function resetFontEntry(entry: FontEntry): void;
|
|
18
|
-
/** Create an empty FontManagerState for initialization. */
|
|
19
|
-
export declare function createFontManagerState(): FontManagerState;
|
|
20
|
-
/** Check whether a font has a non-zero glyph ID for the given character. */
|
|
21
|
-
export declare function fontHasGlyph(font: any, ch: string): boolean;
|
|
22
|
-
/** Get the horizontal advance width in font design units, computing and caching it if needed. */
|
|
23
|
-
export declare function fontAdvanceUnits(entry: FontEntry, shapeClusterWithFont: (entry: FontEntry, text: string) => ShapedCluster): number;
|
|
24
|
-
/** Get the bounding-box width of a glyph in font design units, with caching. */
|
|
25
|
-
export declare function glyphWidthUnits(entry: FontEntry, glyphId: number | undefined | null): number;
|
|
26
|
-
/**
|
|
27
|
-
* Select the best font index from the manager's font list for rendering the
|
|
28
|
-
* given text cluster, searching in fallback order similar to Ghostty.
|
|
29
|
-
*/
|
|
30
|
-
export declare function pickFontIndexForText(state: FontManagerState, text: string, expectedSpan: number): number;
|
|
31
|
-
/** Fetch a font file from a URL and return its ArrayBuffer, or null on failure. */
|
|
32
|
-
export declare function tryFetchFontBuffer(url: string): Promise<ArrayBuffer | null>;
|
|
33
|
-
/** Query locally installed fonts via the Local Font Access API and return the first match, or null. */
|
|
34
|
-
export declare function tryLocalFontBuffer(matchers: string[]): Promise<ArrayBuffer | null>;
|
|
35
|
-
/**
|
|
36
|
-
* Load the primary font buffer, trying local Nerd Font matchers first,
|
|
37
|
-
* then a remote fallback URL, then broader local font matchers. Throws
|
|
38
|
-
* if all sources fail.
|
|
39
|
-
*/
|
|
40
|
-
export declare function loadPrimaryFontBuffer(localMatchers: string[], fallbackUrl: string, fallbackLocalMatchers: string[]): Promise<ArrayBuffer>;
|
|
41
|
-
/** Load fallback font buffers from a list of sources, trying remote URLs then local matchers. */
|
|
42
|
-
export declare function loadFallbackFontBuffers(sources: FallbackFontSource[]): Promise<{
|
|
43
|
-
name: string;
|
|
44
|
-
buffer: ArrayBuffer;
|
|
45
|
-
}[]>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { WebGPUCoreState, WebGPUState, WebGLState } from "./types";
|
|
2
|
-
/** Initialize shared WebGPU core state (device, pipelines, vertex buffer) from a canvas. */
|
|
3
|
-
export declare function initWebGPUCore(canvas: HTMLCanvasElement): Promise<WebGPUCoreState | null>;
|
|
4
|
-
/**
|
|
5
|
-
* Initialize a full WebGPU renderer state for a canvas, including context,
|
|
6
|
-
* uniform buffer, and bind groups. Accepts an optional pre-initialized core.
|
|
7
|
-
*/
|
|
8
|
-
export declare function initWebGPU(canvas: HTMLCanvasElement, options?: {
|
|
9
|
-
core?: WebGPUCoreState | null;
|
|
10
|
-
}): Promise<WebGPUState | null>;
|
|
11
|
-
/** Initialize a WebGL2 fallback renderer state from a canvas. */
|
|
12
|
-
export declare function initWebGL(canvas: HTMLCanvasElement): WebGLState | null;
|
|
13
|
-
/** Grow a WebGPU instance buffer if the required byte length exceeds current capacity. */
|
|
14
|
-
export declare function ensureInstanceBuffer(state: WebGPUState, kind: "rect" | "glyph", byteLength: number): void;
|
|
15
|
-
/** Re-configure the WebGPU canvas context with the current device and format. */
|
|
16
|
-
export declare function configureContext(state: WebGPUState): void;
|
|
17
|
-
/** Grow a WebGL instance buffer if the required byte length exceeds current capacity. */
|
|
18
|
-
export declare function ensureGLInstanceBuffer(state: WebGLState, kind: "rect" | "glyph", byteLength: number): void;
|
|
19
|
-
/** Create the initial resize tracking state with default values. */
|
|
20
|
-
export declare function createResizeState(): {
|
|
21
|
-
active: boolean;
|
|
22
|
-
lastAt: number;
|
|
23
|
-
cols: number;
|
|
24
|
-
rows: number;
|
|
25
|
-
dpr: number;
|
|
26
|
-
};
|
|
27
|
-
/** Create the initial scrollbar position state with default values. */
|
|
28
|
-
export declare function createScrollbarState(): {
|
|
29
|
-
lastInputAt: number;
|
|
30
|
-
lastTotal: number;
|
|
31
|
-
lastOffset: number;
|
|
32
|
-
lastLen: number;
|
|
33
|
-
};
|
package/dist/restty-input.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./input/index";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|