import { IAsync } from "./AsyncBuilder.js"; import { Continuation } from "./AsyncBuilder.js"; import { CancellationToken } from "./AsyncBuilder.js"; declare class MailboxQueue { private firstAndLast?; add(message: Msg): void; tryGet(): Msg | undefined; } export type MailboxBody = (m: MailboxProcessor) => IAsync; export interface AsyncReplyChannel { reply: (r: Reply) => void; } export declare class MailboxProcessor { body: MailboxBody; cancellationToken: CancellationToken; messages: MailboxQueue; continuation?: Continuation; constructor(body: MailboxBody, cancellationToken?: CancellationToken); } export declare function startInstance($this: MailboxProcessor): void; export declare function receive($this: MailboxProcessor): (ctx: import("./AsyncBuilder.js").IAsyncContext) => void; export declare function post($this: MailboxProcessor, message: Msg): void; export declare function postAndAsyncReply($this: MailboxProcessor, buildMessage: (c: AsyncReplyChannel) => Msg): (ctx: import("./AsyncBuilder.js").IAsyncContext) => void; export declare function start(body: MailboxBody, cancellationToken?: CancellationToken): MailboxProcessor; export default MailboxProcessor;