1 | import { IntrospectionResult, Type } from '@nestjs/common';
|
2 | import { GetOrResolveOptions } from '@nestjs/common/interfaces';
|
3 | import { AbstractInstanceResolver } from './abstract-instance-resolver';
|
4 | import { NestContainer } from './container';
|
5 | import { Injector } from './injector';
|
6 | import { InstanceLinksHost } from './instance-links-host';
|
7 | import { ContextId } from './instance-wrapper';
|
8 | import { Module } from './module';
|
9 | export declare abstract class ModuleRef extends AbstractInstanceResolver {
|
10 | protected readonly container: NestContainer;
|
11 | protected readonly injector: Injector;
|
12 | private _instanceLinksHost;
|
13 | protected get instanceLinksHost(): InstanceLinksHost;
|
14 | constructor(container: NestContainer);
|
15 | /**
|
16 | * Retrieves an instance of either injectable or controller, otherwise, throws exception.
|
17 | * @returns {TResult}
|
18 | */
|
19 | abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol): TResult;
|
20 | |
21 |
|
22 |
|
23 |
|
24 | abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options: {
|
25 | strict?: boolean;
|
26 | each?: undefined | false;
|
27 | }): TResult;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options: {
|
33 | strict?: boolean;
|
34 | each: true;
|
35 | }): Array<TResult>;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | abstract get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options?: GetOrResolveOptions): TResult | Array<TResult>;
|
41 | |
42 |
|
43 |
|
44 |
|
45 | abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol): Promise<TResult>;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
51 | id: number;
|
52 | }): Promise<TResult>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 | abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
58 | id: number;
|
59 | }, options?: {
|
60 | strict?: boolean;
|
61 | each?: undefined | false;
|
62 | }): Promise<TResult>;
|
63 | |
64 |
|
65 |
|
66 |
|
67 | abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
68 | id: number;
|
69 | }, options?: {
|
70 | strict?: boolean;
|
71 | each: true;
|
72 | }): Promise<Array<TResult>>;
|
73 | |
74 |
|
75 |
|
76 |
|
77 | abstract resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
78 | id: number;
|
79 | }, options?: GetOrResolveOptions): Promise<TResult | Array<TResult>>;
|
80 | abstract create<T = any>(type: Type<T>): Promise<T>;
|
81 | introspect<T = any>(token: Type<T> | string | symbol): IntrospectionResult;
|
82 | registerRequestByContextId<T = any>(request: T, contextId: ContextId): void;
|
83 | protected instantiateClass<T = any>(type: Type<T>, moduleRef: Module): Promise<T>;
|
84 | }
|