The parameter decorators

The official decorators proposal defines a parameter decorator as follows:

"A parameter decorator function is a function that accepts three arguments: The object that owns the method that contains the decorated parameter, the property key of the property (or undefined for a parameter of the constructor), and the ordinal index of the parameter. The return value of this decorator is ignored".
                                                                  - Ron Buckton, Decorators Proposal - TypeScript

The following type declares the signature of a parameter decorator:

declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; 
Please note that this signature ...

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.