title: How to ensure an array's values the keys of a typescript interface?
body: <p>I am trying to produce an <code>events</code> property on <code>Klass</code> which contains an array of strings that exactly matches all the keys of a given interface. Like so:</p>
  
  <pre><code>interface Events {
      one: (foo: string) =&gt; void
      two: (bar: number) =&gt; void
  }
  
  class Klass {
      protected readonly events: [keyof Events] = ['one', 'two']
  }
  </code></pre>
  
  <p>However, the above errors out with the following:</p>
  
  <pre><code>[ts]
  Type '["one", "two"]' is not assignable to type '["one" | "two"]'.
    Types of property 'length' are incompatible.
      Type '2' is not assignable to type '1'. [2322]
  (property) Klass.events: ["one" | "two"]
  </code></pre>
  
  <p>What is needed here to ensure that the <code>events</code> property returns an array that contains all of the events?</p>