title: Adding dynamic properties to class with static properties
body: <p>I'm trying to allow dynamic properties in my TS class like so.</p>
  <pre><code>export class Finding {
    id?: number;
  
    title = '';
  
    assets?: Asset[] = [];
  
    createdAt = Math.floor(Date.now() / 1000);
  
    [dynamicField: string]: DynamicFieldTypes;
  }
  </code></pre>
  <p>But it gives me the following error.</p>
  <blockquote>
  <p>Property ‘title’ of type ‘string’ is not assignable to ‘string’ index type ‘DynamicFieldTypes’.ts(2411)
  View Problem</p>
  </blockquote>
  <p>I assume it's because <code>[dynamicField: string]</code> overrides the types of all other properties. How do I fix that?</p>
  <p>Inheritance doesn't fix that either</p>
  <p><a href="https://www.typescriptlang.org/play?#code/KYOwrgtgBAIgniAhhAlgYwGIuAGwCYAqcADsAM5QDeAUFHVAC7AAeDANFOBAEbABO1AL7VqLYgHs+DKGhyIyFLCDwoQAcyq16KPAH4AXJ0i8+AbhH1GKBjmBQAvFADkT81rryywBmQNQyDHyqagDaALoOUOFulmh8wIhMeACC0o4AsokAFgB0AGY44pIAFDCJwDkg4gDuxQCUUAD0UACMAAwddTH0IXgIyOhYuHiGAUHqYYbwSKiY2PhEpGTmgkA" rel="nofollow noreferrer">link to playground</a></p>