-
Notifications
You must be signed in to change notification settings - Fork 2
nim.friend.NIMFriend
nim/friend.NIMFriend
-
EventEmitter
<NIMFriendEvents
>↳
NIMFriend
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- request
- delete
- update
- getList
- getFriendProfile
- queryFriendListByKeyword
▸ 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
<NIMFriendEvents
>[Extract
<T
, "change"
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMFriendEvents
>[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 <NIMFriendEvents >[Extract <T , "change" >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMFriend
Add a listener for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMFriendEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMFriend
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMFriendEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMFriend
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMFriendEvents >[Extract <T , "change" >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMFriend
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMFriendEvents >[Extract <T , "change" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMFriend
Name | Type |
---|---|
T |
extends "change"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMFriendEvents >[Extract <T , "change" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMFriend
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/friend.ts:28
▸ request(accid
, verify_type
, msg
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
]>
添加、验证好友
Note
200:成功 404:用户不存在 500:未知错误
Name | Type | Description |
---|---|---|
accid |
string |
对方帐号 |
verify_type |
NIMVerifyType |
好友验证类型 |
msg |
string |
接口扩展字段 |
cb |
null | FriendOptCallback
|
好友请求回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/friend.ts:46
▸ delete(accid
, option
, cb
): Promise
<null
| [NIMResCode
]>
删除好友
Note
200:成功 404:用户不存在 500:未知错误
Name | Type | Description |
---|---|---|
accid |
string |
对方帐号 |
option |
DeleteFriendOption |
删除好友选项,目前仅有是否删除备注信息选项 |
cb |
null | FriendOptCallback
|
删除好友回调函数 |
Promise
<null
| [NIMResCode
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/friend.ts:79
▸ update(profile
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
]>
更新好友资料
Note
200:成功 404:用户不存在 500:未知错误
Name | Type | Description |
---|---|---|
profile |
FriendProfile |
好友资料 |
cb |
null | FriendOptCallback
|
更新好友资料回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
]>
boolean 检查参数如果不符合要求则返回失败
ts/nim/friend.ts:106
▸ getList(cb
, jsonExtension
): Promise
<[NIMResCode
, FriendProfile
[]]>
增量获取好友列表
Note
200:成功
Name | Type | Description |
---|---|---|
cb |
null | GetFriendsListCallback
|
获取好友列表回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<[NIMResCode
, FriendProfile
[]]>
void 无返回值
ts/nim/friend.ts:134
▸ getFriendProfile(accid
, cb
, jsonExtension
): Promise
<[string
, FriendProfile
]>
获取好友信息
Name | Type | Description |
---|---|---|
accid |
string |
对方帐号 |
cb |
null | GetFriendProfileCallback
|
获取好友信息回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<[string
, FriendProfile
]>
void 无返回值
ts/nim/friend.ts:151
▸ queryFriendListByKeyword(keyword
, cb
, jsonExtension
): Promise
<null
| [NIMResCode
, FriendProfile
[]]>
增量获取好友列表
Note
200:成功
Name | Type | Description |
---|---|---|
keyword |
string |
要查询的关键字 |
cb |
null | GetFriendsListCallback
|
获取好友列表回调函数 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
Promise
<null
| [NIMResCode
, FriendProfile
[]]>
boolean 返回 true 表示发送查询请求成功,返回 false 表示关键字为空
ts/nim/friend.ts:176
• friend: NIMFriendAPI
ts/nim/friend.ts:21
• new NIMFriend()
EventEmitter<NIMFriendEvents>.constructor
ts/nim/friend.ts:22
- 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