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