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

20 lines
704 B
TypeScript
Raw Normal View History

import { ModuleMetadata, Provider, Type } from '@nestjs/common';
import { AxiosRequestConfig } from 'axios';
import IAxiosRetry from 'axios-retry';
2023-07-05 22:37:57 +00:00
export type HttpModuleOptions = AxiosRequestConfig &
IAxiosRetry.IAxiosRetryConfig & { isBetterStackTraceEnabled?: boolean };
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>;
useFactory?: (...args: any[]) => Promise<HttpModuleOptions> | HttpModuleOptions;
inject?: any[];
extraProviders?: Provider[];
}