Skip to main content
Module

x/alosaur/mod.ts>DependencyContainer

Alosaur - Deno web framework with many decorators
Very Popular
Go to Latest
interface DependencyContainer
Re-export
import { type DependencyContainer } from "https://deno.land/x/alosaur@v0.21.0/mod.ts";

Methods

register<T>(token: InjectionToken<T>, provider: ValueProvider<T>): DependencyContainer
register<T>(token: InjectionToken<T>, provider: FactoryProvider<T>): DependencyContainer
register<T>(
token: InjectionToken<T>,
provider: TokenProvider<T>,
): DependencyContainer
register<T>(
token: InjectionToken<T>,
provider: ClassProvider<T>,
): DependencyContainer
register<T>(
token: InjectionToken<T>,
provider: constructor<T>,
): DependencyContainer
registerSingleton<T>(from: InjectionToken<T>, to: InjectionToken<T>): DependencyContainer
registerSingleton<T>(token: constructor<T>): DependencyContainer
registerType<T>(from: InjectionToken<T>, to: InjectionToken<T>): DependencyContainer
registerInstance<T>(token: InjectionToken<T>, instance: T): DependencyContainer
resolve<T>(token: InjectionToken<T>): T

Resolve a token into an instance

resolveAll<T>(token: InjectionToken<T>): T[]
isRegistered<T>(token: InjectionToken<T>, recursive?: boolean): boolean

Check if the given dependency is registered

reset(): void

Clears all registered tokens

clearInstances(): void
createChildContainer(): DependencyContainer