Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/danet/src/injector/mod.ts>Injector

The most mature backend framework for Deno
Go to Latest
class Injector
import { Injector } from "https://deno.land/x/danet@1.7.4/src/injector/mod.ts";

Properties

private
availableTypes: Map<Constructor | string, Constructor>
private
contextInjectables: Map<string, Map<Constructor | string, unknown>>
private
logger: Logger
private
resolved: Map<Constructor | string, (ctx?: ExecutionContext) => Promise<unknown> | unknown>
private
resolvedTypes: Map<Constructor | string, Constructor>

Methods

private
getParamToken(Type: Constructor, paramIndex: number)
private
resolveDependencies(Dependencies: Constructor[], ParentConstructor: Constructor)
private
resolveInjectable(
ParentConstructor?: Constructor,
token?: string,
)
private
setNonSingleton(
key: string | InjectableConstructor,
dependencies: Array<Constructor>,
transient?: boolean,
)
get<T>(Type: Constructor<T> | string, ctx?: ExecutionContext): T
has<T>(Type: Constructor<T> | string): boolean