title: Typescript how to map type keys to camelCase
body: <p>I'm new to typescript but I want to create a mapped type that converts keys from another type. Specifically, say I have a type where all the keys are snake-cased, how can I create a type where they are all camel-cased?</p>
  
  <p>I thought I could do something like</p>
  
  <pre><code>type CamelCase&lt;T&gt; = {
    [_.camelCase(P in keyof T)]: T[P];
  }
  
  type MyCamelCaseType = CamelCase&lt;SnakeCaseType&gt;;
  </code></pre>
  
  <p>But TS doesn't like this. How can I transform the keys of an existing type to create a new type in this way?</p>