title: How to get string literal types from Record defined as const
body: <p>I am able to infer types when I'm not using Record</p>
  <pre><code>export const TabsDefinition = {
  dimensionDetails: [
    { name: 'general', label: 'General' },
    { name: 'settings', label: 'Settings' },
    { name: 'list', label: 'List' },
  ],
  } as const;
  
  type MyNames = typeof TabsDefinition.dimensionDetails[number]['name'];
  </code></pre>
  <p>With this approach <code>MyNames</code> is infered as <code>&quot;general&quot; | &quot;settings&quot; | &quot;list&quot;</code></p>
  <p>But I want to use type for array of items - so I created this</p>
  <pre><code>type Tab = {
    name: string;
    label: string;
  };
  
  export const TabsDefinition: Record&lt;string, ReadonlyArray&lt;Tab&gt;&gt; = {
    dimensionDetails: [
      { name: 'general', label: 'General' },
      { name: 'settings', label: 'Settings' },
      { name: 'list', label: 'List' },
    ],
  } as const;
  
  type MyNames = typeof TabsDefinition.dimensionDetails[number]['name'];
  </code></pre>
  <p>but then <code>MyNames</code> type is infered as <code>string</code></p>