Skip to content

Commit 073cd89

Browse files
Odenjavivelasco
Oden
authored andcommitted
Correct typings (#39)
* Correct typings for `themr` * Fixed decorator usage * Update index.d.ts * Updated with better typings from @Podlas29 * Revert to working state
1 parent e0e883d commit 073cd89

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

index.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as React from "react";
2+
13
declare module "react-css-themr"
24
{
35
export interface IThemrOptions
@@ -18,9 +20,19 @@ declare module "react-css-themr"
1820

1921
}
2022

23+
interface ThemedComponent<P, S> extends React.Component<P, S>
24+
{
25+
getWrappedInstance(): React.Component<P, S>;
26+
}
27+
28+
interface ThemedComponentClass<P, S> extends React.ComponentClass<P>
29+
{
30+
new(props?: P, context?: any): ThemedComponent<P, S>;
31+
}
32+
2133
export function themr(
2234
identifier: string,
2335
defaultTheme?: {},
2436
options?: IThemrOptions
25-
);
37+
): <P, S>(component: new(props?: P, context?: any) => React.Component<P, S>) => ThemedComponentClass<P, S>;
2638
}

0 commit comments

Comments
 (0)