import { type AbstractClass, type Class } from "./utils.ts"; import { type Provider } from "./providers.ts"; import type { Container } from "./container.ts"; /** * A token is a reference to a service in the dependency injection (DI) container. * When obtaining a service from the container, you should use this token. */ export type Token = Class | AbstractClass | string | symbol | InjectionToken; /** * A unique injection token object, that is used by reference. Can hold a generic type. * Can optionally hold an (async) factory. */ export declare class InjectionToken { private description; options?: InjectionTokenOptions | undefined; constructor(description: string | symbol, options?: InjectionTokenOptions | undefined); toString(): string; } type InjectionTokenOptions = { async: true; factory: (container: Container) => Promise; } | { async?: false; factory: (container: Container) => T; }; /** * Type-guard to check if a token is a class reference. * * @internal */ export declare function isClassToken(token: Token): token is Class; /** * Type-guard to check if a token is an InjectionToken * * @internal */ export declare function isInjectionToken(token: Token): token is InjectionToken; /** * Describes a token, useful for error messages. * * @internal */ export declare function toString(token: Token): string; /** * Returns the token for a provider. * * @internal */ export declare function getToken(provider: Provider): Token; export {};