UNPKG

asciitorium

Version:

an ASCII ui framework for web + cli

32 lines (31 loc) 1.03 kB
import type { Component } from '../Component'; /** * Interface for layout strategies that handle child component positioning */ export interface LayoutStrategy { /** * Calculate positions and sizes for child components * @param parent The parent component containing the children * @param children Array of child components to layout */ layout(parent: Component, children: Component[]): void; } /** * Available layout types that can be specified by name */ export type LayoutType = 'horizontal' | 'vertical' | 'absolute'; /** * Configuration options for specific layout strategies */ export interface LayoutOptions { fit?: boolean; } /** * Registry of available layout strategies */ export declare class LayoutRegistry { private static strategies; static register(type: LayoutType, strategyClass: new (options?: LayoutOptions) => LayoutStrategy): void; static create(type: LayoutType, options?: LayoutOptions): LayoutStrategy; static getAvailableTypes(): LayoutType[]; }