title: typescript - array of instanceof
body: <p>was wondering if there is any way for typescript to realise the type of the object by deriving it from the base control descendants</p>
  
  <pre><code>interface Config {
    name: string;
  }
  
  interface Input extends Config {
    placeholder?: string;
  }
  
  interface Select extends Config {
    options: Array&lt;Option&gt;;
  }
  
  const fields: Array&lt;Config&gt; = [
    { name: 'a', placeholder: 'a'}, // placeholder does not exist in type 'config'
    { name: 'b', options: []} // options does not exist in type 'config'
  ]
  </code></pre>
  
  <p>also attempted something like </p>
  
  <pre><code>interface Config&lt;T&gt; {
    name: string;
    fieldType: T
  }
  
  interface Input extends Config&lt;'input'&gt; {
    placeholder?: string;
  }
  
  </code></pre>
  
  <p>can anyone redirect?</p>