From e39984132c8b7ee6dd79d80fa549e50ff9368a23 Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov Date: Wed, 18 Jan 2023 22:44:48 +0200 Subject: [PATCH] Extract `withTheme` return type --- typings/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index fd76d0e..9f89f3a 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -7,14 +7,15 @@ import hoistNonReactStatics = require('./hoist-non-react-statics'); type $Without = T extends any ? Pick> : never; type $DeepPartial = { [P in keyof T]?: $DeepPartial }; +export type ThemedComponent = React.ComponentType< + $Without & { theme?: $DeepPartial } +> & hoistNonReactStatics.NonReactStatics; + export type ThemingType = { ThemeProvider: React.ComponentType<{ theme?: Theme }>; withTheme: ( WrappedComponent: React.ComponentType & C - ) => React.ComponentType< - $Without & { theme?: $DeepPartial } - > & - hoistNonReactStatics.NonReactStatics; + ) => ThemedComponent useTheme(overrides?: $DeepPartial): T; };