I used this method but it also accepts both interfaces. I need one to exclude the other.
export interface C extends A {
single: boolean;
}
export interface B extends A {
couple: boolean;
}
export interface A {
others: string;
}
export type A = B | C;
Those are my test, in the third case i need that ts give me error:
\\ OK
const test1: A = {
single: true,
others: ''
}
\\ OK
const test2: A = {
couple: true,
others: ''
}
\\ OK BUT I DONT WANT THIS!!
const test3: A = {
single: true,
couple: true,
others: ''
}