wrapper
wrapper: { connection: Connection; mutation: { addSpeaker: (userId: string) => Promise<void>; askToSpeak: () => void; ban: (username: string, reason: string) => void; banFromRoomChat: (userId: string) => Promise<void>; changeModStatus: (userId: string, value: boolean) => Promise<void>; changeRoomCreator: (userId: string) => Promise<void>; createRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>; createRoomFromScheduledRoom: (data: { description: string; id: string; name: string }) => Promise<{ room: Room }>; createScheduledRoom: (data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>; deleteRoomChatMessage: (userId: string, messageId: string) => Promise<void>; deleteScheduledRoom: (id: string) => any; editProfile: (data: { avatarUrl: string; bannerUrl?: string; bio: string; displayName: string; username: string }) => Promise<{ isUsernameTaken: boolean }>; editRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>; editScheduledRoom: (id: string, data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>; follow: (userId: string, value: boolean) => Promise<void>; inviteToRoom: (userId: string) => void; leaveRoom: () => Promise<{ roomId: string }>; roomBan: (userId: string, shouldBanIp?: boolean) => Promise<void>; roomUpdate: (data: { autoSpeaker?: boolean; description?: string; name?: string; privacy?: string }) => Promise<void>; sendRoomChatMsg: (ast: MessageToken<string, unknown>[], whisperedTo?: string[]) => Promise<void>; setDeaf: (isDeafened: boolean) => Promise<Record<string, never>>; setListener: (userId: string) => Promise<void>; setMute: (isMuted: boolean) => Promise<Record<string, never>>; speakingChange: (value: boolean) => void; unbanFromRoom: (userId: string) => Promise<void>; unbanFromRoomChat: (userId: string) => Promise<void>; userBlock: (userId: string) => Promise<void>; userCreateBot: (username: string) => Promise<CreateBotResponse>; userUnblock: (userId: string) => Promise<void> }; query: { getBlockedFromRoomUsers: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>; getFollowList: (username: string, isFollowing: boolean, cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>; getInviteList: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>; getMyFollowing: (cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>; getMyScheduledRoomsAboutToStart: (roomId: string) => Promise<{ scheduledRooms: ScheduledRoom[] }>; getRoomUsers: () => Promise<GetRoomUsersResponse>; getScheduledRooms: (cursor?: string, getOnlyMyScheduledRooms?: boolean) => Promise<GetScheduledRoomsResponse>; getTopPublicRooms: (cursor?: number) => Promise<GetTopPublicRoomsResponse>; getUserProfile: (idOrUsername: string) => Promise<null | UserWithFollowInfo | { error: string }>; joinRoomAndGetInfo: (roomId: string) => Promise<JoinRoomAndGetInfoResponse | { error: string }>; search: (query: string) => Promise<{ items: (User | Room)[] }> }; subscribe: { handRaised: (handler: Handler<{ userId: string }>) => () => void; invitationToRoom: (handler: Handler<InvitationToRoomResponse>) => () => void; newChatMsg: (handler: Handler<{ msg: Message; userId: string }>) => () => void; newRoomDetails: (handler: Handler<NewRoomDetailsResponse>) => () => void; speakerAdded: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void; speakerRemoved: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void; userJoinRoom: (handler: Handler<{ user: User }>) => () => void; userLeaveRoom: (handler: Handler<{ roomId: string; userId: string }>) => () => void } }
Type declaration
-
connection: Connection
-
mutation: { addSpeaker: (userId: string) => Promise<void>; askToSpeak: () => void; ban: (username: string, reason: string) => void; banFromRoomChat: (userId: string) => Promise<void>; changeModStatus: (userId: string, value: boolean) => Promise<void>; changeRoomCreator: (userId: string) => Promise<void>; createRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>; createRoomFromScheduledRoom: (data: { description: string; id: string; name: string }) => Promise<{ room: Room }>; createScheduledRoom: (data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>; deleteRoomChatMessage: (userId: string, messageId: string) => Promise<void>; deleteScheduledRoom: (id: string) => any; editProfile: (data: { avatarUrl: string; bannerUrl?: string; bio: string; displayName: string; username: string }) => Promise<{ isUsernameTaken: boolean }>; editRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>; editScheduledRoom: (id: string, data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>; follow: (userId: string, value: boolean) => Promise<void>; inviteToRoom: (userId: string) => void; leaveRoom: () => Promise<{ roomId: string }>; roomBan: (userId: string, shouldBanIp?: boolean) => Promise<void>; roomUpdate: (data: { autoSpeaker?: boolean; description?: string; name?: string; privacy?: string }) => Promise<void>; sendRoomChatMsg: (ast: MessageToken<string, unknown>[], whisperedTo?: string[]) => Promise<void>; setDeaf: (isDeafened: boolean) => Promise<Record<string, never>>; setListener: (userId: string) => Promise<void>; setMute: (isMuted: boolean) => Promise<Record<string, never>>; speakingChange: (value: boolean) => void; unbanFromRoom: (userId: string) => Promise<void>; unbanFromRoomChat: (userId: string) => Promise<void>; userBlock: (userId: string) => Promise<void>; userCreateBot: (username: string) => Promise<CreateBotResponse>; userUnblock: (userId: string) => Promise<void> }
-
addSpeaker: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
askToSpeak: () => void
-
ban: (username: string, reason: string) => void
-
- (username: string, reason: string): void
-
Parameters
-
username: string
-
reason: string
Returns void
-
banFromRoomChat: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
changeModStatus: (userId: string, value: boolean) => Promise<void>
-
- (userId: string, value: boolean): Promise<void>
-
Parameters
-
userId: string
-
value: boolean
Returns Promise<void>
-
changeRoomCreator: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
createRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>
-
- (data: { description: string; name: string; privacy: string }): Promise<{ error: string } | { room: Room }>
-
Parameters
-
data: { description: string; name: string; privacy: string }
-
description: string
-
name: string
-
privacy: string
Returns Promise<{ error: string } | { room: Room }>
-
createRoomFromScheduledRoom: (data: { description: string; id: string; name: string }) => Promise<{ room: Room }>
-
- (data: { description: string; id: string; name: string }): Promise<{ room: Room }>
-
Parameters
-
data: { description: string; id: string; name: string }
-
description: string
-
id: string
-
name: string
Returns Promise<{ room: Room }>
-
createScheduledRoom: (data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>
-
- (data: { description: string; name: string; scheduledFor: string }): Promise<ScheduledRoom | { error: string }>
-
Parameters
-
data: { description: string; name: string; scheduledFor: string }
-
description: string
-
name: string
-
scheduledFor: string
Returns Promise<ScheduledRoom | { error: string }>
-
deleteRoomChatMessage: (userId: string, messageId: string) => Promise<void>
-
- (userId: string, messageId: string): Promise<void>
-
Parameters
-
userId: string
-
messageId: string
Returns Promise<void>
-
deleteScheduledRoom: (id: string) => any
-
editProfile: (data: { avatarUrl: string; bannerUrl?: string; bio: string; displayName: string; username: string }) => Promise<{ isUsernameTaken: boolean }>
-
- (data: { avatarUrl: string; bannerUrl?: string; bio: string; displayName: string; username: string }): Promise<{ isUsernameTaken: boolean }>
-
Parameters
-
data: { avatarUrl: string; bannerUrl?: string; bio: string; displayName: string; username: string }
-
avatarUrl: string
-
Optional bannerUrl?: string
-
bio: string
-
displayName: string
-
username: string
Returns Promise<{ isUsernameTaken: boolean }>
-
editRoom: (data: { description: string; name: string; privacy: string }) => Promise<{ error: string } | { room: Room }>
-
- (data: { description: string; name: string; privacy: string }): Promise<{ error: string } | { room: Room }>
-
Parameters
-
data: { description: string; name: string; privacy: string }
-
description: string
-
name: string
-
privacy: string
Returns Promise<{ error: string } | { room: Room }>
-
editScheduledRoom: (id: string, data: { description: string; name: string; scheduledFor: string }) => Promise<ScheduledRoom | { error: string }>
-
- (id: string, data: { description: string; name: string; scheduledFor: string }): Promise<ScheduledRoom | { error: string }>
-
Parameters
-
id: string
-
data: { description: string; name: string; scheduledFor: string }
-
description: string
-
name: string
-
scheduledFor: string
Returns Promise<ScheduledRoom | { error: string }>
-
follow: (userId: string, value: boolean) => Promise<void>
-
- (userId: string, value: boolean): Promise<void>
-
Parameters
-
userId: string
-
value: boolean
Returns Promise<void>
-
inviteToRoom: (userId: string) => void
-
leaveRoom: () => Promise<{ roomId: string }>
-
- (): Promise<{ roomId: string }>
-
Returns Promise<{ roomId: string }>
-
roomBan: (userId: string, shouldBanIp?: boolean) => Promise<void>
-
- (userId: string, shouldBanIp?: boolean): Promise<void>
-
Parameters
-
userId: string
-
Optional shouldBanIp: boolean
Returns Promise<void>
-
roomUpdate: (data: { autoSpeaker?: boolean; description?: string; name?: string; privacy?: string }) => Promise<void>
-
- (data: { autoSpeaker?: boolean; description?: string; name?: string; privacy?: string }): Promise<void>
-
Parameters
-
data: { autoSpeaker?: boolean; description?: string; name?: string; privacy?: string }
-
Optional autoSpeaker?: boolean
-
Optional description?: string
-
Optional name?: string
-
Optional privacy?: string
Returns Promise<void>
-
sendRoomChatMsg: (ast: MessageToken<string, unknown>[], whisperedTo?: string[]) => Promise<void>
-
- (ast: MessageToken<string, unknown>[], whisperedTo?: string[]): Promise<void>
-
Parameters
-
ast: MessageToken<string, unknown>[]
-
Optional whisperedTo: string[]
Returns Promise<void>
-
setDeaf: (isDeafened: boolean) => Promise<Record<string, never>>
-
- (isDeafened: boolean): Promise<Record<string, never>>
-
Parameters
Returns Promise<Record<string, never>>
-
setListener: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
setMute: (isMuted: boolean) => Promise<Record<string, never>>
-
- (isMuted: boolean): Promise<Record<string, never>>
-
Parameters
Returns Promise<Record<string, never>>
-
speakingChange: (value: boolean) => void
-
unbanFromRoom: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
unbanFromRoomChat: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
userBlock: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
userCreateBot: (username: string) => Promise<CreateBotResponse>
-
- (username: string): Promise<CreateBotResponse>
-
Parameters
Returns Promise<CreateBotResponse>
-
userUnblock: (userId: string) => Promise<void>
-
- (userId: string): Promise<void>
-
Parameters
Returns Promise<void>
-
query: { getBlockedFromRoomUsers: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>; getFollowList: (username: string, isFollowing: boolean, cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>; getInviteList: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>; getMyFollowing: (cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>; getMyScheduledRoomsAboutToStart: (roomId: string) => Promise<{ scheduledRooms: ScheduledRoom[] }>; getRoomUsers: () => Promise<GetRoomUsersResponse>; getScheduledRooms: (cursor?: string, getOnlyMyScheduledRooms?: boolean) => Promise<GetScheduledRoomsResponse>; getTopPublicRooms: (cursor?: number) => Promise<GetTopPublicRoomsResponse>; getUserProfile: (idOrUsername: string) => Promise<null | UserWithFollowInfo | { error: string }>; joinRoomAndGetInfo: (roomId: string) => Promise<JoinRoomAndGetInfoResponse | { error: string }>; search: (query: string) => Promise<{ items: (User | Room)[] }> }
-
getBlockedFromRoomUsers: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>
-
- (cursor?: number): Promise<{ nextCursor: null | number; users: User[] }>
-
Parameters
Returns Promise<{ nextCursor: null | number; users: User[] }>
-
getFollowList: (username: string, isFollowing: boolean, cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
- (username: string, isFollowing: boolean, cursor?: number): Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
Parameters
-
username: string
-
isFollowing: boolean
-
Optional cursor: number
Returns Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
getInviteList: (cursor?: number) => Promise<{ nextCursor: null | number; users: User[] }>
-
- (cursor?: number): Promise<{ nextCursor: null | number; users: User[] }>
-
Parameters
Returns Promise<{ nextCursor: null | number; users: User[] }>
-
getMyFollowing: (cursor?: number) => Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
- (cursor?: number): Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
Parameters
Returns Promise<{ nextCursor: null | number; users: UserWithFollowInfo[] }>
-
getMyScheduledRoomsAboutToStart: (roomId: string) => Promise<{ scheduledRooms: ScheduledRoom[] }>
-
- (roomId: string): Promise<{ scheduledRooms: ScheduledRoom[] }>
-
Parameters
Returns Promise<{ scheduledRooms: ScheduledRoom[] }>
-
getRoomUsers: () => Promise<GetRoomUsersResponse>
-
- (): Promise<GetRoomUsersResponse>
-
Returns Promise<GetRoomUsersResponse>
-
getScheduledRooms: (cursor?: string, getOnlyMyScheduledRooms?: boolean) => Promise<GetScheduledRoomsResponse>
-
- (cursor?: string, getOnlyMyScheduledRooms?: boolean): Promise<GetScheduledRoomsResponse>
-
Parameters
-
Optional cursor: string
-
Optional getOnlyMyScheduledRooms: boolean
Returns Promise<GetScheduledRoomsResponse>
-
getTopPublicRooms: (cursor?: number) => Promise<GetTopPublicRoomsResponse>
-
- (cursor?: number): Promise<GetTopPublicRoomsResponse>
-
Parameters
Returns Promise<GetTopPublicRoomsResponse>
-
getUserProfile: (idOrUsername: string) => Promise<null | UserWithFollowInfo | { error: string }>
-
- (idOrUsername: string): Promise<null | UserWithFollowInfo | { error: string }>
-
Parameters
Returns Promise<null | UserWithFollowInfo | { error: string }>
-
joinRoomAndGetInfo: (roomId: string) => Promise<JoinRoomAndGetInfoResponse | { error: string }>
-
- (roomId: string): Promise<JoinRoomAndGetInfoResponse | { error: string }>
-
Parameters
Returns Promise<JoinRoomAndGetInfoResponse | { error: string }>
-
search: (query: string) => Promise<{ items: (User | Room)[] }>
-
- (query: string): Promise<{ items: (User | Room)[] }>
-
Parameters
Returns Promise<{ items: (User | Room)[] }>
-
subscribe: { handRaised: (handler: Handler<{ userId: string }>) => () => void; invitationToRoom: (handler: Handler<InvitationToRoomResponse>) => () => void; newChatMsg: (handler: Handler<{ msg: Message; userId: string }>) => () => void; newRoomDetails: (handler: Handler<NewRoomDetailsResponse>) => () => void; speakerAdded: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void; speakerRemoved: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void; userJoinRoom: (handler: Handler<{ user: User }>) => () => void; userLeaveRoom: (handler: Handler<{ roomId: string; userId: string }>) => () => void }
-
handRaised: (handler: Handler<{ userId: string }>) => () => void
-
- (handler: Handler<{ userId: string }>): () => void
-
Parameters
-
handler: Handler<{ userId: string }>
Returns () => void
-
invitationToRoom: (handler: Handler<InvitationToRoomResponse>) => () => void
-
- (handler: Handler<InvitationToRoomResponse>): () => void
-
Parameters
-
handler: Handler<InvitationToRoomResponse>
Returns () => void
-
newChatMsg: (handler: Handler<{ msg: Message; userId: string }>) => () => void
-
- (handler: Handler<{ msg: Message; userId: string }>): () => void
-
Parameters
-
handler: Handler<{ msg: Message; userId: string }>
Returns () => void
-
newRoomDetails: (handler: Handler<NewRoomDetailsResponse>) => () => void
-
- (handler: Handler<NewRoomDetailsResponse>): () => void
-
Parameters
-
handler: Handler<NewRoomDetailsResponse>
Returns () => void
-
speakerAdded: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void
-
- (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>): () => void
-
Parameters
-
handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>
Returns () => void
-
speakerRemoved: (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>) => () => void
-
- (handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>): () => void
-
Parameters
-
handler: Handler<{ deafMap: BooleanMap; muteMap: BooleanMap; userId: string }>
Returns () => void
-
userJoinRoom: (handler: Handler<{ user: User }>) => () => void
-
- (handler: Handler<{ user: User }>): () => void
-
Parameters
-
handler: Handler<{ user: User }>
Returns () => void
-
userLeaveRoom: (handler: Handler<{ roomId: string; userId: string }>) => () => void
-
- (handler: Handler<{ roomId: string; userId: string }>): () => void
-
Parameters
-
handler: Handler<{ roomId: string; userId: string }>
Returns () => void
The main client class.
The client options.