restty 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +4 -9
  2. package/dist/app/atlas-builder.d.ts +38 -0
  3. package/dist/app/font-sources.d.ts +2 -0
  4. package/dist/app/pane-app-manager.d.ts +43 -0
  5. package/dist/app/panes-context-menu.d.ts +10 -0
  6. package/dist/app/panes-styles.d.ts +5 -0
  7. package/dist/app/panes-types.d.ts +89 -0
  8. package/dist/app/panes.d.ts +10 -0
  9. package/dist/app/restty.d.ts +20 -0
  10. package/dist/app/session.d.ts +6 -0
  11. package/dist/app/types.d.ts +123 -0
  12. package/dist/{app/index.js → chunk-53vdvhe3.js} +24014 -23787
  13. package/dist/fonts/manager.d.ts +24 -0
  14. package/dist/fonts/nerd-constraints.d.ts +4 -0
  15. package/dist/fonts/nerd-ranges.d.ts +2 -0
  16. package/dist/fonts/types.d.ts +51 -0
  17. package/dist/grid/grid.d.ts +22 -0
  18. package/dist/grid/types.d.ts +32 -0
  19. package/dist/ime/ime.d.ts +13 -0
  20. package/dist/ime/types.d.ts +8 -0
  21. package/dist/input/ansi.d.ts +3 -0
  22. package/dist/input/mouse.d.ts +10 -0
  23. package/dist/input/output.d.ts +11 -0
  24. package/dist/input/types.d.ts +7 -0
  25. package/dist/internal.js +105 -56213
  26. package/dist/pty/kitty-media.d.ts +3 -0
  27. package/dist/pty/pty.d.ts +11 -0
  28. package/dist/pty/types.d.ts +49 -0
  29. package/dist/renderer/box-drawing-map.d.ts +4 -0
  30. package/dist/renderer/shaders.d.ts +7 -0
  31. package/dist/renderer/shapes.d.ts +42 -1
  32. package/dist/renderer/types.d.ts +43 -0
  33. package/dist/renderer/webgpu.d.ts +11 -0
  34. package/dist/restty.js +20 -0
  35. package/dist/selection/selection.d.ts +24 -0
  36. package/dist/selection/types.d.ts +13 -0
  37. package/dist/theme/catalog.d.ts +5 -0
  38. package/dist/theme/ghostty.d.ts +18 -0
  39. package/dist/unicode/ghostty-symbol-ranges.d.ts +1 -0
  40. package/dist/unicode/symbols.d.ts +6 -0
  41. package/dist/wasm/embedded.d.ts +1 -0
  42. package/dist/wasm/runtime.d.ts +29 -0
  43. package/package.json +8 -61
  44. package/dist/fonts/index.js +0 -5332
  45. package/dist/grid/index.js +0 -71
  46. package/dist/ime/index.js +0 -84
  47. package/dist/index.js +0 -56210
  48. package/dist/input/index.js +0 -1047
  49. package/dist/pty/index.js +0 -338
  50. package/dist/renderer/index.js +0 -1612
  51. package/dist/selection/index.js +0 -226
  52. package/dist/theme/index.js +0 -11218
  53. package/dist/wasm/index.js +0 -6003
@@ -1,7 +1,15 @@
1
+ /**
2
+ * WASM ABI variant identifier.
3
+ * - info: render state via single info struct
4
+ * - render: render state via separate pointer exports
5
+ * - cells: cell state via separate pointer exports
6
+ */
1
7
  export type WasmAbiKind = "info" | "render" | "cells";
8
+ /** WASM ABI variant descriptor. */
2
9
  export type WasmAbi = {
3
10
  kind: WasmAbiKind;
4
11
  };
