2023-11-14 15:26:43 +00:00
|
|
|
import type { ModuleMetadata, Provider, Type } from '@nestjs/common';
|
|
|
|
import type { AxiosRequestConfig } from 'axios';
|
|
|
|
import type IAxiosRetry from 'axios-retry';
|
2023-11-14 14:50:12 +00:00
|
|
|
|
2023-07-05 22:37:57 +00:00
|
|
|
export type HttpModuleOptions = AxiosRequestConfig &
|
2023-11-14 15:31:21 +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>;
|
2023-11-14 15:31:21 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2023-07-05 22:37:57 +00:00
|
|
|
useFactory?: (...args: any[]) => Promise<HttpModuleOptions> | HttpModuleOptions;
|
2023-11-14 15:31:21 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2023-07-05 22:37:57 +00:00
|
|
|
inject?: any[];
|
|
|
|
extraProviders?: Provider[];
|
|
|
|
}
|