-
Notifications
You must be signed in to change notification settings - Fork 2
nim.plugin.NIMPlugin
nim/plugin.NIMPlugin
-
EventEmitter
<NIMPluginEvents
>↳
NIMPlugin
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- chatRoomRequestEnterAsync
- qchatRequestLinkAddress
▸ eventNames(): never
[]
Return an array listing the events for which the emitter has registered listeners.
never
[]
EventEmitter.eventNames
node_modules/eventemitter3/index.d.ts:15
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMPluginEvents
>[Extract
<T
, never
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMPluginEvents
>[Extract
<T
, never
>]) => void
[]
EventEmitter.listeners
node_modules/eventemitter3/index.d.ts:20
▸ listenerCount(event
): number
Return the number of listeners listening to a given event.
Name | Type |
---|---|
event |
never |
number
EventEmitter.listenerCount
node_modules/eventemitter3/index.d.ts:27
▸ emit<T
>(event
, ...args
): boolean
Calls each of the listeners registered for a given event.
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMPluginEvents >[Extract <T , never >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMPlugin
Add a listener for a given event.
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMPluginEvents >[Extract <T , never >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMPlugin
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMPluginEvents >[Extract <T , never >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMPlugin
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMPluginEvents >[Extract <T , never >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMPlugin
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMPluginEvents >[Extract <T , never >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMPlugin
Name | Type |
---|---|
T |
extends never
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMPluginEvents >[Extract <T , never >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMPlugin
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
undefined |
EventEmitter.removeAllListeners
node_modules/eventemitter3/index.d.ts:79
▸ initEventHandlers(): void
注册全局回调
void
ts/nim/plugin.ts:16
▸ chatRoomRequestEnterAsync(roomId
, cb
, ext
): Promise
<[NIMResCode
, string
]>
异步获取聊天室登录信息
Note
200:成功 414:参数错误 404:聊天室不存在 403:不允许进入该聊天室 415:服务不可用,没有聊天室服务器可分配 13003:在黑名单中
Name | Type | Description |
---|---|---|
roomId |
number |
聊天室ID |
cb |
null | ChatRoomRequestEnterCallback
|
回调函数 |
ext |
string |
json扩展参数(备用,目前不需要) |
Promise
<[NIMResCode
, string
]>
void 无返回值
ts/nim/plugin.ts:35
▸ qchatRequestLinkAddress(ip_version
, cb
, ext
): Promise
<[NIMResCode
, string
[]]>
异步获取圈组link地址 @param[in] ip_version ip协议, 0:ipv4, 1:ipv6, 2:all @param[in] callback 回调函数 @param[in] jsonExtension json扩展参数(备用,目前不需要)
Note
200:成功 414:参数错误
Name | Type |
---|---|
ip_version |
number |
cb |
null | QChatRequestLinkAddressCallback
|
ext |
string |
Promise
<[NIMResCode
, string
[]]>
void 无返回值
ts/nim/plugin.ts:61
• plugin: NIMPluginAPI
ts/nim/plugin.ts:9
• new NIMPlugin()
EventEmitter<NIMPluginEvents>.constructor
ts/nim/plugin.ts:10
- chatroom/chatroom
- chatroom_def/chatroom_def
- nim/client
- nim/data_sync
- nim/friend
- nim/global
- nim/msglog
- nim/nos
- nim/online_session
- nim/pass_through_proxy
- nim/plugin
- nim/session
- nim/subscribe_event
- nim/super_team
- nim/sysmsg
- nim/talk
- nim/talkex
- nim/team
- nim/tool
- nim/user
- nim_def/client_def
- nim_def/data_sync_def
- nim_def/doc_trans_def
- nim_def/friend_def
- nim_def/global_def
- nim_def/msglog_def
- nim_def/nos_def
- nim_def/online_session_def
- nim_def/pass_through_proxy_def
- nim_def/plugin_def
- nim_def/session_def
- nim_def/subscribe_event_def
- nim_def/super_team_def
- nim_def/sysmsg_def
- nim_def/talk_def
- nim_def/talkex_def
- nim_def/team_def
- nim_def/tool_def
- nim_def/user_def
- node-nim
- qchat/attachment
- qchat/channel
- qchat/channel_category
- qchat/instance
- qchat/message
- qchat/role
- qchat/server
- qchat/system_notification
- qchat_def/attachment_def
- qchat_def/channel_def
- qchat_def/instance_def
- qchat_def/message_def
- qchat_def/public_def
- qchat_def/role_def
- qchat_def/server_def
- qchat_def/system_notification_def