import type { ITransportAdapter } from '../remoting/ITransportAdapter';
import type { IMailbox, IActorMessage, IMailboxOptions } from './IMailbox';
/**
 * Mailbox - Exclusive message queue for an actor.
 *
 * Implementation notes:
 * - Uses transport.subscribe for a unique topic (the mailbox address)
 * - Only one subscriber allowed (enforced by claim())
 * - Messages queued internally, delivered via receive() / async iterator
 * - Supports backpressure via configurable policy
 *
 * This provides serialized message processing - the core actor guarantee.
 * Messages are processed one at a time, in order, preventing interleaving bugs.
 */
export declare class Mailbox implements IMailbox {
    readonly address: string;
    private readonly transport;
    private readonly queue;
    private waiting;
    private _closed;
    private _claimed;
    private unsubscribe?;
    private readonly policy;
    private readonly copyPayloads;
    constructor(address: string, transport: ITransportAdapter, options?: IMailboxOptions);
    get depth(): number;
    get closed(): boolean;
    get claimed(): boolean;
    /**
     * Claim exclusive ownership of this mailbox.
     * Must be called before receiving messages.
     */
    claim(): void;
    /**
     * Normalize incoming payload to IActorMessage format.
     */
    private normalizeMessage;
    /**
     * Type guard for IActorMessage shape.
     */
    private isActorMessage;
    /**
     * Clone payload to prevent mutation issues (Hickey mitigation).
     */
    private clonePayload;
    /**
     * Apply backpressure policy when queue is full.
     */
    private applyBackpressure;
    /**
     * Either deliver immediately (if someone waiting) or enqueue.
     */
    private enqueueOrDeliver;
    /**
     * Send a message to this mailbox.
     * Anyone with the address can send.
     */
    send(message: IActorMessage): void;
    /**
     * Receive the next message (blocks until available).
     * Only the owner can receive.
     */
    receive(): Promise<IActorMessage>;
    /**
     * Async iterator for message loop.
     * Enables: for await (const msg of mailbox) { ... }
     */
    [Symbol.asyncIterator](): AsyncIterableIterator<IActorMessage>;
    /**
     * Close the mailbox.
     * Called on actor termination.
     */
    close(): void;
}
//# sourceMappingURL=Mailbox.d.ts.map