Class

MentionPill

MentionPill()

Represents a system for generating a mention pill for an entity.
Constructor

# new MentionPill()

View Source helpers/MentionPill.ts, line 8

Classes

MentionPill

Members

# html

The HTML component of the mention.

View Source helpers/MentionPill.ts, line 18

# text

The plain text component of the mention.

View Source helpers/MentionPill.ts, line 24

Methods

# html() → {string}

The HTML component of the mention.

View Source helpers/MentionPill.ts, line 101

string

# text() → {string}

The plain text component of the mention.

View Source helpers/MentionPill.ts, line 108

string

# async static forRoom(roomIdOrAlias, client) → {Promise.<MentionPill>}

Creates a new mention for a room (not @room, but the room itself to be linked).
Parameters:
Name Type Description
roomIdOrAlias string The room ID or alias to mention.
client MatrixClient Optional client for creating a more pleasing mention.

View Source helpers/MentionPill.ts, line 129

Resolves to the room's mention.
Promise.<MentionPill>

# async static forUser(userId, inRoomId, client) → {Promise.<MentionPill>}

Creates a new mention for a user in an optional room.
Parameters:
Name Type Description
userId string The user ID the mention is for.
inRoomId String Optional room ID the user is being mentioned in, for the aesthetics of the mention.
client MatrixClient Optional client for creating a more pleasing mention.

View Source helpers/MentionPill.ts, line 119

Resolves to the user's mention.
Promise.<MentionPill>

# static withDisplayName(userId, displayName) → {MentionPill}

Creates a mention from static information.
Parameters:
Name Type Description
userId string The user ID the mention is for.
displayName string The user's display name.

View Source helpers/MentionPill.ts, line 138

The mention for the user.
MentionPill