async-injection
Version:
A robust lightweight dependency injection library for TypeScript.
22 lines (21 loc) • 889 B
TypeScript
import { BindableProvider } from './bindable-provider.js';
import { SyncFactory } from './binder.js';
import { InjectableId, Injector } from './injector.js';
import { State } from './state.js';
/**
* @inheritDoc
* This specialization simply invokes it's configured Factory and provides the result.
*/
export declare class FactoryBasedProvider<T> extends BindableProvider<T, SyncFactory<T>> {
constructor(injector: Injector, id: InjectableId<T>, maker: SyncFactory<T>);
/**
* @inheritDoc
* This specialization invokes it's configured Factory and provides the result (or invokes the error handler if necessary).
*/
provideAsState(): State<T>;
/**
* @inheritDoc
* This specialization returns undefined anytime 'asyncOnly' is true (since this Provider is by definition synchronous).
*/
resolveIfSingleton(asyncOnly: boolean): Promise<T>;
}