diff --git a/src/styles/withStyles.d.ts b/src/styles/withStyles.d.ts index d5bd55cc59bc7f..9d4b6633e40c71 100644 --- a/src/styles/withStyles.d.ts +++ b/src/styles/withStyles.d.ts @@ -1,5 +1,6 @@ import * as React from 'react'; import { Theme } from './createMuiTheme'; +import { Omit } from '..' /** * This is basically the API of JSS. It defines a Map, @@ -41,6 +42,6 @@ export interface StyledComponentProps { export default function withStyles( style: StyleRules | StyleRulesCallback, options?: WithStylesOptions, -):

( - component: React.ComponentType

>, -) => React.ComponentType

>; +):

>( + component: React.ComponentType

, +) => React.ComponentType> & StyledComponentProps>; diff --git a/src/styles/withTheme.d.ts b/src/styles/withTheme.d.ts index ee01063b2512be..d4b2d4472ded6d 100644 --- a/src/styles/withTheme.d.ts +++ b/src/styles/withTheme.d.ts @@ -1,11 +1,12 @@ import { Theme } from './createMuiTheme'; +import { Omit } from '..' export interface WithTheme { theme: Theme; } -declare const withTheme: () =>

( - component: React.ComponentType

, -) => React.ComponentClass

; +declare const withTheme: () =>

( + component: React.ComponentType

, +) => React.ComponentClass>; export default withTheme; diff --git a/test/typescript/components.spec.tsx b/test/typescript/components.spec.tsx index 256e527b644911..6f07883f8471fa 100644 --- a/test/typescript/components.spec.tsx +++ b/test/typescript/components.spec.tsx @@ -665,7 +665,7 @@ const TableTest = () => { ); } - return withStyles(styles)<{}>(BasicTable); + return withStyles(styles)(BasicTable); }; const TabsTest = () => { diff --git a/test/typescript/styles.spec.tsx b/test/typescript/styles.spec.tsx index 3e386e265bd670..f19a7f04624270 100644 --- a/test/typescript/styles.spec.tsx +++ b/test/typescript/styles.spec.tsx @@ -28,7 +28,7 @@ const styles: StyleRulesCallback<'root'> = ({ palette, spacing }) => ({ }, }); -const StyledExampleOne = withStyles(styles)(({ classes, text }) => ( +const StyledExampleOne = withStyles(styles)(({ classes, text }) => (

{text}
)); ; @@ -57,7 +57,7 @@ const ComponentWithChildren: React.SFC> = ({ children, }) =>
{children}
; -const StyledExampleThree = withStyles(styleRule)<{}>(ComponentWithChildren); +const StyledExampleThree = withStyles(styleRule)(ComponentWithChildren); ; // Also works with a plain object diff --git a/test/typescript/styling-comparison.spec.tsx b/test/typescript/styling-comparison.spec.tsx index 7d03c5bfcdce2d..6a0c19ddd3ee06 100644 --- a/test/typescript/styling-comparison.spec.tsx +++ b/test/typescript/styling-comparison.spec.tsx @@ -16,7 +16,7 @@ interface Props { variant: TypographyProps['variant']; } -const DecoratedSFC = decorate(({ text, variant, color, classes }) => ( +const DecoratedSFC = decorate(({ text, variant, color, classes }) => ( {text} @@ -35,7 +35,7 @@ const DecoratedClass = decorate( }, ); -const DecoratedNoProps = decorate<{}>( +const DecoratedNoProps = decorate( class extends React.Component> { render() { return Hello, World!;