import { Injector } from "./Injector"; import { Type, GenericClassDecorator, Constructor } from "./Types"; /** * @returns {GenericClassDecorator>} * @constructor */ export function Singleton(_interface?: Constructor): GenericClassDecorator> { return (clazz: Type) => { Injector['modules'].push({ implements: _interface ?? clazz, ctor: clazz }) } } export function Inject(clazz: Constructor) { return function (prototype: Object, key: string) { Injector['injectionQueue'].push({ injectionType: clazz, prototype: prototype, injectIntoKey: key }) } }