import { Application } from '../application'; import { EventDispatcher, Event, EventMap } from './events'; import { DeclarationOption } from './options/declaration'; export interface ComponentHost { readonly application: Application; } export interface Component extends AbstractComponent { } export interface ComponentClass extends Function { new (owner: O): T; } export interface ComponentOptions { name?: string; childClass?: Function; internal?: boolean; } export declare function Component(options: ComponentOptions): ClassDecorator; export declare class ComponentEvent extends Event { owner: ComponentHost; component: AbstractComponent; static ADDED: string; static REMOVED: string; constructor(name: string, owner: ComponentHost, component: AbstractComponent); } export declare const DUMMY_APPLICATION_OWNER: unique symbol; export declare abstract class AbstractComponent extends EventDispatcher implements ComponentHost { private _componentOwner; componentName: string; private _componentOptions?; constructor(owner: O | typeof DUMMY_APPLICATION_OWNER); protected initialize(): void; protected bubble(name: Event | EventMap | string, ...args: any[]): this; getOptionDeclarations(): DeclarationOption[]; get application(): Application; get owner(): O; } export declare abstract class ChildableComponent extends AbstractComponent { private _componentChildren?; private _defaultComponents?; constructor(owner: O | typeof DUMMY_APPLICATION_OWNER); getComponent(name: string): C | undefined; getComponents(): C[]; hasComponent(name: string): boolean; addComponent(name: string, componentClass: T | ComponentClass): T; removeComponent(name: string): C | undefined; removeAllComponents(): void; }