UNPKG

871 BTypeScriptView Raw
1import { PipeTransform } from '../../interfaces/index';
2/**
3 * Decorator that binds pipes to the scope of the controller or method,
4 * depending on its context.
5 *
6 * When `@UsePipes` is used at the controller level, the pipe will be
7 * applied to every handler (method) in the controller.
8 *
9 * When `@UsePipes` is used at the individual handler level, the pipe
10 * will apply only to that specific method.
11 *
12 * @param pipes a single pipe instance or class, or a list of pipe instances or
13 * classes.
14 *
15 * @see [Pipes](https://docs.nestjs.com/pipes)
16 *
17 * @usageNotes
18 * Pipes can also be set up globally for all controllers and routes
19 * using `app.useGlobalPipes()`. [See here for details](https://docs.nestjs.com/pipes#class-validator)
20 *
21 * @publicApi
22 */
23export declare function UsePipes(...pipes: (PipeTransform | Function)[]): ClassDecorator & MethodDecorator;