title: Is there any way to get a names of arguments of function in typescript?
body: <p>I am trying to make a wrapper function which will take a function as an input and will return a newly typed function which allow both a list of parameters and an object which contain parameter names as keys.</p>
  <p>I have written the following code for that. The code works as expected. The problem is that I have pass an additional type which contains the keys as parameter name and value as type of that parameter. I want to do this dynamically. I want to access the names of the parameters</p>
  <pre><code>//I want remove this Args parameters and make it dynamically using F type.
  function wrapper&lt;F extends (...args: any) =&gt; any, Args&gt;(func: unknown) {
     type ParametersList = Parameters&lt;F&gt;;
     return func as (...args: [Args] | ParametersList) =&gt; ReturnType&lt;F&gt;;
  }
  const add = (x: number, y: number) =&gt; x + y;
  const wrappedAdd = wrapper&lt;typeof add, { x: number; y: number }&gt;(add);
  </code></pre>
  <p>The <code>Parameters</code> function returns a named tuple(which is a new feature I guess). Is  there any way we could get the names/labels of that tuple.  You can also suggest any other way.
  Thanks.</p>
  <p>###Edit:
  Ok I after some research I found out that we cannot get the names of the parameters of the function. So now my goal is to shorten my code a little bit. In the above code where I am passing an object in place of <code>Args</code>. I only want to pass an array of strings.</p>
  <pre><code>const wrappedAdd = wrapper&lt;typeof add, [&quot;x&quot;, &quot;y&quot;]&gt;(add);
  </code></pre>
  <p>I want to generate an object dynamically using this array. Thanks</p>