UNPKG

ts-ioc-container

Version:
12 lines (11 loc) 621 B
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>;