chore(ts): use source import extensions

This commit is contained in:
Armin Ronacher
2026-05-20 00:04:03 +02:00
parent 06c6c324d7
commit ae9450dc51
259 changed files with 1483 additions and 1300 deletions

View File

@@ -1,5 +1,5 @@
import type { TUI } from "../tui.js";
import { Text } from "./text.js";
import type { TUI } from "../tui.ts";
import { Text } from "./text.ts";
export interface LoaderIndicatorOptions {
/** Animation frames. Use an empty array to hide the indicator. */
@@ -21,17 +21,23 @@ export class Loader extends Text {
private intervalId: NodeJS.Timeout | null = null;
private ui: TUI | null = null;
private renderIndicatorVerbatim = false;
private spinnerColorFn: (str: string) => string;
private messageColorFn: (str: string) => string;
private message: string = "Loading...";
constructor(
ui: TUI,
private spinnerColorFn: (str: string) => string,
private messageColorFn: (str: string) => string,
private message: string = "Loading...",
spinnerColorFn: (str: string) => string,
messageColorFn: (str: string) => string,
message: string = "Loading...",
indicator?: LoaderIndicatorOptions,
) {
super("", 1, 0);
this.ui = ui;
this.setIndicator(indicator);
this.spinnerColorFn = spinnerColorFn;
this.messageColorFn = messageColorFn;
this.message = message;
}
render(width: number): string[] {