These scenarios below are accepting and non-acceptable declarations.
export class MyComponent{
One reason would be to handle multiple types for the same variable. That's why typescript allows you to use specific values for types.
let x: true | false | 'dog';
x = true; // works
x = false; // works
x = 'cat'; // compilation error
In this case let x: true is just a particular case where there is only one type.
It looks like the string literal types functionality was exetended to allow for other types of values as well. Maybe there is a better documentation example for it but all I could find is the string literal types section in the handbook here.