import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from "axios"; import { BaseRet } from "./common/interface"; export interface WecomConfig { corpId: string; corpSecret: string; baseURL?: string; retryTimes?: number; } /** * @description 企业微信Node Api * @export * @class Wecom */ export declare class Wecom { readonly config: WecomConfig; readonly client: AxiosInstance; readonly api: Record; private _token; /** * @description 设置全局配置 * @static * @param {Partial} config * @memberof Wecom */ static setGlobal(config: Partial): void; /** * Creates an instance of Wecom. * @param {Partial} config 企业微信基本配置信息 * @memberof Wecom */ constructor(config: Partial); /** * @description 获取接口请求所需的token * @return {*} {Promise} * @memberof Wecom */ getToken(): Promise; /** * @description 发送企业微信请求 * @template T * @template R * @param {AxiosRequestConfig} config 配置参数和axios的参数保持一致 * @return {*} {Promise} * @memberof Wecom */ request>(config: AxiosRequestConfig): Promise; /** * @description 添加API * @template T * @param {string} path * @param {() => T} fn * @return {*} {Wecom} * @memberof Wecom */ createApi(path: string, fn: () => T): Wecom; }