import { Injectable } from '../main/injections/injectionsManager'; import { DataboxClass } from './databox/Databox'; import { StaticDataboxClass } from './databox/StaticDatabox'; import { ChannelClass } from './channel/Channel'; import { StaticChannelClass } from './channel/StaticChannel'; import { AnyClass } from '../main/utils/typeUtils'; /** * @description * Property decorator that can be used to inject some value into a property. * The decorator is compatible with databoxes, channels or singletons, * but it is also possible to inject custom raw values. * The injections will be processed before the initialization of the components. * If you provide more databox or channel classes, * they will be combined in the corresponding container. * In the case of singletons, all instances will be resolved in an array. * When you have circular imports that cause a class to be undefined at the start, * you can use an arrow function that returns the class anytime. * When a provided function doesn't produce a databox, channel or singleton class, * the raw awaited value or values are set to the property. * If you want to inject services, you should look at Inject.Service. * @param inject * @example * @Inject(PublicChatDatabox) * private readonly publicChatDb: PublicChatDatabox; * * @Inject(ProfileDatabox_1,ProfileDatabox_3) * private readonly profileDb: DataboxContainer; * * @Inject(CustomClass1,CustomClass2) * private readonly customClasses: [CustomClass1,CustomClass2]; * * @Inject(async () => 'hello') * private readonly someString: string; * * @Inject(async () => 'hello',async () => 'hello2') * private readonly someStrings: [string,string]; */ export declare const Inject: { (...inject: Injectable[] | Injectable[] | Injectable[] | Injectable[] | Injectable[] | (() => any | Promise)[]): (target: any, propertyKey: string) => void; /** * @description * Injects a service, when it exists; otherwise, * it will throw a ServiceNotFoundError error. * @param serviceName * @param instanceName */ Service: (serviceName: string, instanceName?: string) => (target: any, propertyKey: string) => void; };