/** * 自动装配补丁 * 遍历实例对象中 this.xx = null; 的属性 * 或者是 this.xxx = inject('xxx'); 的属性 * 调用时进行自动装配 */ import { IApplicationContext } from '../../interfaces'; export declare class InjectionPoint { defaultValue: any; id: string; constructor(id: string, defaultValue: any); static create(id: string, defaultValue?: any): InjectionPoint; } export declare class Autowire { /** * 创建注入点,类似alias功能,用于注入其他id对象 * @param id 替换id * @param defaultValue 默认值,可选 */ static createInject(id: string, defaultValue?: any): InjectionPoint; static patchInject(instance: any, context: IApplicationContext): void; /** * 自动装配 this.xxx = null; * @param instance 实例对象 * @param context ApplicationContext * @param fn handle function */ static patchNoDollar(instance: any, context: IApplicationContext, fn?: any): void; /** * 自动装配 this.$xxx = null * 插件、logger * @param instance 实例对象 * @param context ApplicationContext * @param fn handle function */ static patchDollar(instance: any, context: IApplicationContext, fn?: any): void; }