Skip to content

DecoratorParameters

@tsed/core

Usage

typescript
import { DecoratorParameters } from "@tsed/core/src/types/DecoratorParameters";

See /packages/core/src/types/DecoratorParameters.ts.

Overview

ts
type DecoratorParameters = [any, string | symbol, number | PropertyDescriptor];

Description

Raw parameters passed by the TypeScript runtime to any decorator (class, property, method or parameter).

The tuple contains:

  • the target (class prototype for instance members or the constructor for static members),
  • the key (string | symbol) of the decorated member,
  • the parameter index (number) or the PropertyDescriptor depending on the decorator type.
ts
function MyDecorator(...args: DecoratorParameters) {}

Released under the MIT License.