title: Extend a `Record<string, string[]>` with a different type of property
body: <p>In Typescript the following seems like it should accomplish the creation of the desired type:</p>
  
  <pre><code>interface RecordX extends Record&lt;string, string[]&gt; {
    id: string
  }
  </code></pre>
  
  <p>but this complains about:</p>
  
  <blockquote>
    <p>Property 'id' of type 'string' is not assignable to string index type 'string[]'. ts(2411) </p>
  </blockquote>
  
  <p>How can one add a property of a different type to a <code>Record&lt;&gt;</code> utility type?</p>
  
  <h2>Details and General Case + Sample</h2>
  
  <p>Generally, how can one describe an object with heterogenous-value-type fixed properties but homogenous-value-type properties that are dynamically added.</p>
  
  <p>S, for example given this object:</p>
  
  <pre><code>const a = {
     // some properties with known "hard-coded" types
     id: '123',
     count: 123,
     set: new Set&lt;number&gt;(),
  
     // and some dynamic properties
     dynamicItemList: ['X', 'Y']
     anotherDynamicallyAddedList: ['Y', 'Z']
  } as ExtensibleRecord
  </code></pre>
  
  <p>So how can one define a type or interface <code>ExtensibleRecord</code> where:</p>
  
  <ol>
  <li>the types and property keys of <code>id</code>, <code>count</code>, and <code>set</code> are fixed as <code>string</code>, <code>number</code> and <code>Set&lt;number&gt;</code></li>
  <li>the types of <code>dynamicItemList</code> and <code>anotherDynamicallyAddedList</code> and any other properties added to the object are <code>string[]</code></li>
  </ol>
  
  <p>I've tried many variants that I'd think might work, including:</p>
  
  <pre><code>type ExtensibleRecord = {
    id: string, count: number, set: Set&lt;number&gt;
  } &amp; Record&lt;string, string[]&gt;
  
  type ExtensibleRecord = {
    id: string, count: number, set: Set&lt;Number&gt;
  } &amp; Omit&lt;Record&lt;string, string[]&gt;, 'id'|'count'|'set'&gt;
  
  interface ExtensibleRecord = {
    id: string,
    count: number,
    set: Set&lt;number&gt;,
    [k: string]: string[]
  }
  </code></pre>
  
  <p>but each seems to result in errors.</p>
  
  <p>This feels like something common and obvious, but I can't find an example or reference.</p>
  
  <h2><a href="http://www.typescriptlang.org/play/#code/C4TwDgpgBAogHsCA7AzgSwEYBsICUIDGA9gE4AmAjFALxQDeAsAFBRRpkBcUKwJaSAcwA0UYgFckwLkjEBbDBBIiUEKVADKqgDwz5igHzMAvlABkUfMXJaefQct78BAbQC6hps1CRYCZOmw8QlIyACYaemZWdi5bJxFxSWk5BSVuVS5NYB0Ug2MzKAB5WTRsyxCbR3tuKpd3EQBydgaAHwbE4FaGlU6PZn5EEgAzAEMCaHhEVEwccvIAZkiWNk4au2Eo0SIJNV1UoU2ezO09gwPl5wBrWNrXG-W3Y2ZmYlRgKBGIxmWVrgaKULzBrnVhbHZcAHzEGsI5QJAQADuGhOuRI+gAFABKaFQMggJAjEoEACSiFkABk0DwuM4GgANYFQBoATQarhxIyQRGAAAtFAARfGEtAEEZYLAgACCZDIEDIlOpUFprMaAC02fkRihfFMArNguQKM8mEA" rel="noreferrer">playground</a></h2>