Skip to content

chatroom.chatroom.ChatRoomModule

Zvicii edited this page Apr 19, 2023 · 8 revisions

Class: ChatRoomModule

chatroom/chatroom.ChatRoomModule

Hierarchy

Table of contents

Methods

Properties

Constructors

Methods

eventNames

eventNames(): keyof ChatRoomEvents[]

Return an array listing the events for which the emitter has registered listeners.

Returns

keyof ChatRoomEvents[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


listeners

listeners<T>(event): (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void[]

Return the listeners registered for a given event.

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T

Returns

(...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void[]

Inherited from

EventEmitter.listeners

Defined in

node_modules/eventemitter3/index.d.ts:20


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

Name Type
event keyof ChatRoomEvents

Returns

number

Inherited from

EventEmitter.listenerCount

Defined in

node_modules/eventemitter3/index.d.ts:27


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
...args ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

on<T>(event, fn, context?): ChatRoomModule

Add a listener for a given event.

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
fn (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void
context? any

Returns

ChatRoomModule

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

addListener<T>(event, fn, context?): ChatRoomModule

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
fn (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void
context? any

Returns

ChatRoomModule

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

once<T>(event, fn, context?): ChatRoomModule

Add a one-time listener for a given event.

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
fn (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void
context? any

Returns

ChatRoomModule

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

removeListener<T>(event, fn?, context?, once?): ChatRoomModule

Remove the listeners of a given event.

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
fn? (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void
context? any
once? boolean

Returns

ChatRoomModule

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

off<T>(event, fn?, context?, once?): ChatRoomModule

Type parameters

Name Type
T extends keyof ChatRoomEvents

Parameters

Name Type
event T
fn? (...args: ArgumentMap<ChatRoomEvents>[Extract<T, keyof ChatRoomEvents>]) => void
context? any
once? boolean

Returns

ChatRoomModule

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): ChatRoomModule

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? keyof ChatRoomEvents

Returns

ChatRoomModule

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

Returns

void

Defined in

ts/chatroom/chatroom.ts:71


init

init(app_install_dir, json_extension): boolean

Parameters

Name Type
app_install_dir string
json_extension string

Returns

boolean

Defined in

ts/chatroom/chatroom.ts:75


cleanup

cleanup(json_extension): void

Parameters

Name Type
json_extension string

Returns

void

Defined in

ts/chatroom/chatroom.ts:79


independentEnter

independentEnter(room_id, info, config): boolean

Parameters

Name Type
room_id number
info ChatRoomIndependentEnterInfo
config ChatRoomConfig

Returns

boolean

Defined in

ts/chatroom/chatroom.ts:83


anonymousEnter

anonymousEnter(room_id, anonymity_info, info, config): boolean

Parameters

Name Type
room_id number
anonymity_info ChatRoomAnoymityEnterInfo
info ChatRoomEnterInfo
config ChatRoomConfig

Returns

boolean

Defined in

ts/chatroom/chatroom.ts:87


enter

enter(room_id, request_login_data, info, json_extension): boolean

Parameters

Name Type
room_id number
request_login_data string
info ChatRoomEnterInfo
json_extension string

Returns

boolean

Defined in

ts/chatroom/chatroom.ts:91


exit

exit(room_id, json_extension): void

Parameters

Name Type
room_id number
json_extension string

Returns

void

Defined in

ts/chatroom/chatroom.ts:95


getLoginState

getLoginState(room_id, json_extension): NIMChatRoomLoginState

Parameters

Name Type
room_id number
json_extension string

Returns

NIMChatRoomLoginState

Defined in

ts/chatroom/chatroom.ts:99


setMsgsBatchReport

setMsgsBatchReport(set_batch, json_extension): void

Parameters

Name Type
set_batch boolean
json_extension string

Returns

void

Defined in

ts/chatroom/chatroom.ts:103


sendMsg

sendMsg(room_id, msg, json_extension): boolean

Parameters

Name Type
room_id number
msg ChatRoomMessage
json_extension string

Returns

boolean

Defined in

ts/chatroom/chatroom.ts:107


getMembersOnlineAsync

getMembersOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, number, ChatRoomMemberInfo[]]>

Parameters

Name Type
room_id number
parameters ChatRoomGetMembersParameters
cb null | GetMembersCallback
json_extension string

Returns

Promise<[number, number, ChatRoomMemberInfo[]]>

Defined in

ts/chatroom/chatroom.ts:111


getMembersByTagOnlineAsync

getMembersByTagOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, number, ChatRoomMemberInfo[]]>

Parameters

Name Type
room_id number
parameters ChatRoomGetMembersByTagParameters
cb null | GetMembersCallback
json_extension string

Returns

Promise<[number, number, ChatRoomMemberInfo[]]>

Defined in

ts/chatroom/chatroom.ts:132


getMembersCountByTagOnlineAsync

getMembersCountByTagOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, NIMResCode, number]>

Parameters

Name Type
room_id number
parameters ChatRoomGetMembersParameters
cb null | GetMembersCountByTagCallback
json_extension string

Returns

Promise<[number, NIMResCode, number]>

Defined in

ts/chatroom/chatroom.ts:153


getMessageHistoryOnlineAsync

getMessageHistoryOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, number, ChatRoomMessage[]]>

Parameters

Name Type
room_id number
parameters ChatRoomGetMsgHistoryParameters
cb null | GetMsgHistoryCallback
json_extension string

Returns

Promise<[number, number, ChatRoomMessage[]]>

Defined in

ts/chatroom/chatroom.ts:174


getMessageHistoryByTagsOnlineAsync

getMessageHistoryByTagsOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, number, ChatRoomMessage[]]>

Parameters

Name Type
room_id number
parameters ChatRoomGetMsgHistoryByTagsParameters
cb null | GetMsgHistoryCallback
json_extension string

Returns

Promise<[number, number, ChatRoomMessage[]]>

Defined in

ts/chatroom/chatroom.ts:195


setMemberAttributeOnlineAsync

setMemberAttributeOnlineAsync(room_id, parameters, cb, json_extension): Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Parameters

Name Type
room_id number
parameters ChatRoomSetMemberAttributeParameters
cb null | SetMemberAttributeCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Defined in

ts/chatroom/chatroom.ts:216


getInfoAsync

getInfoAsync(room_id, cb, json_extension): Promise<[number, NIMResCode, ChatRoomInfo]>

Parameters

Name Type
room_id number
cb null | GetChatRoomInfoCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomInfo]>

