title: Typescript: Type property depending on another property in the same object
body: <p>I'm trying to make a helper function <strong>for others to consume</strong>. The idea is that given an object, one key would influence the type of another key:</p>
  <pre><code>type MyHelper&lt;T = string[]&gt; = {
  parameters: T
  fn: (args: {parameters: Record&lt;keyof T, string&gt;}// maybe I should do something here
  }
  
  const obj:MyHelper = {
      parameters: ['a', 'b'],
      fn({ parameters }) {
          console.log(parameters) // returns {a: 'example', b: 'example'}
      }
  }
  </code></pre>
  <p>The code works fine in the implementation, but the main idea was to be able to infer this values at the IDE. When passing something like a Class I can achieve this, but not with arrays.</p>