12
+ /** Cursor state from WASM terminal core. */
5
13
  export type CursorInfo = {
6
14
  row: number;
7
15
  col: number;
@@ -11,6 +19,7 @@ export type CursorInfo = {
11
19
  wideTail: number;
12
20
  color: number;
13
21
  };
22
+ /** Kitty graphics protocol image placement descriptor. */
14
23
  export type KittyPlacement = {
15
24
  imageId: number;
16
25
  imageFormat: number;
@@ -30,6 +39,7 @@ export type KittyPlacement = {
30
39
  sourceWidth: number;
31
40
  sourceHeight: number;
32
41
  };
42
+ /** Terminal render state snapshot with typed array views into WASM memory. */
33
43
  export type RenderState = {
34
44
  rows: number;
35
45
  cols: number;
@@ -54,6 +64,7 @@ export type RenderState = {
54
64
  selectionEnd: Int16Array | null;
55
65
  cursor: CursorInfo | null;
56
66
  };
67
+ /** WASM module exports for terminal core API. */
57
68
  export type ResttyWasmExports = WebAssembly.Exports & {
58
69
  memory: WebAssembly.Memory;
59
70
  restty_create: (cols: number, rows: number, maxScrollback: number) => number;
@@ -126,30 +137,48 @@ export type ResttyWasmExports = WebAssembly.Exports & {
126
137
  restty_kitty_placement_count?: (handle: number) => number;
127
138
  restty_kitty_placements_ptr?: (handle: number) => number;
128
139
  };
140
+ /** Construction options for WASM runtime. */
129
141
  export type ResttyWasmOptions = {
130
142
  log?: (message: string) => void;
131
143
  };
144
+ /** WASM terminal core runtime with memory management and typed array caching. */
132
145
  export declare class ResttyWasm {
133
146
  readonly exports: ResttyWasmExports;
134
147
  readonly abi: WasmAbi;
135
148
  readonly memory: WebAssembly.Memory;
136
149
  private readonly renderViewCaches;
137
150
  private constructor();
151
+ /** Load and instantiate the embedded WASM module. */
138
152
  static load(options?: ResttyWasmOptions): Promise<ResttyWasm>;
153
+ /** Create a new terminal instance and return its handle. */
139
154
  create(cols: number, rows: number, maxScrollback: number): number;
155
+ /** Destroy a terminal instance and free its resources. */
140
156
  destroy(handle: number): void;
141
157
  private getRenderViewCache;
158
+ /** Resize the terminal grid. */
142
159
  resize(handle: number, cols: number, rows: number): void;
160
+ /** Set pixel dimensions for Kitty graphics protocol. */
143
161
  setPixelSize(handle: number, widthPx: number, heightPx: number): void;
162
+ /** Update internal render buffers after state changes. */
144
163
  renderUpdate(handle: number): void;
164
+ /** Scroll the viewport by delta rows. */
145
165
  scrollViewport(handle: number, delta: number): void;
166
+ /** Read and clear pending output replies from terminal. */
146
167
  drainOutput(handle: number): string;
168
+ /** Get active Kitty keyboard protocol flags. */
147
169
  getKittyKeyboardFlags(handle: number): number;
170
+ /** Get all active Kitty graphics placements. */
148
171
  getKittyPlacements(handle: number): KittyPlacement[];
172
+ /** Write text to terminal for processing. */
149
173
  write(handle: number, text: string): void;
174
+ /** Set default colors for terminal (RGB packed as 0xRRGGBB). */
150
175
  setDefaultColors(handle: number, fg: number, bg: number, cursor: number): void;
176
+ /** Set terminal color palette (RGB triples). */
151
177
  setPalette(handle: number, colors: Uint8Array, count: number): void;
178
+ /** Reset terminal palette to defaults. */
152
179
  resetPalette(handle: number): void;
180
+ /** Get current render state with cached typed array views. */
153
181
  getRenderState(handle: number): RenderState | null;
154
182
  }
183
+ /** Load and instantiate the embedded WASM module (convenience function). */
155
184
  export declare function loadResttyWasm(options?: ResttyWasmOptions): Promise<ResttyWasm>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "restty",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Browser terminal rendering library powered by WASM, WebGPU/WebGL2, and TypeScript text shaping.",
5
5
  "keywords": [
6
6
  "terminal",
@@ -33,83 +33,30 @@
33
33
  "LICENSE"
34
34
  ],
35
35
  "type": "module",
36
- "main": "./dist/index.js",
37
- "module": "./dist/index.js",
36
+ "main": "./dist/restty.js",
37
+ "module": "./dist/restty.js",
38
38
  "types": "./dist/index.d.ts",
39
39
  "exports": {
40
40
  ".": {
41
41
  "types": "./dist/index.d.ts",
42
- "import": "./dist/index.js",
43
- "default": "./dist/index.js"
42
+ "import": "./dist/restty.js",
43
+ "default": "./dist/restty.js"
44
44
  },
45
45
  "./internal": {
46
46
  "types": "./dist/internal.d.ts",
47
47
  "import": "./dist/internal.js",
48
48
  "default": "./dist/internal.js"
49
- },
50
- "./app": {
51
- "types": "./dist/app/index.d.ts",
52
- "import": "./dist/app/index.js",
53
- "default": "./dist/app/index.js"
54
- },
55
- "./pty": {
56
- "types": "./dist/pty/index.d.ts",
57
- "import": "./dist/pty/index.js",
58
- "default": "./dist/pty/index.js"
59
- },
60
- "./input": {
61
- "types": "./dist/input/index.d.ts",
62
- "import": "./dist/input/index.js",
63
- "default": "./dist/input/index.js"
64
- },
65
- "./theme": {
66
- "types": "./dist/theme/index.d.ts",
67
- "import": "./dist/theme/index.js",
68
- "default": "./dist/theme/index.js"
69
- },
70
- "./wasm": {
71
- "types": "./dist/wasm/index.d.ts",
72
- "import": "./dist/wasm/index.js",
73
- "default": "./dist/wasm/index.js"
74
- },
75
- "./fonts": {
76
- "types": "./dist/fonts/index.d.ts",
77
- "import": "./dist/fonts/index.js",
78
- "default": "./dist/fonts/index.js"
79
- },
80
- "./renderer": {
81
- "types": "./dist/renderer/index.d.ts",
82
- "import": "./dist/renderer/index.js",
83
- "default": "./dist/renderer/index.js"
84
- },
85
- "./grid": {
86
- "types": "./dist/grid/index.d.ts",
87
- "import": "./dist/grid/index.js",
88
- "default": "./dist/grid/index.js"
89
- },
90
- "./selection": {
91
- "types": "./dist/selection/index.d.ts",
92
- "import": "./dist/selection/index.js",
93
- "default": "./dist/selection/index.js"
94
- },
95
- "./ime": {
96
- "types": "./dist/ime/index.d.ts",
97
- "import": "./dist/ime/index.js",
98
- "default": "./dist/ime/index.js"
99
49
  }
100
50
  },
101
51
  "scripts": {
102
52
  "setup:wgpu-polyfill": "bun run scripts/setup-wgpu-polyfill.ts",
103
53
  "clean:dist": "rm -rf dist && mkdir -p dist",
104
54
  "build:themes": "bun run scripts/generate-builtin-themes.ts",
105
- "build:lib": "bun build ./src/index.ts ./src/internal.ts ./src/app/index.ts ./src/pty/index.ts ./src/input/index.ts ./src/theme/index.ts ./src/wasm/index.ts ./src/fonts/index.ts ./src/renderer/index.ts ./src/grid/index.ts ./src/selection/index.ts ./src/ime/index.ts --root ./src --outdir ./dist --target browser --format esm",
55
+ "build:lib": "bun run scripts/build-lib.ts",
106
56
  "build:types": "tsc -p tsconfig.build.json",
107
57
  "build": "bun run build:themes && bun run clean:dist && bun run build:lib && bun run build:types",
108
- "build:text-shaper": "bun run playground/build-text-shaper.ts",
109
- "build:restty-input": "bun run playground/build-restty-input.ts",
110
- "build:restty-wasm": "bun run playground/build-restty-wasm.ts",
111
58
  "build:playground-app": "bun run playground/build-playground-app.ts",
112
- "build:assets": "bun run build:text-shaper && bun run build:restty-input && bun run build:restty-wasm && bun run build:playground-app",
59
+ "build:assets": "bun run build:playground-app",
113
60
  "check:themes": "bun run build:themes && git diff --exit-code -- src/theme/builtin-themes.ts",
114
61
  "lint": "oxlint src playground scripts tests",
115
62
  "format:base": "oxfmt src --config .oxfmtrc.json --ignore-path .gitignore --ignore-path .oxfmtignore",
@@ -119,7 +66,7 @@
119
66
  "test": "bun test ./tests",
120
67
  "test:ci": "bun test $(find tests -name '*.test.ts' ! -name 'webgpu-glyph.test.ts' | sort)",
121
68
  "pty": "bun run playground/pty-server.ts",
122
- "playground": "bun run playground/dev-server.ts",
69
+ "playground": "bun run scripts/playground-dev.ts",
123
70
  "playground:static": "bun run playground/server.ts"
124
71
  },
125
72
  "dependencies": {