UNPKG

@teaui/core

Version:

A high-level terminal UI library for Node

34 lines (33 loc) 1.52 kB
import type { Viewport } from '../Viewport.js'; import { type Props as ViewProps, View } from '../View.js'; import type { FlexShorthand, FlexSize } from '../View.js'; import { Container } from '../Container.js'; import { Size } from '../geometry.js'; import { type Direction } from '../types.js'; interface Props extends ViewProps { children?: ([FlexShorthand, View] | View)[]; child?: [FlexShorthand, View] | View; direction?: Direction; fill?: boolean; gap?: number; } type ShorthandProps = NonNullable<Props['children']> | Omit<Props, 'direction'>; export declare class Stack extends Container { #private; static down(props?: ShorthandProps, extraProps?: Omit<Props, 'children' | 'direction'>): Stack; static up(props?: ShorthandProps, extraProps?: Omit<Props, 'children' | 'direction'>): Stack; static right(props?: ShorthandProps, extraProps?: Omit<Props, 'children' | 'direction'>): Stack; static left(props?: ShorthandProps, extraProps?: Omit<Props, 'children' | 'direction'>): Stack; constructor({ children, child, direction, fill, gap, ...viewProps }: Props); get direction(): Direction; set direction(value: Direction); get gap(): number; set gap(value: number); update({ children, child, ...props }: Props): void; naturalSize(available: Size): Size; add(child: View, at?: number): void; addFlex(flexSize: FlexSize, child: View, at?: number): void; get isVertical(): boolean; render(viewport: Viewport): void; } export {};