Defined in

ts/chatroom/chatroom.ts:237


getMemberInfoByIDsAsync

getMemberInfoByIDsAsync(room_id, ids, cb, json_extension): Promise<[number, NIMResCode, ChatRoomMemberInfo[]]>

Parameters

Name Type
room_id number
ids string[]
cb null | GetMembersCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomMemberInfo[]]>

Defined in

ts/chatroom/chatroom.ts:252


kickMemberAsync

kickMemberAsync(room_id, id, notify_ext, cb, json_extension): Promise<[number, NIMResCode]>

Parameters

Name Type
room_id number
id string
notify_ext string
cb null | KickMemberCallback
json_extension string

Returns

Promise<[number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:273


setProxy

setProxy(type, host, port, user, password): void

Parameters

Name Type
type NIMChatRoomProxyType
host string
port number
user string
password string

Returns

void

Defined in

ts/chatroom/chatroom.ts:290


tempMuteMemberAsync

tempMuteMemberAsync(room_id, accid, duration, need_notify, notify_ext, cb, json_extension): Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Parameters

Name Type
room_id number
accid string
duration number
need_notify boolean
notify_ext string
cb null | TempMuteMemberCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Defined in

ts/chatroom/chatroom.ts:294


tempMuteMemberByTagAsync

tempMuteMemberByTagAsync(room_id, target_tag, duration, need_notify, notify_ext, cb, notify_tags, json_extension): Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Parameters

Name Type
room_id number
target_tag string
duration number
need_notify boolean
notify_ext string
cb null | TempMuteMemberCallback
notify_tags string
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomMemberInfo]>

