title: How do you declare function params in typescript with an interface?
body: <p>I know in TS I can do:</p>
  <p><code>const myFunc = (choice: string, index: number) =&gt; {}</code></p>
  <p>but how would I use an interface in there (and should I in terms of best practice?)</p>
  <p>I want to do something like</p>
  <pre><code>interface myFuncArgs {
    choice: string
    index: number
  }
  const myFunc = (choice, index): myFuncArgs  =&gt; {}
  </code></pre>
  <p>but it doesn't like that</p>
  <p>I know for this simple case it doesn't really make sense but what if <code>choice</code> was a complex object and I wanted to declare the types of everything inside? it would look ugly inline.</p>
  <p>how do I do this?</p>