// Type augmentation for fmode-ng
// 扩展接口，添加缺失的方法定义

// 扩展 fmode-ng/social 的接口
declare module 'fmode-ng/social' {
  // 导出 WxworkCurrentChat 接口
  export interface WxworkCurrentChat {
    type?: string;
    chatId?: string;
    group?: any;
    contact?: any;
    id?: string;
    [key: string]: any;
  }
  
  // 扩展 WxworkAuth 接口
  interface WxworkAuth {
    currentProfile?(): Promise<any>;
    currentContact?(): Promise<any>;
  }
  
  // 扩展 WxworkCorp 接口
  interface WxworkCorp {
    ticket?: {
      get(): Promise<any>;
    };
    auth?: {
      getuserinfo(code: string): Promise<any>;
    };
    externalContact?: {
      get(userId: string): Promise<any>;
      groupChat: {
        get(chatId: string): Promise<any>;
        addJoinWay(options: any): Promise<any>;
        getJoinWay(configId: string): Promise<any>;
      };
    };
    message?: {
      sendText(chatId: string, content: string): Promise<any>;
      sendMarkdown(options: any): Promise<any>;
      sendNews(options: any): Promise<any>;
    };
    appchat?: {
      sendText(chatId: string, message: string): Promise<any>;
    };
  }

  // 扩展 WxworkSDK 接口
  interface WxworkSDK {
    ww?: any;
    getCurrentChat?(): Promise<any>;
    syncContact?(contactInfo: any): Promise<any>;
    syncGroupChat?(groupInfo: any): Promise<any>;
    getCurrentUser?(): Promise<any>;
  }
}
