# ClassDecorator type · @imqueue/pg-cache

Source: https://imqueue.org/api/pg-cache/latest/pg-cache.classdecorator/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-cache 5.0.6 — generated reference, not hand-written

A dual-mode class decorator: called as `(constructor)` by legacy (`experimentalDecorators`) TypeScript and as `(value, context)` by standard (TC39) decorators. In both forms the first argument is the class, and the result is the class augmented with [PgCacheable](https://imqueue.org/api/pg-cache/latest/pg-cache.pgcacheable/).

Supporting both is what lets this package decorate `@imqueue` services compiled in either mode, the same way `@imqueue/rpc` and `@imqueue/core` decorators do.

**Signature:**

```typescript
export type ClassDecorator = <T extends new (...args: any[]) => {}>(constructor: T, context?: unknown) => T & PgCacheable;
```
**References:** [PgCacheable](https://imqueue.org/api/pg-cache/latest/pg-cache.pgcacheable/)

