import type { Store } from "@tsed/core"; import type { Type } from "@tsed/core/types/Type.js"; import { Provider } from "../domain/Provider.js"; import type { ProviderOpts } from "../interfaces/ProviderOpts.js"; import type { FactoryTokenProvider } from "../interfaces/TokenProvider.js"; declare global { namespace TsED { interface ProviderBuilder { /** * Sets the provider scope * @param scope - The scope to set for this provider * @returns Current builder instance */ scope(scope: Provider["scope"]): this; /** * Sets the provider path * @param path - The path to set for this provider * @returns Current builder instance */ path(path: Provider["path"]): this; /** * Sets the provider alias * @param alias - The alias to set for this provider * @returns Current builder instance */ alias(alias: Provider["alias"]): this; /** * Sets the provider hooks * @param hooks - The hooks to set for this provider * @returns Current builder instance */ hooks(hooks: Provider["hooks"]): this; /** * Sets the provider dependencies * @param deps - The dependencies to set for this provider * @returns Current builder instance */ deps(deps: Provider["deps"]): this; /** * Sets the provider imports * @param imports - The imports to set for this provider * @returns Current builder instance */ imports(imports: Provider["imports"]): this; /** * Sets the provider configuration * @param configuration - The configuration to set for this provider * @returns Current builder instance */ configuration(configuration: Provider["configuration"]): this; /** * Sets the provider priority * @param priority - The priority to set for this provider * @returns Current builder instance */ priority(priority: Provider["priority"]): this; /** * Sets the provider type * @param type - The type to set for this provider * @returns Current builder instance */ type(type: Provider["type"]): this; /** * Sets the provider children * @param children - The children to set for this provider * @returns Current builder instance */ children(children: Provider["children"]): this; /** * Sets the provider middlewares * @param middlewares - The middlewares to set for this provider * @returns Current builder instance */ middlewares(middlewares: Provider["middlewares"]): this; /** * Sets a factory function for the provider * @param factory - Factory function that creates provider instances * @returns Builder instance with updated factory type */ factory(factory: (...args: unknown[]) => FactoryReturn): TsED.ProviderBuilder>; /** * Sets an async factory function for the provider * @param asyncFactory - Async factory function that creates provider instances * @returns Builder instance with updated factory type */ asyncFactory(asyncFactory: (...args: unknown[]) => Promise): TsED.ProviderBuilder>; /** * Sets a static value for the provider * @param value - Value to be provided * @returns Builder instance with value type */ value(value: Value): TsED.ProviderBuilder>; /** * Sets the class to be used by the provider * @param k - Class type to be provided * @returns Builder instance with class type */ class(k: TokenKlass): TsED.ClassProviderBuilder; /** * Gets the provider's store * @returns Provider store instance */ store(): Store; /** * Gets the underlying provider instance * @returns Provider instance */ inspect(): Provider; /** * Gets the provider's token * @returns Provider token */ token(): Token; /** * Sets a value in the provider's store * @param key - Key to store the value under * @param value - Value to store * @returns Current builder instance */ set(key: string, value: unknown): this; } interface ClassProviderBuilder extends ProviderBuilder { } } } export declare class ProviderBuilder { protected provider: Provider; /** * Creates a new Provider Builder instance * @param options - Provider options including token and configuration */ constructor(options: ProviderOpts); static add(property: Keys, method: (this: ClassProviderBuilder, ...args: Parameters[Keys]>) => ReturnType[Keys]>): typeof ProviderBuilder; /** * Sets the provider scope * @param scope - The scope to set for this provider * @returns Current builder instance */ scope(scope: Provider["scope"]): ProviderBuilder; /** * Sets the provider path * @param path - The path to set for this provider * @returns Current builder instance */ path(path: Provider["path"]): ProviderBuilder; /** * Sets the provider alias * @param alias - The alias to set for this provider * @returns Current builder instance */ alias(alias: Provider["alias"]): ProviderBuilder; /** * Sets the provider hooks * @param hooks - The hooks to set for this provider * @returns Current builder instance */ hooks(hooks: Provider["hooks"]): ProviderBuilder; /** * Sets the provider dependencies * @param deps - The dependencies to set for this provider * @returns Current builder instance */ deps(deps: Provider["deps"]): ProviderBuilder; /** * Sets the provider imports * @param imports - The imports to set for this provider * @returns Current builder instance */ imports(imports: Provider["imports"]): ProviderBuilder; /** * Sets the provider configuration * @param configuration - The configuration to set for this provider * @returns Current builder instance */ configuration(configuration: Provider["configuration"]): ProviderBuilder; /** * Sets the provider priority * @param priority - The priority to set for this provider * @returns Current builder instance */ priority(priority: Provider["priority"]): ProviderBuilder; /** * Sets the provider type * @param type - The type to set for this provider * @returns Current builder instance */ type(type: Provider["type"]): ProviderBuilder; /** * Sets the provider children * @param children - The children to set for this provider * @returns Current builder instance */ children(children: Provider["children"]): ProviderBuilder; /** * Sets the provider middlewares * @param middlewares - The middlewares to set for this provider * @returns Current builder instance */ middlewares(middlewares: Provider["middlewares"]): ProviderBuilder; /** * Sets a factory function for the provider * @param factory - Factory function that creates provider instances * @returns Builder instance with updated factory type */ factory(factory: (...args: unknown[]) => FactoryReturn): ProviderBuilder>; /** * Sets an async factory function for the provider * @param asyncFactory - Async factory function that creates provider instances * @returns Builder instance with updated factory type */ asyncFactory(asyncFactory: (...args: unknown[]) => Promise): ProviderBuilder>; /** * Sets a static value for the provider * @param value - Value to be provided * @returns Builder instance with value type */ value(value: Value): ProviderBuilder>; /** * Sets the class to be used by the provider * @param k - Class type to be provided * @returns Builder instance with class type */ class(k: Type): ProviderBuilder; /** * Gets the provider's store * @returns Provider store instance */ store(): Store; /** * Gets the underlying provider instance * @returns Provider instance */ inspect(): Provider; /** * Gets the provider's token * @returns Provider token */ token(): Token; /** * Sets a value in the provider's store * @param key - Key to store the value under * @param value - Value to store * @returns Current builder instance */ set(key: string, value: unknown): ProviderBuilder; } type ClassProviderBuilder = TsED.ClassProviderBuilder; export declare function providerBuilder(baseOpts?: Partial): { (token: Token, options?: Partial): TsED.ClassProviderBuilder; (token: Token, options?: Partial): TsED.ProviderBuilder; }; export {};