If I define a type like this:
type MyType = {
...
propertyA: string;
propertyB: number;
...
}
is there a way to create another type that includes MyType but allows for versions of it with omitted properties? For example:
type MyOtherType = {
propertyC: MyType | Omit<MyType, ANYTHING>;
}
I attempted using Omit<MyType, any>
, but it removes the types of other properties. What is the correct approach in this situation?