title: In TypeScript, can I narrow a parameter type in an imported library, just within my project?
body: <p>I am importing an external library in my TypeScript code. One of the types in this library provides a method <code>libraryMethod(x: string)</code>. I know that <em>within my project</em> only valid values for <code>x</code> are <code>'a'</code> and <code>'b'</code>.</p>
  
  <p>If it was my code, I would have changed <code>x: string</code> to <code>x: 'a'|'b'</code> directly.</p>
  
  <p>Is there a way to redefine type of <code>x</code> (without wrapping <code>libraryMethod</code> in another method)?</p>