nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
66.9k stars 7.55k forks source link

what is alternative for 'CustomValue' ? #2393

Closed xmlking closed 5 years ago

xmlking commented 5 years ago
ERROR in /Developer/Work/SPA/ngx-starter-kit/apps/api/src/app/email/email-core.module.ts(1,10):
TS2305: Module '"../../../../../../../../../Developer/Work/SPA/ngx-starter-kit/node_modules/@nestjs/core/injector/module"' has no exported member 'CustomValue'.
ERROR in /Developer/Work/SPA/ngx-starter-kit/node_modules/@nestjs/microservices/nest-microservice.d.ts(6,22):
TS2415: Class 'NestMicroservice' incorrectly extends base class 'NestApplicationContext'.
  Property 'isInitialized' is private in type 'NestMicroservice' but not in type 'NestApplicationContext'.

image

underfin commented 5 years ago
export type Provider<T = any> =
  | Type<any>
  | ClassProvider<T>
  | ValueProvider<T>
  | FactoryProvider<T>
  | ExistingProvider<T>;

export interface ClassProvider<T = any> {
  provide: string | symbol | Type<any> | Abstract<any> | Function;
  useClass: Type<T>;
  scope?: Scope;
}

export interface ValueProvider<T = any> {
  provide: string | symbol | Type<any> | Abstract<any> | Function;
  useValue: T;
}

export interface FactoryProvider<T = any> {
  provide: string | symbol | Type<any> | Abstract<any> | Function;
  useFactory: (...args: any[]) => T;
  inject?: Array<Type<any> | string | symbol | Abstract<any> | Function>;
  scope?: Scope;
}

export interface ExistingProvider<T = any> {
  provide: string | symbol | Type<any> | Abstract<any> | Function;
  useExisting: any;
}

You can use ValueProvider

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.