UNPKG

893 BTypeScriptView Raw
1import { ValueRegistry } from './interfaces';
2/**
3 * Registry of all classes in gabliam instance
4 */
5export declare class Registry {
6 registry: Map<string | symbol, ValueRegistry<any>[]>;
7 /**
8 * Add a sub registry
9 * @param {Registry} subRegistry
10 */
11 addRegistry(subRegistry: Registry): void;
12 /**
13 * Get values of type in a registry
14 * @param {symbol|string} type
15 * @returns T[] return the list of velue
16 */
17 get<T>(type: symbol | string): Array<ValueRegistry<T>>;
18 /**
19 * Add value in registry for a type
20 * @param {symbol|string} type
21 * @param {T} target
22 */
23 add<T extends ValueRegistry<T>>(type: symbol | string, target: ValueRegistry<T>): void;
24 getAllAutoBind(): ValueRegistry<any>[];
25 /**
26 * Remove all values for a type
27 * @param {symbol} type
28 */
29 remove(type: symbol | string): void;
30}