-
Notifications
You must be signed in to change notification settings - Fork 2
nim.user.NIMUser
nim/user.NIMUser
-
EventEmitter
<NIMUserEvents
>↳
NIMUser
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- setBlack
- setMute
- getMutelist
- getBlacklist
- getUserNameCard
- getUserNameCardOnline
- updateMyUserNameCard
- queryUserListByKeyword
- updatePushToken
▸ eventNames(): keyof NIMUserEvents
[]
Return an array listing the events for which the emitter has registered listeners.
keyof NIMUserEvents
[]
EventEmitter.eventNames
node_modules/eventemitter3/index.d.ts:15
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMUserEvents
>[Extract
<T
, keyof NIMUserEvents
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMUserEvents
>[Extract
<T
, keyof NIMUserEvents
>]) => 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 NIMUserEvents
|
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 NIMUserEvents
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMUser
Add a listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMUser
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMUser
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMUser
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMUser
Name | Type |
---|---|
T |
extends keyof NIMUserEvents
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMUserEvents >[Extract <T , keyof NIMUserEvents >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMUser
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
keyof NIMUserEvents
|
EventEmitter.removeAllListeners
node_modules/eventemitter3/index.d.ts:79
▸ initEventHandlers(): void
注册全局回调
void
ts/nim/user.ts:31
▸ setBlack(accid
, setBlack
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, string
, boolean
]>
设置、取消设置黑名单
Note
200:成功 419:黑名单数量超过上限
Name | Type | Description |
---|---|---|
accid |
string |
好友id |
setBlack |
boolean |
- |
cb |
null | SetRelationCallback
|
|
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, string
, boolean
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:47
▸ setMute(accid
, set_mute
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, string
, boolean
]>
设置、取消设置静音名单
Note
200:成功 419:静音列表数量超过上限
Name | Type | Description |
---|---|---|
accid |
string |
好友id |
set_mute |
boolean |
取消或设置 |
cb |
null | SetRelationCallback
|
|
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, string
, boolean
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:79
▸ getMutelist(cb
, jsonExtension
): Promise
<[NIMResCode
, BlackMuteListInfo
[]]>
获得静音名单列表
Note
200:成功
Name | Type | Description |
---|---|---|
cb |
null | GetSpecialListCallback
|
|
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<[NIMResCode
, BlackMuteListInfo
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:108
▸ getBlacklist(cb
, jsonExtension
): Promise
<[NIMResCode
, BlackMuteListInfo
[]]>
获得黑名单名单
Name | Type | Description |
---|---|---|
cb |
null | GetSpecialListCallback
|
|
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<[NIMResCode
, BlackMuteListInfo
[]]>
void 无返回值
ts/nim/user.ts:124
▸ getUserNameCard(accids
, cb
, jsonExtension
): Promise
<null
| [UserNameCard
[]]>
获取本地的指定帐号的用户名片
Note
200:成功 414:参数错误 20000:还未初始化或初始化未正常完成 20001:还未登陆或登录未完成
Name | Type | Description |
---|---|---|
accids |
string [] |
|
cb |
null | GetUserNameCardCallback
|
操作结果回调 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [UserNameCard
[]]>
void 无返回值
ts/nim/user.ts:148
▸ getUserNameCardOnline(accids
, cb
, jsonExtension
): Promise
<null
| [UserNameCard
[]]>
在线查询指定帐号的用户名片
Note
200:成功 414:参数错误 20000:还未初始化或初始化未正常完成 20001:还未登陆或登录未完成
Name | Type | Description |
---|---|---|
accids |
string [] |
|
cb |
null | GetUserNameCardCallback
|
操作结果回调 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [UserNameCard
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:180
▸ updateMyUserNameCard(nameCard
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
]>
更新自己的用户名片
Note
200:成功 400:非法参数
Name | Type | Description |
---|---|---|
nameCard |
UserNameCard |
- |
cb |
null | UpdateMyUserNameCardCallback
|
操作结果回调 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:210
▸ queryUserListByKeyword(keyword
, cb
, jsonExtension
): Promise
<null
| [UserNameCard
[]]>
获取本地的指定帐号的用户名片
Name | Type | Description |
---|---|---|
keyword |
string |
要查询的关键字 |
cb |
null | GetUserNameCardCallback
|
操作结果回调 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [UserNameCard
[]]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/user.ts:235
▸ updatePushToken(cerName
, token
, type
): void
更新推送证书
Name | Type | Description |
---|---|---|
cerName |
string |
- |
token |
string |
设备token |
type |
NINPushType |
1: pushkit (仅iOS) 其他 apns 默认填0 |
void
void 无返回值
ts/nim/user.ts:260
• user: NIMUserAPI
ts/nim/user.ts:24
• new NIMUser()
EventEmitter<NIMUserEvents>.constructor
ts/nim/user.ts:25
- 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