UNPKG

997 BTypeScriptView Raw
1import { DynamicModule } from '../../interfaces';
2import { DEFAULT_FACTORY_CLASS_METHOD_KEY, DEFAULT_METHOD_KEY } from '../constants';
3import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface';
4/**
5 * Class that represents a blueprint/prototype for a configurable Nest module.
6 * This class provides static methods for constructing dynamic modules. Their names
7 * can be controlled through the "MethodKey" type argument.
8 *
9 * @publicApi
10 */
11export type ConfigurableModuleCls<ModuleOptions, MethodKey extends string = typeof DEFAULT_METHOD_KEY, FactoryClassMethodKey extends string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY, ExtraModuleDefinitionOptions = {}> = {
12 new (): any;
13} & Record<`${MethodKey}`, (options: ModuleOptions & Partial<ExtraModuleDefinitionOptions>) => DynamicModule> & Record<`${MethodKey}Async`, (options: ConfigurableModuleAsyncOptions<ModuleOptions, FactoryClassMethodKey> & Partial<ExtraModuleDefinitionOptions>) => DynamicModule>;