-
Notifications
You must be signed in to change notification settings - Fork 2
nim.online_session.NIMOnlineSession
nim/online_session.NIMOnlineSession
-
EventEmitter
<NIMOnlineSessionEvents
>↳
NIMOnlineSession
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- querySessionList
- querySession
- updateSession
- deleteSession
▸ eventNames(): "change"
[]
Return an array listing the events for which the emitter has registered listeners.
"change"
[]
EventEmitter.eventNames
node_modules/eventemitter3/index.d.ts:15
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMOnlineSessionEvents
>[Extract
<T
, "change"
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMOnlineSessionEvents
>[Extract
<T
, "change"
>]) => 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 |
"change" |
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 "change"
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMOnlineSession
Add a listener for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMOnlineSession
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMOnlineSession
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMOnlineSession
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMOnlineSession
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMOnlineSessionEvents >[Extract <T , "change" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMOnlineSession
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
"change" |
EventEmitter.removeAllListeners
node_modules/eventemitter3/index.d.ts:79
▸ initEventHandlers(): void
注册全局回调
void
ts/nim/online_session.ts:29
▸ querySessionList(minTime
, maxTime
, needLastMsg
, limit
, cb
): Promise
<[QuerySessionListResult
]>
会话服务 查询会话列表
Name | Type | Description |
---|---|---|
minTime |
number |
最小时间戳,未知可以填0,表示到最早时间 |
maxTime |
number |
最大时间戳,未知可以填0,表示从当前时间 |
needLastMsg |
boolean |
是否需要返回lastMsg,默认true |
limit |
number |
结果集limit,最大100,缺省值100 |
cb |
null | QueryOnlineSessionListCallback
|
结果回调 可查看NIMQueryOnlineSessionListCallback定义 |
Promise
<[QuerySessionListResult
]>
void 无返回值
ts/nim/online_session.ts:41
▸ querySession(to_type
, session_id
, cb
): Promise
<[NIMResCode
, SessionInfo
]>
会话服务 查询会话
Name | Type | Description |
---|---|---|
to_type |
NIMSessionType |
会话类型 |
session_id |
string |
会话ID |
cb |
null | QueryOnlineSessionInfoCallback
|
结果回调 可查看NIMQuerySessionInfoCallback定义 |
Promise
<[NIMResCode
, SessionInfo
]>
void 无返回值
ts/nim/online_session.ts:64
▸ updateSession(to_type
, session_id
, ext
, cb
): Promise
<[NIMResCode
]>
会话服务 更新会话
Name | Type | Description |
---|---|---|
to_type |
NIMSessionType |
会话类型 |
session_id |
string |
会话ID |
ext |
string |
会话的扩展字段 |
cb |
null | UpdateOnlineSessionInfoCallback
|
结果回调 可查看NIMUpdateSessionInfoCallback定义 |
Promise
<[NIMResCode
]>
void 无返回值
ts/nim/online_session.ts:82
▸ deleteSession(param
, cb
): Promise
<[NIMResCode
]>
会话服务 删除会话
Name | Type | Description |
---|---|---|
param |
DeleteSessionParam |
要删除的会话列 |
cb |
null | DeleteOnlineSessionInfoCallback
|
结果回调 可查看DeleteSessionInfoCallback定义 |
Promise
<[NIMResCode
]>
void 无返回值
ts/nim/online_session.ts:98
• session: NIMOnlineSessionAPI
ts/nim/online_session.ts:22
• new NIMOnlineSession()
EventEmitter<NIMOnlineSessionEvents>.constructor
ts/nim/online_session.ts:23
- 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