ts-ioc-container
Version:
Typescript IoC container
13 lines (12 loc) • 643 B
TypeScript
import type { IContainer } from '../container/IContainer';
import type { IProvider } from './IProvider';
import { ProviderDecorator } from './IProvider';
import type { Cache } from './Cache';
import { InjectOptions } from '../injector/IInjector';
export declare class SingletonProvider<T> extends ProviderDecorator<T> {
private readonly provider;
private readonly cache;
constructor(provider: IProvider<T>, cache: Cache<unknown, T>);
resolve(container: IContainer, options: InjectOptions): T;
}
export declare const singleton: <T = unknown>(cacheProvider?: () => Cache<unknown, T>) => import("./ProviderPipe").ProviderPipe<T>;