import { Disposable } from "@codesandbox/pitcher-common"; import type { ClientJSON } from "@codesandbox/pitcher-protocol/dist/src/messages/client"; import { States } from "class-states"; import type { CommandState, ICommandChannel, ChannelData, ChannelMessageEvent } from "../../../interface/clients/IChannelClient"; import type { PitcherMessageHandler } from "../../PitcherMessageHandler"; import type { ClientClient } from "../ClientClient"; /** * Allows to send commands to clients of the same user, guarantees message is sent to the host */ export declare class CommandChannel extends Disposable implements ICommandChannel { private name; private hostChannel; private messageHandler; private currentClient; state: States>; constructor({ name, currentClient, clientClient, messageHandler, }: { name: string; currentClient: ClientJSON; clientClient: ClientClient; messageHandler: PitcherMessageHandler; }); private updateChannels; /** * Messages from your other clients */ onMessage(cb: (message: ChannelMessageEvent) => void): import("@codesandbox/pitcher-common").IDisposable; /** * Send to your other clients */ send(message: T): void; resync(): void; } //# sourceMappingURL=CommandChannel.d.ts.map