This question is similar to this question, but not similar enough for me to understand how to do it.
I want to copy a type, but exclude all the methods from it.
interface XYZ {
x: number;
y: string;
z(): void;
}
So z
would be excluded and I would end up with:
interface XY {
x: number;
y: string;
}
I know that it's possible to do:
type OmitZ = Omit<XYZ, "z">;
But I don't want to omit based on key string, but based on property type. Is that even possible?