title: Typed function parameters using destructuring and rest in TypeScript
body: <p>I have a function:</p>
  
  <pre><code>export default ({
    input: { name, onChange, value, ...restInput },
    meta,
    ...rest
  }) =&gt; (
    ...
  );
  </code></pre>
  
  <p>Given that 'name' is a string, 'onChange' is a function, 'value' is a string, 'meta' is an object, how can I add types to those parameters?
  My best guess would be like so:</p>
  
  <pre><code>export default ({
    input: { (name: String), (onChange: function), (value: String), ...restInput },
    (meta: Object),
    ...rest
  }) =&gt; (
    ...
  );
  </code></pre>
  
  <p>But it seems to have syntax errors. And even more I have no idea how to add types to rest parameters.</p>