import type { IMatrixContext } from '../../engine/core/IMatrixContext';
import type { Position } from '../composite/Position';
/**
 * Component class constructor interface.
 */
export interface IComponentClass {
    new (): unknown;
    readonly name: string;
}
/**
 * Descriptor for recreating a child (Blueprint).
 * Used by Supervisor to restart crashed actors.
 */
export interface IChildBlueprint {
    componentClass: IComponentClass;
    props?: Record<string, unknown>;
}
/**
 * Child entry - ADDRESS ONLY, no component reference.
 */
export interface IChildEntry {
    /** Unique identifier within this parent */
    readonly id: string;
    /** Mount path (address) of the child */
    readonly mount: string;
    /** Slot the child belongs to */
    readonly slot: string;
    /** Component class name for introspection */
    readonly componentClass: string;
    /** When the child was added */
    readonly createdAt: number;
    /** Ops this child accepts (captured at registration) */
    readonly accepts: string[];
    /** Events this child emits (captured at registration) */
    readonly emits: string[];
    /** Sibling tracks this child listens to (captured at registration) */
    readonly tracks: string[];
}
/**
 * Options for adding a child.
 */
export interface IAddChildOptions {
    /** Slot to add child to (default: 'default') */
    slot?: string;
    /** Initial properties to pass to child */
    props?: Record<string, unknown>;
    /** Position within the slot */
    position?: Position;
}
/**
 * Internal entry with cleanup tracking and supervision metadata.
 */
interface IInternalChildEntry extends IChildEntry {
    unsubs: Set<() => void>;
    /** Blueprint for restarting */
    descriptor?: IChildBlueprint;
}
/**
 * ChildManager - Manages child actors by address.
 *
 * Provides address-based tracking and metadata storage for supervision.
 * DOES NOT hold references to child component instances.
 */
export declare class ChildManager {
    private readonly children;
    private readonly order;
    private readonly context;
    constructor(context: IMatrixContext);
    /**
     * Add a child actor.
     */
    addChild(id: string, componentClass: IComponentClass, options?: IAddChildOptions): Promise<string>;
    /**
     * Register a child that was created externally.
     */
    registerChild(id: string, mount: string, slot?: string, componentClassName?: string, position?: Position, classCtor?: IComponentClass, initialProps?: Record<string, unknown>): void;
    private _insertIdAtPosition;
    removeChild(id: string): Promise<void>;
    unregisterChild(id: string): void;
    getChildSlot(id: string): string | undefined;
    updateChildMount(id: string, newMount: string): void;
    moveChild(id: string, position: Position): void;
    getChildMount(id: string): string | undefined;
    getChild(id: string): IChildEntry | undefined;
    /**
     * Get internal child entry including supervision metadata.
     * Used by SupervisionBehavior to restart children.
     */
    getInternalChild(id: string): IInternalChildEntry | undefined;
    hasChild(id: string): boolean;
    /**
     * Get component class name for a child.
     * Used for introspection/serialization.
     */
    getChildClass(id: string): string | undefined;
    getChildIds(slot?: string): string[];
    getAllChildren(): IChildEntry[];
    getChildrenInSlot(slot: string): IChildEntry[];
    get childCount(): number;
    get slots(): string[];
    addChildUnsub(id: string, unsub: () => void): void;
    sendToChild(id: string, command: string, payload?: unknown): void;
    onChildEvent(id: string, event: string, handler: (payload: unknown) => void): () => void;
    broadcastToChildren(command: string, payload?: unknown, slot?: string): void;
    disposeAll(): Promise<void>;
}
export {};
//# sourceMappingURL=ChildManager.d.ts.map