title: Is it possible to infer the keys of an object that is predefined?
body: <p>I have an object:</p>
  <pre><code>const obj = {
      a: {...},
      b: {...},
      ...
  }
  </code></pre>
  <p>In ts if I'll create a type:</p>
  <pre><code>type oT = keyof typeof obj;
  </code></pre>
  <p>I'll get the union of the keys..</p>
  <p>I want to define 'obj' as a record type e.g</p>
  <pre><code>type myType = Record&lt;string, IMyInterface&gt;;
  const obj: myType ={...}
  </code></pre>
  <p>but still infer the keys for oT type, how can I do that?</p>