Skip to content

Commit 2a51d70

Browse files
Fix for #1308 and #1309 (#1310)
1 parent 41a138f commit 2a51d70

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/react-jss/src/index.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ interface WithStylesProps<S extends Styles | ((theme: unknown) => Styles)> {
4545
*/
4646
type WithStyles<S extends Styles | ((theme: unknown) => Styles)> = WithStylesProps<S>
4747

48-
interface BaseOptions extends StyleSheetFactoryOptions {
48+
export interface DefaultTheme {}
49+
50+
interface BaseOptions<Theme = DefaultTheme> extends StyleSheetFactoryOptions {
4951
index?: number
50-
theming?: Theming<object>
52+
theming?: Theming<Theme>
5153
}
5254

5355
interface WithStylesOptions extends BaseOptions {
5456
injectTheme?: boolean
5557
jss?: Jss
5658
}
5759

58-
interface CreateUseStylesOptions extends BaseOptions {
60+
interface CreateUseStylesOptions<Theme = DefaultTheme> extends BaseOptions<Theme> {
5961
name?: string
6062
}
6163

62-
export interface DefaultTheme {}
63-
6464
declare function createUseStyles<Theme = DefaultTheme, C extends string = string>(
6565
styles: Record<C, any> | ((theme: Theme) => Record<C, any>),
66-
options?: CreateUseStylesOptions
66+
options?: CreateUseStylesOptions<Theme>
6767
): (data?: unknown) => Classes<C>
6868

6969
declare function withStyles<
@@ -93,6 +93,7 @@ export {
9393
ThemeProvider,
9494
withTheme,
9595
createTheming,
96+
Theming,
9697
useTheme,
9798
JssContext,
9899
createUseStyles,

0 commit comments

Comments
 (0)