@opentui/core 0.3.1 → 0.3.3
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 +1 -0
- package/buffer.d.ts +4 -3
- package/edit-buffer.d.ts +3 -4
- package/editor-view.d.ts +3 -4
- package/{index-gnh42qx3.js → index-jh82sd41.js} +2 -2
- package/{index-2wycxnwx.js → index-mbck6rbg.js} +3 -3
- package/{index-jx0p1c2f.js → index-mn090kzf.js} +499 -279
- package/{index-jx0p1c2f.js.map → index-mn090kzf.js.map} +15 -15
- package/{index-zv319bjp.js → index-qndc8vq8.js} +237 -106
- package/index-qndc8vq8.js.map +35 -0
- package/index.js +5 -3
- package/index.js.map +1 -1
- package/lib/clipboard.d.ts +2 -3
- package/package.json +9 -7
- package/renderables/Box.d.ts +4 -0
- package/renderables/Code.d.ts +12 -1
- package/renderables/Diff.d.ts +5 -0
- package/renderables/Markdown.d.ts +11 -1
- package/renderables/ScrollBox.d.ts +1 -0
- package/renderer.d.ts +2 -3
- package/runtime-plugin-support-configure.js +4 -4
- package/runtime-plugin-support.js +4 -4
- package/runtime-plugin.js +3 -3
- package/syntax-style.d.ts +3 -4
- package/testing.js +1 -1
- package/text-buffer-view.d.ts +3 -4
- package/text-buffer.d.ts +3 -4
- package/zig.d.ts +264 -252
- package/index-zv319bjp.js.map +0 -35
- /package/{index-gnh42qx3.js.map → index-jh82sd41.js.map} +0 -0
- /package/{index-2wycxnwx.js.map → index-mbck6rbg.js.map} +0 -0
package/index.js
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
applySaturation,
|
|
64
64
|
applyScanlines,
|
|
65
65
|
createCoreSlotRegistry,
|
|
66
|
+
createMarkdownCodeBlockRenderer,
|
|
66
67
|
createSlotRegistry,
|
|
67
68
|
createTimeline,
|
|
68
69
|
defaultTextareaKeyBindings,
|
|
@@ -71,7 +72,7 @@ import {
|
|
|
71
72
|
resolveCoreSlot,
|
|
72
73
|
setupAudio,
|
|
73
74
|
vstyles
|
|
74
|
-
} from "./index-
|
|
75
|
+
} from "./index-qndc8vq8.js";
|
|
75
76
|
import {
|
|
76
77
|
ASCIIFontSelectionHelper,
|
|
77
78
|
ATTRIBUTE_BASE_BITS,
|
|
@@ -246,7 +247,7 @@ import {
|
|
|
246
247
|
white,
|
|
247
248
|
wrapWithDelegates,
|
|
248
249
|
yellow
|
|
249
|
-
} from "./index-
|
|
250
|
+
} from "./index-mn090kzf.js";
|
|
250
251
|
export {
|
|
251
252
|
yellow,
|
|
252
253
|
wrapWithDelegates,
|
|
@@ -339,6 +340,7 @@ export {
|
|
|
339
340
|
createTextAttributes,
|
|
340
341
|
createTerminalPalette,
|
|
341
342
|
createSlotRegistry,
|
|
343
|
+
createMarkdownCodeBlockRenderer,
|
|
342
344
|
createExtmarksController,
|
|
343
345
|
createCoreSlotRegistry,
|
|
344
346
|
createCliRenderer,
|
|
@@ -494,5 +496,5 @@ export {
|
|
|
494
496
|
ACHROMATOPSIA_MATRIX
|
|
495
497
|
};
|
|
496
498
|
|
|
497
|
-
//# debugId=
|
|
499
|
+
//# debugId=1D83681F895D51C264756E2164756E21
|
|
498
500
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
package/lib/clipboard.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RenderLib } from "../zig.js";
|
|
1
|
+
import type { RendererHandle, RenderLib } from "../zig.js";
|
|
3
2
|
export declare enum ClipboardTarget {
|
|
4
3
|
Clipboard = 0,
|
|
5
4
|
Primary = 1,
|
|
@@ -10,7 +9,7 @@ export declare function encodeOsc52Payload(text: string, encoder?: TextEncoder):
|
|
|
10
9
|
export declare class Clipboard {
|
|
11
10
|
private lib;
|
|
12
11
|
private rendererPtr;
|
|
13
|
-
constructor(lib: RenderLib, rendererPtr:
|
|
12
|
+
constructor(lib: RenderLib, rendererPtr: RendererHandle);
|
|
14
13
|
copyToClipboardOSC52(text: string, target?: ClipboardTarget): boolean;
|
|
15
14
|
clearClipboardOSC52(target?: ClipboardTarget): boolean;
|
|
16
15
|
isOsc52Supported(): boolean;
|
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.3.
|
|
7
|
+
"version": "0.3.3",
|
|
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": {
|
|
@@ -69,11 +69,13 @@
|
|
|
69
69
|
"web-tree-sitter": "0.25.10"
|
|
70
70
|
},
|
|
71
71
|
"optionalDependencies": {
|
|
72
|
-
"@opentui/core-darwin-x64": "0.3.
|
|
73
|
-
"@opentui/core-darwin-arm64": "0.3.
|
|
74
|
-
"@opentui/core-linux-x64": "0.3.
|
|
75
|
-
"@opentui/core-linux-arm64": "0.3.
|
|
76
|
-
"@opentui/core-win32-x64": "0.3.
|
|
77
|
-
"@opentui/core-win32-arm64": "0.3.
|
|
72
|
+
"@opentui/core-darwin-x64": "0.3.3",
|
|
73
|
+
"@opentui/core-darwin-arm64": "0.3.3",
|
|
74
|
+
"@opentui/core-linux-x64": "0.3.3",
|
|
75
|
+
"@opentui/core-linux-arm64": "0.3.3",
|
|
76
|
+
"@opentui/core-win32-x64": "0.3.3",
|
|
77
|
+
"@opentui/core-win32-arm64": "0.3.3",
|
|
78
|
+
"@opentui/core-linux-x64-musl": "0.3.3",
|
|
79
|
+
"@opentui/core-linux-arm64-musl": "0.3.3"
|
|
78
80
|
}
|
|
79
81
|
}
|
package/renderables/Box.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface BoxOptions<TRenderable extends Renderable = BoxRenderable> exte
|
|
|
11
11
|
customBorderChars?: BorderCharacters;
|
|
12
12
|
shouldFill?: boolean;
|
|
13
13
|
title?: string;
|
|
14
|
+
titleColor?: string | RGBA;
|
|
14
15
|
titleAlignment?: "left" | "center" | "right";
|
|
15
16
|
bottomTitle?: string;
|
|
16
17
|
bottomTitleAlignment?: "left" | "center" | "right";
|
|
@@ -31,6 +32,7 @@ export declare class BoxRenderable extends Renderable {
|
|
|
31
32
|
protected borderSides: BorderSidesConfig;
|
|
32
33
|
shouldFill: boolean;
|
|
33
34
|
protected _title?: string;
|
|
35
|
+
protected _titleColor?: RGBA;
|
|
34
36
|
protected _titleAlignment: "left" | "center" | "right";
|
|
35
37
|
protected _bottomTitle?: string;
|
|
36
38
|
protected _bottomTitleAlignment: "left" | "center" | "right";
|
|
@@ -60,6 +62,8 @@ export declare class BoxRenderable extends Renderable {
|
|
|
60
62
|
set focusedBorderColor(value: RGBA | string);
|
|
61
63
|
get title(): string | undefined;
|
|
62
64
|
set title(value: string | undefined);
|
|
65
|
+
get titleColor(): RGBA | undefined;
|
|
66
|
+
set titleColor(value: string | RGBA | undefined);
|
|
63
67
|
get titleAlignment(): "left" | "center" | "right";
|
|
64
68
|
set titleAlignment(value: "left" | "center" | "right");
|
|
65
69
|
get bottomTitle(): string | undefined;
|
package/renderables/Code.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RenderContext } from "../types.js";
|
|
1
|
+
import { type LineInfo, type RenderContext } from "../types.js";
|
|
2
2
|
import { SyntaxStyle } from "../syntax-style.js";
|
|
3
3
|
import { TreeSitterClient } from "../lib/tree-sitter/index.js";
|
|
4
4
|
import { TextBufferRenderable, type TextBufferOptions } from "./TextBufferRenderable.js";
|
|
@@ -45,6 +45,8 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
45
45
|
private _onHighlight?;
|
|
46
46
|
private _onChunks?;
|
|
47
47
|
private _highlightingPromise;
|
|
48
|
+
private _renderedLineSources?;
|
|
49
|
+
private _mappedLineInfo?;
|
|
48
50
|
protected _contentDefaultOptions: {
|
|
49
51
|
content: string;
|
|
50
52
|
conceal: true;
|
|
@@ -54,6 +56,11 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
54
56
|
constructor(ctx: RenderContext, options: CodeOptions);
|
|
55
57
|
get content(): string;
|
|
56
58
|
set content(value: string);
|
|
59
|
+
get lineInfo(): LineInfo;
|
|
60
|
+
get wrapMode(): "none" | "char" | "word";
|
|
61
|
+
set wrapMode(value: "none" | "char" | "word");
|
|
62
|
+
protected onResize(width: number, height: number): void;
|
|
63
|
+
protected updateTextInfo(): void;
|
|
57
64
|
get filetype(): string | undefined;
|
|
58
65
|
set filetype(value: string | undefined);
|
|
59
66
|
get syntaxStyle(): SyntaxStyle;
|
|
@@ -77,6 +84,10 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
77
84
|
protected transformChunks(chunks: TextChunk[], context: ChunkRenderContext): Promise<TextChunk[]>;
|
|
78
85
|
private ensureVisibleTextBeforeHighlight;
|
|
79
86
|
private startHighlight;
|
|
87
|
+
private setRenderedLineSources;
|
|
88
|
+
private static isIdentityLineSources;
|
|
89
|
+
private static getMergedConcealLineRanges;
|
|
90
|
+
private getConcealLinesSourceMap;
|
|
80
91
|
getLineHighlights(lineIdx: number): import("../types.js").Highlight[];
|
|
81
92
|
protected renderSelf(buffer: OptimizedBuffer): void;
|
|
82
93
|
}
|
package/renderables/Diff.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class DiffRenderable extends Renderable {
|
|
|
37
37
|
private _view;
|
|
38
38
|
private _parsedDiff;
|
|
39
39
|
private _parseError;
|
|
40
|
+
private _hunkStartLines;
|
|
41
|
+
private _hunkRowOffsets;
|
|
40
42
|
private _fg?;
|
|
41
43
|
private _filetype?;
|
|
42
44
|
private _syntaxStyle?;
|
|
@@ -77,6 +79,7 @@ export declare class DiffRenderable extends Renderable {
|
|
|
77
79
|
private isInsideSide;
|
|
78
80
|
protected onResize(width: number, height: number): void;
|
|
79
81
|
private requestRebuild;
|
|
82
|
+
private invalidateHunkRowOffsets;
|
|
80
83
|
private rebuildView;
|
|
81
84
|
private handleLineInfoChange;
|
|
82
85
|
private attachLineInfoListeners;
|
|
@@ -139,4 +142,6 @@ export declare class DiffRenderable extends Renderable {
|
|
|
139
142
|
clearAllLineColors(): void;
|
|
140
143
|
highlightLines(startLine: number, endLine: number, color: string | RGBA | LineColorConfig): void;
|
|
141
144
|
clearHighlightLines(startLine: number, endLine: number): void;
|
|
145
|
+
getHunkRowOffsets(): number[];
|
|
146
|
+
private computeHunkRowOffsets;
|
|
142
147
|
}
|
|
@@ -3,7 +3,7 @@ import { type RenderContext } from "../types.js";
|
|
|
3
3
|
import { SyntaxStyle } from "../syntax-style.js";
|
|
4
4
|
import type { BorderStyle } from "../lib/border.js";
|
|
5
5
|
import { RGBA, type ColorInput } from "../lib/RGBA.js";
|
|
6
|
-
import { type MarkedToken, type Token } from "marked";
|
|
6
|
+
import { type MarkedToken, type Token, type Tokens } from "marked";
|
|
7
7
|
import { type TextTableColumnFitter, type TextTableColumnWidthMode, type TextTableContent } from "./TextTable.js";
|
|
8
8
|
import type { TreeSitterClient } from "../lib/tree-sitter/index.js";
|
|
9
9
|
import { type ParseState } from "./markdown-parser.js";
|
|
@@ -113,6 +113,9 @@ export interface RenderNodeContext {
|
|
|
113
113
|
/** Creates default renderable for this token */
|
|
114
114
|
defaultRender: () => Renderable | null;
|
|
115
115
|
}
|
|
116
|
+
export type MarkdownCodeBlockRenderer = (token: Tokens.Code, context: RenderNodeContext) => Renderable | undefined | null;
|
|
117
|
+
export type MarkdownCodeBlockRendererMap = ReadonlyMap<string, MarkdownCodeBlockRenderer> | Readonly<Record<string, MarkdownCodeBlockRenderer>>;
|
|
118
|
+
export declare function createMarkdownCodeBlockRenderer(renderers: MarkdownCodeBlockRendererMap): MarkdownOptions["renderNode"];
|
|
116
119
|
interface TableContentCache {
|
|
117
120
|
content: TextTableContent;
|
|
118
121
|
cellKeys: Uint32Array[];
|
|
@@ -124,6 +127,8 @@ export interface BlockState {
|
|
|
124
127
|
renderable: Renderable;
|
|
125
128
|
tableContentCache?: TableContentCache;
|
|
126
129
|
tracksInterBlockMargin?: boolean;
|
|
130
|
+
/** Whether built-in reconciliation can update this renderable without replacing it. */
|
|
131
|
+
canUpdateInPlace: boolean;
|
|
127
132
|
}
|
|
128
133
|
export type { ParseState };
|
|
129
134
|
export declare class MarkdownRenderable extends Renderable {
|
|
@@ -204,6 +209,7 @@ export declare class MarkdownRenderable extends Renderable {
|
|
|
204
209
|
private createMarkdownBlockToken;
|
|
205
210
|
private normalizeMarkdownBlockRaw;
|
|
206
211
|
private normalizeScrollbackMarkdownBlockRaw;
|
|
212
|
+
private isCodeBlockOnlyRenderer;
|
|
207
213
|
private buildRenderableTokens;
|
|
208
214
|
private buildTopLevelRenderBlocks;
|
|
209
215
|
private shouldAddTopLevelMargin;
|
|
@@ -228,6 +234,10 @@ export declare class MarkdownRenderable extends Renderable {
|
|
|
228
234
|
private createTopLevelDefaultRenderable;
|
|
229
235
|
private createTopLevelRenderable;
|
|
230
236
|
private createDefaultRenderable;
|
|
237
|
+
private createCustomRenderable;
|
|
238
|
+
private createTopLevelCustomRenderable;
|
|
239
|
+
private renderCustomNode;
|
|
240
|
+
private destroyUnusedDefaultRenderable;
|
|
231
241
|
private updateBlockRenderable;
|
|
232
242
|
private updateTopLevelBlocks;
|
|
233
243
|
private canUpdateBlockRenderable;
|
|
@@ -73,6 +73,7 @@ export declare class ScrollBoxRenderable extends BoxRenderable {
|
|
|
73
73
|
get scrollWidth(): number;
|
|
74
74
|
get scrollHeight(): number;
|
|
75
75
|
private updateStickyState;
|
|
76
|
+
private syncManualScrollState;
|
|
76
77
|
private applyStickyStart;
|
|
77
78
|
constructor(ctx: RenderContext, options: ScrollBoxOptions);
|
|
78
79
|
protected onUpdate(deltaTime: number): void;
|
package/renderer.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Renderable, RootRenderable } from "./Renderable.js";
|
|
2
2
|
import { DebugOverlayCorner, type CursorStyleOptions, type MousePointerStyle, type RenderContext, type TerminalCapabilities, type ThemeMode, type WidthMethod } from "./types.js";
|
|
3
3
|
import { RGBA, type ColorInput } from "./lib/RGBA.js";
|
|
4
|
-
import type { Pointer } from "./platform/ffi.js";
|
|
5
4
|
import { OptimizedBuffer } from "./buffer.js";
|
|
6
|
-
import { type NativeBufferedOutput, type NativeRenderStats } from "./zig.js";
|
|
5
|
+
import { type NativeBufferedOutput, type NativeRenderStats, type RendererHandle } from "./zig.js";
|
|
7
6
|
import { TerminalConsole, type ConsoleOptions } from "./console.js";
|
|
8
7
|
import { type MouseEventType, type RawMouseEvent, type ScrollInfo } from "./lib/parse.mouse.js";
|
|
9
8
|
import { Selection } from "./lib/selection.js";
|
|
@@ -203,7 +202,7 @@ export declare enum RendererControlState {
|
|
|
203
202
|
export declare class CliRenderer extends EventEmitter implements RenderContext {
|
|
204
203
|
private static animationFrameId;
|
|
205
204
|
private lib;
|
|
206
|
-
rendererPtr:
|
|
205
|
+
rendererPtr: RendererHandle;
|
|
207
206
|
stdin: NodeJS.ReadStream;
|
|
208
207
|
private stdout;
|
|
209
208
|
private exitOnCtrlC;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ensureRuntimePluginSupport
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jh82sd41.js";
|
|
5
5
|
import {
|
|
6
6
|
createRuntimePlugin,
|
|
7
7
|
runtimeModuleIdForSpecifier
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
8
|
+
} from "./index-mbck6rbg.js";
|
|
9
|
+
import"./index-qndc8vq8.js";
|
|
10
|
+
import"./index-mn090kzf.js";
|
|
11
11
|
export {
|
|
12
12
|
runtimeModuleIdForSpecifier,
|
|
13
13
|
ensureRuntimePluginSupport,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ensureRuntimePluginSupport
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jh82sd41.js";
|
|
5
5
|
import {
|
|
6
6
|
createRuntimePlugin,
|
|
7
7
|
runtimeModuleIdForSpecifier
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
8
|
+
} from "./index-mbck6rbg.js";
|
|
9
|
+
import"./index-qndc8vq8.js";
|
|
10
|
+
import"./index-mn090kzf.js";
|
|
11
11
|
// src/runtime-plugin-support.ts
|
|
12
12
|
ensureRuntimePluginSupport();
|
|
13
13
|
export {
|
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-mbck6rbg.js";
|
|
7
|
+
import"./index-qndc8vq8.js";
|
|
8
|
+
import"./index-mn090kzf.js";
|
|
9
9
|
export {
|
|
10
10
|
runtimeModuleIdForSpecifier,
|
|
11
11
|
isCoreRuntimeModuleSpecifier,
|
package/syntax-style.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RGBA, type ColorInput } from "./lib/RGBA.js";
|
|
2
|
-
import { type RenderLib } from "./zig.js";
|
|
3
|
-
import { type Pointer } from "./platform/ffi.js";
|
|
2
|
+
import { type RenderLib, type SyntaxStyleHandle } from "./zig.js";
|
|
4
3
|
export interface StyleDefinition {
|
|
5
4
|
fg?: RGBA;
|
|
6
5
|
bg?: RGBA;
|
|
@@ -41,7 +40,7 @@ export declare class SyntaxStyle {
|
|
|
41
40
|
private nameCache;
|
|
42
41
|
private styleDefs;
|
|
43
42
|
private mergedCache;
|
|
44
|
-
constructor(lib: RenderLib, ptr:
|
|
43
|
+
constructor(lib: RenderLib, ptr: SyntaxStyleHandle);
|
|
45
44
|
static create(): SyntaxStyle;
|
|
46
45
|
static fromTheme(theme: ThemeTokenStyle[]): SyntaxStyle;
|
|
47
46
|
static fromStyles(styles: Record<string, StyleDefinitionInput>): SyntaxStyle;
|
|
@@ -49,7 +48,7 @@ export declare class SyntaxStyle {
|
|
|
49
48
|
registerStyle(name: string, style: StyleDefinitionInput): number;
|
|
50
49
|
resolveStyleId(name: string): number | null;
|
|
51
50
|
getStyleId(name: string): number | null;
|
|
52
|
-
get ptr():
|
|
51
|
+
get ptr(): SyntaxStyleHandle;
|
|
53
52
|
getStyleCount(): number;
|
|
54
53
|
clearNameCache(): void;
|
|
55
54
|
getStyle(name: string): StyleDefinition | undefined;
|
package/testing.js
CHANGED
package/text-buffer-view.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { RGBA } from "./lib/RGBA.js";
|
|
2
|
-
import { type LineInfo, type RenderLib } from "./zig.js";
|
|
3
|
-
import { type Pointer } from "./platform/ffi.js";
|
|
2
|
+
import { type LineInfo, type RenderLib, type TextBufferViewHandle } from "./zig.js";
|
|
4
3
|
import type { TextBuffer } from "./text-buffer.js";
|
|
5
4
|
export declare class TextBufferView {
|
|
6
5
|
private lib;
|
|
7
6
|
private viewPtr;
|
|
8
7
|
private textBuffer;
|
|
9
8
|
private _destroyed;
|
|
10
|
-
constructor(lib: RenderLib, ptr:
|
|
9
|
+
constructor(lib: RenderLib, ptr: TextBufferViewHandle, textBuffer: TextBuffer);
|
|
11
10
|
static create(textBuffer: TextBuffer): TextBufferView;
|
|
12
11
|
private guard;
|
|
13
|
-
get ptr():
|
|
12
|
+
get ptr(): TextBufferViewHandle;
|
|
14
13
|
setSelection(start: number, end: number, bgColor?: RGBA, fgColor?: RGBA): void;
|
|
15
14
|
updateSelection(end: number, bgColor?: RGBA, fgColor?: RGBA): void;
|
|
16
15
|
resetSelection(): void;
|
package/text-buffer.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { StyledText } from "./lib/styled-text.js";
|
|
2
2
|
import { RGBA } from "./lib/RGBA.js";
|
|
3
|
-
import { type RenderLib } from "./zig.js";
|
|
4
|
-
import { type Pointer } from "./platform/ffi.js";
|
|
3
|
+
import { type RenderLib, type TextBufferHandle } from "./zig.js";
|
|
5
4
|
import { type WidthMethod, type Highlight } from "./types.js";
|
|
6
5
|
import type { SyntaxStyle } from "./syntax-style.js";
|
|
7
6
|
export interface TextChunk {
|
|
@@ -25,7 +24,7 @@ export declare class TextBuffer {
|
|
|
25
24
|
private _textBytes?;
|
|
26
25
|
private _memId?;
|
|
27
26
|
private _appendedChunks;
|
|
28
|
-
constructor(lib: RenderLib, ptr:
|
|
27
|
+
constructor(lib: RenderLib, ptr: TextBufferHandle);
|
|
29
28
|
static create(widthMethod: WidthMethod): TextBuffer;
|
|
30
29
|
private guard;
|
|
31
30
|
setText(text: string): void;
|
|
@@ -39,7 +38,7 @@ export declare class TextBuffer {
|
|
|
39
38
|
getLineCount(): number;
|
|
40
39
|
get length(): number;
|
|
41
40
|
get byteSize(): number;
|
|
42
|
-
get ptr():
|
|
41
|
+
get ptr(): TextBufferHandle;
|
|
43
42
|
getPlainText(): string;
|
|
44
43
|
getTextRange(startOffset: number, endOffset: number): string;
|
|
45
44
|
/**
|