title: How to declare types for Cypress tasks with minimal duplication?
body: <p>I define a function</p>
  <pre><code>function a(arg: X): Y { ... }
  
  ...
  on('task', { a })
  </code></pre>
  <p>for use as a Cypress task, and can add types:</p>
  <pre><code>declare global {
    namespace Cypress {
      interface Chainable {
        task(event: 'a', arg: Parameters&lt;typeof a&gt;[0]): Chainable&lt;ReturnType&lt;typeof a&gt;&gt;;
      }
    }
  }
  </code></pre>
  <p>Repeat for each task (omitting <code>arg</code> where necessary). Is there a way to decrease repetition? Of course, I could write <code>... arg: X): Chainable&lt;Y&gt;</code>, but then they could go out of sync with <code>a</code>'s definition and the compiler wouldn't catch it.</p>