@nestjs/common/interfaces#Type TypeScript Examples
The following examples show how to use
@nestjs/common/interfaces#Type.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.d.ts From nest-jaeger with MIT License | 6 votes |
export declare function isClass(middleware: any): middleware is Type<any>;
Example #2
Source File: utils.d.ts From nest-jaeger with MIT License | 6 votes |
export declare function assignToken(metatype: Type<any>, token?: any): Type<any>;
Example #3
Source File: utils.d.ts From nest-jaeger with MIT License | 6 votes |
filterMiddleware: <T extends Function | Type<any> = any>(middleware: T[], excludedRoutes: RouteInfo[], httpAdapter: HttpServer) => Type<any>[]
Example #4
Source File: utils.d.ts From nest-jaeger with MIT License | 6 votes |
mapToClass: <T extends Function | Type<any>>(middleware: T, excludedRoutes: RouteInfoRegex[], httpAdapter: HttpServer) => Type<any>
Example #5
Source File: tenancy-core.module.ts From nestjs-tenancy with MIT License | 6 votes |
/**
* Create options providers
*
* @private
* @static
* @param {TenancyModuleAsyncOptions} options
* @returns {Provider[]}
* @memberof TenancyCoreModule
*/
private static createAsyncProviders(
options: TenancyModuleAsyncOptions,
): Provider[] {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)];
}
const useClass = options.useClass as Type<TenancyOptionsFactory>;
return [
this.createAsyncOptionsProvider(options),
{
provide: useClass,
useClass,
},
];
}
Example #6
Source File: tenancy-core.module.ts From nestjs-tenancy with MIT License | 6 votes |
/**
* Create options provider
*
* @private
* @static
* @param {TenancyModuleAsyncOptions} options
* @returns {Provider}
* @memberof TenancyCoreModule
*/
private static createAsyncOptionsProvider(
options: TenancyModuleAsyncOptions,
): Provider {
if (options.useFactory) {
return {
provide: TENANT_MODULE_OPTIONS,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
const inject = [
(options.useClass || options.useExisting) as Type<TenancyOptionsFactory>,
];
return {
provide: TENANT_MODULE_OPTIONS,
useFactory: async (optionsFactory: TenancyOptionsFactory) =>
await optionsFactory.createTenancyOptions(),
inject,
};
}
Example #7
Source File: invalid-class-scope.exception.d.ts From nest-jaeger with MIT License | 5 votes |
constructor(metatypeOrToken: Type<any> | Abstract<any> | string | symbol);
Example #8
Source File: base-exception-filter-context.d.ts From nest-jaeger with MIT License | 5 votes |
reflectCatchExceptions(instance: ExceptionFilter): Type<any>[];
Example #9
Source File: execution-context-host.d.ts From nest-jaeger with MIT License | 5 votes |
getClass<T = any>(): Type<T>;
Example #10
Source File: execution-context-host.d.ts From nest-jaeger with MIT License | 5 votes |
constructor(args: any[], constructorRef?: Type<any>, handler?: Function);
Example #11
Source File: compiler.d.ts From nest-jaeger with MIT License | 5 votes |
compile(metatype: Type<any> | DynamicModule | Promise<DynamicModule>): Promise<ModuleFactory>;
Example #12
Source File: compiler.d.ts From nest-jaeger with MIT License | 5 votes |
extractMetadata(metatype: Type<any> | DynamicModule | Promise<DynamicModule>): Promise<{
type: Type<any>;
dynamicMetadata?: Partial<DynamicModule> | undefined;
}>;
Example #13
Source File: compiler.d.ts From nest-jaeger with MIT License | 5 votes |
isDynamicModule(module: Type<any> | DynamicModule): module is DynamicModule;
Example #14
Source File: builder.d.ts From nest-jaeger with MIT License | 5 votes |
apply(...middleware: Array<Type<any> | Function | any>): MiddlewareConfigProxy;
Example #15
Source File: routes-mapper.d.ts From nest-jaeger with MIT License | 5 votes |
mapRouteToRouteInfo(route: Type<any> | RouteInfo | string): RouteInfo[];