@jitl/opentui-core 0.1.97 → 0.2.15
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/NativeSpanFeed.d.ts +2 -2
- package/README.md +2 -1
- package/Renderable.d.ts +12 -1
- package/audio.d.ts +89 -0
- package/buffer.d.ts +6 -5
- package/console.d.ts +3 -1
- package/edit-buffer.d.ts +1 -1
- package/editor-view.d.ts +1 -1
- package/{index-yxe6e14n.js → index-46f5e8m6.js} +1388 -1721
- package/index-46f5e8m6.js.map +36 -0
- package/index-5zwezmgj.js +639 -0
- package/index-5zwezmgj.js.map +11 -0
- package/index-axv7cw60.js +44 -0
- package/index-axv7cw60.js.map +10 -0
- package/{index-rhfjv9c1.js → index-g9agybj3.js} +4626 -984
- package/index-g9agybj3.js.map +82 -0
- package/index-k18nf2r7.js +21 -0
- package/{ffi-x3zvcksd.js.map → index-k18nf2r7.js.map} +1 -1
- package/{index-tkk6cmr2.js → index-rp7vz5rh.js} +125 -23
- package/index-rp7vz5rh.js.map +10 -0
- package/{index-kcpn1hka.js → index-xwsdfq5x.js} +16 -6
- package/index-xwsdfq5x.js.map +10 -0
- package/index.d.ts +1 -0
- package/index.js +37 -17
- package/index.js.map +1 -1
- package/lib/RGBA.d.ts +22 -6
- package/lib/clipboard.d.ts +1 -1
- package/lib/{keymapping.d.ts → keybinding.internal.d.ts} +10 -2
- package/lib/objects-in-viewport.d.ts +4 -4
- package/lib/parse.keypress-kitty.d.ts +1 -0
- package/lib/parse.keypress.d.ts +1 -0
- package/lib/render-geometry.d.ts +8 -0
- package/lib/stdin-parser.d.ts +4 -1
- package/lib/terminal-capability-detection.d.ts +2 -0
- package/lib/terminal-palette.d.ts +20 -5
- package/lib/tree-sitter/assets/update.d.ts +1 -0
- package/lib/tree-sitter/client.d.ts +2 -0
- package/lib/tree-sitter/default-parsers.d.ts +1 -1
- package/lib/tree-sitter/index.d.ts +0 -2
- package/lib/tree-sitter/update-assets.d.ts +3 -0
- package/lib/tree-sitter/update-assets.js +377 -0
- package/lib/tree-sitter/update-assets.js.map +12 -0
- package/lib/tree-sitter-styled-text.d.ts +6 -4
- package/node22-bun-ffi-structs-ha8fmzzb.js +396 -0
- package/node22-bun-ffi-structs-ha8fmzzb.js.map +10 -0
- package/package.json +23 -22
- package/parser.worker.js +161 -24
- package/parser.worker.js.map +12 -5
- package/platform/bun-ffi-structs.d.ts +2 -0
- package/platform/ffi.d.ts +126 -0
- package/platform/node22-bun-ffi-structs.d.ts +33 -0
- package/platform/node22-ffi.d.ts +33 -0
- package/{compat → platform}/runtime.d.ts +6 -0
- package/platform/worker.d.ts +4 -0
- package/renderables/Code.d.ts +4 -0
- package/renderables/Markdown.d.ts +62 -0
- package/renderables/ScrollBox.d.ts +1 -0
- package/renderables/Select.d.ts +3 -1
- package/renderables/TabSelect.d.ts +3 -1
- package/renderables/TextBufferRenderable.d.ts +1 -0
- package/renderables/TextTable.d.ts +15 -1
- package/renderables/Textarea.d.ts +5 -3
- package/renderables/markdown-parser.d.ts +1 -0
- package/renderer-theme-mode.d.ts +29 -0
- package/renderer.d.ts +142 -16
- package/runtime-plugin-support-configure.d.ts +4 -0
- package/runtime-plugin-support-configure.js +20 -0
- package/{index-re3ntm60.js.map → runtime-plugin-support-configure.js.map} +1 -1
- package/runtime-plugin-support.d.ts +3 -3
- package/runtime-plugin-support.js +9 -18
- package/runtime-plugin-support.js.map +3 -3
- package/runtime-plugin.d.ts +1 -4
- package/runtime-plugin.js +5 -5
- package/syntax-style.d.ts +11 -3
- package/testing/terminal-capabilities.d.ts +7 -0
- package/testing/test-recorder.d.ts +6 -6
- package/testing/test-renderer.d.ts +34 -2
- package/testing.d.ts +2 -0
- package/testing.js +329 -23
- package/testing.js.map +7 -5
- package/text-buffer-view.d.ts +2 -1
- package/text-buffer.d.ts +1 -1
- package/types.d.ts +33 -1
- package/zig-structs.d.ts +111 -20
- package/zig.d.ts +57 -7
- package/3d/SpriteResourceManager.d.ts +0 -74
- package/3d/SpriteUtils.d.ts +0 -13
- package/3d/TextureUtils.d.ts +0 -24
- package/3d/ThreeRenderable.d.ts +0 -40
- package/3d/WGPURenderer.d.ts +0 -61
- package/3d/animation/ExplodingSpriteEffect.d.ts +0 -71
- package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +0 -76
- package/3d/animation/SpriteAnimator.d.ts +0 -124
- package/3d/animation/SpriteParticleGenerator.d.ts +0 -62
- package/3d/canvas.d.ts +0 -44
- package/3d/index.d.ts +0 -12
- package/3d/physics/PlanckPhysicsAdapter.d.ts +0 -19
- package/3d/physics/RapierPhysicsAdapter.d.ts +0 -19
- package/3d/physics/physics-interface.d.ts +0 -27
- package/3d.d.ts +0 -2
- package/3d.js +0 -33843
- package/3d.js.map +0 -155
- package/Worker-vajwjk0s.js +0 -94
- package/Worker-vajwjk0s.js.map +0 -10
- package/compat/FFIType.d.ts +0 -304
- package/compat/Worker.d.ts +0 -1
- package/compat/bun-ffi-structs.d.ts +0 -2
- package/compat/ffi.d.ts +0 -86
- package/compat/nodejs/Worker.d.ts +0 -16
- package/compat/nodejs/bun-ffi-structs/index.d.ts +0 -46
- package/compat/nodejs/ffi.d.ts +0 -21
- package/compat/nodejs/registerResolveJs.d.ts +0 -1
- package/compat/nodejs/runtime.d.ts +0 -7
- package/compat/nodejs/test.d.ts +0 -4
- package/compat/nodejs/trampoline.worker.d.ts +0 -1
- package/compat/test.d.ts +0 -1
- package/compat/testHelpers.d.ts +0 -18
- package/ffi-x3zvcksd.js +0 -25
- package/index-5yqvbmcz.js +0 -220
- package/index-5yqvbmcz.js.map +0 -10
- package/index-bnfz2g63.js +0 -654
- package/index-bnfz2g63.js.map +0 -10
- package/index-cbvybypy.js +0 -43
- package/index-cbvybypy.js.map +0 -10
- package/index-kcpn1hka.js.map +0 -10
- package/index-re3ntm60.js +0 -51
- package/index-rhfjv9c1.js.map +0 -70
- package/index-tkk6cmr2.js.map +0 -10
- package/index-yxe6e14n.js.map +0 -42
- package/runtime-hdpkc6qf.js +0 -220
- package/runtime-hdpkc6qf.js.map +0 -17
- /package/{compat/nodejs/registerBun.d.ts → native-event-worker-repro.worker.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -4,13 +4,12 @@ import {
|
|
|
4
4
|
ASCIIFont,
|
|
5
5
|
ASCIIFontRenderable,
|
|
6
6
|
ArrowRenderable,
|
|
7
|
+
Audio,
|
|
7
8
|
BloomEffect,
|
|
8
9
|
Box,
|
|
9
|
-
BoxRenderable,
|
|
10
10
|
CRTRollingBarEffect,
|
|
11
11
|
CloudsEffect,
|
|
12
12
|
Code,
|
|
13
|
-
CodeRenderable,
|
|
14
13
|
DEUTERANOPIA_COMP_MATRIX,
|
|
15
14
|
DEUTERANOPIA_SIM_MATRIX,
|
|
16
15
|
DiffRenderable,
|
|
@@ -31,7 +30,6 @@ import {
|
|
|
31
30
|
PROTANOPIA_COMP_MATRIX,
|
|
32
31
|
PROTANOPIA_SIM_MATRIX,
|
|
33
32
|
RainbowTextEffect,
|
|
34
|
-
RootTextNodeRenderable,
|
|
35
33
|
SEPIA_MATRIX,
|
|
36
34
|
SOLARIZATION_MATRIX,
|
|
37
35
|
SYNTHWAVE_MATRIX,
|
|
@@ -44,7 +42,6 @@ import {
|
|
|
44
42
|
SliderRenderable,
|
|
45
43
|
SlotRegistry,
|
|
46
44
|
SlotRenderable,
|
|
47
|
-
SyntaxStyle,
|
|
48
45
|
TECHNICOLOR_MATRIX,
|
|
49
46
|
TRITANOPIA_COMP_MATRIX,
|
|
50
47
|
TRITANOPIA_SIM_MATRIX,
|
|
@@ -52,10 +49,6 @@ import {
|
|
|
52
49
|
TabSelectRenderable,
|
|
53
50
|
TabSelectRenderableEvents,
|
|
54
51
|
Text,
|
|
55
|
-
TextBufferRenderable,
|
|
56
|
-
TextBufferView,
|
|
57
|
-
TextNodeRenderable,
|
|
58
|
-
TextRenderable,
|
|
59
52
|
TextTableRenderable,
|
|
60
53
|
TextareaRenderable,
|
|
61
54
|
TimeToFirstDrawRenderable,
|
|
@@ -70,16 +63,16 @@ import {
|
|
|
70
63
|
applyNoise,
|
|
71
64
|
applySaturation,
|
|
72
65
|
applyScanlines,
|
|
73
|
-
convertThemeToStyles,
|
|
74
66
|
createCoreSlotRegistry,
|
|
75
67
|
createSlotRegistry,
|
|
76
68
|
createTimeline,
|
|
69
|
+
defaultTextareaKeyBindings,
|
|
77
70
|
engine,
|
|
78
|
-
isTextNodeRenderable,
|
|
79
71
|
registerCorePlugin,
|
|
80
72
|
resolveCoreSlot,
|
|
73
|
+
setupAudio,
|
|
81
74
|
vstyles
|
|
82
|
-
} from "./index-
|
|
75
|
+
} from "./index-46f5e8m6.js";
|
|
83
76
|
import {
|
|
84
77
|
ASCIIFontSelectionHelper,
|
|
85
78
|
ATTRIBUTE_BASE_BITS,
|
|
@@ -87,9 +80,13 @@ import {
|
|
|
87
80
|
BaseRenderable,
|
|
88
81
|
BorderCharArrays,
|
|
89
82
|
BorderChars,
|
|
83
|
+
BoxRenderable,
|
|
90
84
|
CliRenderEvents,
|
|
91
85
|
CliRenderer,
|
|
86
|
+
CodeRenderable,
|
|
92
87
|
ConsolePosition,
|
|
88
|
+
DEFAULT_BACKGROUND_RGB,
|
|
89
|
+
DEFAULT_FOREGROUND_RGB,
|
|
93
90
|
DataPathsManager,
|
|
94
91
|
DebugOverlayCorner,
|
|
95
92
|
EditBuffer,
|
|
@@ -114,17 +111,24 @@ import {
|
|
|
114
111
|
RenderableEvents,
|
|
115
112
|
RendererControlState,
|
|
116
113
|
RootRenderable,
|
|
114
|
+
RootTextNodeRenderable,
|
|
117
115
|
Selection,
|
|
118
116
|
StdinParser,
|
|
119
117
|
StyledText,
|
|
118
|
+
SyntaxStyle,
|
|
120
119
|
SystemClock,
|
|
121
120
|
TargetChannel,
|
|
122
121
|
TerminalConsole,
|
|
123
122
|
TerminalPalette,
|
|
124
123
|
TextAttributes,
|
|
125
124
|
TextBuffer,
|
|
125
|
+
TextBufferRenderable,
|
|
126
|
+
TextBufferView,
|
|
127
|
+
TextNodeRenderable,
|
|
128
|
+
TextRenderable,
|
|
126
129
|
TreeSitterClient,
|
|
127
130
|
addDefaultParsers,
|
|
131
|
+
ansi256IndexToRgb,
|
|
128
132
|
attributesWithLink,
|
|
129
133
|
basenameToFiletype,
|
|
130
134
|
bg,
|
|
@@ -150,9 +154,11 @@ import {
|
|
|
150
154
|
brightWhite,
|
|
151
155
|
brightYellow,
|
|
152
156
|
buildKittyKeyboardFlags,
|
|
157
|
+
buildTerminalPaletteSignature,
|
|
153
158
|
capture,
|
|
154
159
|
clearEnvCache,
|
|
155
160
|
convertGlobalToLocalSelection,
|
|
161
|
+
convertThemeToStyles,
|
|
156
162
|
coordinateToCharacterIndex,
|
|
157
163
|
createCliRenderer,
|
|
158
164
|
createExtmarksController,
|
|
@@ -189,15 +195,18 @@ import {
|
|
|
189
195
|
isEditBufferRenderable,
|
|
190
196
|
isRenderable,
|
|
191
197
|
isStyledText,
|
|
198
|
+
isTextNodeRenderable,
|
|
192
199
|
isVNode,
|
|
193
200
|
isValidBorderStyle,
|
|
194
201
|
italic,
|
|
195
202
|
link,
|
|
196
203
|
magenta,
|
|
197
|
-
main,
|
|
198
204
|
maybeMakeRenderable,
|
|
199
205
|
measureText,
|
|
200
206
|
nonAlphanumericKeys,
|
|
207
|
+
normalizeColorValue,
|
|
208
|
+
normalizeIndexedColorIndex,
|
|
209
|
+
normalizeTerminalPalette,
|
|
201
210
|
parseAlign,
|
|
202
211
|
parseAlignItems,
|
|
203
212
|
parseBorderStyle,
|
|
@@ -229,6 +238,7 @@ import {
|
|
|
229
238
|
stringToStyledText,
|
|
230
239
|
stripAnsiSequences,
|
|
231
240
|
t,
|
|
241
|
+
terminalNamedSingleStrokeKeys,
|
|
232
242
|
treeSitterToStyledText,
|
|
233
243
|
treeSitterToTextChunks,
|
|
234
244
|
underline,
|
|
@@ -236,23 +246,24 @@ import {
|
|
|
236
246
|
white,
|
|
237
247
|
wrapWithDelegates,
|
|
238
248
|
yellow
|
|
239
|
-
} from "./index-
|
|
240
|
-
import"./index-
|
|
241
|
-
import"./index-
|
|
249
|
+
} from "./index-g9agybj3.js";
|
|
250
|
+
import"./index-5zwezmgj.js";
|
|
251
|
+
import"./index-k18nf2r7.js";
|
|
242
252
|
export {
|
|
243
253
|
yellow,
|
|
244
254
|
wrapWithDelegates,
|
|
245
255
|
white,
|
|
246
256
|
vstyles,
|
|
247
257
|
visualizeRenderableTree,
|
|
248
|
-
main as updateAssets,
|
|
249
258
|
underline,
|
|
250
259
|
treeSitterToTextChunks,
|
|
251
260
|
treeSitterToStyledText,
|
|
261
|
+
terminalNamedSingleStrokeKeys,
|
|
252
262
|
t,
|
|
253
263
|
stripAnsiSequences,
|
|
254
264
|
stringToStyledText,
|
|
255
265
|
strikethrough,
|
|
266
|
+
setupAudio,
|
|
256
267
|
setRenderLibPath,
|
|
257
268
|
rgbToHex,
|
|
258
269
|
reverse,
|
|
@@ -282,6 +293,9 @@ export {
|
|
|
282
293
|
parseBorderStyle,
|
|
283
294
|
parseAlignItems,
|
|
284
295
|
parseAlign,
|
|
296
|
+
normalizeTerminalPalette,
|
|
297
|
+
normalizeIndexedColorIndex,
|
|
298
|
+
normalizeColorValue,
|
|
285
299
|
nonAlphanumericKeys,
|
|
286
300
|
measureText,
|
|
287
301
|
maybeMakeRenderable,
|
|
@@ -320,6 +334,7 @@ export {
|
|
|
320
334
|
dim,
|
|
321
335
|
detectLinks,
|
|
322
336
|
delegate,
|
|
337
|
+
defaultTextareaKeyBindings,
|
|
323
338
|
decodePasteBytes,
|
|
324
339
|
cyan,
|
|
325
340
|
createTimeline,
|
|
@@ -334,6 +349,7 @@ export {
|
|
|
334
349
|
convertGlobalToLocalSelection,
|
|
335
350
|
clearEnvCache,
|
|
336
351
|
capture,
|
|
352
|
+
buildTerminalPaletteSignature,
|
|
337
353
|
buildKittyKeyboardFlags,
|
|
338
354
|
brightYellow,
|
|
339
355
|
brightWhite,
|
|
@@ -367,6 +383,7 @@ export {
|
|
|
367
383
|
applyChromaticAberration,
|
|
368
384
|
applyBrightness,
|
|
369
385
|
applyAsciiArt,
|
|
386
|
+
ansi256IndexToRgb,
|
|
370
387
|
addDefaultParsers,
|
|
371
388
|
exports_src as Yoga,
|
|
372
389
|
VignetteEffect,
|
|
@@ -454,6 +471,8 @@ export {
|
|
|
454
471
|
DataPathsManager,
|
|
455
472
|
DEUTERANOPIA_SIM_MATRIX,
|
|
456
473
|
DEUTERANOPIA_COMP_MATRIX,
|
|
474
|
+
DEFAULT_FOREGROUND_RGB,
|
|
475
|
+
DEFAULT_BACKGROUND_RGB,
|
|
457
476
|
ConsolePosition,
|
|
458
477
|
CodeRenderable,
|
|
459
478
|
Code,
|
|
@@ -467,6 +486,7 @@ export {
|
|
|
467
486
|
BorderCharArrays,
|
|
468
487
|
BloomEffect,
|
|
469
488
|
BaseRenderable,
|
|
489
|
+
Audio,
|
|
470
490
|
ArrowRenderable,
|
|
471
491
|
ATTRIBUTE_BASE_MASK,
|
|
472
492
|
ATTRIBUTE_BASE_BITS,
|
|
@@ -476,5 +496,5 @@ export {
|
|
|
476
496
|
ACHROMATOPSIA_MATRIX
|
|
477
497
|
};
|
|
478
498
|
|
|
479
|
-
//# debugId=
|
|
499
|
+
//# debugId=5776EF784D8C968A64756E2164756E21
|
|
480
500
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
package/lib/RGBA.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
export type RGBTriplet = readonly [number, number, number];
|
|
2
|
+
export type ColorIntent = "rgb" | "indexed" | "default";
|
|
3
|
+
export type ColorInput = string | RGBA;
|
|
4
|
+
export declare const DEFAULT_FOREGROUND_RGB: RGBTriplet;
|
|
5
|
+
export declare const DEFAULT_BACKGROUND_RGB: RGBTriplet;
|
|
6
|
+
export interface NormalizedColorValue {
|
|
7
|
+
rgba: RGBA;
|
|
8
|
+
}
|
|
9
|
+
export declare function normalizeIndexedColorIndex(index: number): number;
|
|
10
|
+
export declare function ansi256IndexToRgb(index: number): RGBTriplet;
|
|
1
11
|
export declare class RGBA {
|
|
2
|
-
|
|
3
|
-
buffer:
|
|
4
|
-
|
|
5
|
-
static fromArray(array: Float32Array): RGBA;
|
|
12
|
+
buffer: Uint16Array;
|
|
13
|
+
constructor(buffer: Uint16Array);
|
|
14
|
+
static fromArray(array: Uint16Array): RGBA;
|
|
6
15
|
static fromValues(r: number, g: number, b: number, a?: number): RGBA;
|
|
16
|
+
static clone(rgba: RGBA): RGBA;
|
|
7
17
|
static fromInts(r: number, g: number, b: number, a?: number): RGBA;
|
|
8
18
|
static fromHex(hex: string): RGBA;
|
|
19
|
+
static fromIndex(index: number, snapshot?: ColorInput): RGBA;
|
|
20
|
+
static defaultForeground(snapshot?: ColorInput): RGBA;
|
|
21
|
+
static defaultBackground(snapshot?: ColorInput): RGBA;
|
|
9
22
|
toInts(): [number, number, number, number];
|
|
10
23
|
get r(): number;
|
|
11
24
|
set r(value: number);
|
|
@@ -15,11 +28,14 @@ export declare class RGBA {
|
|
|
15
28
|
set b(value: number);
|
|
16
29
|
get a(): number;
|
|
17
30
|
set a(value: number);
|
|
18
|
-
|
|
31
|
+
get meta(): number;
|
|
32
|
+
get intent(): ColorIntent;
|
|
33
|
+
get slot(): number;
|
|
34
|
+
map<R>(fn: (value: number) => R): [R, R, R, R];
|
|
19
35
|
toString(): string;
|
|
20
36
|
equals(other?: RGBA): boolean;
|
|
21
37
|
}
|
|
22
|
-
export
|
|
38
|
+
export declare function normalizeColorValue(value: ColorInput | null | undefined): NormalizedColorValue | null;
|
|
23
39
|
export declare function hexToRgb(hex: string): RGBA;
|
|
24
40
|
export declare function rgbToHex(rgb: RGBA): string;
|
|
25
41
|
export declare function hsvToRgb(h: number, s: number, v: number): RGBA;
|
package/lib/clipboard.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface KeyBindingLike {
|
|
2
2
|
name: string;
|
|
3
3
|
ctrl?: boolean;
|
|
4
4
|
shift?: boolean;
|
|
5
5
|
meta?: boolean;
|
|
6
6
|
super?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface KeyBinding<Action extends string = string> extends KeyBindingLike {
|
|
7
9
|
action: Action;
|
|
8
10
|
}
|
|
11
|
+
export interface KeyBindingLookup extends KeyBindingLike {
|
|
12
|
+
baseCode?: number;
|
|
13
|
+
}
|
|
9
14
|
export type KeyAliasMap = Record<string, string>;
|
|
10
15
|
export declare const defaultKeyAliases: KeyAliasMap;
|
|
11
16
|
export declare function mergeKeyAliases(defaults: KeyAliasMap, custom: KeyAliasMap): KeyAliasMap;
|
|
12
17
|
export declare function mergeKeyBindings<Action extends string>(defaults: KeyBinding<Action>[], custom: KeyBinding<Action>[]): KeyBinding<Action>[];
|
|
13
|
-
export declare function getKeyBindingKey
|
|
18
|
+
export declare function getKeyBindingKey(binding: KeyBindingLike): string;
|
|
19
|
+
export declare function getKeyBindingKeys(binding: KeyBindingLookup): string[];
|
|
20
|
+
export declare function getKeyBindingAction<Action extends string>(map: Map<string, Action>, binding: KeyBindingLookup): Action | undefined;
|
|
21
|
+
export declare function matchesKeyBinding(binding: KeyBindingLookup, match: KeyBindingLike): boolean;
|
|
14
22
|
export declare function buildKeyBindingsMap<Action extends string>(bindings: KeyBinding<Action>[], aliasMap?: KeyAliasMap): Map<string, Action>;
|
|
15
23
|
/**
|
|
16
24
|
* Converts a key binding to a human-readable string representation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ViewportBounds } from "../types.js";
|
|
2
2
|
interface ViewportObject {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
screenX: number;
|
|
4
|
+
screenY: number;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
zIndex: number;
|
|
@@ -10,14 +10,14 @@ interface ViewportObject {
|
|
|
10
10
|
* Returns objects that overlap with the viewport bounds.
|
|
11
11
|
*
|
|
12
12
|
* @param viewport - The viewport bounds to check against
|
|
13
|
-
* @param objects - Array of objects MUST be sorted by position (
|
|
13
|
+
* @param objects - Array of objects MUST be sorted by screen position (screenY for column, screenX for row direction)
|
|
14
14
|
* @param direction - Primary scroll direction: "column" (vertical) or "row" (horizontal)
|
|
15
15
|
* @param padding - Extra padding around viewport to include nearby objects
|
|
16
16
|
* @param minTriggerSize - Minimum array size to use binary search optimization
|
|
17
17
|
* @returns Array of visible objects sorted by zIndex
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Objects must be pre-sorted by their start position (
|
|
20
|
+
* Objects must be pre-sorted by their start screen position (screenY for column direction, screenX for row direction).
|
|
21
21
|
* Unsorted input will produce incorrect results.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getObjectsInViewport<T extends ViewportObject>(viewport: ViewportBounds, objects: T[], direction?: "row" | "column", padding?: number, minTriggerSize?: number): T[];
|
package/lib/parse.keypress.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type RenderGeometryScreenMode = "alternate-screen" | "main-screen" | "split-footer";
|
|
2
|
+
export interface RenderGeometry {
|
|
3
|
+
effectiveFooterHeight: number;
|
|
4
|
+
renderOffset: number;
|
|
5
|
+
renderWidth: number;
|
|
6
|
+
renderHeight: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function calculateRenderGeometry(screenMode: RenderGeometryScreenMode, terminalWidth: number, terminalHeight: number, footerHeight: number): RenderGeometry;
|
package/lib/stdin-parser.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type ParsedKey } from "./parse.keypress.js";
|
|
|
3
3
|
import { type RawMouseEvent } from "./parse.mouse.js";
|
|
4
4
|
import type { PasteMetadata } from "./paste.js";
|
|
5
5
|
export { SystemClock, type Clock, type TimerHandle } from "./clock.js";
|
|
6
|
-
export type StdinResponseProtocol = "csi" | "osc" | "dcs" | "apc" | "unknown";
|
|
6
|
+
export type StdinResponseProtocol = "csi" | "cpr" | "osc" | "dcs" | "apc" | "unknown";
|
|
7
7
|
export type StdinEvent = {
|
|
8
8
|
type: "key";
|
|
9
9
|
raw: string;
|
|
@@ -27,6 +27,7 @@ export interface StdinParserProtocolContext {
|
|
|
27
27
|
privateCapabilityRepliesActive: boolean;
|
|
28
28
|
pixelResolutionQueryActive: boolean;
|
|
29
29
|
explicitWidthCprActive: boolean;
|
|
30
|
+
startupCursorCprActive: boolean;
|
|
30
31
|
}
|
|
31
32
|
export interface StdinParserOptions {
|
|
32
33
|
timeoutMs?: number;
|
|
@@ -60,6 +61,8 @@ export declare class StdinParser {
|
|
|
60
61
|
constructor(options?: StdinParserOptions);
|
|
61
62
|
get bufferCapacity(): number;
|
|
62
63
|
updateProtocolContext(patch: Partial<StdinParserProtocolContext>): void;
|
|
64
|
+
private getAbortableStartupCursorCprState;
|
|
65
|
+
abortPendingStartupCursorCpr(): void;
|
|
63
66
|
push(data: Uint8Array): void;
|
|
64
67
|
read(): StdinEvent | null;
|
|
65
68
|
drain(onEvent: (event: StdinEvent) => void): void;
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* - Kitty Keyboard Query: ESC[?Nu where N is 0,1,2,etc
|
|
10
10
|
* - DA1 (Device Attributes): ESC[?...c
|
|
11
11
|
* - Pixel Resolution: ESC[4;height;widtht
|
|
12
|
+
* - OSC 99 notification capability query response
|
|
13
|
+
* - iTerm2 OSC 1337 feature-reporting response
|
|
12
14
|
*/
|
|
13
15
|
/**
|
|
14
16
|
* Check if a sequence is a terminal capability response.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RGBA } from "./RGBA.js";
|
|
1
2
|
import { type Clock } from "./clock.js";
|
|
2
3
|
type Hex = string | null;
|
|
3
4
|
export type WriteFunction = (data: string | Buffer) => boolean;
|
|
@@ -22,21 +23,33 @@ export interface TerminalPaletteDetector {
|
|
|
22
23
|
detectOSCSupport(timeoutMs?: number): Promise<boolean>;
|
|
23
24
|
cleanup(): void;
|
|
24
25
|
}
|
|
26
|
+
export interface NormalizedTerminalPalette {
|
|
27
|
+
palette: RGBA[];
|
|
28
|
+
defaultForeground: RGBA;
|
|
29
|
+
defaultBackground: RGBA;
|
|
30
|
+
}
|
|
25
31
|
export type OscSubscriptionSource = {
|
|
26
32
|
subscribeOsc(handler: (sequence: string) => void): () => void;
|
|
27
33
|
};
|
|
34
|
+
export interface TerminalPaletteOptions {
|
|
35
|
+
stdin: NodeJS.ReadStream;
|
|
36
|
+
stdout: NodeJS.WriteStream;
|
|
37
|
+
writeFn?: WriteFunction;
|
|
38
|
+
isLegacyTmux?: boolean;
|
|
39
|
+
isTmux?: boolean;
|
|
40
|
+
oscSource?: OscSubscriptionSource;
|
|
41
|
+
clock?: Clock;
|
|
42
|
+
}
|
|
28
43
|
export declare class TerminalPalette implements TerminalPaletteDetector {
|
|
29
44
|
private stdin;
|
|
30
45
|
private stdout;
|
|
31
46
|
private writeFn;
|
|
32
47
|
private activeQuerySessions;
|
|
33
48
|
private inLegacyTmux;
|
|
49
|
+
private inTmux;
|
|
34
50
|
private oscSource?;
|
|
35
51
|
private readonly clock;
|
|
36
|
-
constructor(
|
|
37
|
-
/**
|
|
38
|
-
* Write an OSC sequence, wrapping for tmux if needed
|
|
39
|
-
*/
|
|
52
|
+
constructor(options: TerminalPaletteOptions);
|
|
40
53
|
private writeOsc;
|
|
41
54
|
cleanup(): void;
|
|
42
55
|
private subscribeInput;
|
|
@@ -46,5 +59,7 @@ export declare class TerminalPalette implements TerminalPaletteDetector {
|
|
|
46
59
|
private querySpecialColors;
|
|
47
60
|
detect(options?: GetPaletteOptions): Promise<TerminalColors>;
|
|
48
61
|
}
|
|
49
|
-
export declare function createTerminalPalette(
|
|
62
|
+
export declare function createTerminalPalette(options: TerminalPaletteOptions): TerminalPaletteDetector;
|
|
63
|
+
export declare function normalizeTerminalPalette(colors?: TerminalColors | null): NormalizedTerminalPalette;
|
|
64
|
+
export declare function buildTerminalPaletteSignature(colors?: TerminalColors | null): string;
|
|
50
65
|
export {};
|
|
@@ -19,9 +19,11 @@ export declare class TreeSitterClient extends EventEmitter<TreeSitterClientEvent
|
|
|
19
19
|
private emitError;
|
|
20
20
|
private emitWarning;
|
|
21
21
|
private startWorker;
|
|
22
|
+
private resolveWorkerPath;
|
|
22
23
|
private stopWorker;
|
|
23
24
|
private handleReset;
|
|
24
25
|
initialize(): Promise<void>;
|
|
26
|
+
private initializeClient;
|
|
25
27
|
private registerDefaultParsers;
|
|
26
28
|
private resolvePath;
|
|
27
29
|
addFiletypeParser(filetypeParser: FiletypeParserOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FiletypeParserOptions } from "./types.js";
|
|
2
|
-
export declare function getParsers(): FiletypeParserOptions[]
|
|
2
|
+
export declare function getParsers(): Promise<FiletypeParserOptions[]>;
|
|
@@ -3,6 +3,4 @@ export * from "./client.js";
|
|
|
3
3
|
export * from "../tree-sitter-styled-text.js";
|
|
4
4
|
export * from "./types.js";
|
|
5
5
|
export * from "./resolve-ft.js";
|
|
6
|
-
export type { UpdateOptions } from "./assets/update.js";
|
|
7
|
-
export { updateAssets } from "./assets/update.js";
|
|
8
6
|
export declare function getTreeSitterClient(): TreeSitterClient;
|