Nope. This is not how casting works in TypeScript. To get an unsafe cast you have to go via the ‘any’ or ‘unknown’ types.
e.g.
‘foo as unknown as Dog’
e.g.
‘foo as unknown as Dog’
// No error here
type Animal = 'dog' | 'cat';
const notAnimal = 'couch' as Animal;
// No error here either
type Food = { isSpicy: boolean };
const empty = {} as Food;
https://www.typescriptlang.org/play/index.html#code/C4TwDgpg...