Skip to content

nim.sysmsg.NIMSysMsg

Zvicii edited this page Jul 7, 2023 · 7 revisions

Class: NIMSysMsg

nim/sysmsg.NIMSysMsg

Hierarchy

Table of contents

Methods

Properties

Constructors

Methods

eventNames

eventNames(): keyof NIMSysMsgEvents[]

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

Returns

keyof NIMSysMsgEvents[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


listeners

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

Return the listeners registered for a given event.

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

Name Type
event T

Returns

(...args: ArgumentMap<NIMSysMsgEvents>[Extract<T, keyof NIMSysMsgEvents>]) => 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 NIMSysMsgEvents

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 NIMSysMsgEvents

Parameters

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

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

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

Add a listener for a given event.

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

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

Returns

NIMSysMsg

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

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

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

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

Returns

NIMSysMsg

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

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

Add a one-time listener for a given event.

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

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

Returns

NIMSysMsg

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

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

Remove the listeners of a given event.

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

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

Returns

NIMSysMsg

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

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

Type parameters

Name Type
T extends keyof NIMSysMsgEvents

Parameters

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

Returns

NIMSysMsg

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): NIMSysMsg

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? keyof NIMSysMsgEvents

Returns

NIMSysMsg

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

注册全局回调

Returns

void

Defined in

ts/nim/sysmsg.ts:30


sendCustomNotificationMsg

sendCustomNotificationMsg(msg): void

发送自定义通知消息

Parameters

Name Type
msg SysMessage

Returns

void

void 无返回值

Defined in

ts/nim/sysmsg.ts:38


queryMsgAsync

queryMsgAsync(limit_count, last_time, cb, jsonExtension): Promise<null | [number, number, SysMessage[]]>

查询本地系统消息

Parameters

Name Type Description
limit_count number 一次查询数量,建议20
last_time number 上次查询最后一条消息的时间戳
cb null | QuerySysmsgCallback 查询本地系统消息的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [number, number, SysMessage[]]>

boolean 检查参数如果不符合要求则返回失败

Defined in

ts/nim/sysmsg.ts:49


queryUnreadCount

queryUnreadCount(cb, jsonExtension): Promise<[NIMResCode, number]>

查询未读消息数

Note

200:成功

Parameters

Name Type Description
cb null | NotifySysmsgResCallback 查询未读消息数的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<[NIMResCode, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:83


setStatusAsync

setStatusAsync(msg_id, status, cb, jsonExtension): Promise<null | [NIMResCode, number, number]>

设置消息状态

Note

200:成功

Parameters

Name Type Description
msg_id string 消息id
status NIMSysMsgStatus 消息状态
cb null | NotifySingleSysmsgCallback 设置消息状态的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [NIMResCode, number, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:105


readAllAsync

readAllAsync(cb, jsonExtension): Promise<[NIMResCode, number]>

设置全部消息为已读

Note

200:成功

Parameters

Name Type Description
cb null | NotifySysmsgResCallback 设置全部消息为已读的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<[NIMResCode, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:139


deleteAsync

deleteAsync(msg_id, cb, jsonExtension): Promise<null | [NIMResCode, number, number]>

删除消息

Note

200:成功

Parameters

Name Type Description
msg_id string 消息id
cb null | NotifySingleSysmsgCallback 删除消息的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [NIMResCode, number, number]>

boolean 检查参数如果不符合要求则返回失败

Defined in

ts/nim/sysmsg.ts:160


deleteAllAsync

deleteAllAsync(cb, jsonExtension): Promise<null | [NIMResCode, number]>

全部删除

Note

200:成功

Parameters

Name Type Description
cb null | NotifySysmsgResCallback 删除消息的回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [NIMResCode, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:188


setStatusByTypeAsync

setStatusByTypeAsync(type, status, cb, jsonExtension): Promise<null | [NIMResCode, number]>

按类型设置系统通知状态

Note

200:成功

Parameters

Name Type Description
type NIMSysMsgType 类型
status NIMSysMsgStatus 状态
cb null | NotifySysmsgResCallback 回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [NIMResCode, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:214


deleteByTypeAsync

deleteByTypeAsync(type, cb, jsonExtension): Promise<null | [NIMResCode, number]>

按类型删除系统通知

Note

200:成功

Parameters

Name Type Description
type NIMSysMsgType 类型
cb null | NotifySysmsgResCallback 回调函数
jsonExtension string json扩展参数(备用,目前不需要)

Returns

Promise<null | [NIMResCode, number]>

void 无返回值

Defined in

ts/nim/sysmsg.ts:249

Properties

sysmsg

sysmsg: NIMSysMsgAPI

Defined in

ts/nim/sysmsg.ts:23

Constructors

constructor

new NIMSysMsg()

Overrides

EventEmitter<NIMSysMsgEvents&gt;.constructor

Defined in

ts/nim/sysmsg.ts:24

Clone this wiki locally