I am new to Typescript and currently facing a roadblock with this specific issue. I have defined a type as:
type MainType = Node & {
id: string;
name: string;
notifications: number
}
My objective is to create a type that does not include the Node
type.
//Desired type
{
id: string;
name: string;
notifications: number
}
// I attempted to use Exclude, but it just returns never
type SecondaryType = Exclude<MainType, Node>
//I also experimented with Omit, however, it doesn't allow me to exclude Node
type SecondaryType = Omit<MainType, Node>