title: how can you express "keyof T" to be a subset of String?
body: <p>The Firebase typings have an interface <code>IQuery</code> which has the <code>equalTo()</code> method typed as:</p>
  
  <pre><code>public equalTo(value: number | string | boolean | null, name?: string): IQuery;
  </code></pre>
  
  <p>I have a mocking library which is trying to mimic the API surface of what Firebase is exposing but in the case of the <code>name</code> parameter the general typing of "string" can be made more specific:</p>
  
  <pre><code> public equalTo(value: number | string | boolean | null, key?: keyof T): IQuery&lt;T&gt;
  </code></pre>
  
  <p>By stating <code>keyof T</code> we get some very useful static checking that I'd hate to lose out on and in fact up to TypeScript 2.8.3 I seemed to be able to do this but when moving to <code>2.9.x</code>+ of Typescript I now get this error:</p>
  
  <blockquote>
    <p>Type 'string' is not assignable to type 'keyof T'.</p>
  </blockquote>
  
  <p>For a bit more context, the class definition in my mocking library is:</p>
  
  <pre><code> export default class Query&lt;T = any&gt; implements IQuery&lt;T&gt; { ... }
  </code></pre>
  
  <p>Where the <code>&lt;T&gt;</code> generic type is an indicator of type of the data structure that the query will return. </p>
  
  <p>Further it is worth noting that T, <em>will always</em> be shaped as a dictionary/hash with string keys and therefore <code>keyof T</code> will subset of string values but in my typing I'm not making this clear so I get where Typescript is taking issue ... I just don't know how to express that <code>keyof T</code> must be a string.</p>