Skip to content

Commit 3c1417c

Browse files
committed
typings
1 parent 413cd38 commit 3c1417c

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

index.d.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
import * as React from "react";
22

3-
declare module "react-css-themr"
4-
{
5-
export interface IThemrOptions
6-
{
7-
/** @default "deeply" */
8-
composeTheme?: "deeply" | "softly" | false,
9-
}
10-
11-
export interface ThemeProviderProps
12-
{
3+
declare module "react-css-themr" {
4+
type TReactCSSThemrTheme = {
5+
[key: string]: string | TReactCSSThemrTheme
6+
}
7+
8+
export function themeable(...themes: Array<TReactCSSThemrTheme>): TReactCSSThemrTheme;
9+
10+
export interface IThemrOptions {
11+
/** @default "deeply" */
12+
composeTheme?: "deeply" | "softly" | false,
13+
}
14+
15+
export interface ThemeProviderProps {
1316
innerRef?: Function,
14-
theme: {}
15-
}
17+
theme: {}
18+
}
1619

17-
export class ThemeProvider extends React.Component<ThemeProviderProps, any>
18-
{
20+
export class ThemeProvider extends React.Component<ThemeProviderProps, any> {
1921

20-
}
22+
}
2123

22-
interface ThemedComponent<P, S> extends React.Component<P, S>
23-
{
24+
interface ThemedComponent<P, S> extends React.Component<P, S> {
2425

25-
}
26+
}
2627

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

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"invariant": "^2.2.1"
2828
},
2929
"devDependencies": {
30+
"@types/react": "~15.0.4",
3031
"babel-cli": "^6.7.7",
3132
"babel-core": "^6.18.0",
3233
"babel-eslint": "^7.1.1",

0 commit comments

Comments
 (0)