import { ObjectConstructor } from "@halsp/core"; import { KeyTargetType } from "./interfaces"; import { InjectTarget } from "./inject-parser"; import { InjectType } from "./inject-type"; declare module "@halsp/core" { interface Startup { useInject(): this; inject(key: string, target: T): this; inject(key: string, target: (ctx: Context) => T | Promise, type?: InjectType): this; inject(key: string, target: ObjectConstructor, type?: InjectType): this; inject(anestor: ObjectConstructor, target: TTarget): this; inject(target: ObjectConstructor, type?: InjectType): this; inject(anestor: ObjectConstructor, target: (ctx: Context) => TTarget | Promise, type?: InjectType): this; inject(anestor: ObjectConstructor, target: ObjectConstructor, type?: InjectType): this; } interface Context { getService(key: string): Promise; getService(target: InjectTarget): Promise; getCachedService(target: ObjectConstructor | string): T | undefined; } }