import { TerminalRegion } from '../region.js'; import type { Renderable } from './renderable.js'; /** * Base class for terminal UI components * Provides layout properties and rendering interface * * Note: We don't need parent/child relationships. Flex just needs: * - An array of renderables to measure and render * - No need for components to know their parent */ export declare abstract class Component implements Renderable { protected region: TerminalRegion; protected children: Component[]; protected minWidth: number; protected maxWidth: number; readonly flexGrow: number; readonly flexShrink: number; protected width?: number; constructor(region: TerminalRegion, options?: ComponentOptions); /** * Add a child component (for Flex to build its children array) * No parent wiring needed - Flex just iterates over children */ addChild(child: Component): void; /** * Get the preferred width of this component */ abstract getPreferredWidth(): number; /** * Get the minimum width this component needs */ getMinWidth(): number; /** * Get the maximum width this component can use */ getMaxWidth(): number; /** * Render the component at the given position and width */ abstract render(x: number, y: number, width: number): void; /** * Get the height this component will take */ abstract getHeight(): number; } export interface ComponentOptions { minWidth?: number; maxWidth?: number; flexGrow?: number; flexShrink?: number; width?: number; } //# sourceMappingURL=base.d.ts.map