2023-11-27 03:56:15 +00:00
|
|
|
import type {
|
|
|
|
InjectionToken,
|
|
|
|
ModuleMetadata,
|
|
|
|
OptionalFactoryDependency,
|
|
|
|
Provider,
|
|
|
|
Type,
|
|
|
|
} from '@nestjs/common';
|
2023-11-14 15:26:43 +00:00
|
|
|
import type { AxiosRequestConfig } from 'axios';
|
2023-11-27 03:56:15 +00:00
|
|
|
import type { IAxiosRetryConfig } from 'axios-retry';
|
2023-11-14 14:50:12 +00:00
|
|
|
|
2023-12-24 02:37:29 +00:00
|
|
|
export type HttpModuleOptions = AxiosRequestConfig & IAxiosRetryConfig;
|
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-27 03:56:15 +00:00
|
|
|
inject?: (InjectionToken | OptionalFactoryDependency)[];
|
2023-07-05 22:37:57 +00:00
|
|
|
extraProviders?: Provider[];
|
|
|
|
}
|