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

20 lines
719 B
TypeScript
Raw Normal View History

import type { ModuleMetadata, Provider, Type } from '@nestjs/common';
import type { AxiosRequestConfig } from 'axios';
import type 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[];
}