Skip to content

nim.online_session.NIMOnlineSession

Zvicii edited this page Feb 10, 2023 · 6 revisions

Class: NIMOnlineSession

nim/online_session.NIMOnlineSession

Hierarchy

Table of contents

Methods

Properties

Constructors

Methods

eventNames

eventNames(): "change"[]

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

Returns

"change"[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


listeners

listeners<T>(event): (...args: ArgumentMap<NIMOnlineSessionEvents>[Extract<T, "change">]) => void[]

Return the listeners registered for a given event.

Type parameters

Name Type
T extends "change"

Parameters

Name Type
event T

Returns

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

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 "change"

Parameters

Name Type
event T
...args ArgumentMap<NIMOnlineSessionEvents>[Extract<T, "change">]

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

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

Add a listener for a given event.

Type parameters

Name Type
T extends "change"

Parameters

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

Returns

NIMOnlineSession

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

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

Type parameters

Name Type
T extends "change"

Parameters

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

Returns

NIMOnlineSession

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

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

Add a one-time listener for a given event.

Type parameters

Name Type
T extends "change"

Parameters

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

Returns

NIMOnlineSession

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

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

Remove the listeners of a given event.

Type parameters

Name Type
T extends "change"

Parameters

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

Returns

NIMOnlineSession

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

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

Type parameters

Name Type
T extends "change"

Parameters

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

Returns

NIMOnlineSession

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): NIMOnlineSession

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? "change"

Returns

NIMOnlineSession

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

注册全局回调

Returns

void

Defined in

ts/nim/online_session.ts:29


querySessionList

querySessionList(minTime, maxTime, needLastMsg, limit, cb): Promise<[QuerySessionListResult]>

会话服务 查询会话列表

Parameters

Name Type Description
minTime number 最小时间戳,未知可以填0,表示到最早时间
maxTime number 最大时间戳,未知可以填0,表示从当前时间
needLastMsg boolean 是否需要返回lastMsg,默认true
limit number 结果集limit,最大100,缺省值100
cb null | QueryOnlineSessionListCallback 结果回调 可查看NIMQueryOnlineSessionListCallback定义

Returns

Promise<[QuerySessionListResult]>

void 无返回值

Defined in

ts/nim/online_session.ts:41


querySession

querySession(to_type, session_id, cb): Promise<[NIMResCode, SessionInfo]>

会话服务 查询会话

Parameters

Name Type Description
to_type NIMSessionType 会话类型
session_id string 会话ID
cb null | QueryOnlineSessionInfoCallback 结果回调 可查看NIMQuerySessionInfoCallback定义

Returns

Promise<[NIMResCode, SessionInfo]>

void 无返回值

Defined in

ts/nim/online_session.ts:64


updateSession

updateSession(to_type, session_id, ext, cb): Promise<[NIMResCode]>

会话服务 更新会话

Parameters

Name Type Description
to_type NIMSessionType 会话类型
session_id string 会话ID
ext string 会话的扩展字段
cb null | UpdateOnlineSessionInfoCallback 结果回调 可查看NIMUpdateSessionInfoCallback定义

Returns

Promise<[NIMResCode]>

void 无返回值

Defined in

ts/nim/online_session.ts:82


deleteSession

deleteSession(param, cb): Promise<[NIMResCode]>

会话服务 删除会话

Parameters

Name Type Description
param DeleteSessionParam 要删除的会话列
cb null | DeleteOnlineSessionInfoCallback 结果回调 可查看DeleteSessionInfoCallback定义

Returns

Promise<[NIMResCode]>

void 无返回值

Defined in

ts/nim/online_session.ts:98

Properties

session

session: NIMOnlineSessionAPI

Defined in

ts/nim/online_session.ts:22

Constructors

constructor

new NIMOnlineSession()

Overrides

EventEmitter<NIMOnlineSessionEvents&gt;.constructor

Defined in

ts/nim/online_session.ts:23

Clone this wiki locally