UNPKG

639 BTypeScriptView Raw
1import { ConfigModule } from '..';
2import { ConfigFactory } from '../interfaces';
3import { ConfigObject } from '../types';
4export interface ConfigFactoryKeyHost<T = unknown> {
5 KEY: string;
6 asProvider(): {
7 imports: [ReturnType<typeof ConfigModule.forFeature>];
8 useFactory: (config: T) => T;
9 inject: [string];
10 };
11}
12/**
13 * Registers the configuration object behind a specified token.
14 */
15export declare function registerAs<TConfig extends ConfigObject, TFactory extends ConfigFactory = ConfigFactory<TConfig>>(token: string, configFactory: TFactory): TFactory & ConfigFactoryKeyHost<ReturnType<TFactory>>;