Understand Subtypes in TypeScript
A can be assigned to a value of type B, then A is considered a subtype of B, denoted as A extends B. This concept is primarily used in generic constraints (restricting a type parameter T to be a subtype of a specific type) and conditional types (A extends B ? C : D).declare let a: 'name';
declare let b: string;
b = a; // OK: 'name' is a subtype of string
a = b; // Error: string is not a subtype of 'name'