UNPKG

1.43 kBTypeScriptView Raw
1import { IntrospectionResult, Type } from '@nestjs/common';
2import { NestContainer } from './container';
3import { ContextId } from './instance-wrapper';
4import { Module } from './module';
5export declare abstract class ModuleRef {
6 protected readonly container: NestContainer;
7 private readonly injector;
8 private _instanceLinksHost;
9 private get instanceLinksHost();
10 constructor(container: NestContainer);
11 abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options?: {
12 strict: boolean;
13 }): TResult;
14 abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: ContextId, options?: {
15 strict: boolean;
16 }): Promise<TResult>;
17 abstract create<T = any>(type: Type<T>): Promise<T>;
18 introspect<T = any>(token: Type<T> | string | symbol): IntrospectionResult;
19 registerRequestByContextId<T = any>(request: T, contextId: ContextId): void;
20 protected find<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, contextModule?: Module): TResult;
21 protected resolvePerContext<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, contextModule: Module, contextId: ContextId, options?: {
22 strict: boolean;
23 }): Promise<TResult>;
24 protected instantiateClass<T = any>(type: Type<T>, moduleRef: Module): Promise<T>;
25}