@opentui/core 0.0.0-20250908-4906ddad

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 (64) hide show
  1. package/3d/SpriteResourceManager.d.ts +74 -0
  2. package/3d/SpriteUtils.d.ts +13 -0
  3. package/3d/TextureUtils.d.ts +24 -0
  4. package/3d/WGPURenderer.d.ts +59 -0
  5. package/3d/animation/ExplodingSpriteEffect.d.ts +71 -0
  6. package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +76 -0
  7. package/3d/animation/SpriteAnimator.d.ts +124 -0
  8. package/3d/animation/SpriteParticleGenerator.d.ts +62 -0
  9. package/3d/canvas.d.ts +42 -0
  10. package/3d/index.d.ts +11 -0
  11. package/3d/physics/PlanckPhysicsAdapter.d.ts +19 -0
  12. package/3d/physics/RapierPhysicsAdapter.d.ts +19 -0
  13. package/3d/physics/physics-interface.d.ts +27 -0
  14. package/3d.d.ts +2 -0
  15. package/3d.js +33847 -0
  16. package/3d.js.map +154 -0
  17. package/LICENSE +21 -0
  18. package/README.md +43 -0
  19. package/Renderable.d.ts +266 -0
  20. package/animation/Timeline.d.ts +125 -0
  21. package/ansi.d.ts +28 -0
  22. package/buffer.d.ts +74 -0
  23. package/console.d.ts +86 -0
  24. package/index-d6kwx5pm.js +8837 -0
  25. package/index-d6kwx5pm.js.map +36 -0
  26. package/index.d.ts +12 -0
  27. package/index.js +3721 -0
  28. package/index.js.map +23 -0
  29. package/lib/KeyHandler.d.ts +11 -0
  30. package/lib/RGBA.d.ts +24 -0
  31. package/lib/TrackedNode.d.ts +36 -0
  32. package/lib/ascii.font.d.ts +301 -0
  33. package/lib/border.d.ts +47 -0
  34. package/lib/hast-styled-text.d.ts +38 -0
  35. package/lib/index.d.ts +11 -0
  36. package/lib/output.capture.d.ts +24 -0
  37. package/lib/parse.keypress.d.ts +14 -0
  38. package/lib/parse.mouse.d.ts +23 -0
  39. package/lib/selection.d.ts +63 -0
  40. package/lib/styled-text.d.ts +73 -0
  41. package/lib/word-jumps.d.ts +2 -0
  42. package/lib/yoga.options.d.ts +31 -0
  43. package/package.json +48 -0
  44. package/post/filters.d.ts +105 -0
  45. package/renderables/ASCIIFont.d.ts +43 -0
  46. package/renderables/Box.d.ts +70 -0
  47. package/renderables/FrameBuffer.d.ts +16 -0
  48. package/renderables/Input.d.ts +70 -0
  49. package/renderables/ScrollBar.d.ts +77 -0
  50. package/renderables/ScrollBox.d.ts +82 -0
  51. package/renderables/Select.d.ts +102 -0
  52. package/renderables/Slider.d.ts +31 -0
  53. package/renderables/TabSelect.d.ts +86 -0
  54. package/renderables/Text.d.ts +72 -0
  55. package/renderables/composition/VRenderable.d.ts +16 -0
  56. package/renderables/composition/constructs.d.ts +12 -0
  57. package/renderables/composition/vnode.d.ts +46 -0
  58. package/renderables/index.d.ts +12 -0
  59. package/renderer.d.ts +232 -0
  60. package/singleton.d.ts +5 -0
  61. package/text-buffer.d.ts +52 -0
  62. package/types.d.ts +56 -0
  63. package/utils.d.ts +10 -0
  64. package/zig.d.ts +110 -0
