In our country there are two currencies, rial and toman, which can be converted into each other (1 toman = 10 rial), I want to create a specific type for each currency, that to be unassignable. I don't want to lose any performance (for example by using objects instead of number)
example code:
type toman = number
type rial = number
function x(r: rial): void {
console.log(r)
}
const t: toman = 5
x(t) // I want to get an error here, because toman is unassignable to rial