UNPKG

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