package/lib/RGBA.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ export declare class RGBA {
2
+ buffer: Float32Array;
3
+ constructor(buffer: Float32Array);
4
+ static fromArray(array: Float32Array): RGBA;
5
+ static fromValues(r: number, g: number, b: number, a?: number): RGBA;
6
+ static fromInts(r: number, g: number, b: number, a?: number): RGBA;
7
+ static fromHex(hex: string): RGBA;
8
+ toInts(): [number, number, number, number];
9
+ get r(): number;
10
+ set r(value: number);
11
+ get g(): number;
12
+ set g(value: number);
13
+ get b(): number;
14
+ set b(value: number);
15
+ get a(): number;
16
+ set a(value: number);
17
+ map<R>(fn: (value: number) => R): R[];
18
+ toString(): string;
19
+ }
20
+ export type ColorInput = string | RGBA;
21
+ export declare function hexToRgb(hex: string): RGBA;
22
+ export declare function rgbToHex(rgb: RGBA): string;
23
+ export declare function hsvToRgb(h: number, s: number, v: number): RGBA;
24
+ export declare function parseColor(color: ColorInput): RGBA;
@@ -0,0 +1,36 @@
1
+ import { type Config, type Node as YogaNode } from "yoga-layout";
2
+ import { EventEmitter } from "events";
3
+ interface NodeMetadata {
4
+ [key: string]: any;
5
+ }
6
+ declare class TrackedNode<T extends NodeMetadata = NodeMetadata> extends EventEmitter {
7
+ private static idCounter;
8
+ id: number;
9
+ yogaNode: YogaNode;
10
+ metadata: T;
11
+ parent: TrackedNode<any> | null;
12
+ children: TrackedNode<any>[];
13
+ protected _destroyed: boolean;
14
+ protected _width: number | "auto" | `${number}%`;
15
+ protected _height: number | "auto" | `${number}%`;
16
+ constructor(yogaNode: YogaNode, metadata?: T);
17
+ parseWidth(width: number | "auto" | `${number}%`): number | "auto";
18
+ parseHeight(height: number | "auto" | `${number}%`): number | "auto";
19
+ setWidth(width: number | "auto" | `${number}%`): void;
20
+ setHeight(height: number | "auto" | `${number}%`): void;
21
+ addChild<U extends NodeMetadata>(childNode: TrackedNode<U>): number;
22
+ getChildIndex<U extends NodeMetadata>(childNode: TrackedNode<U>): number;
23
+ removeChild<U extends NodeMetadata>(childNode: TrackedNode<U>): boolean;
24
+ removeChildAtIndex(index: number): TrackedNode<any> | null;
25
+ moveChild<U extends NodeMetadata>(childNode: TrackedNode<U>, newIndex: number): number;
26
+ insertChild<U extends NodeMetadata>(childNode: TrackedNode<U>, index: number): number;
27
+ getChildCount(): number;
28
+ getChildAtIndex(index: number): TrackedNode<any> | null;
29
+ setMetadata(key: keyof T, value: T[keyof T]): void;
30
+ getMetadata<K extends keyof T>(key: K): T[K];
31
+ removeMetadata<K extends keyof T>(key: K): void;
32
+ hasChild<U extends NodeMetadata>(childNode: TrackedNode<U>): boolean;
33
+ destroy(): void;
34
+ }
35
+ declare function createTrackedNode<T extends NodeMetadata>(metadata?: T, yogaConfig?: Config): TrackedNode<T>;
36
+ export { TrackedNode, createTrackedNode };
@@ -0,0 +1,301 @@
1
+ import { OptimizedBuffer } from "../buffer";
2
+ import { RGBA } from "./RGBA";
3
+ export type ASCIIFontName = "tiny" | "block" | "shade" | "slick";
4
+ export declare const fonts: {
5
+ tiny: {
6
+ name: string;
7
+ version: string;
8
+ homepage: string;
9
+ colors: number;
10
+ lines: number;
11
+ buffer: string[];
12
+ letterspace: string[];
13
+ letterspace_size: number;
14
+ chars: {
15
+ A: string[];
16
+ B: string[];
17
+ C: string[];
18
+ D: string[];
19
+ E: string[];
20
+ F: string[];
21
+ G: string[];
22
+ H: string[];
23
+ I: string[];
24
+ J: string[];
25
+ K: string[];
26
+ L: string[];
27
+ M: string[];
28
+ N: string[];
29
+ O: string[];
30
+ P: string[];
31
+ Q: string[];
32
+ R: string[];
33
+ S: string[];
34
+ T: string[];
35
+ U: string[];
36
+ V: string[];
37
+ W: string[];
38
+ X: string[];
39
+ Y: string[];
40
+ Z: string[];
41
+ "0": string[];
42
+ "1": string[];
43
+ "2": string[];
44
+ "3": string[];
45
+ "4": string[];
46
+ "5": string[];
47
+ "6": string[];
48
+ "7": string[];
49
+ "8": string[];
50
+ "9": string[];
51
+ "!": string[];
52
+ "?": string[];
53
+ ".": string[];
54
+ "+": string[];
55
+ "-": string[];
56
+ _: string[];
57
+ "=": string[];
58
+ "@": string[];
59
+ "#": string[];
60
+ $: string[];
61
+ "%": string[];
62
+ "&": string[];
63
+ "(": string[];
64
+ ")": string[];
65
+ "/": string[];
66
+ ":": string[];
67
+ ";": string[];
68
+ ",": string[];
69
+ "'": string[];
70
+ "\"": string[];
71
+ " ": string[];
72
+ };
73
+ };
74
+ block: {
75
+ name: string;
76
+ version: string;
77
+ homepage: string;
78
+ colors: number;
79
+ lines: number;
80
+ buffer: string[];
81
+ letterspace: string[];
82
+ letterspace_size: number;
83
+ chars: {
84
+ A: string[];
85
+ B: string[];
86
+ C: string[];
87
+ D: string[];
88
+ E: string[];
89
+ F: string[];
90
+ G: string[];
91
+ H: string[];
92
+ I: string[];
93
+ J: string[];
94
+ K: string[];
95
+ L: string[];
96
+ M: string[];
97
+ N: string[];
98
+ O: string[];
99
+ P: string[];
100
+ Q: string[];
101
+ R: string[];
102
+ S: string[];
103
+ T: string[];
104
+ U: string[];
105
+ V: string[];
106
+ W: string[];
107
+ X: string[];
108
+ Y: string[];
109
+ Z: string[];
110
+ "0": string[];
111
+ "1": string[];
112
+ "2": string[];
113
+ "3": string[];
114
+ "4": string[];
115
+ "5": string[];
116
+ "6": string[];
117
+ "7": string[];
118
+ "8": string[];
119
+ "9": string[];
120
+ "!": string[];
121
+ "?": string[];
122
+ ".": string[];
123
+ "+": string[];
124
+ "-": string[];
125
+ _: string[];
126
+ "=": string[];
127
+ "@": string[];
128
+ "#": string[];
129
+ $: string[];
130
+ "%": string[];
131
+ "&": string[];
132
+ "(": string[];
133
+ ")": string[];
134
+ "/": string[];
135
+ ":": string[];
136
+ ";": string[];
137
+ ",": string[];
138
+ "'": string[];
139
+ "\"": string[];
140
+ " ": string[];
141
+ };
142
+ };
143
+ shade: {
144
+ name: string;
145
+ version: string;
146
+ homepage: string;
147
+ colors: number;
148
+ lines: number;
149
+ buffer: string[];
150
+ letterspace: string[];
151
+ letterspace_size: number;
152
+ chars: {
153
+ A: string[];
154
+ B: string[];
155
+ C: string[];
156
+ D: string[];
157
+ E: string[];
158
+ F: string[];
159
+ G: string[];
160
+ H: string[];
161
+ I: string[];
162
+ J: string[];
163
+ K: string[];
164
+ L: string[];
165
+ M: string[];
166
+ N: string[];
167
+ O: string[];
168
+ P: string[];
169
+ Q: string[];
170
+ R: string[];
171
+ S: string[];
172
+ T: string[];
173
+ U: string[];
174
+ V: string[];
175
+ W: string[];
176
+ X: string[];
177
+ Y: string[];
178
+ Z: string[];
179
+ "0": string[];
180
+ "1": string[];
181
+ "2": string[];
182
+ "3": string[];
183
+ "4": string[];
184
+ "5": string[];
185
+ "6": string[];
186
+ "7": string[];
187
+ "8": string[];
188
+ "9": string[];
189
+ "!": string[];
190
+ "?": string[];
191
+ ".": string[];
192
+ "+": string[];
193
+ "-": string[];
194
+ _: string[];
195
+ "=": string[];
196
+ "@": string[];
197
+ "#": string[];
198
+ $: string[];
199
+ "%": string[];
200
+ "&": string[];
201
+ "(": string[];
202
+ ")": string[];
203
+ "/": string[];
204
+ ":": string[];
205
+ ";": string[];
206
+ ",": string[];
207
+ "'": string[];
208
+ "\"": string[];
209
+ " ": string[];
210
+ };
211
+ };
212
+ slick: {
213
+ name: string;
214
+ version: string;
215
+ homepage: string;
216
+ colors: number;
217
+ lines: number;
218
+ buffer: string[];
219
+ letterspace: string[];
220
+ letterspace_size: number;
221
+ chars: {
222
+ A: string[];
223
+ B: string[];
224
+ C: string[];
225
+ D: string[];
226
+ E: string[];
227
+ F: string[];
228
+ G: string[];
229
+ H: string[];
230
+ I: string[];
231
+ J: string[];
232
+ K: string[];
233
+ L: string[];
234
+ M: string[];
235
+ N: string[];
236
+ O: string[];
237
+ P: string[];
238
+ Q: string[];
239
+ R: string[];
240
+ S: string[];
241
+ T: string[];
242
+ U: string[];
243
+ V: string[];
244
+ W: string[];
245
+ X: string[];
246
+ Y: string[];
247
+ Z: string[];
248
+ "0": string[];
249
+ "1": string[];
250
+ "2": string[];
251
+ "3": string[];
252
+ "4": string[];
253
+ "5": string[];
254
+ "6": string[];
255
+ "7": string[];
256
+ "8": string[];
257
+ "9": string[];
258
+ "!": string[];
259
+ "?": string[];
260
+ ".": string[];
261
+ "+": string[];
262
+ "-": string[];
263
+ _: string[];
264
+ "=": string[];
265
+ "@": string[];
266
+ "#": string[];
267
+ $: string[];
268
+ "%": string[];
269
+ "&": string[];
270
+ "(": string[];
271
+ ")": string[];
272
+ "/": string[];
273
+ ":": string[];
274
+ ";": string[];
275
+ ",": string[];
276
+ "'": string[];
277
+ "\"": string[];
278
+ " ": string[];
279
+ };
280
+ };
281
+ };
282
+ export declare function measureText({ text, font }: {
283
+ text: string;
284
+ font?: keyof typeof fonts;
285
+ }): {
286
+ width: number;
287
+ height: number;
288
+ };
289
+ export declare function getCharacterPositions(text: string, font?: keyof typeof fonts): number[];
290
+ export declare function coordinateToCharacterIndex(x: number, text: string, font?: keyof typeof fonts): number;
291
+ export declare function renderFontToFrameBuffer(buffer: OptimizedBuffer, { text, x, y, fg, bg, font, }: {
292
+ text: string;
293
+ x?: number;
294
+ y?: number;
295
+ fg?: RGBA | RGBA[];
296
+ bg?: RGBA;
297
+ font?: keyof typeof fonts;
298
+ }): {
299
+ width: number;
300
+ height: number;
301
+ };
@@ -0,0 +1,47 @@
1
+ import type { ColorInput } from "./RGBA";
2
+ export interface BorderCharacters {
3
+ topLeft: string;
4
+ topRight: string;
5
+ bottomLeft: string;
6
+ bottomRight: string;
7
+ horizontal: string;
8
+ vertical: string;
9
+ topT: string;
10
+ bottomT: string;
11
+ leftT: string;
12
+ rightT: string;
13
+ cross: string;
14
+ }
15
+ export type BorderStyle = "single" | "double" | "rounded" | "heavy";
16
+ export type BorderSides = "top" | "right" | "bottom" | "left";
17
+ export declare const BorderChars: Record<BorderStyle, BorderCharacters>;
18
+ export interface BorderConfig {
19
+ borderStyle: BorderStyle;
20
+ border: boolean | BorderSides[];
21
+ borderColor?: ColorInput;
22
+ customBorderChars?: BorderCharacters;
23
+ }
24
+ export interface BoxDrawOptions {
25
+ x: number;
26
+ y: number;
27
+ width: number;
28
+ height: number;
29
+ borderStyle: BorderStyle;
30
+ border: boolean | BorderSides[];
31
+ borderColor: ColorInput;
32
+ customBorderChars?: BorderCharacters;
33
+ backgroundColor: ColorInput;
34
+ shouldFill?: boolean;
35
+ title?: string;
36
+ titleAlignment?: "left" | "center" | "right";
37
+ }
38
+ export interface BorderSidesConfig {
39
+ top: boolean;
40
+ right: boolean;
41
+ bottom: boolean;
42
+ left: boolean;
43
+ }
44
+ export declare function getBorderFromSides(sides: BorderSidesConfig): boolean | BorderSides[];
45
+ export declare function getBorderSides(border: boolean | BorderSides[]): BorderSidesConfig;
46
+ export declare function borderCharsToArray(chars: BorderCharacters): Uint32Array;
47
+ export declare const BorderCharArrays: Record<BorderStyle, Uint32Array>;
@@ -0,0 +1,38 @@
1
+ import { RGBA } from "./RGBA";
2
+ import { StyledText } from "./styled-text";
3
+ export interface HASTText {
4
+ type: "text";
5
+ value: string;
6
+ }
7
+ export interface HASTElement {
8
+ type: "element";
9
+ tagName: string;
10
+ properties?: {
11
+ className?: string;
12
+ };
13
+ children: HASTNode[];
14
+ }
15
+ export type HASTNode = HASTText | HASTElement;
16
+ export interface StyleDefinition {
17
+ fg?: RGBA;
18
+ bg?: RGBA;
19
+ bold?: boolean;
20
+ italic?: boolean;
21
+ underline?: boolean;
22
+ dim?: boolean;
23
+ }
24
+ interface MergedStyle {
25
+ fg?: RGBA;
26
+ bg?: RGBA;
27
+ attributes: number;
28
+ }
29
+ export declare class SyntaxStyle {
30
+ private styles;
31
+ private mergedStyleCache;
32
+ constructor(styles: Record<string, StyleDefinition>);
33
+ mergeStyles(...styleNames: string[]): MergedStyle;
34
+ clearCache(): void;
35
+ getCacheSize(): number;
36
+ }
37
+ export declare function hastToStyledText(hast: HASTNode, syntaxStyle: SyntaxStyle): StyledText;
38
+ export {};
package/lib/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export * from "./border";
2
+ export * from "./TrackedNode";
3
+ export * from "./KeyHandler";
4
+ export * from "./ascii.font";
5
+ export * from "./hast-styled-text";
6
+ export * from "./RGBA";
7
+ export * from "./parse.keypress";
8
+ export * from "./styled-text";
9
+ export * from "./yoga.options";
10
+ export * from "./parse.mouse";
11
+ export * from "./selection";
@@ -0,0 +1,24 @@
1
+ import { Writable } from "stream";
2
+ import { EventEmitter } from "events";
3
+ export type CapturedOutput = {
4
+ stream: "stdout" | "stderr";
5
+ output: string;
6
+ };
7
+ export declare class Capture extends EventEmitter {
8
+ private output;
9
+ constructor();
10
+ get size(): number;
11
+ write(stream: "stdout" | "stderr", data: string): void;
12
+ claimOutput(): string;
13
+ private clear;
14
+ }
15
+ export declare class CapturedWritableStream extends Writable {
16
+ private stream;
17
+ private capture;
18
+ isTTY: boolean;
19
+ columns: number;
20
+ rows: number;
21
+ constructor(stream: "stdout" | "stderr", capture: Capture);
22
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
23
+ getColorDepth(): number;
24
+ }
@@ -0,0 +1,14 @@
1
+ import { Buffer } from "node:buffer";
2
+ export declare const nonAlphanumericKeys: string[];
3
+ export type ParsedKey = {
4
+ name: string;
5
+ ctrl: boolean;
6
+ meta: boolean;
7
+ shift: boolean;
8
+ option: boolean;
9
+ sequence: string;
10
+ number: boolean;
11
+ raw: string;
12
+ code?: string;
13
+ };
14
+ export declare const parseKeypress: (s?: Buffer | string) => ParsedKey;
@@ -0,0 +1,23 @@
1
+ export type MouseEventType = "down" | "up" | "move" | "drag" | "drag-end" | "drop" | "over" | "out" | "scroll";
2
+ export interface ScrollInfo {
3
+ direction: "up" | "down" | "left" | "right";
4
+ delta: number;
5
+ }
6
+ export type RawMouseEvent = {
7
+ type: MouseEventType;
8
+ button: number;
9
+ x: number;
10
+ y: number;
11
+ modifiers: {
12
+ shift: boolean;
13
+ alt: boolean;
14
+ ctrl: boolean;
15
+ };
16
+ scroll?: ScrollInfo;
17
+ };
18
+ export declare class MouseParser {
19
+ private mouseButtonsPressed;
20
+ private static readonly SCROLL_DIRECTIONS;
21
+ reset(): void;
22
+ parseMouseEvent(data: Buffer): RawMouseEvent | null;
23
+ }
@@ -0,0 +1,63 @@
1
+ import { Renderable, type ViewportBounds } from "..";
2
+ import { fonts } from "./ascii.font";
3
+ export declare class Selection {
4
+ private _anchor;
5
+ private _originalFocus;
6
+ private _normalizedAnchor;
7
+ private _normalizedFocus;
8
+ private _selectedRenderables;
9
+ private _touchedRenderables;
10
+ private _isActive;
11
+ private _isSelecting;
12
+ constructor(anchorRenderable: Renderable, anchor: {
13
+ x: number;
14
+ y: number;
15
+ }, focus: {
16
+ x: number;
17
+ y: number;
18
+ });
19
+ get anchor(): {
20
+ x: number;
21
+ y: number;
22
+ };
23
+ get focus(): {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ set focus(value: {
28
+ x: number;
29
+ y: number;
30
+ });
31
+ private _updateNormalizedSelection;
32
+ get isActive(): boolean;
33
+ set isActive(value: boolean);
34
+ get isSelecting(): boolean;
35
+ set isSelecting(value: boolean);
36
+ get bounds(): ViewportBounds;
37
+ updateSelectedRenderables(selectedRenderables: Renderable[]): void;
38
+ get selectedRenderables(): Renderable[];
39
+ updateTouchedRenderables(touchedRenderables: Renderable[]): void;
40
+ get touchedRenderables(): Renderable[];
41
+ getSelectedText(): string;
42
+ }
43
+ export interface LocalSelectionBounds {
44
+ anchorX: number;
45
+ anchorY: number;
46
+ focusX: number;
47
+ focusY: number;
48
+ isActive: boolean;
49
+ }
50
+ export declare function convertGlobalToLocalSelection(globalSelection: Selection | null, localX: number, localY: number): LocalSelectionBounds | null;
51
+ export declare class ASCIIFontSelectionHelper {
52
+ private getText;
53
+ private getFont;
54
+ private localSelection;
55
+ constructor(getText: () => string, getFont: () => keyof typeof fonts);
56
+ hasSelection(): boolean;
57
+ getSelection(): {
58
+ start: number;
59
+ end: number;
60
+ } | null;
61
+ shouldStartSelection(localX: number, localY: number, width: number, height: number): boolean;
62
+ onLocalSelectionChanged(localSelection: LocalSelectionBounds | null, width: number, height: number): boolean;
63
+ }
@@ -0,0 +1,73 @@
1
+ import type { TextRenderable } from "../renderables/Text";
2
+ import type { TextChunk } from "../text-buffer";
3
+ import { type ColorInput } from "./RGBA";
4
+ export type Color = ColorInput;
5
+ export interface StyleAttrs {
6
+ fg?: Color;
7
+ bg?: Color;
8
+ bold?: boolean;
9
+ italic?: boolean;
10
+ underline?: boolean;
11
+ strikethrough?: boolean;
12
+ dim?: boolean;
13
+ reverse?: boolean;
14
+ blink?: boolean;
15
+ }
16
+ export declare class StyledText {
17
+ chunks: TextChunk[];
18
+ textRenderable?: TextRenderable;
19
+ constructor(chunks: TextChunk[]);
20
+ mount(textRenderable: TextRenderable): void;
21
+ /**
22
+ * @deprecated: Use textRenderable.insertChunk instead
23
+ */
24
+ insert(chunk: TextChunk, index?: number): StyledText;
25
+ /**
26
+ * @deprecated: Use textRenderable.removeChunk instead
27
+ */
28
+ remove(chunk: TextChunk): StyledText;
29
+ /**
30
+ * @deprecated: Use textRenderable.replaceChunk instead
31
+ */
32
+ replace(chunk: TextChunk, oldChunk: TextChunk): StyledText;
33
+ }
34
+ export declare function stringToStyledText(content: string): StyledText;
35
+ export type StylableInput = string | number | boolean | TextChunk;
36
+ export declare const black: (input: StylableInput) => TextChunk;
37
+ export declare const red: (input: StylableInput) => TextChunk;
38
+ export declare const green: (input: StylableInput) => TextChunk;
39
+ export declare const yellow: (input: StylableInput) => TextChunk;
40
+ export declare const blue: (input: StylableInput) => TextChunk;
41
+ export declare const magenta: (input: StylableInput) => TextChunk;
42
+ export declare const cyan: (input: StylableInput) => TextChunk;
43
+ export declare const white: (input: StylableInput) => TextChunk;
44
+ export declare const brightBlack: (input: StylableInput) => TextChunk;
45
+ export declare const brightRed: (input: StylableInput) => TextChunk;
46
+ export declare const brightGreen: (input: StylableInput) => TextChunk;
47
+ export declare const brightYellow: (input: StylableInput) => TextChunk;
48
+ export declare const brightBlue: (input: StylableInput) => TextChunk;
49
+ export declare const brightMagenta: (input: StylableInput) => TextChunk;
50
+ export declare const brightCyan: (input: StylableInput) => TextChunk;
51
+ export declare const brightWhite: (input: StylableInput) => TextChunk;
52
+ export declare const bgBlack: (input: StylableInput) => TextChunk;
53
+ export declare const bgRed: (input: StylableInput) => TextChunk;
54
+ export declare const bgGreen: (input: StylableInput) => TextChunk;
55
+ export declare const bgYellow: (input: StylableInput) => TextChunk;
56
+ export declare const bgBlue: (input: StylableInput) => TextChunk;
57
+ export declare const bgMagenta: (input: StylableInput) => TextChunk;
58
+ export declare const bgCyan: (input: StylableInput) => TextChunk;
59
+ export declare const bgWhite: (input: StylableInput) => TextChunk;
60
+ export declare const bold: (input: StylableInput) => TextChunk;
61
+ export declare const italic: (input: StylableInput) => TextChunk;
62
+ export declare const underline: (input: StylableInput) => TextChunk;
63
+ export declare const strikethrough: (input: StylableInput) => TextChunk;
64
+ export declare const dim: (input: StylableInput) => TextChunk;
65
+ export declare const reverse: (input: StylableInput) => TextChunk;
66
+ export declare const blink: (input: StylableInput) => TextChunk;
67
+ export declare const fg: (color: Color) => (input: StylableInput) => TextChunk;
68
+ export declare const bg: (color: Color) => (input: StylableInput) => TextChunk;
69
+ /**
70
+ * Template literal handler for styled text (non-cached version).
71
+ * Returns a StyledText object containing chunks of text with optional styles.
72
+ */
73
+ export declare function t(strings: TemplateStringsArray, ...values: StylableInput[]): StyledText;
@@ -0,0 +1,2 @@
1
+ export declare function nextWordEndCrossLines(text: string, caret: number): number;
2
+ export declare function previousWordStartCrossLines(text: string, caret: number): number;