Update for TypeScript 3.5: The Omit<Type, Keys> utility type is now available. Please see Mathias’ answer for an example usage.
Old Answer: Since TypeScript 2.8 and the introduction of Exclude, It’s now possible to write this as follows:
type Without<T, K> = {
[L in Exclude<keyof T, K>]: T[L]
};
Or alternatively, and more concisely, as:
type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
For your usage, you could now write the following:
type ExcludeCart<T> = Without<T, "cart">;