-
Notifications
You must be signed in to change notification settings - Fork 2
nim.sysmsg.NIMSysMsg
nim/sysmsg.NIMSysMsg
-
EventEmitter
<NIMSysMsgEvents
>↳
NIMSysMsg
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- sendCustomNotificationMsg
- queryMsgAsync
- queryUnreadCount
- setStatusAsync
- readAllAsync
- deleteAsync
- deleteAllAsync
- setStatusByTypeAsync
- deleteByTypeAsync
▸ eventNames(): keyof NIMSysMsgEvents
[]
Return an array listing the events for which the emitter has registered listeners.
keyof NIMSysMsgEvents
[]
EventEmitter.eventNames
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMSysMsgEvents
>[Extract
<T
, keyof NIMSysMsgEvents
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMSysMsgEvents
>[Extract
<T
, keyof NIMSysMsgEvents
>]) => void
[]
EventEmitter.listeners
▸ listenerCount(event
): number
Return the number of listeners listening to a given event.
Name | Type |
---|---|
event |
keyof NIMSysMsgEvents
|
number
EventEmitter.listenerCount
▸ emit<T
>(event
, ...args
): boolean
Calls each of the listeners registered for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >] |
boolean
EventEmitter.emit
▸ on<T
>(event
, fn
, context?
): NIMSysMsg
Add a listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >]) => void
|
context? |
any |
EventEmitter.on
▸ addListener<T
>(event
, fn
, context?
): NIMSysMsg
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >]) => void
|
context? |
any |
EventEmitter.addListener
▸ once<T
>(event
, fn
, context?
): NIMSysMsg
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >]) => void
|
context? |
any |
EventEmitter.once
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMSysMsg
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
▸ off<T
>(event
, fn?
, context?
, once?
): NIMSysMsg
Name | Type |
---|---|
T |
extends keyof NIMSysMsgEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMSysMsgEvents >[Extract <T , keyof NIMSysMsgEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
▸ removeAllListeners(event?
): NIMSysMsg
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
keyof NIMSysMsgEvents
|
EventEmitter.removeAllListeners
▸ initEventHandlers(): void
注册全局回调
void
▸ sendCustomNotificationMsg(msg
): void
发送自定义通知消息
Name | Type |
---|---|
msg |
SysMessage |
void
void 无返回值
▸ queryMsgAsync(limit_count
, last_time
, cb
, jsonExtension
): boolean
查询本地系统消息
Name | Type | Description |
---|---|---|
limit_count |
number |
一次查询数量,建议20 |
last_time |
number |
上次查询最后一条消息的时间戳 |
cb |
QuerySysmsgCallback |
查询本地系统消息的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
boolean 检查参数如果不符合要求则返回失败
▸ queryUnreadCount(cb
, jsonExtension
): void
查询未读消息数
Note
200:成功
Name | Type | Description |
---|---|---|
cb |
NotifySysmsgResCallback |
查询未读消息数的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
void
void 无返回值
▸ setStatusAsync(msg_id
, status
, cb
, jsonExtension
): boolean
设置消息状态
Note
200:成功
Name | Type | Description |
---|---|---|
msg_id |
number |
消息id |
status |
NIMSysMsgStatus |
消息状态 |
cb |
NotifySingleSysmsgCallback |
设置消息状态的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
void 无返回值
▸ readAllAsync(cb
, jsonExtension
): void
设置全部消息为已读
Note
200:成功
Name | Type | Description |
---|---|---|
cb |
NotifySysmsgResCallback |
设置全部消息为已读的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
void
void 无返回值
▸ deleteAsync(msg_id
, cb
, jsonExtension
): boolean
删除消息
Note
200:成功
Name | Type | Description |
---|---|---|
msg_id |
number |
消息id |
cb |
NotifySingleSysmsgCallback |
删除消息的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
boolean 检查参数如果不符合要求则返回失败
▸ deleteAllAsync(cb
, jsonExtension
): boolean
全部删除
Note
200:成功
Name | Type | Description |
---|---|---|
cb |
NotifySysmsgResCallback |
删除消息的回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
void 无返回值
▸ setStatusByTypeAsync(type
, status
, cb
, jsonExtension
): boolean
按类型设置系统通知状态
Note
200:成功
Name | Type | Description |
---|---|---|
type |
NIMSysMsgType |
类型 |
status |
NIMSysMsgStatus |
状态 |
cb |
NotifySysmsgResCallback |
回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
void 无返回值
▸ deleteByTypeAsync(type
, cb
, jsonExtension
): boolean
按类型删除系统通知
Note
200:成功
Name | Type | Description |
---|---|---|
type |
NIMSysMsgType |
类型 |
cb |
NotifySysmsgResCallback |
回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
boolean
void 无返回值
• sysmsg: NIMSysMsgAPI
• new NIMSysMsg()
EventEmitter<NIMSysMsgEvents>.constructor
- 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