ContextChannels

Index

Type aliases

ChannelId

ChannelId: string

Variables

Const GLOBAL_CHANNEL_ID

GLOBAL_CHANNEL_ID: ChannelId = "global"

Functions

addEventListener

  • addEventListener(event: "channel-changed", listener: ChannelChangedListener, identity?: Identity): void
  • Event that is fired whenever a window changes from one channel to another.

    This includes switching to/from the global channel. The channel and previousChannel fields use the same conventions for denoting the global channel as getChannel.

    Parameters

    • event: "channel-changed"
    • listener: ChannelChangedListener
    • Optional identity: Identity

    Returns void

getAllChannels

  • getAllChannels(): Promise<Channel[]>

getChannel

  • getChannel(identity?: Identity): Promise<Channel>
  • Returns the channel that the current window is assigned to

    Parameters

    • Optional identity: Identity

    Returns Promise<Channel>

getChannelMembers

  • getChannelMembers(id: ChannelId): Promise<Identity[]>
  • Returns a list of all windows belonging to the specified channel.

    Parameters

    Returns Promise<Identity[]>

joinChannel

  • joinChannel(id: ChannelId, identity?: Identity): Promise<void>
  • Sets the window to the channel with the given identifier

    Use the special constant 'global' to revert to the global channel.

    Parameters

    Returns Promise<void>