UNPKG

@teaui/core

Version:

A high-level terminal UI library for Node

72 lines (71 loc) 1.8 kB
import type { Viewport } from '../Viewport.js'; import { Size } from '../geometry.js'; import { ZStack } from './ZStack.js'; type ContainerProps = ConstructorParameters<typeof ZStack>[0] & {}; export type Border = 'none' | 'single' | 'bold' | 'double' | 'rounded' | 'dotted'; export type BorderChars = [string, string, string, string, string, string] | [string, string, string, string, string, string, string] | [string, string, string, string, string, string, string, string]; export type CalculatedBorderChars = [ string, string, string, string, string, string, string, string ]; export interface BorderSizes { maxTop: number; maxBottom: number; maxRight: number; maxLeft: number; topLeft: { width: number; height: number; }; topMiddle: { width: number; height: number; }; topRight: { width: number; height: number; }; leftMiddle: { width: number; height: number; }; rightMiddle: { width: number; height: number; }; bottomLeft: { width: number; height: number; }; bottomMiddle: { width: number; height: number; }; bottomRight: { width: number; height: number; }; } interface Props extends ContainerProps { border?: Border | BorderChars; highlight?: boolean; title?: string; } export declare class Box extends ZStack { #private; constructor(props: Props); get border(): Border | BorderChars; set border(value: Border | BorderChars); update(props: Props): void; get title(): string | undefined; set title(value: string | undefined); naturalSize(available: Size): Size; render(viewport: Viewport): void; } export {};