Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Created February 22, 2021 17:54
Show Gist options
  • Save whoisryosuke/952cf670964d2027037a01390cb9582a to your computer and use it in GitHub Desktop.
Save whoisryosuke/952cf670964d2027037a01390cb9582a to your computer and use it in GitHub Desktop.
Typescript - Omit multiple properties from a property -- via: https://stackoverflow.com/a/57603792
export type ComponentProps = {
x: number;
y: number;
j: string;
k: string;
};
export type B = Omit<ComponentProps, 'j' | 'k'>
// Same as
// type B = {
// x: number;
// y: number;
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment