title: Can you get a union of string literals from a readonly string tuple?
body: <p>I would like to create an interface that describes a structure like this...</p>
  <pre><code>const myObject: MyInterface = {
    keys: ['a', 'b', 'c'], //Arbitrary length and string literals, array is readonly
    props: {
      a: null //OK
      b: null //OK
      c: null //OK
      d: null //Invalid, 'd' is not in keys tuple
    }
  }
  </code></pre>
  <p>From what I can gather there shouldn't be an issue for TypeScript to infer this at compile time, given that the keys array cannot change and only has string literals. Here is what I've tried at the moment:</p>
  <pre><code>interface MyInterface {
    readonly keys: readonly string[];
    readonly props: Record&lt;this['keys'][number],any&gt;;
  }
  </code></pre>
  <p>This only manages to infer that the keys must be strings, not that they must match the given literals. Is there any way to accomplish what I'm actually after?</p>