title: Can I make a wrapper function with TypeScript using spread syntax, without having to specify arguments and types?
body: <p>The following code is a common, and very neat, way of implementing wrapper functions in JavaScript.</p>
  
  <p>The code wraps <code>innerFunction</code> (which has some named arguments) with the wrapper <code>outerFunction</code>:</p>
  
  <pre><code>function innerFunction(firstArgument, secondArgument, thirdArgument) {
    console.log('innerFunction', arguments);
  }
  
  function outerFunction() {
    console.log('outerFunction', arguments);
    innerFunction(...arguments)
  }
  
  outerFunction(1, 2, 3);
  
  </code></pre>
  
  <p><strong>This works perfectly fine as JavaScript</strong> - you can see <code>outerFunction</code> passes whatever arguments to <code>innerFunction</code>: </p>
  
  <pre><code>outerFunction [Arguments] { '0': 1, '1': 2, '2': 3 }
  innerFunction [Arguments] { '0': 1, '1': 2, '2': 3 }
  </code></pre>
  
  <p>Typescript doesn't like this, as it wants me to put the inner functions types into the outer function. </p>
  
  <p><strong>Is there a better way of doing this in TypeScript?</strong> Surely TypeScript's static analysis can see the outer function gets its types from the inner function?</p>
  
  <p>I accept the answer might be 'no, you have to add the types of the inner function to the outer function'. But I'd like to consult with my peers here in case there's a better way of doing this.</p>