@opentui/core 0.2.0 → 0.2.2
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/buffer.d.ts +3 -3
- package/edit-buffer.d.ts +1 -1
- package/editor-view.d.ts +1 -1
- package/{index-mch6dv67.js → index-d07rkqtc.js} +252 -37
- package/{index-mch6dv67.js.map → index-d07rkqtc.js.map} +5 -5
- package/{index-mw2x3082.js → index-jv9g79dk.js} +694 -237
- package/{index-mw2x3082.js.map → index-jv9g79dk.js.map} +16 -15
- package/index-p147fdyc.js +44 -0
- package/index-p147fdyc.js.map +10 -0
- package/{index-epp5y71w.js → index-yedf4bn5.js} +3 -3
- package/index.js +2 -2
- package/lib/clipboard.d.ts +1 -1
- package/lib/terminal-palette.d.ts +12 -5
- package/package.json +14 -20
- package/platform/ffi.d.ts +64 -2
- package/renderer.d.ts +10 -4
- package/runtime-plugin-support-configure.d.ts +4 -0
- package/runtime-plugin-support-configure.js +18 -0
- package/runtime-plugin-support-configure.js.map +9 -0
- package/runtime-plugin-support.d.ts +3 -3
- package/runtime-plugin-support.js +7 -16
- package/runtime-plugin-support.js.map +3 -3
- package/runtime-plugin.js +3 -3
- package/syntax-style.d.ts +1 -1
- package/testing.js +1 -1
- package/text-buffer-view.d.ts +1 -1
- package/text-buffer.d.ts +1 -1
- package/zig-structs.d.ts +2 -2
- package/zig.d.ts +1 -1
- 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 -34041
- package/3d.js.map +0 -155
- /package/{index-epp5y71w.js.map → index-yedf4bn5.js.map} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
createRuntimePlugin
|
|
4
|
+
} from "./index-yedf4bn5.js";
|
|
5
|
+
|
|
6
|
+
// src/runtime-plugin-support-configure.ts
|
|
7
|
+
var {plugin: registerBunPlugin } = globalThis.Bun;
|
|
8
|
+
var runtimePluginSupportInstalledKey = "__opentuiCoreRuntimePluginSupportInstalled__";
|
|
9
|
+
function normalizeRewriteKey(rewrite) {
|
|
10
|
+
return `${rewrite?.nodeModulesRuntimeSpecifiers ?? true}:${rewrite?.nodeModulesBareSpecifiers ?? false}`;
|
|
11
|
+
}
|
|
12
|
+
function assertCompatibleInstall(install, options) {
|
|
13
|
+
for (const specifier of Object.keys(options.additional ?? {})) {
|
|
14
|
+
if (!install.additionalSpecifiers.has(specifier)) {
|
|
15
|
+
throw new Error(`OpenTUI Core runtime plugin support is already installed without ${specifier}. Call ensureRuntimePluginSupport({ additional }) from @opentui/core/runtime-plugin-support/configure before importing @opentui/core/runtime-plugin-support.`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (options.core && options.core !== install.core) {
|
|
19
|
+
throw new Error("OpenTUI Core runtime plugin support is already installed with a different core runtime module.");
|
|
20
|
+
}
|
|
21
|
+
if (options.rewrite && normalizeRewriteKey(options.rewrite) !== install.rewriteKey) {
|
|
22
|
+
throw new Error("OpenTUI Core runtime plugin support is already installed with different rewrite options.");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function ensureRuntimePluginSupport(options = {}) {
|
|
26
|
+
const state = globalThis;
|
|
27
|
+
const install = state[runtimePluginSupportInstalledKey];
|
|
28
|
+
if (install) {
|
|
29
|
+
assertCompatibleInstall(install, options);
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
registerBunPlugin(createRuntimePlugin(options));
|
|
33
|
+
state[runtimePluginSupportInstalledKey] = {
|
|
34
|
+
additionalSpecifiers: new Set(Object.keys(options.additional ?? {})),
|
|
35
|
+
core: options.core,
|
|
36
|
+
rewriteKey: normalizeRewriteKey(options.rewrite)
|
|
37
|
+
};
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { ensureRuntimePluginSupport };
|
|
42
|
+
|
|
43
|
+
//# debugId=09C0597CB92E654F64756E2164756E21
|
|
44
|
+
//# sourceMappingURL=index-p147fdyc.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/runtime-plugin-support-configure.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { plugin as registerBunPlugin } from \"bun\"\nimport { createRuntimePlugin, type CreateRuntimePluginOptions, type RuntimeModuleEntry } from \"./runtime-plugin.js\"\n\nconst runtimePluginSupportInstalledKey = \"__opentuiCoreRuntimePluginSupportInstalled__\"\n\ninterface RuntimePluginSupportInstall {\n additionalSpecifiers: ReadonlySet<string>\n core?: RuntimeModuleEntry\n rewriteKey: string\n}\n\ntype RuntimePluginSupportState = typeof globalThis & {\n [runtimePluginSupportInstalledKey]?: RuntimePluginSupportInstall\n}\n\nfunction normalizeRewriteKey(rewrite: CreateRuntimePluginOptions[\"rewrite\"] | undefined): string {\n return `${rewrite?.nodeModulesRuntimeSpecifiers ?? true}:${rewrite?.nodeModulesBareSpecifiers ?? false}`\n}\n\nfunction assertCompatibleInstall(install: RuntimePluginSupportInstall, options: CreateRuntimePluginOptions): void {\n for (const specifier of Object.keys(options.additional ?? {})) {\n if (!install.additionalSpecifiers.has(specifier)) {\n throw new Error(\n `OpenTUI Core runtime plugin support is already installed without ${specifier}. Call ensureRuntimePluginSupport({ additional }) from @opentui/core/runtime-plugin-support/configure before importing @opentui/core/runtime-plugin-support.`,\n )\n }\n }\n\n if (options.core && options.core !== install.core) {\n throw new Error(\"OpenTUI Core runtime plugin support is already installed with a different core runtime module.\")\n }\n\n if (options.rewrite && normalizeRewriteKey(options.rewrite) !== install.rewriteKey) {\n throw new Error(\"OpenTUI Core runtime plugin support is already installed with different rewrite options.\")\n }\n}\n\nexport function ensureRuntimePluginSupport(options: CreateRuntimePluginOptions = {}): boolean {\n const state = globalThis as RuntimePluginSupportState\n const install = state[runtimePluginSupportInstalledKey]\n\n if (install) {\n assertCompatibleInstall(install, options)\n return false\n }\n\n registerBunPlugin(createRuntimePlugin(options))\n\n state[runtimePluginSupportInstalledKey] = {\n additionalSpecifiers: new Set(Object.keys(options.additional ?? {})),\n core: options.core,\n rewriteKey: normalizeRewriteKey(options.rewrite),\n }\n return true\n}\n\nexport { createRuntimePlugin, runtimeModuleIdForSpecifier } from \"./runtime-plugin.js\"\nexport type {\n CreateRuntimePluginOptions,\n RuntimeModuleEntry,\n RuntimeModuleExports,\n RuntimeModuleLoader,\n} from \"./runtime-plugin.js\"\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAAA;AAGA,IAAM,mCAAmC;AAYzC,SAAS,mBAAmB,CAAC,SAAoE;AAAA,EAC/F,OAAO,GAAG,SAAS,gCAAgC,QAAQ,SAAS,6BAA6B;AAAA;AAGnG,SAAS,uBAAuB,CAAC,SAAsC,SAA2C;AAAA,EAChH,WAAW,aAAa,OAAO,KAAK,QAAQ,cAAc,CAAC,CAAC,GAAG;AAAA,IAC7D,IAAI,CAAC,QAAQ,qBAAqB,IAAI,SAAS,GAAG;AAAA,MAChD,MAAM,IAAI,MACR,oEAAoE,uKACtE;AAAA,IACF;AAAA,EACF;AAAA,EAEA,IAAI,QAAQ,QAAQ,QAAQ,SAAS,QAAQ,MAAM;AAAA,IACjD,MAAM,IAAI,MAAM,gGAAgG;AAAA,EAClH;AAAA,EAEA,IAAI,QAAQ,WAAW,oBAAoB,QAAQ,OAAO,MAAM,QAAQ,YAAY;AAAA,IAClF,MAAM,IAAI,MAAM,0FAA0F;AAAA,EAC5G;AAAA;AAGK,SAAS,0BAA0B,CAAC,UAAsC,CAAC,GAAY;AAAA,EAC5F,MAAM,QAAQ;AAAA,EACd,MAAM,UAAU,MAAM;AAAA,EAEtB,IAAI,SAAS;AAAA,IACX,wBAAwB,SAAS,OAAO;AAAA,IACxC,OAAO;AAAA,EACT;AAAA,EAEA,kBAAkB,oBAAoB,OAAO,CAAC;AAAA,EAE9C,MAAM,oCAAoC;AAAA,IACxC,sBAAsB,IAAI,IAAI,OAAO,KAAK,QAAQ,cAAc,CAAC,CAAC,CAAC;AAAA,IACnE,MAAM,QAAQ;AAAA,IACd,YAAY,oBAAoB,QAAQ,OAAO;AAAA,EACjD;AAAA,EACA,OAAO;AAAA;",
|
|
8
|
+
"debugId": "09C0597CB92E654F64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
exports_src
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-d07rkqtc.js";
|
|
5
5
|
import {
|
|
6
6
|
__require
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-jv9g79dk.js";
|
|
8
8
|
|
|
9
9
|
// src/runtime-plugin.ts
|
|
10
10
|
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
@@ -408,4 +408,4 @@ function createRuntimePlugin(input = {}) {
|
|
|
408
408
|
export { isCoreRuntimeModuleSpecifier, runtimeModuleIdForSpecifier, createRuntimePlugin };
|
|
409
409
|
|
|
410
410
|
//# debugId=5D58E30F1E057B9664756E2164756E21
|
|
411
|
-
//# sourceMappingURL=index-
|
|
411
|
+
//# sourceMappingURL=index-yedf4bn5.js.map
|
package/index.js
CHANGED
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
registerCorePlugin,
|
|
71
71
|
resolveCoreSlot,
|
|
72
72
|
vstyles
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-d07rkqtc.js";
|
|
74
74
|
import {
|
|
75
75
|
ASCIIFontSelectionHelper,
|
|
76
76
|
ATTRIBUTE_BASE_BITS,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
white,
|
|
246
246
|
wrapWithDelegates,
|
|
247
247
|
yellow
|
|
248
|
-
} from "./index-
|
|
248
|
+
} from "./index-jv9g79dk.js";
|
|
249
249
|
export {
|
|
250
250
|
yellow,
|
|
251
251
|
wrapWithDelegates,
|
package/lib/clipboard.d.ts
CHANGED
|
@@ -31,18 +31,25 @@ export interface NormalizedTerminalPalette {
|
|
|
31
31
|
export type OscSubscriptionSource = {
|
|
32
32
|
subscribeOsc(handler: (sequence: string) => void): () => void;
|
|
33
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
|
+
}
|
|
34
43
|
export declare class TerminalPalette implements TerminalPaletteDetector {
|
|
35
44
|
private stdin;
|
|
36
45
|
private stdout;
|
|
37
46
|
private writeFn;
|
|
38
47
|
private activeQuerySessions;
|
|
39
48
|
private inLegacyTmux;
|
|
49
|
+
private inTmux;
|
|
40
50
|
private oscSource?;
|
|
41
51
|
private readonly clock;
|
|
42
|
-
constructor(
|
|
43
|
-
/**
|
|
44
|
-
* Write an OSC sequence, wrapping for tmux if needed
|
|
45
|
-
*/
|
|
52
|
+
constructor(options: TerminalPaletteOptions);
|
|
46
53
|
private writeOsc;
|
|
47
54
|
cleanup(): void;
|
|
48
55
|
private subscribeInput;
|
|
@@ -52,7 +59,7 @@ export declare class TerminalPalette implements TerminalPaletteDetector {
|
|
|
52
59
|
private querySpecialColors;
|
|
53
60
|
detect(options?: GetPaletteOptions): Promise<TerminalColors>;
|
|
54
61
|
}
|
|
55
|
-
export declare function createTerminalPalette(
|
|
62
|
+
export declare function createTerminalPalette(options: TerminalPaletteOptions): TerminalPaletteDetector;
|
|
56
63
|
export declare function normalizeTerminalPalette(colors?: TerminalColors | null): NormalizedTerminalPalette;
|
|
57
64
|
export declare function buildTerminalPaletteSignature(colors?: TerminalColors | null): string;
|
|
58
65
|
export {};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.2",
|
|
8
8
|
"description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -18,11 +18,6 @@
|
|
|
18
18
|
"require": "./index.js",
|
|
19
19
|
"types": "./index.d.ts"
|
|
20
20
|
},
|
|
21
|
-
"./3d": {
|
|
22
|
-
"import": "./3d.js",
|
|
23
|
-
"require": "./3d.js",
|
|
24
|
-
"types": "./3d.d.ts"
|
|
25
|
-
},
|
|
26
21
|
"./testing": {
|
|
27
22
|
"import": "./testing.js",
|
|
28
23
|
"require": "./testing.js",
|
|
@@ -38,6 +33,11 @@
|
|
|
38
33
|
"require": "./runtime-plugin-support.js",
|
|
39
34
|
"types": "./runtime-plugin-support.d.ts"
|
|
40
35
|
},
|
|
36
|
+
"./runtime-plugin-support/configure": {
|
|
37
|
+
"import": "./runtime-plugin-support-configure.js",
|
|
38
|
+
"require": "./runtime-plugin-support-configure.js",
|
|
39
|
+
"types": "./runtime-plugin-support-configure.d.ts"
|
|
40
|
+
},
|
|
41
41
|
"./parser.worker": {
|
|
42
42
|
"import": "./lib/tree-sitter/parser.worker.js",
|
|
43
43
|
"require": "./lib/tree-sitter/parser.worker.js",
|
|
@@ -45,9 +45,8 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"bun-ffi-structs": "0.
|
|
49
|
-
"diff": "
|
|
50
|
-
"jimp": "1.6.0",
|
|
48
|
+
"bun-ffi-structs": "0.2.2",
|
|
49
|
+
"diff": "9.0.0",
|
|
51
50
|
"marked": "17.0.1",
|
|
52
51
|
"string-width": "7.2.0",
|
|
53
52
|
"strip-ansi": "7.1.2",
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
"@opentui/keymap": "workspace:*",
|
|
58
57
|
"@types/bun": "latest",
|
|
59
58
|
"@types/node": "^24.0.0",
|
|
60
|
-
"@types/three": "0.177.0",
|
|
61
59
|
"commander": "^13.1.0",
|
|
62
60
|
"typescript": "^5",
|
|
63
61
|
"web-tree-sitter": "0.25.10"
|
|
@@ -66,15 +64,11 @@
|
|
|
66
64
|
"web-tree-sitter": "0.25.10"
|
|
67
65
|
},
|
|
68
66
|
"optionalDependencies": {
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"@opentui/core-
|
|
74
|
-
"@opentui/core-
|
|
75
|
-
"@opentui/core-linux-x64": "0.2.0",
|
|
76
|
-
"@opentui/core-linux-arm64": "0.2.0",
|
|
77
|
-
"@opentui/core-win32-x64": "0.2.0",
|
|
78
|
-
"@opentui/core-win32-arm64": "0.2.0"
|
|
67
|
+
"@opentui/core-darwin-x64": "0.2.2",
|
|
68
|
+
"@opentui/core-darwin-arm64": "0.2.2",
|
|
69
|
+
"@opentui/core-linux-x64": "0.2.2",
|
|
70
|
+
"@opentui/core-linux-arm64": "0.2.2",
|
|
71
|
+
"@opentui/core-win32-x64": "0.2.2",
|
|
72
|
+
"@opentui/core-win32-arm64": "0.2.2"
|
|
79
73
|
}
|
|
80
74
|
}
|
package/platform/ffi.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
declare const pointerBrand: unique symbol;
|
|
2
|
-
export type
|
|
2
|
+
export type PointerInput = number | bigint;
|
|
3
|
+
export type Pointer = PointerInput & {
|
|
3
4
|
readonly [pointerBrand]: "Pointer";
|
|
4
5
|
};
|
|
6
|
+
type PointerSource = ArrayBufferLike | ArrayBufferView;
|
|
7
|
+
type BunPointer = number;
|
|
5
8
|
export declare const FFIType: {
|
|
6
9
|
readonly char: "char";
|
|
7
10
|
readonly int8_t: "int8_t";
|
|
@@ -57,8 +60,67 @@ export interface Library<Fns extends Record<string, FFIFunction>> {
|
|
|
57
60
|
createCallback(callback: (...args: any[]) => any, definition: FFIFunction): FFICallbackInstance;
|
|
58
61
|
close(): void;
|
|
59
62
|
}
|
|
63
|
+
interface FfiBackend {
|
|
64
|
+
dlopen<Fns extends Record<string, FFIFunction>>(path: string | URL, symbols: Fns): Library<Fns>;
|
|
65
|
+
ptr(value: PointerSource): Pointer;
|
|
66
|
+
suffix: string;
|
|
67
|
+
toArrayBuffer(pointer: Pointer, offset: number | undefined, length: number): ArrayBuffer;
|
|
68
|
+
}
|
|
69
|
+
interface BunFFIFunction {
|
|
70
|
+
readonly args?: readonly FFITypeOrString[];
|
|
71
|
+
readonly returns?: FFITypeOrString;
|
|
72
|
+
readonly ptr?: BunPointer;
|
|
73
|
+
readonly threadsafe?: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface BunFfiLibrary<Fns extends Record<string, BunFFIFunction>> {
|
|
76
|
+
symbols: {
|
|
77
|
+
[K in keyof Fns]: (...args: any[]) => any;
|
|
78
|
+
};
|
|
79
|
+
close(): void;
|
|
80
|
+
}
|
|
81
|
+
interface BunFfiBackend {
|
|
82
|
+
JSCallback: new (callback: (...args: any[]) => any, definition: BunFFIFunction) => FFICallbackInstance;
|
|
83
|
+
dlopen<Fns extends Record<string, BunFFIFunction>>(path: string | URL, symbols: Fns): BunFfiLibrary<Fns>;
|
|
84
|
+
ptr(value: PointerSource): Pointer;
|
|
85
|
+
suffix: string;
|
|
86
|
+
toArrayBuffer(pointer: BunPointer, offset: number | undefined, length: number): ArrayBuffer;
|
|
87
|
+
}
|
|
88
|
+
interface NodeFFIFunction {
|
|
89
|
+
readonly parameters: readonly string[];
|
|
90
|
+
readonly result: string;
|
|
91
|
+
}
|
|
92
|
+
interface NodeDynamicLibrary {
|
|
93
|
+
close(): void;
|
|
94
|
+
registerCallback(signature: NodeFFIFunction, callback: (...args: any[]) => any): bigint;
|
|
95
|
+
unregisterCallback(pointer: bigint): void;
|
|
96
|
+
}
|
|
97
|
+
interface NodeFfiLibrary {
|
|
98
|
+
readonly lib: NodeDynamicLibrary;
|
|
99
|
+
readonly functions: Record<string, (...args: any[]) => any>;
|
|
100
|
+
}
|
|
101
|
+
interface NodeFfiBackend {
|
|
102
|
+
dlopen(path: string | null, symbols: Record<string, NodeFFIFunction>): NodeFfiLibrary;
|
|
103
|
+
getRawPointer(source: ArrayBuffer): bigint;
|
|
104
|
+
suffix: string;
|
|
105
|
+
toArrayBuffer(pointer: bigint, length: number, copy?: boolean): ArrayBuffer;
|
|
106
|
+
}
|
|
107
|
+
export declare const FFI_UNAVAILABLE = "OpenTUI native FFI is not available for this runtime yet";
|
|
108
|
+
export declare const BUN_DLOPEN_NULL = "Bun FFI backend does not support dlopen(null)";
|
|
109
|
+
export declare const LIBRARY_CLOSED = "Cannot create FFI callback after library.close() has been called";
|
|
110
|
+
export declare const NODE_CALLBACK_THREADSAFE = "Node FFI callbacks are same-thread only and do not support threadsafe callbacks";
|
|
111
|
+
export declare const NODE_NAPI_UNSUPPORTED = "Node FFI backend does not support Bun N-API FFI types";
|
|
112
|
+
export declare const NODE_POINTER_OVERRIDE = "Node FFI backend does not support FFIFunction.ptr overrides";
|
|
113
|
+
export declare const NODE_PTR_VALUE = "node:ffi ptr() only supports ArrayBuffer and ArrayBufferView values backed by ArrayBuffer";
|
|
114
|
+
export declare const NODE_STRING_RETURN = "Node FFI backend does not normalize string return values (yet)";
|
|
115
|
+
export declare const NODE_USIZE_UNSUPPORTED = "Node FFI backend does not support usize until (yet)";
|
|
116
|
+
export declare const POINTER_NEGATIVE = "Pointer must be non-negative";
|
|
117
|
+
export declare const POINTER_UNSAFE = "Pointer exceeds safe integer range";
|
|
118
|
+
export declare function toPointer(value: PointerInput): Pointer;
|
|
119
|
+
export declare function ffiBool(value: boolean): 0 | 1;
|
|
120
|
+
export declare function createBunBackend(bun: BunFfiBackend): FfiBackend;
|
|
121
|
+
export declare function createNodeBackend(nodeFfi: NodeFfiBackend): FfiBackend;
|
|
60
122
|
export declare const dlopen: <Fns extends Record<string, FFIFunction>>(path: string | URL, symbols: Fns) => Library<Fns>;
|
|
61
|
-
export declare const ptr: (value:
|
|
123
|
+
export declare const ptr: (value: PointerSource) => Pointer;
|
|
62
124
|
export declare const suffix: string;
|
|
63
125
|
export declare const toArrayBuffer: (pointer: Pointer, offset: number | undefined, length: number) => ArrayBuffer;
|
|
64
126
|
export {};
|
package/renderer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Renderable, RootRenderable } from "./Renderable.js";
|
|
2
2
|
import { DebugOverlayCorner, type CursorStyleOptions, type MousePointerStyle, type RenderContext, type ThemeMode, type WidthMethod } from "./types.js";
|
|
3
3
|
import { RGBA, type ColorInput } from "./lib/RGBA.js";
|
|
4
|
-
import type { Pointer } from "
|
|
4
|
+
import type { Pointer } from "./platform/ffi.js";
|
|
5
5
|
import { OptimizedBuffer } from "./buffer.js";
|
|
6
6
|
import { type RenderLib } from "./zig.js";
|
|
7
7
|
import { TerminalConsole, type ConsoleOptions } from "./console.js";
|
|
@@ -150,6 +150,7 @@ export declare enum CliRenderEvents {
|
|
|
150
150
|
FOCUSED_RENDERABLE = "focused_renderable",
|
|
151
151
|
FOCUSED_EDITOR = "focused_editor",
|
|
152
152
|
THEME_MODE = "theme_mode",
|
|
153
|
+
PALETTE = "palette",
|
|
153
154
|
CAPABILITIES = "capabilities",
|
|
154
155
|
SELECTION = "selection",
|
|
155
156
|
DEBUG_OVERLAY_TOGGLE = "debugOverlay:toggle",
|
|
@@ -226,6 +227,7 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
|
|
|
226
227
|
private animationRequest;
|
|
227
228
|
private resizeTimeoutId;
|
|
228
229
|
private capabilityTimeoutId;
|
|
230
|
+
private xtVersionWaiters;
|
|
229
231
|
private splitStartupSeedTimeoutId;
|
|
230
232
|
private pendingSplitStartupCursorSeed;
|
|
231
233
|
private resizeDebounceDelay;
|
|
@@ -267,11 +269,11 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
|
|
|
267
269
|
private _openConsoleOnError;
|
|
268
270
|
private _paletteDetector;
|
|
269
271
|
private _paletteCache;
|
|
270
|
-
private _cachedPalette;
|
|
271
272
|
private _paletteDetectionPromise;
|
|
272
273
|
private _paletteDetectionSize;
|
|
273
274
|
private _paletteEpoch;
|
|
274
|
-
private
|
|
275
|
+
private _nativePaletteSignature;
|
|
276
|
+
private _emittedPaletteSignature;
|
|
275
277
|
private _palettePublishGeneration;
|
|
276
278
|
private _onDestroy?;
|
|
277
279
|
private themeModeState;
|
|
@@ -492,7 +494,11 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
|
|
|
492
494
|
private getCachedPaletteBySize;
|
|
493
495
|
private ensurePaletteDetector;
|
|
494
496
|
private syncNativePaletteState;
|
|
495
|
-
private
|
|
497
|
+
private emitPaletteChange;
|
|
498
|
+
private resolveXtVersionWaiters;
|
|
499
|
+
private waitForXtVersion;
|
|
500
|
+
private shouldSyncNativePaletteState;
|
|
501
|
+
private refreshPalette;
|
|
496
502
|
clearPaletteCache(): void;
|
|
497
503
|
/**
|
|
498
504
|
* Detects the terminal's color palette
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CreateRuntimePluginOptions } from "./runtime-plugin.js";
|
|
2
|
+
export declare function ensureRuntimePluginSupport(options?: CreateRuntimePluginOptions): boolean;
|
|
3
|
+
export { createRuntimePlugin, runtimeModuleIdForSpecifier } from "./runtime-plugin.js";
|
|
4
|
+
export type { CreateRuntimePluginOptions, RuntimeModuleEntry, RuntimeModuleExports, RuntimeModuleLoader, } from "./runtime-plugin.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ensureRuntimePluginSupport
|
|
4
|
+
} from "./index-p147fdyc.js";
|
|
5
|
+
import {
|
|
6
|
+
createRuntimePlugin,
|
|
7
|
+
runtimeModuleIdForSpecifier
|
|
8
|
+
} from "./index-yedf4bn5.js";
|
|
9
|
+
import"./index-d07rkqtc.js";
|
|
10
|
+
import"./index-jv9g79dk.js";
|
|
11
|
+
export {
|
|
12
|
+
runtimeModuleIdForSpecifier,
|
|
13
|
+
ensureRuntimePluginSupport,
|
|
14
|
+
createRuntimePlugin
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//# debugId=20E180CC53AAFA2A64756E2164756E21
|
|
18
|
+
//# sourceMappingURL=runtime-plugin-support-configure.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
export { createRuntimePlugin, runtimeModuleIdForSpecifier, type CreateRuntimePluginOptions, type RuntimeModuleEntry, type RuntimeModuleExports, type RuntimeModuleLoader, };
|
|
1
|
+
import { ensureRuntimePluginSupport } from "./runtime-plugin-support-configure.js";
|
|
2
|
+
export { ensureRuntimePluginSupport };
|
|
3
|
+
export { createRuntimePlugin, runtimeModuleIdForSpecifier, type CreateRuntimePluginOptions, type RuntimeModuleEntry, type RuntimeModuleExports, type RuntimeModuleLoader, } from "./runtime-plugin-support-configure.js";
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ensureRuntimePluginSupport
|
|
4
|
+
} from "./index-p147fdyc.js";
|
|
2
5
|
import {
|
|
3
6
|
createRuntimePlugin,
|
|
4
7
|
runtimeModuleIdForSpecifier
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
|
|
8
|
+
} from "./index-yedf4bn5.js";
|
|
9
|
+
import"./index-d07rkqtc.js";
|
|
10
|
+
import"./index-jv9g79dk.js";
|
|
9
11
|
// src/runtime-plugin-support.ts
|
|
10
|
-
var {plugin: registerBunPlugin } = globalThis.Bun;
|
|
11
|
-
var runtimePluginSupportInstalledKey = "__opentuiCoreRuntimePluginSupportInstalled__";
|
|
12
|
-
function ensureRuntimePluginSupport(options = {}) {
|
|
13
|
-
const state = globalThis;
|
|
14
|
-
if (state[runtimePluginSupportInstalledKey]) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
registerBunPlugin(createRuntimePlugin(options));
|
|
18
|
-
state[runtimePluginSupportInstalledKey] = true;
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
12
|
ensureRuntimePluginSupport();
|
|
22
13
|
export {
|
|
23
14
|
runtimeModuleIdForSpecifier,
|
|
@@ -25,5 +16,5 @@ export {
|
|
|
25
16
|
createRuntimePlugin
|
|
26
17
|
};
|
|
27
18
|
|
|
28
|
-
//# debugId=
|
|
19
|
+
//# debugId=77F70D7DCCE5C8F764756E2164756E21
|
|
29
20
|
//# sourceMappingURL=runtime-plugin-support.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/runtime-plugin-support.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {
|
|
5
|
+
"import { ensureRuntimePluginSupport } from \"./runtime-plugin-support-configure.js\"\n\nexport { ensureRuntimePluginSupport }\nexport {\n createRuntimePlugin,\n runtimeModuleIdForSpecifier,\n type CreateRuntimePluginOptions,\n type RuntimeModuleEntry,\n type RuntimeModuleExports,\n type RuntimeModuleLoader,\n} from \"./runtime-plugin-support-configure.js\"\n\nensureRuntimePluginSupport()\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;AAYA,2BAA2B;",
|
|
8
|
+
"debugId": "77F70D7DCCE5C8F764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/runtime-plugin.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
createRuntimePlugin,
|
|
4
4
|
isCoreRuntimeModuleSpecifier,
|
|
5
5
|
runtimeModuleIdForSpecifier
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
6
|
+
} from "./index-yedf4bn5.js";
|
|
7
|
+
import"./index-d07rkqtc.js";
|
|
8
|
+
import"./index-jv9g79dk.js";
|
|
9
9
|
export {
|
|
10
10
|
runtimeModuleIdForSpecifier,
|
|
11
11
|
isCoreRuntimeModuleSpecifier,
|
package/syntax-style.d.ts
CHANGED
package/testing.js
CHANGED
package/text-buffer-view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RGBA } from "./lib/RGBA.js";
|
|
2
2
|
import { type LineInfo, type RenderLib } from "./zig.js";
|
|
3
|
-
import { type Pointer } from "
|
|
3
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
4
4
|
import type { TextBuffer } from "./text-buffer.js";
|
|
5
5
|
export declare class TextBufferView {
|
|
6
6
|
private lib;
|
package/text-buffer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StyledText } from "./lib/styled-text.js";
|
|
2
2
|
import { RGBA } from "./lib/RGBA.js";
|
|
3
3
|
import { type RenderLib } from "./zig.js";
|
|
4
|
-
import { type Pointer } from "
|
|
4
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
5
5
|
import { type WidthMethod, type Highlight } from "./types.js";
|
|
6
6
|
import type { SyntaxStyle } from "./syntax-style.js";
|
|
7
7
|
export interface TextChunk {
|
package/zig-structs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Pointer } from "
|
|
1
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
2
2
|
import { RGBA } from "./lib/RGBA.js";
|
|
3
3
|
type StyledChunkInput = {
|
|
4
4
|
text: string;
|
|
@@ -38,7 +38,7 @@ export declare const VisualCursorStruct: import("bun-ffi-structs").DefineStructR
|
|
|
38
38
|
export declare const TerminalCapabilitiesStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["kitty_keyboard", "bool_u8"], readonly ["kitty_graphics", "bool_u8"], readonly ["rgb", "bool_u8"], readonly ["ansi256", "bool_u8"], readonly ["unicode", import("bun-ffi-structs").EnumDef<{
|
|
39
39
|
wcwidth: number;
|
|
40
40
|
unicode: number;
|
|
41
|
-
}>], readonly ["sgr_pixels", "bool_u8"], readonly ["color_scheme_updates", "bool_u8"], readonly ["explicit_width", "bool_u8"], readonly ["scaled_text", "bool_u8"], readonly ["sixel", "bool_u8"], readonly ["focus_tracking", "bool_u8"], readonly ["sync", "bool_u8"], readonly ["bracketed_paste", "bool_u8"], readonly ["hyperlinks", "bool_u8"], readonly ["osc52", "bool_u8"], readonly ["explicit_cursor_positioning", "bool_u8"], readonly ["term_name", "char*"], readonly ["term_name_len", "u64", {
|
|
41
|
+
}>], readonly ["sgr_pixels", "bool_u8"], readonly ["color_scheme_updates", "bool_u8"], readonly ["explicit_width", "bool_u8"], readonly ["scaled_text", "bool_u8"], readonly ["sixel", "bool_u8"], readonly ["focus_tracking", "bool_u8"], readonly ["sync", "bool_u8"], readonly ["bracketed_paste", "bool_u8"], readonly ["hyperlinks", "bool_u8"], readonly ["osc52", "bool_u8"], readonly ["explicit_cursor_positioning", "bool_u8"], readonly ["in_tmux", "bool_u8"], readonly ["term_name", "char*"], readonly ["term_name_len", "u64", {
|
|
42
42
|
readonly lengthOf: "term_name";
|
|
43
43
|
}], readonly ["term_version", "char*"], readonly ["term_version_len", "u64", {
|
|
44
44
|
readonly lengthOf: "term_version";
|
package/zig.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Pointer } from "
|
|
1
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
2
2
|
import { type CursorStyle, type CursorStyleOptions, type TargetChannel, type DebugOverlayCorner, type WidthMethod, type Highlight, type LineInfo } from "./types.js";
|
|
3
3
|
export type { LineInfo, AllocatorStats, BuildOptions };
|
|
4
4
|
import { RGBA } from "./lib/RGBA.js";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import type { Scene } from "three";
|
|
3
|
-
export interface ResourceConfig {
|
|
4
|
-
imagePath: string;
|
|
5
|
-
sheetNumFrames: number;
|
|
6
|
-
}
|
|
7
|
-
export interface SheetProperties {
|
|
8
|
-
imagePath: string;
|
|
9
|
-
sheetTilesetWidth: number;
|
|
10
|
-
sheetTilesetHeight: number;
|
|
11
|
-
sheetNumFrames: number;
|
|
12
|
-
}
|
|
13
|
-
export interface InstanceManagerOptions {
|
|
14
|
-
maxInstances: number;
|
|
15
|
-
renderOrder?: number;
|
|
16
|
-
depthWrite?: boolean;
|
|
17
|
-
name?: string;
|
|
18
|
-
frustumCulled?: boolean;
|
|
19
|
-
matrix?: THREE.Matrix4;
|
|
20
|
-
}
|
|
21
|
-
export interface MeshPoolOptions {
|
|
22
|
-
geometry: () => THREE.BufferGeometry;
|
|
23
|
-
material: THREE.Material;
|
|
24
|
-
maxInstances: number;
|
|
25
|
-
name?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare class MeshPool {
|
|
28
|
-
private pools;
|
|
29
|
-
acquireMesh(poolId: string, options: MeshPoolOptions): THREE.InstancedMesh;
|
|
30
|
-
releaseMesh(poolId: string, mesh: THREE.InstancedMesh): void;
|
|
31
|
-
fill(poolId: string, options: MeshPoolOptions, count: number): void;
|
|
32
|
-
clearPool(poolId: string): void;
|
|
33
|
-
clearAllPools(): void;
|
|
34
|
-
}
|
|
35
|
-
export declare class InstanceManager {
|
|
36
|
-
private scene;
|
|
37
|
-
private instancedMesh;
|
|
38
|
-
private material;
|
|
39
|
-
private maxInstances;
|
|
40
|
-
private _freeIndices;
|
|
41
|
-
private instanceCount;
|
|
42
|
-
private _matrix;
|
|
43
|
-
constructor(scene: Scene, geometry: THREE.BufferGeometry, material: THREE.Material, options: InstanceManagerOptions);
|
|
44
|
-
acquireInstanceSlot(): number;
|
|
45
|
-
releaseInstanceSlot(instanceIndex: number): void;
|
|
46
|
-
getInstanceCount(): number;
|
|
47
|
-
getMaxInstances(): number;
|
|
48
|
-
get hasFreeIndices(): boolean;
|
|
49
|
-
get mesh(): THREE.InstancedMesh;
|
|
50
|
-
dispose(): void;
|
|
51
|
-
}
|
|
52
|
-
export declare class SpriteResource {
|
|
53
|
-
private _texture;
|
|
54
|
-
private _sheetProperties;
|
|
55
|
-
private scene;
|
|
56
|
-
private _meshPool;
|
|
57
|
-
constructor(texture: THREE.DataTexture, sheetProperties: SheetProperties, scene: Scene);
|
|
58
|
-
get texture(): THREE.DataTexture;
|
|
59
|
-
get sheetProperties(): SheetProperties;
|
|
60
|
-
get meshPool(): MeshPool;
|
|
61
|
-
createInstanceManager(geometry: THREE.BufferGeometry, material: THREE.Material, options: InstanceManagerOptions): InstanceManager;
|
|
62
|
-
get uvTileSize(): THREE.Vector2;
|
|
63
|
-
dispose(): void;
|
|
64
|
-
}
|
|
65
|
-
export declare class SpriteResourceManager {
|
|
66
|
-
private resources;
|
|
67
|
-
private textureCache;
|
|
68
|
-
private scene;
|
|
69
|
-
constructor(scene: Scene);
|
|
70
|
-
private getResourceKey;
|
|
71
|
-
getOrCreateResource(texture: THREE.DataTexture, sheetProps: SheetProperties): Promise<SpriteResource>;
|
|
72
|
-
createResource(config: ResourceConfig): Promise<SpriteResource>;
|
|
73
|
-
clearCache(): void;
|
|
74
|
-
}
|
package/3d/SpriteUtils.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Sprite, SpriteMaterial, type SpriteMaterialParameters } from "three";
|
|
2
|
-
export declare class SheetSprite extends Sprite {
|
|
3
|
-
private _frameIndex;
|
|
4
|
-
private _numFrames;
|
|
5
|
-
constructor(material: SpriteMaterial, numFrames: number);
|
|
6
|
-
setIndex: (index: number) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare class SpriteUtils {
|
|
9
|
-
static fromFile(path: string, { materialParameters, }?: {
|
|
10
|
-
materialParameters?: Omit<SpriteMaterialParameters, "map">;
|
|
11
|
-
}): Promise<Sprite>;
|
|
12
|
-
static sheetFromFile(path: string, numFrames: number): Promise<SheetSprite>;
|
|
13
|
-
}
|
package/3d/TextureUtils.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Color, Texture, DataTexture } from "three";
|
|
2
|
-
export declare class TextureUtils {
|
|
3
|
-
/**
|
|
4
|
-
* Loads a texture from a file path using sharp.
|
|
5
|
-
* Returns a THREE.Texture with ImageData attached to its .image property.
|
|
6
|
-
*/
|
|
7
|
-
static loadTextureFromFile(path: string): Promise<DataTexture | null>;
|
|
8
|
-
/**
|
|
9
|
-
* Alias for loadTextureFromFile for convenience.
|
|
10
|
-
*/
|
|
11
|
-
static fromFile(path: string): Promise<DataTexture | null>;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a THREE.Texture with a checkerboard pattern.
|
|
14
|
-
*/
|
|
15
|
-
static createCheckerboard(size?: number, color1?: Color, color2?: Color, checkSize?: number): Texture;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a THREE.Texture with a gradient pattern.
|
|
18
|
-
*/
|
|
19
|
-
static createGradient(size?: number, startColor?: Color, endColor?: Color, direction?: "horizontal" | "vertical" | "radial"): Texture;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a THREE.Texture with a procedural noise pattern.
|
|
22
|
-
*/
|
|
23
|
-
static createNoise(size?: number, scale?: number, octaves?: number, color1?: Color, color2?: Color): Texture;
|
|
24
|
-
}
|