I was wondering; is something like this possible ?
interface User {
name: string;
age: number;
}
// The syntax User['*'] doesn't exist, this is just an example
const user: User['*'] = 'Bob'; // No error
const user: User['*'] = 32; // No error
const user: User['*'] = true; // Error
I know about the "or" (|
), but this can become really redondent if the User
interface has a lot of typed properties.