asciitorium
Version:
an ASCII CLUI framework
34 lines (33 loc) • 997 B
TypeScript
import { Component, ComponentProps } from '../core/Component.js';
/**
* Properties for Default component
*/
export interface DefaultProps extends ComponentProps {
/** Component class or function to instantiate as fallback */
create?: any;
/** Optional props to pass to the component */
with?: any;
}
/**
* Default component for use within Switch as a fallback case.
*
* Creates a new component instance when no Case matches,
* ensuring proper lifecycle management and clean state.
*
* Usage:
* ```tsx
* <Default create={GuestPanel} />
* <Default create={GuestPanel} with={{ width: 50 }} />
* ```
*
* WARNING: Do not use JSX children syntax - components will persist in memory!
*/
export declare class Default extends Component {
private readonly componentFactory?;
constructor(props: DefaultProps);
/**
* Returns the component factory function if provided.
*/
getComponentFactory(): (() => Component) | undefined;
draw(): string[][];
}