@inversifyjs/core
Version:
InversifyJs core package
35 lines • 1.31 kB
TypeScript
import { ServiceIdentifier } from '@inversifyjs/common';
import { MetadataName } from '../../metadata/models/MetadataName';
import { MetadataTag } from '../../metadata/models/MetadataTag';
import { PlanResult } from '../models/PlanResult';
interface GetPlanOptionsTagConstraint {
key: MetadataTag;
value: unknown;
}
export interface GetPlanOptions {
serviceIdentifier: ServiceIdentifier;
isMultiple: boolean;
name: MetadataName | undefined;
optional: boolean | undefined;
tag: GetPlanOptionsTagConstraint | undefined;
}
/**
* Service to cache plans.
*
* This class is used to cache plans and to notify PlanService subscribers when the cache is cleared.
* The cache should be cleared when a new binding is registered or when a binding is unregistered.
*
* Subscribers are supposed to be plan services from child containers.
*
* Ancestor binding constraints are the reason to avoid reusing plans from plan children nodes.
*/
export declare class PlanResultCacheService {
#private;
constructor();
clearCache(): void;
get(options: GetPlanOptions): PlanResult | undefined;
set(options: GetPlanOptions, planResult: PlanResult): void;
subscribe(subscriber: PlanResultCacheService): void;
}
export {};
//# sourceMappingURL=PlanResultCacheService.d.ts.map