I have these two types:
type FooId = string
type BarId = string
I use it wherever I want to inform about what type of string I expect there.
Due to the nature of TS I can still do something like this:
const foo1: FooId = "bar"
const foo1: FooId = "bar" as FooId
const foo2: FooId = "bar" as BarId;
Is it possible forbid the third assignment, only, somehow? (or even to forbid also the first, but still allow the second)
I want to avoid that BarId
values can be used as FooId
values (and vice versa).