mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Revert "Make 'Omit' a distributive conditional type to support union prop types. Fixes #39300. (#39323)" (#40095)
This reverts commit f71b4a0526.
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
1d5494e2a9
commit
47a8bdda3e
Vendored
+1
-1
@@ -346,7 +346,7 @@ export type ThemedCssFunction<T extends object> = BaseThemedCssFunction<
|
||||
>;
|
||||
|
||||
// Helper type operators
|
||||
type Omit<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
type WithOptionalTheme<P extends { theme?: T }, T> = Omit<P, "theme"> & {
|
||||
theme?: T;
|
||||
};
|
||||
|
||||
@@ -1052,7 +1052,8 @@ function unionTest() {
|
||||
font-size: ${props => props.kind === 'book' ? 16 : 14}
|
||||
`;
|
||||
|
||||
<StyledReadable kind="book" author="Hejlsberg" />;
|
||||
// undesired, fix was reverted because of https://github.com/Microsoft/TypeScript/issues/30663
|
||||
<StyledReadable kind="book" author="Hejlsberg" />; // $ExpectError
|
||||
<StyledReadable kind="magazine" author="Hejlsberg" />; // $ExpectError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user