title: Override the properties of an interface in TypeScript
body: <p>I know that overriding properties of an interface in an extended interface, modifying their types, is forbidden.</p>
  
  <p>I'm looking for an alternative solution that would allow me to not copy the contents of the first interface (it's pretty big).</p>
  
  <p>Here is below my first naive approach. Given that base interface:</p>
  
  <pre><code>interface OrginalInterface {
      title?: string;
      text?: string;
      anotherProperty?: SomeType;
      // lots of other properties
  }
  </code></pre>
  
  <p>This interface is defined in a library. <em>I can't modify it (ie. add generics, for example) just to satisfy my needs in the extended interface.</em></p>
  
  <p>In the extended interface, used by a wrapper library (mine), I want to reuse the existing interface, while making some fields having a different type:</p>
  
  <pre><code>interface ExtendedInterface extends OriginalInterface {
      title?: string | ReactElement&lt;any&gt;;
      text?: string | ReactElement&lt;any&gt;;
  }
  </code></pre>
  
  <p>But this is not possible.</p>
  
  <pre><code>error TS2430: Interface 'ExtendedInterface' incorrectly extends interface 'OriginalInterface'.
    Types of property 'title' are incompatible.
      Type 'ReactElement&lt;any&gt;' is not assignable to type 'string'.
  </code></pre>
  
  <p>I also tried to merge the two interfaces together:</p>
  
  <pre><code>type Extended = OriginalInterface &amp; NewInterfaceWithOverridingPropertiesOnly;
  </code></pre>
  
  <p>While this passes the compilation, it does not work. If you declare a variable with this type, you'll only be able to assign objects that have a compatible structure with <code>OriginalInterface</code>.</p>
  
  <p>I feel like TypeScript's type-system don't offers me any other way to express my need to declare a new type <em>derived</em> from <code>OrginalInterface</code>. I don't need the new type to be assignable to <code>OriginalInterface</code> ; I just need it to reuse most properties of <code>OriginalInterface</code>.</p>
  
  <p>I'd need something like mapped types with a condition on which properties are affected. Maybe <a href="https://github.com/Microsoft/TypeScript/pull/21316" rel="noreferrer">Conditional types</a> from pre-release TypeScript 2.8? Or should I copy the first interface's contents?</p>