@teaui/core
Version:
A high-level terminal UI library for Node
33 lines (32 loc) • 1 kB
TypeScript
import type { Viewport } from '../Viewport.js';
import { View } from '../View.js';
import { type Props as ContainerProps, Container } from '../Container.js';
import { Size } from '../geometry.js';
import { type MouseEvent } from '../events/index.js';
import { System } from '../System.js';
interface StyleProps {
/**
* @default true
*/
isCollapsed?: boolean;
/**
* If true, the collapsed view is always shown. Usually the expanded view
* *replaces* the collapsed view.
* @default false
*/
showCollapsed?: boolean;
collapsed?: View;
expanded?: View;
}
type Props = StyleProps & ContainerProps;
export declare class Collapsible extends Container {
#private;
constructor(props: Props);
update(props: Props): void;
add(child: View, at?: number): void;
removeChild(child: View): void;
naturalSize(available: Size): Size;
receiveMouse(event: MouseEvent, system: System): void;
render(viewport: Viewport): void;
}
export {};