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
package/dist/surface/restty.d.ts
CHANGED
|
@@ -1,63 +1,48 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import type { ResttyFontSource, ResttyShaderStage } from "../runtime/types";
|
|
5
|
-
import { ResttyPaneHandle } from "./restty-pane-handle";
|
|
1
|
+
import type { ResttyFontInput, ResttyShaderStage } from "../runtime/core/models";
|
|
2
|
+
import type { ResttyManagedPaneManager, ResttyManagedPaneSearchUiStyleOptions, ResttyManagedPaneStyleOptions } from "./panes/managed-pane-types";
|
|
3
|
+
import { ResttyPaneHandle } from "./restty/pane-handle";
|
|
6
4
|
import { ResttyActivePaneApi } from "./restty/active-pane-api";
|
|
7
|
-
import { type ResttyPluginInfo, type ResttyPluginManifestEntry, type ResttyPluginRegistry, type ResttyPluginLoadResult
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
appOptions?: CreateResttyAppPaneManagerOptions["appOptions"];
|
|
18
|
-
/** Font sources applied to every pane. */
|
|
19
|
-
fontSources?: ResttyPaneAppOptionsInput["fontSources"];
|
|
20
|
-
/** Global shader stages synchronized to all panes. */
|
|
21
|
-
shaderStages?: ResttyShaderStage[];
|
|
22
|
-
/** Global handler for desktop notifications emitted by any pane. */
|
|
23
|
-
onDesktopNotification?: (notification: DesktopNotification & {
|
|
24
|
-
paneId: number;
|
|
25
|
-
}) => void;
|
|
26
|
-
/** Whether to create the first pane automatically (default true). */
|
|
27
|
-
createInitialPane?: boolean | {
|
|
28
|
-
focus?: boolean;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
5
|
+
import { type ResttyPluginInfo, type ResttyPluginManifestEntry, type ResttyPluginRegistry, type ResttyPluginLoadResult } from "./plugins/types";
|
|
6
|
+
import type { ResttyRenderStageHandle, ResttyPlugin } from "./plugins/context.types";
|
|
7
|
+
import type { ResttyConfig } from "./restty/config";
|
|
8
|
+
import type { ResttySurfacePane } from "./restty/events";
|
|
9
|
+
export { ResttyPaneHandle } from "./restty/pane-handle";
|
|
10
|
+
export type { ResttyPaneApi } from "./restty/pane-handle";
|
|
11
|
+
export { RESTTY_PLUGIN_API_VERSION } from "./plugins/types";
|
|
12
|
+
export type { ResttyPluginApiRange, ResttyPluginRequires, ResttyPluginInfo, ResttyPluginManifestEntry, ResttyPluginRegistryEntry, ResttyPluginRegistry, ResttyPluginLoadStatus, ResttyPluginLoadResult, ResttyPluginEvents, ResttyPluginDisposable, ResttyPluginCleanup, ResttyPluginHostApi, ResttyInputInterceptorPayload, ResttyOutputInterceptorPayload, ResttyInputInterceptor, ResttyOutputInterceptor, ResttyLifecycleHookPayload, ResttyLifecycleHook, ResttyRenderHookPayload, ResttyRenderHook, ResttyInterceptorOptions, ResttyRenderStageHandle, ResttyPluginContext, ResttyPlugin, } from "./plugins/types";
|
|
13
|
+
export type { ResttyConfig, ResttyServicesConfig, ResttyServicesConfigInput, ResttySurfaceConfig, } from "./restty/config";
|
|
14
|
+
export type { ResttySurfaceEvents, ResttySurfacePane } from "./restty/events";
|
|
31
15
|
/**
|
|
32
16
|
* Main entry point for the restty terminal widget. Manages a set of
|
|
33
|
-
* split panes, each running its own terminal
|
|
17
|
+
* split panes, each running its own terminal runtime, and exposes
|
|
34
18
|
* convenience methods that operate on the active pane.
|
|
35
19
|
*/
|
|
36
20
|
export declare class Restty extends ResttyActivePaneApi {
|
|
37
|
-
readonly paneManager:
|
|
38
|
-
private
|
|
21
|
+
readonly paneManager: ResttyManagedPaneManager;
|
|
22
|
+
private fonts;
|
|
39
23
|
private readonly shaderOps;
|
|
40
|
-
private readonly
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
private readonly controller;
|
|
25
|
+
private readonly paneLookupOps;
|
|
26
|
+
constructor(options: ResttyConfig);
|
|
27
|
+
getPanes(): ResttySurfacePane[];
|
|
28
|
+
getPaneById(id: number): ResttySurfacePane | null;
|
|
29
|
+
getActivePane(): ResttySurfacePane | null;
|
|
30
|
+
getFocusedPane(): ResttySurfacePane | null;
|
|
46
31
|
panes(): ResttyPaneHandle[];
|
|
47
32
|
pane(id: number): ResttyPaneHandle | null;
|
|
48
33
|
activePane(): ResttyPaneHandle | null;
|
|
49
34
|
focusedPane(): ResttyPaneHandle | null;
|
|
50
35
|
forEachPane(visitor: (pane: ResttyPaneHandle) => void): void;
|
|
51
|
-
|
|
36
|
+
setFonts(fonts: ResttyFontInput[]): Promise<void>;
|
|
52
37
|
setShaderStages(stages: ResttyShaderStage[]): void;
|
|
53
38
|
getShaderStages(): ResttyShaderStage[];
|
|
54
39
|
addShaderStage(stage: ResttyShaderStage): ResttyRenderStageHandle;
|
|
55
40
|
removeShaderStage(id: string): boolean;
|
|
56
41
|
createInitialPane(options?: {
|
|
57
42
|
focus?: boolean;
|
|
58
|
-
}):
|
|
59
|
-
splitActivePane(direction: ResttyPaneSplitDirection):
|
|
60
|
-
splitPane(id: number, direction: ResttyPaneSplitDirection):
|
|
43
|
+
}): ResttySurfacePane;
|
|
44
|
+
splitActivePane(direction: ResttyPaneSplitDirection): ResttySurfacePane | null;
|
|
45
|
+
splitPane(id: number, direction: ResttyPaneSplitDirection): ResttySurfacePane | null;
|
|
61
46
|
closePane(id: number): boolean;
|
|
62
47
|
getPaneStyleOptions(): Readonly<Required<ResttyManagedPaneStyleOptions>>;
|
|
63
48
|
setPaneStyleOptions(options: ResttyManagedPaneStyleOptions): void;
|
|
@@ -83,13 +68,7 @@ export declare class Restty extends ResttyActivePaneApi {
|
|
|
83
68
|
resize(cols: number, rows: number): void;
|
|
84
69
|
focus(): void;
|
|
85
70
|
blur(): void;
|
|
86
|
-
private paneLookup;
|
|
87
|
-
private lifecycleHooks;
|
|
88
|
-
private lifecycleAndPluginHooks;
|
|
89
71
|
protected requireActivePaneHandle(): ResttyPaneHandle;
|
|
90
|
-
private runLifecycleHooks;
|
|
91
|
-
private runRenderHooks;
|
|
92
|
-
private emitPluginEvent;
|
|
93
72
|
}
|
|
94
73
|
/** Create a new Restty instance with the given options. */
|
|
95
|
-
export declare function createRestty(options:
|
|
74
|
+
export declare function createRestty(options: ResttyConfig): Restty;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createPaneSearchUiController } from "./controller";
|
|
2
|
+
export type { CreatePaneSearchUiControllerOptions, PaneSearchUiController, ResttyPaneSearchUiCloseOptions, ResttyPaneSearchUiOpenOptions, ResttyPaneSearchUiOptions, ResttyPaneSearchUiPane, ResttyPaneSearchUiShortcutOptions, ResttyPaneSearchUiStyleOptions, } from "./types";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ResttyPaneSearchUiStyleOptions } from "./types";
|
|
2
|
+
export declare function normalizeSearchUiStyleOptions(options: ResttyPaneSearchUiStyleOptions | undefined): Required<ResttyPaneSearchUiStyleOptions>;
|
|
3
|
+
export declare function ensurePaneSearchUiStyles(doc: Document): void;
|
|
4
|
+
export declare function applySearchUiStyleOptions(root: HTMLElement, options: Readonly<Required<ResttyPaneSearchUiStyleOptions>>): void;
|
|
5
|
+
export declare function clearSearchUiStyleOptions(root: HTMLElement): void;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type
|
|
3
|
-
setSearchQuery: (query: string) => void;
|
|
4
|
-
clearSearch: () => void;
|
|
5
|
-
searchNext: () => void;
|
|
6
|
-
searchPrevious: () => void;
|
|
7
|
-
getSearchState: () => ResttySearchState;
|
|
8
|
-
};
|
|
1
|
+
import type { ResttyRuntimeSearchApi } from "../../runtime/core/api";
|
|
2
|
+
import type { ResttySearchState } from "../../runtime/core/models";
|
|
9
3
|
export type ResttyPaneSearchUiPane = {
|
|
10
4
|
id: number;
|
|
11
5
|
container: HTMLDivElement;
|
|
12
6
|
focusTarget?: HTMLElement | null;
|
|
13
|
-
|
|
7
|
+
setSearchQuery: ResttyRuntimeSearchApi["setQuery"];
|
|
8
|
+
clearSearch: ResttyRuntimeSearchApi["clear"];
|
|
9
|
+
searchNext: ResttyRuntimeSearchApi["next"];
|
|
10
|
+
searchPrevious: ResttyRuntimeSearchApi["previous"];
|
|
11
|
+
getSearchState: ResttyRuntimeSearchApi["getState"];
|
|
14
12
|
};
|
|
15
13
|
export type ResttyPaneSearchUiStyleOptions = {
|
|
16
14
|
offsetTopPx?: number;
|
|
@@ -69,7 +67,7 @@ export type PaneSearchUiController = {
|
|
|
69
67
|
setStyleOptions: (options: ResttyPaneSearchUiStyleOptions) => void;
|
|
70
68
|
destroy: () => void;
|
|
71
69
|
};
|
|
72
|
-
export
|
|
70
|
+
export type CreatePaneSearchUiControllerOptions = {
|
|
73
71
|
root: HTMLElement;
|
|
74
72
|
enabled?: boolean;
|
|
75
73
|
placeholder?: string;
|
|
@@ -80,8 +78,19 @@ export declare function createPaneSearchUiController(options: {
|
|
|
80
78
|
statusFormatter?: (state: ResttySearchState) => string;
|
|
81
79
|
shortcut?: boolean | ResttyPaneSearchUiShortcutOptions;
|
|
82
80
|
styles?: ResttyPaneSearchUiStyleOptions;
|
|
83
|
-
getPaneById: (paneId: number) => ResttyPaneSearchUiPane | null;
|
|
84
81
|
getActivePane: () => ResttyPaneSearchUiPane | null;
|
|
85
82
|
getFocusedPane: () => ResttyPaneSearchUiPane | null;
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
83
|
+
};
|
|
84
|
+
export type PaneSearchUiState = {
|
|
85
|
+
pane: ResttyPaneSearchUiPane;
|
|
86
|
+
root: HTMLDivElement;
|
|
87
|
+
input: HTMLInputElement;
|
|
88
|
+
prevButton: HTMLButtonElement;
|
|
89
|
+
nextButton: HTMLButtonElement;
|
|
90
|
+
clearButton: HTMLButtonElement;
|
|
91
|
+
closeButton: HTMLButtonElement;
|
|
92
|
+
status: HTMLDivElement;
|
|
93
|
+
cleanupFns: Array<() => void>;
|
|
94
|
+
state: ResttySearchState;
|
|
95
|
+
open: boolean;
|
|
96
|
+
};
|
package/dist/wasm/embedded.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const WASM_BINARY: string;
|
|
@@ -141,12 +141,6 @@ export type ResttyWasmExports = WebAssembly.Exports & {
|
|
|
141
141
|
restty_link_buffer_len?: (handle: number) => number;
|
|
142
142
|
restty_active_cursor_x?: (handle: number) => number;
|
|
143
143
|
restty_active_cursor_y?: (handle: number) => number;
|
|
144
|
-
restty_debug_scroll_left?: (handle: number) => number;
|
|
145
|
-
restty_debug_scroll_right?: (handle: number) => number;
|
|
146
|
-
restty_debug_term_cols?: (handle: number) => number;
|
|
147
|
-
restty_debug_term_rows?: (handle: number) => number;
|
|
148
|
-
restty_debug_page_cols?: (handle: number) => number;
|
|
149
|
-
restty_debug_page_rows?: (handle: number) => number;
|
|
150
144
|
restty_output_ptr?: (handle: number) => number;
|
|
151
145
|
restty_output_len?: (handle: number) => number;
|
|
152
146
|
restty_output_consume?: (handle: number, len: number) => number;
|
package/dist/xterm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Restty, type
|
|
1
|
+
import { type Restty, type ResttyConfig } from "./surface/restty";
|
|
2
2
|
export type IDisposable = {
|
|
3
3
|
dispose: () => void;
|
|
4
4
|
};
|
|
@@ -20,7 +20,7 @@ export type TerminalAddon = {
|
|
|
20
20
|
* Additional unknown keys are accepted for migration ergonomics and kept in
|
|
21
21
|
* the terminal option bag, but are not forwarded to restty internals.
|
|
22
22
|
*/
|
|
23
|
-
export type TerminalOptions = Omit<
|
|
23
|
+
export type TerminalOptions = Omit<ResttyConfig, "root"> & {
|
|
24
24
|
cols?: number;
|
|
25
25
|
rows?: number;
|
|
26
26
|
[key: string]: unknown;
|
|
@@ -32,7 +32,8 @@ export type TerminalOptions = Omit<ResttyOptions, "root"> & {
|
|
|
32
32
|
*/
|
|
33
33
|
export declare class Terminal {
|
|
34
34
|
private readonly resttyOptionsBase;
|
|
35
|
-
private readonly
|
|
35
|
+
private readonly userTerminalConfig;
|
|
36
|
+
private readonly userServicesConfig;
|
|
36
37
|
private readonly addons;
|
|
37
38
|
private readonly pendingOutput;
|
|
38
39
|
private readonly dataListeners;
|
package/dist/xterm.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRestty
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-wdme6j9c.js";
|
|
4
|
+
import"./chunk-y6hfk43b.js";
|
|
5
|
+
import"./chunk-db9dt7pr.js";
|
|
6
|
+
import"./chunk-s26trws6.js";
|
|
4
7
|
|
|
5
|
-
// src/xterm/
|
|
6
|
-
function
|
|
8
|
+
// src/xterm/compat-services.ts
|
|
9
|
+
function createCompatServicesConfig(userServicesConfig, emitData) {
|
|
7
10
|
return (context) => {
|
|
8
|
-
const resolved = typeof
|
|
11
|
+
const resolved = typeof userServicesConfig === "function" ? userServicesConfig(context) : userServicesConfig ?? {};
|
|
9
12
|
const userBeforeInput = resolved.beforeInput;
|
|
10
13
|
return {
|
|
11
14
|
...resolved,
|
|
@@ -53,7 +56,8 @@ function emitWithGuard(bucket, payload, label) {
|
|
|
53
56
|
// src/xterm.ts
|
|
54
57
|
class Terminal {
|
|
55
58
|
resttyOptionsBase;
|
|
56
|
-
|
|
59
|
+
userTerminalConfig;
|
|
60
|
+
userServicesConfig;
|
|
57
61
|
addons = new Set;
|
|
58
62
|
pendingOutput = [];
|
|
59
63
|
dataListeners = new Set;
|
|
@@ -67,9 +71,10 @@ class Terminal {
|
|
|
67
71
|
cols;
|
|
68
72
|
rows;
|
|
69
73
|
constructor(options = {}) {
|
|
70
|
-
const { cols, rows,
|
|
74
|
+
const { cols, rows, terminal, services, ...resttyOptionsBase } = options;
|
|
71
75
|
this.resttyOptionsBase = resttyOptionsBase;
|
|
72
|
-
this.
|
|
76
|
+
this.userTerminalConfig = terminal;
|
|
77
|
+
this.userServicesConfig = services;
|
|
73
78
|
this.optionValues = { ...options };
|
|
74
79
|
delete this.optionValues.cols;
|
|
75
80
|
delete this.optionValues.rows;
|
|
@@ -105,7 +110,8 @@ class Terminal {
|
|
|
105
110
|
this.elementRef = parent;
|
|
106
111
|
this.resttyInstance = createRestty({
|
|
107
112
|
...this.resttyOptionsBase,
|
|
108
|
-
|
|
113
|
+
terminal: this.userTerminalConfig,
|
|
114
|
+
services: createCompatServicesConfig(this.userServicesConfig, (data) => {
|
|
109
115
|
emitWithGuard(this.dataListeners, data, "onData");
|
|
110
116
|
}),
|
|
111
117
|
root: parent
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "restty",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Browser terminal rendering library powered by WASM, WebGPU/WebGL2, and TypeScript text shaping.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"terminal",
|
|
7
|
-
"terminal-emulator",
|
|
8
|
-
"tty",
|
|
9
6
|
"ansi",
|
|
10
|
-
"
|
|
7
|
+
"font-shaping",
|
|
11
8
|
"ghostty",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"wasm",
|
|
9
|
+
"terminal",
|
|
10
|
+
"terminal-emulator",
|
|
15
11
|
"text-shaper",
|
|
16
12
|
"text-shaping",
|
|
13
|
+
"tty",
|
|
14
|
+
"typescript",
|
|
17
15
|
"unicode",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
16
|
+
"vt",
|
|
17
|
+
"wasm",
|
|
18
|
+
"webgl2",
|
|
19
|
+
"webgpu"
|
|
20
20
|
],
|
|
21
|
-
"
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "https://github.com/wiedymi/restty"
|
|
24
|
-
},
|
|
21
|
+
"homepage": "https://github.com/wiedymi/restty#readme",
|
|
25
22
|
"bugs": {
|
|
26
23
|
"url": "https://github.com/wiedymi/restty/issues"
|
|
27
24
|
},
|
|
28
|
-
"homepage": "https://github.com/wiedymi/restty#readme",
|
|
29
25
|
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/wiedymi/restty"
|
|
29
|
+
},
|
|
30
30
|
"files": [
|
|
31
31
|
"dist",
|
|
32
32
|
"README.md",
|
|
@@ -47,25 +47,30 @@
|
|
|
47
47
|
"import": "./dist/internal.js",
|
|
48
48
|
"default": "./dist/internal.js"
|
|
49
49
|
},
|
|
50
|
+
"./internal/runtime": {
|
|
51
|
+
"types": "./dist/internal/runtime.d.ts",
|
|
52
|
+
"import": "./dist/internal/runtime.js",
|
|
53
|
+
"default": "./dist/internal/runtime.js"
|
|
54
|
+
},
|
|
55
|
+
"./internal/surface": {
|
|
56
|
+
"types": "./dist/internal/surface.d.ts",
|
|
57
|
+
"import": "./dist/internal/surface.js",
|
|
58
|
+
"default": "./dist/internal/surface.js"
|
|
59
|
+
},
|
|
50
60
|
"./xterm": {
|
|
51
61
|
"types": "./dist/xterm.d.ts",
|
|
52
62
|
"import": "./dist/xterm.js",
|
|
53
63
|
"default": "./dist/xterm.js"
|
|
54
64
|
},
|
|
65
|
+
"./headless": {
|
|
66
|
+
"types": "./dist/headless.d.ts",
|
|
67
|
+
"import": "./dist/headless.js",
|
|
68
|
+
"default": "./dist/headless.js"
|
|
69
|
+
},
|
|
55
70
|
"./esm": {
|
|
56
71
|
"types": "./dist/index.d.ts",
|
|
57
72
|
"import": "./dist/restty.esm.js",
|
|
58
73
|
"default": "./dist/restty.esm.js"
|
|
59
|
-
},
|
|
60
|
-
"./esm/internal": {
|
|
61
|
-
"types": "./dist/internal.d.ts",
|
|
62
|
-
"import": "./dist/internal.esm.js",
|
|
63
|
-
"default": "./dist/internal.esm.js"
|
|
64
|
-
},
|
|
65
|
-
"./esm/xterm": {
|
|
66
|
-
"types": "./dist/xterm.d.ts",
|
|
67
|
-
"import": "./dist/xterm.esm.js",
|
|
68
|
-
"default": "./dist/xterm.esm.js"
|
|
69
74
|
}
|
|
70
75
|
},
|
|
71
76
|
"scripts": {
|
|
@@ -77,8 +82,8 @@
|
|
|
77
82
|
"build:esm": "bun run scripts/build-esm.ts",
|
|
78
83
|
"build:types": "tsc -p tsconfig.build.json",
|
|
79
84
|
"build": "bun run build:themes && bun run clean:dist && bun run build:lib && bun run build:esm && bun run build:types",
|
|
80
|
-
"build
|
|
81
|
-
"build
|
|
85
|
+
"playground:build": "bunx vite build --config playground/vite.config.ts",
|
|
86
|
+
"pages:build": "bun run playground:build",
|
|
82
87
|
"check:themes": "bun run build:themes && git diff --exit-code -- src/theme/builtin-themes.ts",
|
|
83
88
|
"lint": "oxlint src playground scripts tests",
|
|
84
89
|
"format:base": "oxfmt src --config .oxfmtrc.json --ignore-path .gitignore --ignore-path .oxfmtignore",
|
|
@@ -87,19 +92,33 @@
|
|
|
87
92
|
"prepublishOnly": "bun run build",
|
|
88
93
|
"test": "bun test ./tests",
|
|
89
94
|
"test:ci": "bun test $(find tests -name '*.test.ts' ! -name 'webgpu-glyph.test.ts' | sort)",
|
|
90
|
-
"pty": "bun run playground/pty-server.ts",
|
|
91
95
|
"playground": "bun run scripts/playground-dev.ts",
|
|
92
|
-
"playground:
|
|
96
|
+
"playground:pty": "bun run playground/pty-server.ts",
|
|
97
|
+
"playground:preview": "bun run playground/server.ts"
|
|
93
98
|
},
|
|
94
99
|
"dependencies": {
|
|
95
|
-
"text-shaper": "0.1.
|
|
100
|
+
"text-shaper": "0.1.23"
|
|
96
101
|
},
|
|
97
102
|
"devDependencies": {
|
|
98
|
-
"@
|
|
103
|
+
"@tailwindcss/vite": "^4.2.4",
|
|
104
|
+
"@types/mdx": "^2.0.13",
|
|
105
|
+
"@types/react": "^19.2.14",
|
|
106
|
+
"@types/react-dom": "^19.2.3",
|
|
107
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
108
|
+
"@webcontainer/api": "^1.6.4",
|
|
99
109
|
"@webgpu/types": "^0.1.69",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
110
|
+
"fumadocs-core": "^16.8.7",
|
|
111
|
+
"fumadocs-mdx": "^14.3.2",
|
|
112
|
+
"fumadocs-ui": "^16.8.7",
|
|
113
|
+
"just-bash": "^2.14.4",
|
|
114
|
+
"oxfmt": "^0.47.0",
|
|
115
|
+
"oxlint": "^1.62.0",
|
|
116
|
+
"react": "^19.2.5",
|
|
117
|
+
"react-dom": "^19.2.5",
|
|
118
|
+
"react-router": "^7.14.2",
|
|
119
|
+
"tailwindcss": "^4.2.4",
|
|
102
120
|
"typescript": "^5.9.3",
|
|
121
|
+
"vite": "^8.0.10",
|
|
103
122
|
"wgpu-polyfill": "^0.1.0"
|
|
104
123
|
},
|
|
105
124
|
"engines": {
|