UNPKG

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