ts-ioc-container
Version:
Typescript IoC container
12 lines (11 loc) • 621 B
TypeScript
import type { IContainer } from '../container/IContainer';
import type { IProvider, ProviderResolveOptions } from './IProvider';
import { ProviderDecorator } from './IProvider';
import type { Cache } from './Cache';
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: ProviderResolveOptions): T;
}
export declare const singleton: <T = unknown>(cacheProvider?: () => Cache<unknown, T>) => import("./ProviderPipe").ProviderPipe<T>;