UNPKG

ts-ioc-container

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