title: how to preserve keys when using typeof on index signature?
body: <p>I'm trying to preserve the properties of an object that declares its type via index signature. Minimal example below (the code snipped doesn't do anything useful and isn't subject to the question, I want to use mapped types over these, but also retain compiler support for the body, for example a function accepting indexWithType and outputting a mapped type while preserving its keys).</p>
  <p>I understand why this is happening, with the type, typeof resolves to IndexSignature and discards the specific subtype.</p>
  <p>How do I convince typescript to use the lower bound instead?</p>
  <pre><code>type IndexSignature = {
      [index: string]: string
  }
  
  const indexWithType: IndexSignature = {
      test: &quot;value&quot;
  }
  
  const indexWithOutType = {
      test: &quot;value&quot;
  }
  
  const lost: typeof indexWithType = {
      // NOT AN ERROR! But I want one, typescript lost the properties of indexWithType
  }
  
  const notLost: typeof indexWithOutType = {
      // ERROR! Does work as expected.
  }
  </code></pre>