mpc-js
    Preparing search index...

    Interface ClientToClientCommands

    interface ClientToClientCommands {
        channels(): Promise<string[]>;
        readMessages(): Promise<Map<string, string[]>>;
        sendMessage(channel: string, text: string): Promise<void>;
        subscribe(channel: string): Promise<void>;
        unsubscribe(channel: string): Promise<void>;
    }

    Hierarchy

    • ReturnType<typeof createClientToClientCommands>
      • ClientToClientCommands
    Index

    Methods

    • Reads messages for this client. Returns a Map containing the messages grouped by channel name.

      Returns Promise<Map<string, string[]>>

    • Send a message to the specified channel.

      Parameters

      • channel: string
      • text: string

      Returns Promise<void>

    • Subscribe to a channel. The channel is created if it does not exist already. The name may consist of alphanumeric ASCII characters plus underscore, dash, dot and colon.

      Parameters

      • channel: string

      Returns Promise<void>

    • Unsubscribe from a channel.

      Parameters

      • channel: string

      Returns Promise<void>