When to use types (vs interface) in TS : <p>I cannot determine understand when, if ever, you'd want to use a <code>type</code> instead of an <code>interface</code> for a variable in typescript. Assume the following two:</p>

<pre><code>type User = {
    id: string;
    name: string;
    type: string;
}

interface User {
    id: string;
    name: string;
    type: string;
}
</code></pre>

<p>I can define a variable with both exactly the same was <code>const user: User = ...</code>. However, here are all the things I can do with <code>interface</code> that I cannot do with <code>types</code>:</p>

<pre><code>// Extension:
interface AdminUser extends User {
    permissions: string[];
    role: string;
}

// Using in abstract method:
abstract class Home {
    abstract login(user: User): void;
}

class AdminHome extends Home {
    login(user: AdminUser) {
        ...
    }
}
</code></pre>

<p>Just to name a few.</p>

<p>So my question is: when would you ever want to use a <code>type</code>?</p>
