Closed
Description
openedon Feb 14, 2018
TypeScript Version: 2.8.0-dev.20180214
Code
type A = { A: number; B: number };
type ExcludeB<T> = Exclude<keyof T, 'B'>;
type B = ExcludeB<A>; // 'A' | 'B'
type C = Exclude<keyof A, 'B'>; // 'A'
function stripB<T>(key: T): Pick<T, Exclude<keyof T, 'B'>> {
return null!;
}
stripB({A: 1, B: 1}) // -> {A: number, B: number}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment