Interface IComposable

Represent the class can be composite

interface IComposable {
    children: IComposable[];
    parent: undefined | IComposable;
    add(item: IComposable | IComposable[]): this;
    detach(): void;
    dispose(): void;
    extractChildrenToFlatList(): IComposable[];
    remove(item: IComposable | IComposable[]): this;
}

Implemented by

Properties

children: IComposable[]

Contains all child components

parent: undefined | IComposable

The parent of this component, undefined means it's the root

Methods