import { DependencyIdentifier } from './dependencyIdentifier'; import { Self, SkipSelf } from './dependencyLookUp'; import { Many, Optional } from './dependencyQuantity'; import { WithNew } from './dependencyWithNew'; export interface Ctor { new (...args: any[]): T; name: string; } export declare function isCtor(thing: unknown): thing is Ctor; export interface DependencyItemHooks { onInstantiation?: (instance: T) => void; } export interface ClassDependencyItem extends DependencyItemHooks { useClass: Ctor; lazy?: boolean; } export declare function isClassDependencyItem(thing: unknown): thing is ClassDependencyItem; export type FactoryDepModifier = typeof Self | typeof SkipSelf | typeof Optional | typeof Many | typeof WithNew; export type FactoryDep = [...FactoryDepModifier[], DependencyIdentifier] | DependencyIdentifier; export interface FactoryDependencyItem extends DependencyItemHooks { useFactory: (...deps: any[]) => T; dynamic?: true; deps?: FactoryDep[]; } export declare function isFactoryDependencyItem(thing: unknown): thing is FactoryDependencyItem; export interface ValueDependencyItem extends DependencyItemHooks { useValue: T; } export declare function isValueDependencyItem(thing: unknown): thing is ValueDependencyItem; /** * Reuse an existing dependency. You can consider it as an alias to another dependency. */ export interface ExistingDependencyItem extends DependencyItemHooks { /** * The identifier of the existing dependency. */ useExisting: DependencyIdentifier; } export declare function isExistingDependencyItem(thing: unknown): thing is ExistingDependencyItem; export interface AsyncDependencyItem extends DependencyItemHooks { useAsync: () => Promise | [DependencyIdentifier, SyncDependencyItem]>; } export declare function isAsyncDependencyItem(thing: unknown): thing is AsyncDependencyItem; export declare const AsyncHookSymbol: unique symbol; export interface AsyncHook { __symbol: typeof AsyncHookSymbol; whenReady(): Promise; } export declare function isAsyncHook(thing: unknown): thing is AsyncHook; export type SyncDependencyItem = ClassDependencyItem | FactoryDependencyItem | ExistingDependencyItem | ValueDependencyItem; export type DependencyItem = SyncDependencyItem | AsyncDependencyItem; export declare function prettyPrintIdentifier(id: DependencyIdentifier): string;