UNPKG

@nestjs/core

Version:

Nest - modern, fast, powerful node.js web framework (@core)

24 lines (23 loc) 1.32 kB
import { Type } from '@nestjs/common'; import { NestContainer } from './container'; import { ContextId } from './instance-wrapper'; import { Module } from './module'; export declare abstract class ModuleRef { protected readonly container: NestContainer; private readonly injector; private readonly containerScanner; constructor(container: NestContainer); abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, options?: { strict: boolean; }): TResult; abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, contextId?: ContextId, options?: { strict: boolean; }): Promise<TResult>; abstract create<T = any>(type: Type<T>): Promise<T>; protected find<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol): TResult; protected instantiateClass<T = any>(type: Type<T>, moduleRef: Module): Promise<T>; protected findInstanceByToken<TInput = any, TResult = TInput>(metatypeOrToken: Type<TInput> | string | symbol, contextModule: Module): TResult; protected resolvePerContext<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, contextModule: Module, contextId: ContextId, options?: { strict: boolean; }): Promise<TResult>; }