UNPKG

@teaui/core

Version:

A high-level terminal UI library for Node

36 lines (35 loc) 1 kB
import type { Viewport } from '../Viewport.js'; import type { Props as ViewProps } from '../View.js'; import { View } from '../View.js'; import { Style } from '../Style.js'; import { Size } from '../geometry.js'; import { Alignment, FontFamily } from '../types.js'; interface TextProps { text?: string; lines?: undefined; } interface LinesProps { text?: undefined; lines: string[]; } interface StyleProps { style?: Style; alignment: Alignment; wrap: boolean; font?: FontFamily; } type Props = Partial<StyleProps> & (TextProps | LinesProps) & ViewProps; export declare class Text extends View { #private; constructor(propsOrString?: string | Props); get text(): string; set text(value: string); get font(): FontFamily; set font(value: FontFamily); get style(): Style | undefined; set style(value: Style | undefined); update(props: Props): void; naturalSize(available: Size): Size; render(viewport: Viewport): void; } export {};