/**
 * SocialFriends.ts — 好友 / 私聊房间 / 站内信 相关 API（完整 TypeScript 实现）
 *
 * 封装 coreservice 路由：好友申请、好友关系、黑名单、私聊房间创建/举报、
 * 关注/粉丝查询、站内信（含奖励领取）、邮箱验证。内置请求限流与缓存。
 *
 * @example
 *   await keepwork.socialFriends.applyFriend(123, 'I am Alice');
 *   await keepwork.socialFriends.acceptApply(456);
 *   const friends = await keepwork.socialFriends.list();
 *   const room = await keepwork.socialFriends.createChatRoom(123);
 */
/** 通用选项对象 */
export type SocialOptions = Record<string, unknown>;
/** 好友标识：id 或包含 friendId/targetId/userId/id 的对象 */
export type FriendRef = string | number | {
    friendId?: string | number;
    targetId?: string | number;
    userId?: string | number;
    id?: string | number;
    [key: string]: unknown;
};
/** 限流错误（带额外字段） */
export interface RateLimitError extends Error {
    code: 'SOCIAL_RATE_LIMITED';
    action: string;
    rateLimitKey: string;
    retryAfter: number;
    retryAfterMs: number;
}
/** sdk 需提供的最小接口 */
interface SocialFriendsSdk {
    baseURL?: string;
    getAuthHeaders(): Record<string, string>;
    request(path: string, options?: {
        method?: string;
        body?: unknown;
    }): Promise<unknown>;
    get(path: string, params?: Record<string, unknown>): Promise<unknown>;
    post(path: string, body?: unknown): Promise<unknown>;
    put(path: string, body?: unknown): Promise<unknown>;
    delete(path: string): Promise<unknown>;
}
export default class SocialFriends {
    static DefaultRateLimitMs: number;
    /** 各操作的限流间隔（ms）。 */
    static RateLimitMs: Readonly<Record<string, number>>;
    /** 好友申请状态枚举。 */
    static FriendApplyStatus: Readonly<Record<string, number>>;
    /** 好友关系状态枚举。 */
    static FriendshipStatus: Readonly<Record<string, number>>;
    sdk: SocialFriendsSdk;
    private _rateLimitState;
    private _rateLimitCache;
    private _fixedResponseCache;
    constructor(sdk: unknown);
    private _getRateLimitMs;
    private _getRateLimitKey;
    /** 稳定序列化（键排序），用于生成确定性缓存 key。 */
    private _stableStringify;
    /** 强制限流；超限抛 RateLimitError。返回限流 key。 */
    private _enforceRateLimit;
    /** 限流 + 缓存：超限时若有缓存则返回缓存。 */
    private _cachedRateLimitedRequest;
    /** 固定缓存：命中即返回，否则请求后按 shouldCache 决定是否缓存。 */
    private _fixedCachedRequest;
    private _clearCachedAction;
    /** 清除站内信列表缓存。 */
    clearMailListCache(): void;
    /** 递归判断是否已领取奖励。 */
    private _hasReceivedRewards;
    /** 去除空值参数。 */
    private _compactParams;
    /** 把 core API 基地址改写为指定服务的端点。 */
    private _getServiceEndpoint;
    private _getPushManageEndpoint;
    /** 向指定端点发起请求（相对路径走 sdk.request，绝对 URL 走 fetch）。 */
    private _requestEndpoint;
    private _requireId;
    /** 从 id 或对象中提取好友 id。 */
    private _normalizeFriendId;
    /** 归一化申请状态（数字或枚举名）。 */
    private _normalizeApplyStatus;
    /** 申请添加好友。 */
    applyFriend(friendOrOptions: FriendRef, remark?: string): Promise<unknown>;
    apply(friendOrOptions: FriendRef, remark?: string): Promise<unknown>;
    requestFriend(friendOrOptions: FriendRef, remark?: string): Promise<unknown>;
    addFriend(friendOrOptions: FriendRef, remark?: string): Promise<unknown>;
    /** 处理待处理的好友申请（status: 2/AGREE, 3/REFUSE, 4/BLOCK）。 */
    processApply(applyId: string | number, status: string | number): Promise<unknown>;
    acceptApply(applyId: string | number): Promise<unknown>;
    rejectApply(applyId: string | number): Promise<unknown>;
    refuseApply(applyId: string | number): Promise<unknown>;
    blockApply(applyId: string | number): Promise<unknown>;
    acceptFriendApply(applyId: string | number): Promise<unknown>;
    rejectFriendApply(applyId: string | number): Promise<unknown>;
    /** 列出发给当前用户的好友申请。 */
    listApplies(options?: SocialOptions): Promise<unknown>;
    getApply(options?: SocialOptions): Promise<unknown>;
    getApplies(options?: SocialOptions): Promise<unknown>;
    listApplications(options?: SocialOptions): Promise<unknown>;
    /** 列出当前用户好友关系（含好友信息和在线状态）。 */
    list(options?: SocialOptions): Promise<unknown>;
    getFriendships(options?: SocialOptions): Promise<unknown>;
    listFriends(options?: SocialOptions): Promise<unknown>;
    /** 通过用户名搜索当前用户的 Keepwork 好友（旧 /users/friends 路由）。 */
    searchFriends(options?: SocialOptions | string): Promise<unknown>;
    getFriends(options?: SocialOptions | string): Promise<unknown>;
    removeFriend(friendOrOptions: FriendRef): Promise<unknown>;
    deleteFriend(friendOrOptions: FriendRef): Promise<unknown>;
    delete(friendOrOptions: FriendRef): Promise<unknown>;
    remove(friendOrOptions: FriendRef): Promise<unknown>;
    updateFriend(friendOrOptions: FriendRef, comment?: string): Promise<unknown>;
    updateRemark(friendOrOptions: FriendRef, comment?: string): Promise<unknown>;
    setFriendComment(friendOrOptions: FriendRef, comment?: string): Promise<unknown>;
    addToBlacklist(friendOrOptions: FriendRef): Promise<unknown>;
    blockFriend(friendOrOptions: FriendRef): Promise<unknown>;
    blacklist(friendOrOptions: FriendRef): Promise<unknown>;
    removeFromBlacklist(friendOrOptions: FriendRef): Promise<unknown>;
    unblockFriend(friendOrOptions: FriendRef): Promise<unknown>;
    unblacklist(friendOrOptions: FriendRef): Promise<unknown>;
    listBlacklist(options?: SocialOptions): Promise<unknown>;
    getBlacklist(options?: SocialOptions): Promise<unknown>;
    /** 更新在线状态（需 API-key 权限的内部路由）。 */
    setOnlineStatus(userId: string | number, status: unknown): Promise<unknown>;
    clearAllOnlineStatus(): Promise<unknown>;
    getFollowing(options?: SocialOptions): Promise<unknown>;
    getFollowers(options?: SocialOptions): Promise<unknown>;
    /** 为当前用户和好友创建或获取私聊房间。 */
    createChatRoom(targetOrOptions: FriendRef): Promise<unknown>;
    openPrivateChat(targetOrOptions: FriendRef): Promise<unknown>;
    createP2PChat(targetOrOptions: FriendRef): Promise<unknown>;
    createPrivateChatRoom(targetOrOptions: FriendRef): Promise<unknown>;
    /** 举报私聊违规内容。 */
    reportChat(options?: SocialOptions): Promise<unknown>;
    reportUser(reportUserId: string | number, content?: string): Promise<unknown>;
    reportChatUser(reportUserId: string | number, content?: string): Promise<unknown>;
    /** 通过 push-manage 发送站内信。 */
    sendMail(options?: SocialOptions): Promise<unknown>;
    /** 列出当前用户站内信。 */
    listMails(options?: SocialOptions): Promise<unknown>;
    getMails(options?: SocialOptions): Promise<unknown>;
    listEmails(options?: SocialOptions): Promise<unknown>;
    getEmails(options?: SocialOptions): Promise<unknown>;
    deleteMail(mailOrOptions: SocialOptions | string | number | Array<string | number>): Promise<unknown>;
    delEmail(mailOrOptions: SocialOptions | string | number | Array<string | number>): Promise<unknown>;
    removeMail(mailOrOptions: SocialOptions | string | number | Array<string | number>): Promise<unknown>;
    setMailRead(options?: SocialOptions | string | number | Array<string | number>): Promise<unknown>;
    setEmailReaded(options?: SocialOptions): Promise<unknown>;
    markMailRead(options?: SocialOptions): Promise<unknown>;
    getMailReward(options?: SocialOptions): Promise<unknown>;
    getEmailReward(options?: SocialOptions): Promise<unknown>;
    claimMailReward(options?: SocialOptions): Promise<unknown>;
    readMail(mailOrOptions: SocialOptions | string | number): Promise<unknown>;
    readEmail(mailOrOptions: SocialOptions | string | number): Promise<unknown>;
    openMail(mailOrOptions: SocialOptions | string | number): Promise<unknown>;
    /** 请求 Keepwork 邮箱验证码。 */
    sendEmailCaptcha(emailOrOptions: string | {
        email?: string;
    }): Promise<unknown>;
    requestEmailCaptcha(emailOrOptions: string | {
        email?: string;
    }): Promise<unknown>;
    getEmailCaptcha(emailOrOptions: string | {
        email?: string;
    }): Promise<unknown>;
    /** 验证邮箱验证码并绑定/解绑当前用户邮箱。 */
    verifyEmail(options?: SocialOptions): Promise<unknown>;
    bindEmail(email: string, captcha: string): Promise<unknown>;
    unbindEmail(email: string, captchaOrPassword?: string): Promise<unknown>;
}
export {};
//# sourceMappingURL=SocialFriends.d.ts.map