Skip to content
GitHub

InterceptorInterface

interface in meocord/interface Since 4.1.0

interface InterceptorInterface

What an interceptor implements: intercept, which runs around the handler.

Implement it on a class marked with Interceptor, and apply the class with UseInterceptor.

Where it runs

  • Interceptors — where @UseInterceptor or @MeoCord({ interceptors }) applies the class

Members

intercept

intercept(
  context: ExecutionContext,
  next: CallHandler,
): Promise<unknown> | unknown

Runs around the handler.

Parameters

NameTypeDescription
contextExecutionContext

The call being handled: its arguments, controller, handler and metadata.

nextCallHandler

Continues with the next interceptor, then the handler.

Returns

Promise<unknown> | unknown

What the call returns: usually the result of next.handle().

See also