import { Container } from './container'; import { InjectFunction, GenericToken } from './interfaces'; /** * 创建属性装饰器的高阶函数(Stage 3 Field Decorator) * * 直接在装饰器执行阶段将元数据写入 context.metadata, * 不再使用 context.addInitializer,消除实例化时的重复回调。 * * @param decoratorKey 装饰器名称(如 'inject'、'self' 等) * @param defaultValue 装饰器的默认参数值 * @returns 装饰器函数 */ declare function createDecorator(decoratorKey: string, defaultValue?: any): (decoratorValue?: any) => (_value: undefined, context: ClassFieldDecoratorContext) => void; export declare const Inject: InjectFunction>; export declare const Self: (decoratorValue?: any) => (_value: undefined, context: ClassFieldDecoratorContext) => void; export declare const SkipSelf: (decoratorValue?: any) => (_value: undefined, context: ClassFieldDecoratorContext) => void; export declare const Optional: (decoratorValue?: any) => (_value: undefined, context: ClassFieldDecoratorContext) => void; export declare const PostConstruct: (metaValue?: any) => (_value: Function, context: ClassMethodDecoratorContext) => void; export declare const PreDestroy: (metaValue?: any) => (_value: Function, context: ClassMethodDecoratorContext) => void; /** * 类装饰器:在类定义阶段关联 target(类构造函数)和 context.metadata * * 当所有成员装饰器(@Inject、@PostConstruct 等)执行完毕后, * @Injectable 读取 context.metadata 并通过 defineMetadata 写入 CacheMap, * 建立 target → metadata 的映射关系。 * * 使用方式:@Injectable()(需要调用,与其他装饰器保持一致) */ export declare function Injectable(): (Ctor: Function, context: ClassDecoratorContext) => void; /** * 延迟注入装饰器,Stage 3 Field Decorator 签名。 * 通过 context.addInitializer 在实例上定义 getter/setter, * 首次访问属性时才从容器中解析依赖。 * * @param token 要解析的服务 Token * @param container 可选,显式指定容器。未传入时通过 Container.getContainerOf 查找, * 仅支持 Instance 类型绑定。toConstantValue / toDynamicValue 场景需显式传入。 */ export declare function LazyInject(token: GenericToken, container?: Container): (_value: undefined, context: ClassFieldDecoratorContext) => void; /** * 创建绑定到指定容器的延迟注入装饰器工厂。 */ export declare function createLazyInject(container: Container): (token: GenericToken) => (_value: undefined, context: ClassFieldDecoratorContext) => void; export declare function decorate(decorator: any, target: any, key: string): void; export {};