UNPKG

@teaui/core

Version:

A high-level terminal UI library for Node

36 lines (35 loc) 1.36 kB
import { type Props as ContainerProps, Container } from '../Container.js'; import { type Purpose } from '../Palette.js'; import type { View } from '../View.js'; import { Stack } from './Stack.js'; import { type Direction } from '../types.js'; export interface Props extends ContainerProps { title?: string; purpose?: Purpose; direction?: Direction; } /** * Internal base class for Alert and Callout. Not exported. * * Owns a managed Stack for child layout. Subclasses must call * `this.addDirect(view)` to add views to the Container directly * (bypassing the stack-forwarding `add()` override), and use * `this.contentStack` to place the stack in their view hierarchy. */ export declare class Notification extends Container { #private; constructor({ title, purpose, direction, children, child, ...props }: Props); /** * The managed Stack that holds title + children. * Subclasses use this to place the stack in their view hierarchy. */ protected get contentStack(): Stack; /** * Add a view directly to the Container, bypassing the stack-forwarding * `add()` override. Used by subclasses to set up their view hierarchy. */ protected addDirect(child: View, at?: number): void; update(props: Props): void; add(child: View, at?: number): void; removeChild(child: View): void; }