import { ProviderRef } from './provider-ref'; import { ProviderToken } from '../providers'; /** * An implementation of the `ProviderRef` that is used when a provider is defined as a factory function with the useFactory property. * The factory can be synchronous or asynchronous * * ```ts * @CliModule({ * providers: [ * { provide: APP_SERVICE, useFactory: async () => { } } * ] * }) * ``` */ export declare class FactoryProviderRef implements ProviderRef { injectToken: ProviderToken; /** * Reference to the factory function defined in the provider */ private factoryFn; /** * Reference to the value that is returned by the factory function, ensuring that the provider follows a singleton approach * and only executes the factory function once for multiple references */ private value; /** * Determines whether factory function should only be called once for all provider references or whether the it * should be called for each reference */ singleton: boolean; /** * Creates a new instance * @param token The provider key that is used when the `injector` looks up the provider for injection * @param factoryFn Factory function that is called when the provider is resolved. * @param singleton Determines whether factory function should only be called once for all provider references or whether the it * should be called for each reference */ constructor(token: ProviderToken, factoryFn: (...args: any) => T, singleton: boolean); resolve(callstack?: ProviderToken[]): Promise; }