title: explicitly say a value as a certain key in TS
body: <p>I have the following code where I pass an object, and want to get the first key of it :</p>
  <pre><code>      const resultKey = Object.keys(data)[0];
        if (!Object.prototype.hasOwnProperty.call(data, resultKey)) {
          return { hasMore: false, options: [] };
        }
  </code></pre>
  <p>now if the above pass, then <code>data</code> do contains <code>resultKey</code> so I would like this to not fail</p>
  <pre><code>data[resultKey]?.total
  
  </code></pre>
  <p>right now I get prompted with</p>
  <blockquote>
  <p>Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'QueryResult&lt;Q, V&gt;'.
  No index signature with a parameter of type 'string' was found on type 'QueryResult&lt;Q, V&gt;'</p>
  </blockquote>
  <p>I know it s not ideal, but how can I specify that that type is safe (knowing that <code>resultKey</code> can be anything.</p>