import { Observable } from 'rxjs'; import { ExecutionContext } from './execution-context.interface'; /** * Interface providing access to the response stream. * * @see [Interceptors](https://docs.nestjs.com/interceptors) * * @publicApi */ export interface CallHandler { /** * Returns an `Observable` representing the response stream from the route * handler. */ handle(): Observable; } /** * Interface describing implementation of an interceptor. * * @see [Interceptors](https://docs.nestjs.com/interceptors) * * @publicApi */ export interface NestInterceptor { /** * Method to implement a custom interceptor. * * @param context an `ExecutionContext` object providing methods to access the * route handler and class about to be invoked. * @param next a reference to the `CallHandler`, which provides access to an * `Observable` representing the response stream from the route handler. */ intercept(context: ExecutionContext, next: CallHandler): Observable | Promise>; }