# Interface FriendEventListener

好友事件变化监听

#### Version

25.12.0

interface FriendEventListener {
onFriendAdd(
userId: string,
name: string,
portraitUri: string,
directionType: FriendDirectionTypeBoth,
operationTime: number,
): void;
onFriendDelete(
userIds: string[],
directionType: FriendDirectionTypeBoth,
operationTime: number,
): void;
onFriendApplicationStatusChanged(
userId: string,
applicationType: FriendApplicationType,
applicationStatus: FriendApplicationStatus,
directionType: FriendDirectionTypeBoth,
operationTime: number,
extra: string,
): void;
onFriendCleared(operationTime: number): void;
onFriendInfoChangedSync(
userId: string,
remark: string,
extProfile: any,
operationTime: number,
): void;
}

- Defined in user/listener/FriendEventListener.ts:7

##### Index

### Methods

onFriendAdd
onFriendDelete
onFriendApplicationStatusChanged
onFriendCleared
onFriendInfoChangedSync

## Methods

### onFriendAdd

- onFriendAdd(
  userId: string,
  name: string,
  portraitUri: string,
  directionType: FriendDirectionTypeBoth,
  operationTime: number,
  ): void

  添加好友回调

  #### Parameters

  - userId: string

    用户 ID

  - name: string

    用户名

  - portraitUri: string

    用户头像

  - directionType: FriendDirectionTypeBoth

    好友方向类型

  - operationTime: number

    操作时间

  #### Returns void

  - Defined in user/listener/FriendEventListener.ts:16

### onFriendDelete

- onFriendDelete(
  userIds: string[],
  directionType: FriendDirectionTypeBoth,
  operationTime: number,
  ): void

  删除好友回调

  #### Parameters

  - userIds: string[]

    用户列表

  - directionType: FriendDirectionTypeBoth

    好友方向类型

  - operationTime: number

    操作时间

  #### Returns void

  - Defined in user/listener/FriendEventListener.ts:30

### onFriendApplicationStatusChanged

- onFriendApplicationStatusChanged(
  userId: string,
  applicationType: FriendApplicationType,
  applicationStatus: FriendApplicationStatus,
  directionType: FriendDirectionTypeBoth,
  operationTime: number,
  extra: string,
  ): void

  #### Parameters

  - userId: string
  - applicationType: FriendApplicationType
  - applicationStatus: FriendApplicationStatus
  - directionType: FriendDirectionTypeBoth
  - operationTime: number
  - extra: string

  #### Returns void

  - Defined in user/listener/FriendEventListener.ts:33

### onFriendCleared

- onFriendCleared(operationTime: number): void

  清空好友的回调 此操作只能由服务端发起

  #### Parameters

  - operationTime: number

    操作时间

  #### Returns void

  - Defined in user/listener/FriendEventListener.ts:47

### onFriendInfoChangedSync

- onFriendInfoChangedSync(
  userId: string,
  remark: string,
  extProfile: any,
  operationTime: number,
  ): void

  好友信息变更多端回调事件

  #### Parameters

  - userId: string

    用户 ID

  - remark: string

    好友备注

  - extProfile: any

    扩展信息

  - operationTime: number

    操作时间

  #### Returns void

  - Defined in user/listener/FriendEventListener.ts:56