-
Notifications
You must be signed in to change notification settings - Fork 2
nim.subscribe_event.NIMSubscribeEvent
nim/subscribe_event.NIMSubscribeEvent
-
EventEmitter
<NIMSubscribeEventEvents
>↳
NIMSubscribeEvent
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- publish
- subscribe
- unSubscribe
- batchUnSubscribe
- querySubscribe
▸ eventNames(): keyof NIMSubscribeEventEvents
[]
Return an array listing the events for which the emitter has registered listeners.
keyof NIMSubscribeEventEvents
[]
EventEmitter.eventNames
node_modules/eventemitter3/index.d.ts:15
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMSubscribeEventEvents
>[Extract
<T
, keyof NIMSubscribeEventEvents
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMSubscribeEventEvents
>[Extract
<T
, keyof NIMSubscribeEventEvents
>]) => 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 |
keyof NIMSubscribeEventEvents
|
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 keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMSubscribeEvent
Add a listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMSubscribeEvent
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMSubscribeEvent
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMSubscribeEvent
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMSubscribeEvent
Name | Type |
---|---|
T |
extends keyof NIMSubscribeEventEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMSubscribeEventEvents >[Extract <T , keyof NIMSubscribeEventEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMSubscribeEvent
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
keyof NIMSubscribeEventEvents
|
EventEmitter.removeAllListeners
node_modules/eventemitter3/index.d.ts:79
▸ initEventHandlers(): void
注册全局回调
void
ts/nim/subscribe_event.ts:32
▸ publish(data
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, number
, EventData
]>
发布事件
Note
200:成功 403:应用没开通事件服务 404:禁用了特定事件 414:参数错误 500:未知错误
Name | Type | Description |
---|---|---|
data |
EventData |
- |
cb |
null | PublishEventCallback
|
发布事件回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, number
, EventData
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/subscribe_event.ts:50
▸ subscribe(eventType
, ttl
, syncType
, accids
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, number
, string
[]]>
订阅事件
Note
200:成功 414:参数错误 500:未知错误
Name | Type | Description |
---|---|---|
eventType |
NIMEventType |
- |
ttl |
number |
订阅有效期,单位:秒,范围:60s到30天 |
syncType |
NIMEventSubscribeSyncEventType |
- |
accids |
string [] |
- |
cb |
null | SubscribeEventCallback
|
订阅事件回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, number
, string
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/subscribe_event.ts:80
▸ unSubscribe(eventType
, accids
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, number
, string
[]]>
按账号取消指定事件的订阅关系
Note
200:成功 414:参数错误 500:未知错误
Name | Type | Description |
---|---|---|
eventType |
NIMEventType |
- |
accids |
string [] |
- |
cb |
null | UnSubscribeEventCallback
|
取消订阅事件回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, number
, string
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/subscribe_event.ts:122
▸ batchUnSubscribe(eventType
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, number
]>
取消指定事件的全部订阅关系
Note
200:成功 414:参数错误 500:未知错误
Name | Type | Description |
---|---|---|
eventType |
NIMEventType |
- |
cb |
null | BatchUnSubscribeEventCallback
|
取消订阅事件回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, number
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/subscribe_event.ts:159
▸ querySubscribe(eventType
, accids
, cb
, jsonExtension
): Promise
<[NIMResCode
, number
, EventSubscribeData
[]]>
按账号查询指定事件订阅关系
Note
200:成功 414:参数错误 500:未知错误
Name | Type | Description |
---|---|---|
eventType |
NIMEventType |
- |
accids |
string [] |
- |
cb |
null | QuerySubscribeEventCallback
|
查询订阅关系回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<[NIMResCode
, number
, EventSubscribeData
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/subscribe_event.ts:191
• subscribeEvent: NIMSubscribeEventAPI
ts/nim/subscribe_event.ts:25
• new NIMSubscribeEvent()
EventEmitter<NIMSubscribeEventEvents>.constructor
ts/nim/subscribe_event.ts:26
- 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