import { InjectionToken } from "./common.js"; import { $Constructor } from "../typings/$types.js"; import { $MODULE_ID_TYPE } from "./$types.js"; export declare const MODULE_MAP: unique symbol; /**有几层面具 */ declare const _MASK_LEVEL_SYMBOL_: unique symbol; /**面具下的实际对象 */ declare const _MASK_SELF_SYMBOL_: unique symbol; export declare class ModuleStroge implements Map<$MODULE_ID_TYPE, any> { private parent?; clear(): void; delete(key: string | number | symbol): boolean; forEach(callbackfn: (value: any, key: string | number | symbol, map: Map) => void, thisArg?: any): void; set(key: string | number | symbol, value: any): this; get size(): number; /** * @TODO 应该也提供对parent、mask的迭代、size计算等功能 */ [Symbol.iterator](): IterableIterator<[string | number | symbol, any]>; entries(): IterableIterator<[string | number | symbol, any]>; keys(): IterableIterator; values(): IterableIterator; [Symbol.toStringTag]: string; private _stroge; constructor(entries?: ReadonlyArray<[$MODULE_ID_TYPE, any]> | null, parent?: ModuleStroge | undefined); get(key: $MODULE_ID_TYPE): T; has(key: $MODULE_ID_TYPE): boolean; /**面具的层数 */ readonly [_MASK_LEVEL_SYMBOL_] = 0; /**指向真实的自己 */ readonly [_MASK_SELF_SYMBOL_]: this; /** * 带上面具 * 创建原型链 * 使用Proxy,避过原型链的拦截,确保`_groupCollection`等可空的属性能够正确作用到`this`的属性上 * @param mask */ installMask(mask: ModuleStroge): ModuleStroge; /** * 卸下面具 */ uninstallMask(deep?: number): this; /** * 组收集器 */ private _groupCollection?; /** * 添加一个组实例 * @param groupName * @param instance */ groupInsert(groupName: $MODULE_ID_TYPE, instance: unknown): void; /** * 获取模块注入的组 * @param CtorRoot */ groupGet(...CtorRootList: Array | $Constructor | $MODULE_ID_TYPE | $MODULE_ID_TYPE[]>): Set; /** * 递归获取出组模块集合 * @param groups */ private groupsGet_; /** * 递归获取出组模块集合 * @param groupName */ private groupGet_; } export {};