Options
All
  • Public
  • Public/Protected
  • All
Menu

Identifies a channel by its type and ID. This is the base class for all channel identifiers. Use the specific subclass constructors (e.g. DirectChannelIdentifier, GroupChannelIdentifier) for type-safe channel identification.

example
const directId = new DirectChannelIdentifier('user-123');
const groupId = new GroupChannelIdentifier('group-456');
console.log(directId.channelType); // ChannelType.DIRECT
console.log(directId.channelId); // 'user-123'

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

  • Creates a new ChannelIdentifier.

    Parameters

    • _channelType: ChannelType

      The type of the channel

    • _channelId: string

      The unique ID of the channel

    Returns ChannelIdentifier

Accessors

  • get channelId(): string
  • The unique ID of the channel

    Returns string

Methods

  • Checks whether this identifier refers to the same channel as another.

    example
    const id1 = new DirectChannelIdentifier('user-123');
    const id2 = new DirectChannelIdentifier('user-123');
    console.log(id1.isEqualTo(id2)); // true

    Parameters

    Returns boolean

    true if both identifiers refer to the same channel