title: Use object values as interface keys
body: <p>I have an object containing property names in the form:</p>
  <pre><code>const INPUT_NAMES = {
      FIRST_NAME: 'first-name',
      LAST_NAME: 'last-name'
  };
  </code></pre>
  <p>I want to generate an interface based on those property name values:</p>
  <pre><code>interface IPropertyFormat {
      [INPUT_NAMES.FIRST_NAME]: string;
      [INPUT_NAMES.LAST_NAME]: string;
  }
  </code></pre>
  <p>That doesn't work because I am not using a literal type, nor a symbol and I get this: <code>A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.</code></p>
  <p>Using a simple constant like:</p>
  <pre><code>const KEY = &quot;FIRST_NAME&quot;;
  
  interface IPropertyFormat {
      [KEY]: string;
  }
  </code></pre>
  <p>works but is not an elegant solution in my case and would like to avoid it if possible. I've checked out <a href="https://stackoverflow.com/questions/49116691/typescript-interface-where-object-keys-are-values-of-another-object">this other kinda related topic</a> but it doesn't provide a solution for my problem.</p>
  <p>Anyone has any idea how to work around this problem?</p>
  <p>EDIT:</p>
  <p>Also, found a &quot;some-what&quot; solution <a href="https://stackoverflow.com/a/65355784/8412959">at this post</a> once again using <strong>const assertions</strong>.</p>