title: Assigning generic to rest argument and having optional / default arguments
body: <p>I am trying to create this function below that takes one optional argument. It's an object, and the only prop needed is <code>value</code> however, I am looking to pass along any <code>...rest</code> parameters that area also passed in.</p>
  
  <pre><code>const useHook = &lt;T extends { value: string }&gt;({
     value: v = '',
     ...props
  }: T = { value: '' } as T) =&gt; {
      const defaultValue = React.useMemo(() =&gt; v, [props])
      const [value, setValue, resetValue] = Hooks.useState(defaultValue)
      const onChange = React.useCallback((e) =&gt; setValue(e.target.value), [setValue])
      return tuple({ value, onChange, ...props }, { defaultValue, resetValue, setValue })
  }
  </code></pre>
  
  <p>Here are the expected cases that should work:</p>
  
  <pre><code>const [props1] = useHook({ value: '12345', name: 'Thomas' }) // works
  const [props2] = useHook({ name: 'Thomas' }) // doesn't work missing "value"
  const [props3] = useHook() // works
  const [props4] = useHook({}) // doesn't work missing "value"
  
  const x = props1.name // string
  </code></pre>
  
  <p>How can I make value optional?</p>
  
  <p>Here's what I am looking for:</p>
  
  <ul>
  <li>Optional <code>value</code> prop has to be <code>string</code></li>
  <li><code>...props</code> are within the first returned tuple</li>
  <li>All of the argument options supported above</li>
  </ul>
  
  <p><a href="https://www.typescriptlang.org/play/?ssl=1&amp;ssc=1&amp;pln=12&amp;pc=29#code/MYewdgzgLgBArhApgCRCA1jAvDAPAFRkQA8pEwATCGAbxgDcBDAGzkQC4ZoAnASzADmMAL4A+ABQ0AsACgY8hfKasODbDADkGgDSzFigHRGADtxDGIexcM6EcdZW05aRMRtXwBKbKNpX98qCQsCSMALbGzIjqUNxs-gHciFBw3GC0RMThkYjaMEYGpubUwrKlMrJB0DAA2kUWAIwAuuoIKGjokgwsTjAATHlg4aoa+AAWIGHuGiKeleDVdWYWfS04bagYXUNhI+OT07PzwbX1EADMa-BIm51zMlWwS8UALFcbHZLCnkA" rel="nofollow noreferrer">Playground link</a></p>