UNPKG

1.06 kBTypeScriptView Raw
1import { ClientOptions, CustomClientOptions } from '../../interfaces';
2import { Type, Provider, ModuleMetadata } from '@nestjs/common/interfaces';
3export type ClientProvider = ClientOptions | CustomClientOptions;
4export type ClientProviderOptions = ClientProvider & {
5 name: string | symbol;
6};
7export type ClientsModuleOptions = Array<ClientProviderOptions> | {
8 clients: Array<ClientProviderOptions>;
9 isGlobal?: boolean;
10};
11export interface ClientsModuleOptionsFactory {
12 createClientOptions(): Promise<ClientProvider> | ClientProvider;
13}
14export interface ClientsProviderAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
15 useExisting?: Type<ClientsModuleOptionsFactory>;
16 useClass?: Type<ClientsModuleOptionsFactory>;
17 useFactory?: (...args: any[]) => Promise<ClientProvider> | ClientProvider;
18 inject?: any[];
19 extraProviders?: Provider[];
20 name: string | symbol;
21}
22export type ClientsModuleAsyncOptions = Array<ClientsProviderAsyncOptions> | {
23 clients: Array<ClientsProviderAsyncOptions>;
24 isGlobal?: boolean;
25};