import { ModuleMetadata, Provider, Type } from '@nestjs/common'; import { DataSource, DataSourceOptions } from 'typeorm'; export declare type TypeOrmModuleOptions = { /** * Number of times to retry connecting * Default: 10 */ retryAttempts?: number; /** * Delay between connection retry attempts (ms) * Default: 3000 */ retryDelay?: number; /** * Function that determines whether the module should * attempt to connect upon failure. * * @param err error that was thrown * @returns whether to retry connection or not */ toRetry?: (err: any) => boolean; /** * If `true`, entities will be loaded automatically. */ autoLoadEntities?: boolean; /** * If `true`, connection will not be closed on application shutdown. * @deprecated */ keepConnectionAlive?: boolean; /** * If `true`, will show verbose error messages on each connection retry. */ verboseRetryLog?: boolean; } & Partial; export interface TypeOrmOptionsFactory { createTypeOrmOptions(connectionName?: string): Promise | TypeOrmModuleOptions; } export declare type TypeOrmDataSourceFactory = (options?: DataSourceOptions) => Promise; export interface TypeOrmModuleAsyncOptions extends Pick { name?: string; useExisting?: Type; useClass?: Type; useFactory?: (...args: any[]) => Promise | TypeOrmModuleOptions; dataSourceFactory?: TypeOrmDataSourceFactory; inject?: any[]; extraProviders?: Provider[]; }