import type { Constructor } from "./inject"; export interface Injectable { __init_service?: (dependencies: Dependencies | Map) => any; new (): any; } export type DependencyOverride = Injectable | object; export type Dependencies = Array<[Constructor, DependencyOverride]>; export declare class Service { private static __init_service; /** * By default each injected dependency is a new instance of the given class. * This method allows to either replace the constructor of the dependency with * another one, or provide a value that will be injected instead. */ static setDefaultDependency(dependencyConstructor: T, instance: InstanceType | T): void; /** * Initialize a service and injects the provided dependencies into it and it's * dependents. When a dependency is not provided but is used by the Service, the * default one will be used. */ static init(this: T, ...dependencies: Dependencies): InstanceType; protected __reflectProto?: () => object; protected __dependenciesOverrides?: () => Map; constructor(); private __initializeDependencies; /** * Instantiate a service. If this service has some dependencies overridden, * those will be propagated to the new service. * * This is especially useful when you want to create a new instance of a service * conditionally, since that's not possible with the `Inject()` decorator. */ protected spawnService(service: S, ...overrides: Dependencies): InstanceType; }