title: Model DOM sub-trees in TypeScript
body: <p>How could I write a type-safe function that accepts (e.g.) an <a href="https://developer.mozilla.org/en/docs/Web/API/HTMLFormElement" rel="nofollow noreferrer"><code>HTMLFormElement</code></a> with two <a href="https://developer.mozilla.org/en/docs/Web/API/HTMLInputElement" rel="nofollow noreferrer"><code>HTMLInputElement</code></a> children, one of them of type <code>number</code> and the other of type <code>text</code> and optional?</p>
  
  <p>I don't know if this is even possible, but it would be highly beneficial for writing any DOM-manipulating function. Either way, what other approaches would you take to implement functions like the one described above?</p>