My definition includes type A
and type B
type A = {
kind: "A",
value: string,
value2: string,
value3: string,
};
type B = { kind: "B" } & A ;
I am aiming for type B
to have all the characteristics of type A
but with a distinct kind
value
However, when I attempt the following:
const temp: B = {
kind: "B",
value: "X",
value2: "X2",
value3: "X3",
};
The following error is triggered:
TS2322 type
string
is not assignable to typenever