import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios'; export interface AxiosRequestConfigExtend extends AxiosRequestConfig { /** * 是否需要同步 */ noAsync?: boolean; /** * 是否需要授权 */ noAuth?: boolean; /** * Post请求是否需要token */ noSeed?: boolean; /** * 是否需要通用提示信息 */ noMessage?: boolean; /** * 是否需要跳过重定向 */ noRedirect?: boolean; /** * 会话失效是否需要重试 */ noRetry?: boolean; /** * 蓝莓维保的特殊业务需求 */ isCheck?: boolean; /** * 配置方法,用于异步更新配置时 */ configFun?: () => AxiosRequestConfigExtend; /** * 配置方法,用于异步更新配置时 */ requestInstance?: AxiosInstance; } export interface ResponseDataTypeAll { code: number; content?: string; pagingQueryResult: Object; value: any; messageContent?: string; messageType: 'SUCCESS' | 'FAIL' | 'WARN' | 'PROCESS' | 'APPROVE' | 'SESSION_INVALID'; redirectUrl?: string; success?: boolean; valueObj: any; data: any; meta: { code: string | number; message: string; }; } export declare type ResponseDataType = Promise; export declare function addPostToken(config: AxiosRequestConfigExtend, requestInstance: AxiosInstance, keySeed: string, seedUri: string): Promise; export interface HeaderDefaultType { _appsource: string; [key: string]: string; } export interface RequestConstantType { [key: string]: string; } export declare const requestConstantOld: RequestConstantType; export declare const requestConstantNew: RequestConstantType; export declare const requestConstantNingde: RequestConstantType; export declare const requestConstantOcm: RequestConstantType; export declare const requestConstantCommon: RequestConstantType; export interface ClientSettingType extends RequestConstantType { /** * app类型 */ _appsource?: 'building' | 'alipayminiapp' | 'pc' | 'weixinminiapp' | 'dingdingh5'; /** * X-Requested-With */ 'X-Requested-With'?: string; /** * 类型 */ appsource?: string; headerDefault?: object; [key: string]: any; } export interface ClientSDKType { /** * 获取缓存 * @param key */ getStorageSync: (key: string) => any; /** * 设置缓存 * @param key * @param data */ setStorageSync: (key: string, data: any) => void; /** * 成功提示 * @param content */ successMessage: (content: string) => any; /** * 警告提示 * @param content */ warningMessage: (content: string) => any; /** * 失败提示 * @param content */ errorMessage: (content: string, config?: AxiosRequestConfigExtend) => any; /** * 处理重定向的函数 * @param redirectUrl * @param content */ handleRedirectUrl: (redirectUrl: string, content: string, response: AxiosResponse, handleRedirectUrlFun?: any) => any; /** * 获取授权code,支付是getAuthCode,微信是login,需要转化下 * @param options */ getAuthCode: (options?: object) => Promise; [key: string]: any; } /** * 获取参数,包括hash和search * @param key 参数 */ export declare function getParamValue(key: string): any; /** * 获取URI,不带 # */ export declare function getHashUri(): string; /** * 获取上传请求头 * @param requestInstance Axios实例 * @param this adapter实例 */ export declare function getUploadHeader(requestInstance: AxiosInstance, { clientSDK, clientSetting }: { clientSDK: any; clientSetting: any; }): object; /** * 格式化响应体header * @param response 响应体 */ export declare function formatResponseHeader(response: any): any; /** * 格式化响应体Data * @param response 响应体 */ export declare function formatResponseData(resData: any, response: any): any; /** * 旧版成功信息 * @param messageType */ export declare function isSuccessOld(messageType: any): boolean; /** * 旧版会话信息,不弹窗提示 * @param messageType */ export declare function is401Old(messageType: any, headers: any): boolean; /** * 403重定向 * @param messageType */ export declare function is403Old(messageType: any): boolean; /** * 新版成功信息 * @param code */ export declare function isSuccessNew(code: any): boolean; /** * 新版成功信息 * @param code */ export declare function is401New(code: any): boolean;