title: In TypeScript, how to set the index signature of an object that is the property of a class?
body: <p>Here is a class:</p>
  
  <pre><code>export class Survey {
      isCompleted: boolean;
      response: {
          'devices': string[];
          'languages': string[];
          'frameworks': string[];
          'backend': string[];
      };
  }
  </code></pre>
  
  <p>I'm getting the "<em>Element implicitly has an 'any' type because type '...' has no index signature</em>" error when trying the following:</p>
  
  <pre><code>return Object.keys(user1.response).map(key =&gt; {
          return percentageMatch(user1.response[key], user2.response[key]) * categoryScores[key];
      })
  </code></pre>
  
  <p><code>user1</code> and <code>user2</code> are instances of the <code>Survey</code> class.</p>
  
  <p>I know how to set an index signature with simple object literals but how do I do it with the properties of the <code>response</code> object, which is itself a property of the <code>Survey</code> class.</p>