title: Typescript dependent optional properties
body: <p>I need a type in which some optional properties depend on each other.<br />
  I.e. if an object defines one such property, then it must define all other properties that depend on it.</p>
  <p>I thought of separating the main type and the sets of optional properties, and then having a union type, but it doesn't seem to work.<br />
  Namely, I expect that if</p>
  <pre><code>interface T {a: any, b: any}
  interface U {c: any, d, any}
  type V = T | (T &amp; U)
  </code></pre>
  <p>Then <code>v: V</code> would only be able to contain either <code>{a, b}</code> or <code>{a, b, c, d}</code>.<br />
  However, typescript shows no error when <code>v</code> only has <code>{a, b, c}</code> (which is neither <code>T</code>, nor <code>T &amp; U</code>).<br />
  What am I missing?<br />
  Also, could there be a more succint way of expressing <code>T | (T &amp; U)</code>?</p>