title: Constructing an array of string from the properties of a function return type
body: <p>I need to create an array containing the properties of the return type of this function</p>
  <pre><code>const createTableData = (cod: string, promo: string, type: string) =&gt; ({
    code: cod,
    promo: promo,
    type: type,
  })
  </code></pre>
  <p>thus the array should be</p>
  <pre><code>[&quot;code&quot;, &quot;promo&quot;, &quot;type&quot;]
  </code></pre>
  <p>but the compiler complains saying that I'm using the ReturnType as a value here</p>
  <pre><code>class T extends ReturnType&lt;typeof createTableData&gt; {}
  const vals = Object.keys(Reflect.construct(T, []))
  </code></pre>