title: How to implement a typescript decorator?
body: <p><a href="http://blogs.msdn.com/b/typescript/archive/2015/03/27/announcing-typescript-1-5-alpha.aspx">TypeScript 1.5</a> now has <a href="https://github.com/wycats/javascript-decorators">decorators</a>.</p>
  
  <p>Could someone provide a simple example demonstrating the proper way to implement a decorator and describe what the arguments in the possible valid decorator signatures mean?</p>
  
  <pre><code>declare type ClassDecorator = &lt;TFunction extends Function&gt;(target: TFunction) =&gt; TFunction | void;
  declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) =&gt; void;
  declare type MethodDecorator = &lt;T&gt;(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor&lt;T&gt;) =&gt; TypedPropertyDescriptor&lt;T&gt; | void;
  declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) =&gt; void;
  </code></pre>
  
  <p>Additionally, are there any best practice considerations that should be kept in mind while implementing a decorator?</p>