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

x/momentum/mvc-handlebars/deps.ts>ModuleRef

Momentum is an open-source framework for building server-side Deno applications in TypeScript. It provides the paradigms and design patterns to guide developers to create robust, scalable, and enterprise-grade applications.
Latest
class ModuleRef
Re-export
import { ModuleRef } from "https://deno.land/x/momentum@v0.8.2/mvc-handlebars/deps.ts";

Represents a reference to an bootstrapped Momentum module

Constructors

new
ModuleRef(
diContainer: DiContainer,
diCache: DiCache,
instance: unknown,
modules: ModuleRef[],
)

Properties

readonly
controllers: Type<unknown>[]

Get the controllers associated with the module

readonly
diContainer

Get the module dependency injection container

readonly
instance

Get the module instance

readonly
metadata

Get the module metadata

readonly
modules

Get the sub-modules of the module

Methods

resolve<TReturn = unknown>(identifier: TypeIdentifier): Promise<TReturn>

Resolves an instance of @see TReturn

resolve<TReturn = unknown>(identifier: TypeIdentifier, cache: DiCache): Promise<TReturn>

Resolves an instance of @see TReturn using a custom @see DiCache

Static Methods

private
populateDiContainer(
diContainer: DiContainer,
importedModules: ModuleRef[],
)
private
resolveModule(
moduleDefinition: ModuleClass | DynamicModule,
diContainer: DiContainer,
diCache: DiCache,
moduleCache?: Map<ExtendedModuleMetadata, ModuleRef>,
)
createModuleRef(
moduleMetadata: ExtendedModuleMetadata,
diContainer: DiContainer,
diCache: DiCache,
moduleCache?: Map<ExtendedModuleMetadata, ModuleRef>,
): Promise<ModuleRef>