2021-09-07 18:25:31 +00:00
|
|
|
import { ModuleMetadata, Provider, Type } from '@nestjs/common';
|
|
|
|
import { AxiosRequestConfig } from 'axios';
|
|
|
|
import { IAxiosRetryConfig } from 'axios-retry'
|
|
|
|
|
2021-12-23 22:17:18 +00:00
|
|
|
export type HttpModuleOptions = (AxiosRequestConfig & IAxiosRetryConfig & { isBetterStackTraceEnabled?: boolean });
|
2021-09-07 18:25:31 +00:00
|
|
|
|
|
|
|
export interface HttpModuleOptionsFactory {
|
|
|
|
createHttpOptions(): Promise<HttpModuleOptions> | HttpModuleOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface HttpModuleAsyncOptions
|
|
|
|
extends Pick<ModuleMetadata, 'imports'> {
|
|
|
|
useExisting?: Type<HttpModuleOptionsFactory>;
|
|
|
|
useClass?: Type<HttpModuleOptionsFactory>;
|
|
|
|
useFactory?: (
|
|
|
|
...args: any[]
|
|
|
|
) => Promise<HttpModuleOptions> | HttpModuleOptions;
|
|
|
|
inject?: any[];
|
|
|
|
extraProviders?: Provider[];
|
|
|
|
}
|