-
Notifications
You must be signed in to change notification settings - Fork 119
/
IRoomExtender.ts
40 lines (34 loc) · 1.14 KB
/
IRoomExtender.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { RocketChatAssociationModel } from '../metadata';
import { IRoom } from '../rooms';
import { IUser } from '../users';
export interface IRoomExtender {
kind: RocketChatAssociationModel.ROOM;
/**
* Adds a custom field to the room.
* Note: This key can not already exist or it will throw an error.
* Note: The key must not contain a period in it, an error will be thrown.
*
* @param key the name of the custom field
* @param value the value of this custom field
*/
addCustomField(key: string, value: any): IRoomExtender;
/**
* Adds a user to the room.
*
* @param user the user which is to be added to the room
*/
addMember(user: IUser): IRoomExtender;
/**
* Get a list of users being added to the room.
*/
getMembersBeingAdded(): Array<IUser>;
/**
* Get a list of usernames of users being added to the room.
*/
getUsernamesOfMembersBeingAdded(): Array<string>;
/**
* Gets the resulting room that has been extended at the point of calling this.
* Note: modifying the returned value will have no effect.
*/
getRoom(): IRoom;
}