Defined in

ts/chatroom/chatroom.ts:321


updateRoomInfoAsync

updateRoomInfoAsync(room_id, room_info, need_notify, notify_ext, cb, json_extension): Promise<[number, NIMResCode]>

Parameters

Name Type
room_id number
room_info ChatRoomInfo
need_notify boolean
notify_ext string
cb null | UpdateRoomInfoCallback
json_extension string

Returns

Promise<[number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:350


updateMyRoomRoleAsync

updateMyRoomRoleAsync(room_id, info, need_notify, notify_ext, cb, json_extension): Promise<[number, NIMResCode]>

Parameters

Name Type
room_id number
info ChatRoomMemberInfo
need_notify boolean
notify_ext string
cb null | UpdateMyRoomRoleCallback
json_extension string

Returns

Promise<[number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:375


queueOfferAsync

queueOfferAsync(room_id, element, option, cb, json_extension): Promise<[number, NIMResCode, ChatRoomQueueElement]>

Parameters

Name Type
room_id number
element ChatRoomQueueElement
option ChatRoomQueueOfferOption
cb null | QueueOfferCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomQueueElement]>

Defined in

ts/chatroom/chatroom.ts:400


queuePollAsync

queuePollAsync(room_id, element_key, cb, json_extension): Promise<[number, NIMResCode, ChatRoomQueueElement]>

Parameters

Name Type
room_id number
element_key string
cb null | QueuePollCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomQueueElement]>

Defined in

ts/chatroom/chatroom.ts:423


queueListAsync

queueListAsync(room_id, cb, json_extension): Promise<[number, NIMResCode, ChatRoomQueueElement[]]>

Parameters

Name Type
room_id number
cb null | QueueListCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomQueueElement[]]>

Defined in

ts/chatroom/chatroom.ts:444


queueHeaderAsync

queueHeaderAsync(room_id, cb, json_extension): Promise<[number, NIMResCode, ChatRoomQueueElement]>

Parameters

Name Type
room_id number
cb null | QueueHeaderCallback
json_extension string

Returns

Promise<[number, NIMResCode, ChatRoomQueueElement]>

Defined in

ts/chatroom/chatroom.ts:459


queueDropAsync

queueDropAsync(room_id, cb, json_extension): Promise<[number, NIMResCode]>

Parameters

Name Type
room_id number
cb null | QueueDropCallback
json_extension string

Returns

Promise<[number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:474


queueBatchUpdateAsync

queueBatchUpdateAsync(room_id, batch_elements, need_notify, notify_ext, cb, json_extension): Promise<[number, NIMResCode, string[]]>

Parameters

Name Type
room_id number
batch_elements ChatRoomBatchMembers
need_notify boolean
notify_ext string
cb null | QueueBatchUpdateCallback
json_extension string

Returns

Promise<[number, NIMResCode, string[]]>

Defined in

ts/chatroom/chatroom.ts:489


updateLocation

updateLocation(room_id, location, cb, json_extension): Promise<null | [number, NIMResCode]>

Parameters

Name Type
room_id number
location NIMChatRoomLocation
cb null | UpdateLocationCallback
json_extension string

Returns

Promise<null | [number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:514


updateTags

updateTags(room_id, tags_info, cb, json_extension): Promise<null | [number, NIMResCode]>

Parameters

Name Type
room_id number
tags_info ChatRoomUpdateTagsInfo
cb null | UpdateTagsCallback
json_extension string

Returns

Promise<null | [number, NIMResCode]>

Defined in

ts/chatroom/chatroom.ts:539

Properties

chatroom

chatroom: any

Defined in

ts/chatroom/chatroom.ts:65

Constructors

constructor

new ChatRoomModule()

Overrides

EventEmitter<ChatRoomEvents&gt;.constructor

Defined in

ts/chatroom/chatroom.ts:66

Clone this wiki locally