From 6af74511d37a6aa5377ffbd36caa2ec778152c81 Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Mon, 18 Jun 2018 15:34:10 +0300 Subject: [PATCH] fix(typescript): replace Diff type with new built-in Exclude type --- src/sweetalert2-react-content.d.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/sweetalert2-react-content.d.ts b/src/sweetalert2-react-content.d.ts index c417bc1..4796ef3 100644 --- a/src/sweetalert2-react-content.d.ts +++ b/src/sweetalert2-react-content.d.ts @@ -41,16 +41,8 @@ interface ReactOptions { footer?: ReactElementOr<'footer'>; } -// Diff<> and Owerwrite<> types below are inspired from this GitHub comment: -// https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 - -// Diff is a subtraction operator for string literal types. -// It returns the string types of T that are not in U. -// ex: Diff<('a' | 'b' | 'c'), ('c' | 'd')>; // 'a' | 'b' -type Diff = - ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; - // Overwrite will take the properties of U and add to it the properties of T that are not in U. // This emulates an overwrite (override) of chosen properties of T with properties of U. // It works like { ...T, ...U } in JS. -type Overwrite = Pick> & U; +// https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-393936055 +type Overwrite = Pick> & U;