Skip to content

Commit 38c259e

Browse files
committed
fix: fix type errors
1 parent a100a4a commit 38c259e

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/components/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export interface InputOptions extends Omit<ComponentOptions, "rectangle"> {
9494
export class Input extends Box {
9595
declare drawnObjects: {
9696
box: BoxPainter;
97-
text: TextPainter;
98-
cursor: TextPainter;
97+
text: TextPainter<string[]>;
98+
cursor: TextPainter<string[]>;
9999
};
100100
declare theme: InputTheme;
101101

src/components/label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface LabelOptions extends Omit<ComponentOptions, "rectangle"> {
8282
* ```
8383
*/
8484
export class Label extends Component {
85-
declare drawnObjects: { texts: TextPainter[] };
85+
declare drawnObjects: { texts: TextPainter<string[]>[] };
8686

8787
#valueLines: Signal<string[]>;
8888

src/components/progressbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface ProgressBarOptions extends ComponentOptions {
103103
* ```
104104
*/
105105
export class ProgressBar extends Box {
106-
declare drawnObjects: { box: BoxPainter; progress: BoxPainter | TextPainter[] };
106+
declare drawnObjects: { box: BoxPainter; progress: BoxPainter | TextPainter<string[]>[] };
107107
declare theme: ProgressBarTheme;
108108

109109
min: Signal<number>;

src/components/table.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export class Table extends Component {
105105
declare theme: TableTheme;
106106
declare drawnObjects: {
107107
frame: [
108-
top: TextPainter,
109-
bottom: TextPainter,
110-
spacer: TextPainter,
108+
top: TextPainter<string[]>,
109+
bottom: TextPainter<string[]>,
110+
spacer: TextPainter<string[]>,
111111
left: BoxPainter,
112112
right: BoxPainter,
113113
];
114114

115-
header: TextPainter;
116-
data: TextPainter[];
115+
header: TextPainter<string[]>;
116+
data: TextPainter<string[]>[];
117117
};
118118

119119
data: Signal<string[][]>;

src/components/text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Component, ComponentOptions } from "../component.ts";
44
import { Computed, Signal } from "../signals/mod.ts";
55
import { signalify } from "../utils/signals.ts";
66

7-
export interface TextOptions {
7+
export interface TextOptions extends ComponentOptions {
88
text: string | Signal<string>;
99
overwriteWidth?: boolean | Signal<boolean>;
1010
multiCodePointSupport?: boolean | Signal<boolean>;
@@ -57,7 +57,7 @@ export interface TextOptions {
5757
* ```
5858
*/
5959
export class Text extends Component {
60-
declare drawnObjects: { text: TextPainter };
60+
declare drawnObjects: { text: TextPainter<string> };
6161

6262
text: Signal<string>;
6363
overwriteRectangle: Signal<boolean>;
@@ -76,7 +76,7 @@ export class Text extends Component {
7676
view: this.view,
7777
text: new Computed(() => {
7878
const text = this.text.value;
79-
return text.split("\n");
79+
return text;
8080
}),
8181
style: this.style,
8282
zIndex: this.zIndex,

0 commit comments

Comments
 (0)