UNPKG

@nestjs/common

Version:

Decorators, pipes, exceptions and utilities for NestJS applications: @Controller(), @Injectable(), @Body(), ValidationPipe, HttpException and more.

19 lines (18 loc) • 641 B
import { Type } from '../type.interface.js'; import { MiddlewareConfigProxy } from './middleware-config-proxy.interface.js'; /** * Interface defining method for applying user defined middleware to routes. * * @see [MiddlewareConsumer](https://docs.nestjs.com/middleware#middleware-consumer) * * @publicApi */ export interface MiddlewareConsumer { /** * @param {...(Type | Function)} middleware middleware class/function or array of classes/functions * to be attached to the passed routes. * * @returns {MiddlewareConfigProxy} */ apply(...middleware: (Type<any> | Function)[]): MiddlewareConfigProxy; }