nestjs-http-promise/lib/interfaces/http-module.interface.ts

25 lines
834 B
TypeScript
Raw Normal View History

import type {
InjectionToken,
ModuleMetadata,
OptionalFactoryDependency,
Provider,
Type,
} from '@nestjs/common';
import type { AxiosRequestConfig } from 'axios';
import type { IAxiosRetryConfig } from 'axios-retry';
export type HttpModuleOptions = AxiosRequestConfig & IAxiosRetryConfig;
export interface HttpModuleOptionsFactory {
2023-07-05 22:37:57 +00:00
createHttpOptions(): Promise<HttpModuleOptions> | HttpModuleOptions;
}
2023-07-05 22:37:57 +00:00
export interface HttpModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
useExisting?: Type<HttpModuleOptionsFactory>;
useClass?: Type<HttpModuleOptionsFactory>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2023-07-05 22:37:57 +00:00
useFactory?: (...args: any[]) => Promise<HttpModuleOptions> | HttpModuleOptions;
inject?: (InjectionToken | OptionalFactoryDependency)[];
2023-07-05 22:37:57 +00:00
extraProviders?: Provider[];
}