title: How to declare an array of objects of different types in TypeScript?
body: <p>I have a an array with elements representing a HTML form of types TextInput, DateInput, Checkbox and so on.</p>
  
  <p>How do I declare a variable type as an array of elements that can be any of these types?</p>
  
  <p>Something like this</p>
  
  <pre><code>(TextInput | DateInput | Checkbox)[]
  </code></pre>