import { Disposable } from "@codesandbox/pitcher-common"; import type { ChannelState, IChannel, ChannelData, ChannelErrorEvent, ChannelMessageEvent } from "../../../interface/clients/IChannelClient"; import type { PitcherMessageHandler } from "../../PitcherMessageHandler"; /** * Exposes an imperative abstraction over the Channels Protocol of Pitcher. It automatically * keeps a state of subscribers and manages notification listeners * related to the channel being subscribed or not */ export declare class Channel extends Disposable implements IChannel { private name; private messageHandler; private onErrorEmitter; private onJoinEmitter; private onLeaveEmitter; private onMessageEmitter; state: ChannelState; subscribers: Set; onError: import("@codesandbox/pitcher-common").Event; onSubscribe: import("@codesandbox/pitcher-common").Event; onUnsubscribe: import("@codesandbox/pitcher-common").Event; onMessage: import("@codesandbox/pitcher-common").Event>; constructor(name: string, messageHandler: PitcherMessageHandler); private listenToNotifications; subscribe(): Promise; unsubscribe(): Promise; sendAll(data: T): Promise | Promise<{ clients: string[]; }>; send(subscribers: Set, data: T): Promise | Promise<{ clients: string[]; }>; resync(): void; } //# sourceMappingURL=Channel.d.ts.map