title: can typescript property decorators set metadata for the class?
body: <p>In typescript, is it possible to use a property decorator to set metadata for the class? Consider the code below. The "target" of the class decorator is apparently not the same as the "target" of the property decorator. Can I derive one from the other?</p>
  
  <pre><code>import 'reflect-metadata';
  
  
  const MY_CLASS_DECORATOR_KEY = 'MyClassDecoratorKey';
  const MY_PROPERTY_DECORATOR_KEY = 'MyPropertyDecoratorKey';
  
  export const MyClassDecorator = options =&gt; {
      return function (target) {
        console.log('class target: ' , target);
        Reflect.defineMetadata(MY_CLASS_DECORATOR_KEY, options, target);
      };
  };
  
  export const MyPropertyDecorator = (options): PropertyDecorator =&gt; {
      return (target, property) =&gt; {
        console.log('property target: ' , target);
        const metadata = Reflect.getMetadata(MY_PROPERTY_DECORATOR_KEY, target) || {};
        metadata[property] = options;
        Reflect.defineMetadata(MY_PROPERTY_DECORATOR_KEY, metadata, target);
      };
  };
  
  @MyClassDecorator('my class decorator value')
  class MyClass {
      @MyPropertyDecorator('first my property decorator value')
      myFirstProperty: any;
  
      @MyPropertyDecorator('second my property decorator value')
      mySecondProperty: any;
  }
  
  console.log('keys: ', Reflect.getMetadataKeys(MyClass));
  </code></pre>
  
  <p>Note the output: </p>
  
  <pre><code>property target:  MyClass {}
  property target:  MyClass {}
  class target:  function MyClass() {
      }
  keys:  [ 'MyClassDecoratorKey' ]
  </code></pre>
  
  <p>How can I get the metadata keys to also show keys from the property decorator?</p>