title: How to avoid `Subsequent property declarations must have the same type` with Interfaces
body: <p>I have some interface, that has an enum field. Also want to make an overload for this interface which will take one more property on the case of some specific enum value.</p>
  <p>As an example:</p>
  <pre class="lang-js prettyprint-override"><code>enum CellValueType {
      DATE,
      STRING,
      NUMBER
  }
  
  
  export interface TableCell {
      type: CellValueType;
      value: string; // ...
  }
  
  export interface TableCell {
      type: CellValueType.DATE;
      format: string; // Should be exist only on the DATE type
      value: string; // ...
  }
  </code></pre>
  <p>But, the problem is using the interface I got an error:</p>
  <blockquote>
  <p>Subsequent property declarations must have the same type. Property 'type' must be of type 'CellValueType', but here has type 'CellValueType.DATE'.</p>
  </blockquote>
  <p>Error is understandable, no questions about it.</p>
  <p>The main question is how to avoid it in a legal way.</p>
  <p>I know, that I can just use <code>type</code> instead of <code>interface</code> and get this construction:</p>
  <pre><code>export type TableCell = {
      type: CellValueType;
      value: string;
  } | {
      type: CellValueType.DATE;
      format: string; 
      value: string;
  }
  </code></pre>
  <p><s>Works pretty well</s>, but the problem is that classes cannot implement union types.</p>
  <hr />
  <p>Not working as expected, with <code>DATE</code> still compatible with the first signature.
  To work correctly, it needs the <code>type: CellValueType</code> to be changed to <code>type: Exclude&lt;CellValueType, CellValueType.DATE&gt;</code></p>
  <p>Also, I can create a sub-interface only for the <code>DATE</code> enum type but want also to avoid creating an interface for every case.</p>