In the changelog of 2.8, they have this example for conditional types:
type Diff<T, U> = T extends U ? never : T; // Remove types from T that are assignable to U
type T30 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d"
I want to do that except remove the properties of an object. How can I achieve the following:
type ObjectDiff<T, U> = /* ...pls help... */;
type A = { one: string; two: number; three: Date; };
type Stuff = { three: Date; };
type AWithoutStuff = ObjectDiff<A, Stuff>; // { one: string; two: number; }