title: How to overwrite property for intersection type in Typescript?
body: <p>Let's say I have these types:</p>
  <pre class="lang-js prettyprint-override"><code>type BaseAnimal = {
    species: string
    owner: boolean
  }
  
  type Cat = BaseAnimal &amp; {
    species: 'cat'
    hasTail: boolean
  }
  
  type Dog = BaseAnimal &amp; {
    species: 'dog'
    likesWalks: boolean
  }
  
  type Animal = Cat | Dog
  </code></pre>
  <p>And I want to create a type called <code>AnimalParams</code>, which is identical to <code>Animal</code> <strong>except the <code>owner</code> property, which is a string.</strong></p>
  <p>I can't do either of the below.</p>
  <pre class="lang-js prettyprint-override"><code>// This seems to keep the owner property from Animal instead of overwriting
  // So it raises an error if I try to specify owner as a string
  type AnimalParams = Animal &amp; {
    owner: string
  }
  
  // This strips away properties unique to Cat or Dog
  // So it raises an error if I try to specify hasTail or likesWalks
  type AnimalParams = Omit&lt;Animal, 'owner'&gt; &amp; {
    owner: string
  }
  </code></pre>
  <p>Now, the only workaround I can think of is to do as below, but this seems unnecessarily repetitive. Is there a cleaner, more concise way?</p>
  <pre class="lang-js prettyprint-override"><code>type CatParams = Omit&lt;Cat, 'owner'&gt; &amp; {
    owner: string
  }
  
  type DogParams = Omit&lt;Dog, 'owner'&gt; &amp; {
    owner: string
  }
  
  type AnimalParams = CatParams | DogParams
  </code></pre>
  <p>I read a few SO threads on utility types (such as <a href="https://stackoverflow.com/q/41285211/11249670">Overriding interface property type defined in Typescript d.ts file</a>, which was for interfaces), but couldn't find what I needed. Thanks for any answers in advance!</p>