Skip to content

node nim.ChatRoom

Zvicii edited this page Apr 19, 2023 · 3 revisions

Class: ChatRoom

node-nim.ChatRoom

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

ChatRoomModule.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

ChatRoomModule.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

ChatRoomModule.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

ChatRoomModule.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

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

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

ChatRoom

Inherited from

ChatRoomModule.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

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

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

ChatRoom

Inherited from

ChatRoomModule.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

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

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

ChatRoom

Inherited from

ChatRoomModule.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

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

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

ChatRoom

Inherited from

ChatRoomModule.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

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

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

ChatRoom

Inherited from

ChatRoomModule.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): ChatRoom

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? keyof ChatRoomEvents

Returns

ChatRoom

Inherited from

ChatRoomModule.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

Returns

void

Inherited from

ChatRoomModule.initEventHandlers

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

Inherited from

ChatRoomModule.init

Defined in

ts/chatroom/chatroom.ts:75


cleanup

cleanup(json_extension): void

Parameters

Name Type
json_extension string

Returns

void

Inherited from

ChatRoomModule.cleanup

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

Inherited from

ChatRoomModule.independentEnter

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

Inherited from

ChatRoomModule.anonymousEnter

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

Inherited from

ChatRoomModule.enter

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

Inherited from

ChatRoomModule.exit

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

Inherited from

ChatRoomModule.getLoginState

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

Inherited from

ChatRoomModule.setMsgsBatchReport

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

Inherited from

ChatRoomModule.sendMsg

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[]]>

Inherited from

ChatRoomModule.getMembersOnlineAsync

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[]]>

Inherited from

ChatRoomModule.getMembersByTagOnlineAsync

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]>

Inherited from

ChatRoomModule.getMembersCountByTagOnlineAsync

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[]]>

Inherited from

ChatRoomModule.getMessageHistoryOnlineAsync

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[]]>

Inherited from

ChatRoomModule.getMessageHistoryByTagsOnlineAsync

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]>

Inherited from

ChatRoomModule.setMemberAttributeOnlineAsync

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]>

Inherited from

ChatRoomModule.getInfoAsync

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[]]>

Inherited from

ChatRoomModule.getMemberInfoByIDsAsync

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]>

Inherited from

ChatRoomModule.kickMemberAsync

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

Inherited from

ChatRoomModule.setProxy

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]>

Inherited from

ChatRoomModule.tempMuteMemberAsync

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]>

Inherited from

ChatRoomModule.tempMuteMemberByTagAsync

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]>

Inherited from

ChatRoomModule.updateRoomInfoAsync

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]>

Inherited from

ChatRoomModule.updateMyRoomRoleAsync

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]>

Inherited from

ChatRoomModule.queueOfferAsync

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]>

Inherited from

ChatRoomModule.queuePollAsync

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[]]>

Inherited from

ChatRoomModule.queueListAsync

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]>

Inherited from

ChatRoomModule.queueHeaderAsync

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]>

Inherited from

ChatRoomModule.queueDropAsync

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[]]>

Inherited from

ChatRoomModule.queueBatchUpdateAsync

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]>

Inherited from

ChatRoomModule.updateLocation

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]>

Inherited from

ChatRoomModule.updateTags

Defined in

ts/chatroom/chatroom.ts:539

Properties

chatroom

chatroom: any

Inherited from

ChatRoomModule.chatroom

Defined in

ts/chatroom/chatroom.ts:65

Constructors

constructor

new ChatRoom()

Inherited from

ChatRoomModule.constructor

Defined in

ts/chatroom/chatroom.ts:66

Clone this wiki locally