export type I18nText = { zh_cn: string; en_us?: string; ja_jp?: string; }; export type DepartmentBasic = { departmentID: string; name: I18nText; }; export type UserInfo = { userID: string; larkUserID: string; name: I18nText; avatar: string; userType: '_employee' | '_externalUser' | '_anonymousUser'; department: DepartmentBasic; email?: string; tenantName?: string; }; export type DepartmentInfo = { departmentID: string; larkDepartmentID: string; name: I18nText; }; export type AccountType = 'apaas' | 'lark'; export type SearchAvatar = { avatar: { image: { large: string; }; }; }; export type SearchUsersParams = { query?: string; offset?: number; pageSize?: number; searchExternalContact?: boolean; }; export type SearchUsersResponse = { data: { userList: UserInfo[]; total: number; }; status_code: string; }; export type ConvertExternalContactResponse = { data: { userInfo: { tenantID: number; userID: number; }; }; }; export type BatchGetUsersResponse = { data: { userInfoMap: Record; baseResp?: { statusCode?: number; statusMessage?: string; }; }; }; export type SearchDepartmentsParams = { query?: string; offset?: number; pageSize?: number; }; export type SearchDepartmentsResponse = { data: { departmentList: DepartmentInfo[]; total: number; }; status_code: string; }; export type ChatInfo = { /** 群组 ID */ chatID: string; /** 群组名称(国际化文本) */ name: I18nText; /** 头像:URL 或 16 进制 RGB 颜色 */ avatar: string; /** 是否是外部群 */ isExternal?: boolean; /** 群成员数量(不包括机器人),搜索接口返回,批量查询接口不返回 */ userCount?: number; }; export type SearchChatsParams = { query?: string; offset?: number; pageSize?: number; }; export type SearchChatsResponse = { data: { result: { chatResult?: { total: number; items: ChatInfo[]; }; }; }; status_code: string; }; export type BatchGetChatsResponse = { data: { chatInfoMap: Record; }; status_code: string; }; export type UserProfileAccountStatus = 0 | 1 | 2 | 3 | 4; export type SimpleUserProfileInfo = { name?: string; avatar?: string; email?: string; userStatus: UserProfileAccountStatus; userType: '_employee' | '_externalUser'; }; export type LarkCardParam = { needRedirect?: boolean; redirectURL?: string; larkAppID: string; jsAPITicket: string; larkOpenID: string; targetLarkOpenID: string; }; export type SimpleUserProfileData = { useLarkCard: false; userProfileInfo: SimpleUserProfileInfo; }; export type OfficialUserProfileData = { useLarkCard: true; larkCardParam: LarkCardParam; }; export type UserProfileData = SimpleUserProfileData | OfficialUserProfileData; export type UserProfileResponse = { data: UserProfileData; };