---
meta:
 - name: keywords
   description: api typescript node.js documentation InterceptorContext interface
---
# InterceptorContext - @tsed/di

## Usage

```typescript
import { InterceptorContext } from "@tsed/di";
```

> See [/packages/di/src/common/interfaces/InterceptorContext.ts](https://github.com/tsedio/tsed/blob/v8.27.0/packages/di/src/common/interfaces/InterceptorContext.ts#L0-L0).

## Overview

```ts
interface InterceptorContext<Klass = Type, Opts = any> {
    target: Klass;
    propertyKey: string | symbol;
    args: unknown[];
    next: InterceptorNext;
    options?: Opts;
}
```

<!-- Description -->

## Description

Context object passed to interceptors during method execution.

Provides access to the target instance, method name, arguments, and control flow
for intercepting and modifying method behavior.

### Usage

```typescript
import {Interceptor, InterceptorContext, InterceptorMethods} from "@tsed/di";

@Interceptor()
class LogInterceptor implements InterceptorMethods {
  intercept(context: InterceptorContext) {
    console.log("Before:", context.propertyKey);
    const result = context.next();
    console.log("After:", result);
    return result;
  }
}
```

<!-- Members -->

## target

```ts
target: Klass;
```

## propertyKey

```ts
propertyKey: string | symbol;
```

## args

```ts
args: unknown[];
```

## next

```ts
next: InterceptorNext;
```

## options

```ts
options?: Opts;
```
