///
import { GaxiosOptions, GaxiosResponse, RetryConfig } from 'gaxios';
import type { CancelToken } from './CancelToken';
import { Stream } from 'stream';
declare type HaxiosRequestArrayBufferConfig = HAxiosRequestConfigBase & {
responseType: 'arraybuffer';
};
declare type HaxiosRequestJsonConfig = HAxiosRequestConfigBase & {
responseType?: 'json' | undefined;
};
declare type HaxiosRequestTextConfig = HAxiosRequestConfigBase & {
responseType: 'text';
};
declare type HaxiosRequestStreamConfig = HAxiosRequestConfigBase & {
responseType: 'stream';
};
declare type HaxiosRequestBlobConfig = HAxiosRequestConfigBase & {
responseType: 'blob';
};
export declare type DefaultRequestConfig = HaxiosRequestJsonConfig;
export declare type HAxiosRequestConfig = HaxiosRequestArrayBufferConfig | HaxiosRequestJsonConfig | HaxiosRequestTextConfig | HaxiosRequestStreamConfig | HaxiosRequestBlobConfig;
export interface HAxiosRequestConfigBase extends Omit {
data?: D;
onDownloadProgress?: (progressEvent: any) => void;
withCredentials?: boolean;
}
declare type GaxiosXMLHttpRequest = GaxiosResponse['request'];
export interface HaxiosRequest extends GaxiosXMLHttpRequest {
path: string;
}
declare type HaxiosRETURN = CONFIG extends HaxiosRequestArrayBufferConfig ? ArrayBuffer : CONFIG extends HaxiosRequestJsonConfig ? RETURN : CONFIG extends HaxiosRequestTextConfig ? string : CONFIG extends HaxiosRequestStreamConfig ? Stream : CONFIG extends HaxiosRequestBlobConfig ? Blob : unknown;
export interface HAxiosResponse = DefaultRequestConfig> extends Omit>, 'request'> {
config: HAxiosRequestConfig;
request?: HaxiosRequest;
}
export interface AxiosProxyConfig {
host: string;
port: number;
auth?: {
username: string;
password: string;
};
protocol?: string;
}
export declare type AxiosResponseHeaders = Record & {
'set-cookie'?: string[];
};
/**
export interface AxiosRequestTransformer {
(data: any, headers?: AxiosRequestHeaders): any;
}
export interface AxiosResponseTransformer {
(data: any, headers?: AxiosResponseHeaders): any;
}*/
export interface AxiosPromise extends Promise> {
}
export interface Headers {
[index: string]: string;
}
export declare type AxiosAdapter = (options: AxiosConfig, defaultAdapter: (options: AxiosConfig) => AxiosPromise) => AxiosPromise;
export interface AxiosConfig extends Omit {
credentials?: 'omit' | 'same-origin' | 'include';
headers?: Headers;
retry?: boolean;
retryConfig?: RetryConfig;
withCredentials?: boolean;
auth?: {
username: string;
password: string;
};
transformRequest?: never;
transformResponse?: never;
timeoutErrorMessage?: string;
xsrfCookieName?: string;
xsrfHeaderName?: string;
onDownloadProgress?: (progressEvent: any) => void;
maxBodyLength?: number;
socketPath?: string | null;
httpAgent?: any;
httpsAgent?: any;
proxy?: AxiosProxyConfig | false;
cancelToken?: CancelToken;
decompress?: boolean;
}
export {};