import { Self } from "./mod"; import { Option } from "./option"; import { Result } from "./result"; export declare class SenderError { error: string; constructor(self: Self); } export declare class ReceiverError { error: string; constructor(self: Self); } export declare class SyncSender { messages: T[]; constructor(self: Self>); send(value: T): Result<{}, SenderError>; } export declare class SyncReceiver { messages: T[]; constructor(self: Self>); recv(): Option; } export declare function syncChannel(): [SyncSender, SyncReceiver]; export declare class Sender { sender: SyncSender>; constructor(self: Self>); send(task: Promise): void; } export declare class Receiver { task: Promise>; receiver: SyncReceiver>; constructor(self: Self>); recv(): Promise>; } export declare function channel(): [Sender, Receiver];