Skip to content

Commit 6ccb37c

Browse files
author
Oden
authored
Updated with better typings from @Podlas29
1 parent 8af865c commit 6ccb37c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ declare module "react-css-themr"
2020

2121
}
2222

23-
interface ThemedComponent<P, S> extends React.Component<P, S>
24-
{
25-
getWrappedInstance(): React.Component<P, S>;
23+
interface ThemedComponent<P, S, Base> extends React.Component<P, S> {
24+
getWrappedInstance(): Base;
2625
}
2726

28-
interface ThemedComponentClass<P, S> extends React.ComponentClass<P>
29-
{
30-
new(props?: P, context?: any): ThemedComponent<P, S>;
27+
interface ThemedComponentClass<P, S, Base> extends React.ComponentClass<P> {
28+
new(props?: P, context?: any): ThemedComponent<P, S, Base>;
3129
}
3230

33-
export function themr(
34-
identifier: string,
35-
defaultTheme?: {},
36-
options?: IThemrOptions
37-
): <P, S>(component: new(props?: P, context?: any) => React.Component<P, S>) => ThemedComponentClass<P, S>;
31+
export function themr
32+
(
33+
identifier: string,
34+
defaultTheme?: {},
35+
options?: IThemrOptions
36+
): <P, S, C extends new(props?: P, context?: any) => React.Component<P, S>>
37+
(component: C) => ThemedComponentClass<P, S, C>;
3838
}

0 commit comments

Comments
 (0)