Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MatrixUser

Index

Constructors

constructor

  • new MatrixUser(userId: string, _data?: Record<string, unknown>, escape?: boolean): MatrixUser
  • Construct a Matrix user.

    Parameters

    • userId: string

      The userId of the user.

    • _data: Record<string, unknown> = {}
    • escape: boolean = MatrixUser.ESCAPE_DEFAULT

      Escape the user's localpart. Modify {@link MatrixUser~ESCAPE_DEFAULT} to change the default value.

    Returns MatrixUser

Properties

Readonly host

host: string

userId

userId: string

Static ESCAPE_DEFAULT

ESCAPE_DEFAULT: boolean = true
static

This is a global variable to modify the default escaping behaviour of MatrixUser.

Accessors

localpart

  • get localpart(): string

Methods

escapeUserId

  • escapeUserId(): void

get

  • get<T>(key: string): T
  • Get the data value for the given key.

    Type parameters

    • T

    Parameters

    • key: string

      An arbitrary bridge-specific key.

    Returns T

    Stored data for this key. May be undefined.

getDisplayName

  • getDisplayName(): null | string

getId

  • getId(): string

serialize

  • serialize(): { localpart: string }
  • Serialize all the data about this user, excluding the user ID.

    Returns { localpart: string }

    The serialised data

    • localpart: string

set

  • set(key: string, val: unknown): void
  • Set an arbitrary bridge-specific data value for this room.

    Parameters

    • key: string

      The key to store the data value under.

    • val: unknown

      The data value. This value should be serializable via JSON.stringify(data).

    Returns void

setDisplayName

  • setDisplayName(name: string): void

Generated using TypeDoc