<p dir="auto">For example, we have interface</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface A {
   a: string;
   b: number;
   c: string;
   d: number;
   //etc
}"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
   <span class="pl-c1">a</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
   <span class="pl-c1">b</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
   <span class="pl-c1">c</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
   <span class="pl-c1">d</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
   <span class="pl-c">//etc</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">and we want interface which contains all members except <code class="notranslate">{c: string}</code> and includes</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    f: number;
}"><pre class="notranslate"><span class="pl-kos">{</span>
    f: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Ofcource we can split interface A, but, for example, this interface stored in another npm package.</p>
<p dir="auto">Another example</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
interface BemProps {
    modifications?: Array&lt;{
        [index: string]: boolean;
    } | string&gt;;
    prefix?: string;
    additionalClasses?: string;
}

// we want to pass all HTMLButtonElement valid props except className
// for set className we use bem.
function UiButton(props: BemProps &amp; React.HTMLProps&lt;HTMLButtonElement&gt;) {
    return (
        &lt;button disabled className={GetBEMClassNames(props) } {...props}&gt;
            {props.children}
        &lt;/button&gt;
    );
}"><pre class="notranslate"><span class="pl-s1">interface</span> <span class="pl-v">BemProps</span> <span class="pl-kos">{</span>
    <span class="pl-s1">modifications</span>?: <span class="pl-v">Array</span><span class="pl-c1">&lt;</span><span class="pl-kos">{</span>
        <span class="pl-kos">[</span><span class="pl-s1">index</span>: <span class="pl-s1">string</span><span class="pl-kos">]</span>: <span class="pl-s1">boolean</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span> <span class="pl-c1">|</span> <span class="pl-s1">string</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-s1">prefix</span>?: <span class="pl-s1">string</span><span class="pl-kos">;</span>
    <span class="pl-s1">additionalClasses</span>?<span class="pl-s1"></span>: <span class="pl-s1">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// we want to pass all HTMLButtonElement valid props except className</span>
<span class="pl-c">// for set className we use bem.</span>
<span class="pl-k">function</span> <span class="pl-v">UiButton</span><span class="pl-kos">(</span><span class="pl-s1">props</span>: <span class="pl-v">BemProps</span> <span class="pl-c1">&amp;</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">HTMLProps</span><span class="pl-c1">&lt;</span><span class="pl-v">HTMLButtonElement</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-kos">(</span>
        <span class="pl-c1">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">disabled</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-v">GetBEMClassNames</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-kos">{</span>...<span class="pl-s1">props</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span>
            <span class="pl-kos">{</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">children</span><span class="pl-kos">}</span>
        <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">button</span><span class="pl-c1">&gt;</span>
    <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I suggest new keyword 'except' or '!'</p>
<p dir="auto">Usage</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Props =  BemProps &amp; React.HTMLProps&lt;HTMLButtonElement&gt; except { className: string }"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Props</span> <span class="pl-c1">=</span>  <span class="pl-smi">BemProps</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-smi">HTMLProps</span><span class="pl-kos">&lt;</span><span class="pl-smi">HTMLButtonElement</span><span class="pl-kos">&gt;</span> <span class="pl-s1">except</span> <span class="pl-kos">{</span> <span class="pl-s1">className</span>: string <span class="pl-kos">}</span></pre></div>
<p dir="auto">or "!"</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Props =  BemProps &amp; React.HTMLProps&lt;HTMLButtonElement&gt; ! { className: string }"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Props</span> <span class="pl-c1">=</span>  <span class="pl-smi">BemProps</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-smi">HTMLProps</span><span class="pl-kos">&lt;</span><span class="pl-smi">HTMLButtonElement</span><span class="pl-kos">&gt;</span> <span class="pl-c1">!</span> <span class="pl-kos">{</span> <span class="pl-s1">className</span>: string <span class="pl-kos">}</span></pre></div>
<p dir="auto">Another type-safety measure. Sometimes it's desired to limit what developers can do with a value. Not allowing them to get to certain properties of it looks sufficient.</p>
<p dir="auto">Example: We render HTML elements to PDF on the client side. In order to do so we need to run <code class="notranslate">element.getBoundingClientRect</code> to get a bounding box in effect. It is an expensive operation that we wish could only be done once and then the result of it would be passed around along with the element to be rendered. Unfortunately nothing stops developers from ignoring that result and running the same method again and again as long as they can get to <code class="notranslate">element.getBoundingClientRect</code>. Now I wish I could strip that method so no-one can see it once the box is calculated. Subtaction types would solve the problem.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type HTMLDivSpecifics = HTMLDivElement - Element;"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">HTMLDivSpecifics</span> <span class="pl-c1">=</span> <span class="pl-smi">HTMLDivElement</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">Element</span><span class="pl-kos">;</span></pre></div>
<h1 dir="auto">Proposal</h1>
<p dir="auto">add a type operator that produces a new type out of 2 given types according to the rules that follow:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = A - B;"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">B</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This feature would require a new <strong>negated</strong> type like <code class="notranslate">number ~ string</code> which is a <code class="notranslate">number</code> that cannot take <code class="notranslate">number &amp; string</code>.</p>
<p dir="auto">As far as the precedence of new type operator, it should go:</p>
<ol dir="auto">
<li>intersection <code class="notranslate">&amp;</code></li>
<li>union <code class="notranslate">|</code></li>
<li>subtraction <code class="notranslate">-</code></li>
</ol>
<p dir="auto">so that <code class="notranslate">number &amp; boolean | string - string</code>, means <code class="notranslate">((number &amp; boolean) | string) - string</code></p>
<h3 dir="auto">Generics</h3>
<ul dir="auto">
<li>should produce a yet to be resolved type, should be stored as an expression which will produce either a type or an error when all type parameters are known</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Minus&lt;A, B&gt; = A - B; // yet to be calculated"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Minus</span><span class="pl-c1">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-c1">&gt;</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">B</span><span class="pl-kos">;</span> <span class="pl-c">// yet to be calculated</span></pre></div>
<h3 dir="auto">Primitives</h3>
<ul dir="auto">
<li>if the left type (minued) isn't a sub-type of the right type (subtrahend) the <code class="notranslate">-</code> operation should result to an type error</li>
<li><code class="notranslate">never</code> and <code class="notranslate">any</code> should be specially handled</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = number - number; // {}
type C = number - {}; // number
type C = {} - number; // error
type C = number - string; // error
type C = number - 0; // number ~ 0

type C = number | string - boolean; // error
type C = number - void | null | undefined; // error

type C = number - any; // {}
type C = any - any; // any
type C = any - number; // any ~ number
type C = any - never; // error;
type C = never - any; // error;
type C = number - never; // error
type C = never - number; // error
type C = never - never; // error

type C = number | string - string; // number
type C = number - number | string; // {}
type C = number | string - {}; // number | string

type C = number &amp; string - boolean; // error
type C = number &amp; string - string; // number ~ string
"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">string</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">-</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">// number ~ 0</span>

<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">-</span> <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-c1">|</span> <span class="pl-c1">null</span> <span class="pl-c1">|</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>

<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// any</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// any ~ number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error;</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// error;</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>

<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> string<span class="pl-kos">;</span> <span class="pl-c">// number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span> <span class="pl-c1">|</span> <span class="pl-s1">string</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// number | string</span>

<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> string<span class="pl-kos">;</span> <span class="pl-c">// number ~ string</span></pre></div>
<h3 dir="auto">Products</h3>
<ul dir="auto">
<li>only matching properties should be considered, non-matching properties of the left type should stay intact, non-matching properties of the right type should be disregarded</li>
<li>if the names of 2 properties match their types are subject for <code class="notranslate">-</code> operation that produces the type of the resulting property of the same name</li>
<li>if applying <code class="notranslate">-</code> on 2 properties of the same name gives <code class="notranslate">{}</code>, the property gets dropped from the resulting type</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = {} - { x: number }; // {}
type C = { x: number } - {}; // { x: number }
type C = { x: {} } - { x: number }; // error
type C = { x: number } - { x: {} }; // { x: number }
type C = { x: number } - { y: number }; // { x: number }
type C = { x: number } - { x: number }; // {}
type C = { x: number | string } - { x: string }; // { x: number }
type C = { x: number &amp; string } - { x: string }; // { x: number ~ string }
type C = { x: number } - { x: string }; // error"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">y</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number ~ string }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// error</span></pre></div>
<h3 dir="auto">Functions (2 certain signatures)</h3>
<ul dir="auto">
<li>both functions must have the same number of parameters, otherwise it's an error</li>
<li>types of corresponding parameters are subject to the <code class="notranslate">-</code> operator</li>
<li>types of results must 100% match and should be kept intact, otherwise it's an error</li>
<li>if <code class="notranslate">-</code> on 2 parameters gives <code class="notranslate">{}</code> the resulting parameter is <code class="notranslate">{}</code></li>
<li>if all resulting parameters are <code class="notranslate">{}</code> the resulting type is <code class="notranslate">{}</code></li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = ((x: number) =&gt; string) - ((x: number) =&gt; string); // {}
type C = ((x: number) =&gt; number) - ((x: number) =&gt; number); // (x: {}) =&gt; number
type C = ((x: number | string) =&gt; string) - ((x: string) =&gt; string); // (x: number) =&gt; string
type C = ((x: number) =&gt; string) - ((x: string) =&gt; string); // error
type C = ((x: number | string) =&gt; string) - (() =&gt; string); // error
type C = (() =&gt; string) - ((x: number) =&gt; string); // error"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">number</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">number</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// (x: {}) =&gt; number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// (x: number) =&gt; string</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span></pre></div>
<h3 dir="auto">Overloads</h3>
<ul dir="auto">
<li>to be continued...</li>
</ul>