@@ -476,27 +476,16 @@ declare module 'material-ui/Drawer/Drawer' {
476
476
import { SlideProps } from 'material-ui/transitions/Slide' ;
477
477
import { Theme } from 'material-ui/styles/theme' ;
478
478
479
- type DrawerCommonProps = {
479
+ export interface DrawerProps extends ModalProps {
480
480
anchor ?: 'left' | 'top' | 'right' | 'bottom' ;
481
+ docked ?: boolean ;
481
482
elevation ?: number ;
482
483
enterTransitionDuration ?: number ;
483
484
leaveTransitionDuration ?: number ;
484
485
open ?: boolean ;
485
486
SlideProps ?: SlideProps ;
486
487
theme ?: Theme ;
487
- } ;
488
-
489
- type DrawerDockedProps = {
490
- docked ?: true ;
491
- } & DrawerCommonProps &
492
- React . HtmlHTMLAttributes < HTMLDivElement > ;
493
-
494
- type DrawerModalProps = {
495
- docked ?: false ;
496
- onRequestClose ?: React . EventHandler < any > ;
497
- } & ModalProps ;
498
-
499
- export type DrawerProps = DrawerDockedProps | DrawerModalProps ;
488
+ }
500
489
501
490
export default class Drawer extends MaterialUI . Component < DrawerProps > { }
502
491
}
@@ -872,24 +861,15 @@ declare module 'material-ui/List/List' {
872
861
declare module 'material-ui/List/ListItem' {
873
862
import { ButtonBaseProps } from 'material-ui/internal/ButtonBase' ;
874
863
875
- interface ListItemCommonProps extends React . LiHTMLAttributes < HTMLLIElement > {
864
+ export type ListItemProps = {
865
+ button ?: boolean ;
876
866
component ?: React . ReactNode ;
877
867
dense ?: boolean ;
878
868
disabled ?: boolean ;
879
869
disableGutters ?: boolean ;
880
870
divider ?: boolean ;
881
- }
882
-
883
- export type ListItemDefaultProps = {
884
- button ?: false ;
885
- } & ListItemCommonProps ;
886
-
887
- export type ListItemButtonProps = {
888
- button ?: true ;
889
- } & ListItemCommonProps &
890
- ButtonBaseProps ;
891
-
892
- export type ListItemProps = ListItemDefaultProps | ListItemButtonProps ;
871
+ } & ButtonBaseProps &
872
+ React . LiHTMLAttributes < HTMLLIElement > ;
893
873
894
874
export default class ListItem extends MaterialUI . Component < ListItemProps > { }
895
875
}
@@ -971,9 +951,9 @@ declare module 'material-ui/Menu/Menu' {
971
951
}
972
952
973
953
declare module 'material-ui/Menu/MenuItem' {
974
- import { ListItemButtonProps } from 'material-ui/List/ListItem' ;
954
+ import { ListItemProps } from 'material-ui/List/ListItem' ;
975
955
976
- export interface MenuItemProps extends ListItemButtonProps {
956
+ export interface MenuItemProps extends ListItemProps {
977
957
component ?: React . ReactNode ;
978
958
role ?: string ;
979
959
selected ?: boolean ;
@@ -1301,11 +1281,11 @@ declare module 'material-ui/Tabs/Tab' {
1301
1281
disabled ?: boolean ;
1302
1282
fullWidth ?: boolean ;
1303
1283
icon ?: React . ReactNode ;
1304
- index ?: number ;
1284
+ value ?: any ;
1305
1285
label ?: React . ReactNode ;
1306
1286
onChange ?: (
1307
1287
event : React . ChangeEvent < { checked : boolean } > ,
1308
- index : number
1288
+ value : any
1309
1289
) => void ;
1310
1290
onClick ?: React . EventHandler < any > ;
1311
1291
selected ?: boolean ;
@@ -1349,10 +1329,10 @@ declare module 'material-ui/Tabs/Tabs' {
1349
1329
centered ?: boolean ;
1350
1330
children ?: React . ReactNode ;
1351
1331
fullWidth ?: boolean ;
1352
- index : false | number ;
1332
+ value : any ;
1353
1333
indicatorClassName ?: string ;
1354
1334
indicatorColor ?: 'accent' | 'primary' | string ;
1355
- onChange : ( event : React . ChangeEvent < { } > , index : number ) => void ;
1335
+ onChange : ( event : React . ChangeEvent < { } > , value : any ) => void ;
1356
1336
scrollable ?: boolean ;
1357
1337
scrollButtons ?: 'auto' | 'on' | 'off' ;
1358
1338
textColor ?: 'accent' | 'primary' | 'inherit' | string ;
@@ -1621,8 +1601,6 @@ declare module 'material-ui/internal/Portal' {
1621
1601
}
1622
1602
1623
1603
declare module 'material-ui/internal/SwitchBase' {
1624
- import { StyleSheet } from 'material-ui/styles/createStyleSheet' ;
1625
-
1626
1604
export interface SwitchBaseProps {
1627
1605
checked ?: boolean | string ;
1628
1606
checkedClassName ?: string ;
@@ -1648,7 +1626,6 @@ declare module 'material-ui/internal/SwitchBase' {
1648
1626
defaultIcon ?: React . ReactNode ;
1649
1627
defaultCheckedIcon ?: React . ReactNode ;
1650
1628
inputType ?: string ;
1651
- styleSheet ?: StyleSheet ;
1652
1629
}
1653
1630
1654
1631
export default function createSwitch (
@@ -1699,12 +1676,14 @@ declare module 'material-ui/styles' {
1699
1676
export { default as createBreakpoints } from 'material-ui/styles/breakpoints' ;
1700
1677
export { default as createMuiTheme } from 'material-ui/styles/theme' ;
1701
1678
export { default as createPalette } from 'material-ui/styles/palette' ;
1702
- export {
1703
- default as createStyleSheet ,
1704
- } from 'material-ui/styles/createStyleSheet' ;
1705
1679
export { default as createTypography } from 'material-ui/styles/typography' ;
1706
1680
export { default as withStyles } from 'material-ui/styles/withStyles' ;
1707
1681
export { default as withTheme } from 'material-ui/styles/withTheme' ;
1682
+
1683
+ export {
1684
+ StyleRules ,
1685
+ StyleRulesCallback ,
1686
+ } from 'material-ui/styles/withStyles' ;
1708
1687
}
1709
1688
1710
1689
declare module 'material-ui/styles/MuiThemeProvider' {
@@ -1781,34 +1760,6 @@ declare module 'material-ui/styles/createGenerateClassName' {
1781
1760
) => string ;
1782
1761
}
1783
1762
1784
- declare module 'material-ui/styles/createStyleSheet' {
1785
- import { Theme } from 'material-ui/styles/theme' ;
1786
-
1787
- export interface StyleRules {
1788
- [ displayName : string ] : Partial < React . CSSProperties > ;
1789
- }
1790
-
1791
- export interface StyleRulesCallback < Theme > {
1792
- ( theme : Theme ) : StyleRules ;
1793
- }
1794
-
1795
- export interface StyleSheet {
1796
- name : string | false ;
1797
- createStyles < T extends Theme = Theme > ( theme : T ) : StyleRules ;
1798
- options : Object ;
1799
- themingEnabled : boolean ;
1800
- }
1801
-
1802
- export default function createStyleSheet < T extends Theme = Theme > (
1803
- callback : StyleRulesCallback < Theme > | StyleRules
1804
- ) : StyleSheet ;
1805
- export default function createStyleSheet < T extends Theme = Theme > (
1806
- name : string ,
1807
- callback : StyleRulesCallback < Theme > | StyleRules ,
1808
- options ?: Object
1809
- ) : StyleSheet ;
1810
- }
1811
-
1812
1763
declare module 'material-ui/styles/mixins' {
1813
1764
import { Spacing } from 'material-ui/styles/spacing' ;
1814
1765
import { Breakpoints } from 'material-ui/styles/breakpoints' ;
@@ -2050,11 +2001,28 @@ declare module 'material-ui/styles/typography' {
2050
2001
2051
2002
declare module 'material-ui/styles/withStyles' {
2052
2003
import { Theme } from 'material-ui/styles/theme' ;
2053
- import { StyleSheet } from 'material-ui/styles/createStyleSheet' ;
2004
+
2005
+ /**
2006
+ * This is basically the API of JSS. It defines a Map<string, CSS>,
2007
+ * where
2008
+ *
2009
+ * - the `keys` are the class (names) that will be created
2010
+ * - the `values` are objects that represent CSS rules (`React.CSSProperties`).
2011
+ */
2012
+ export interface StyleRules {
2013
+ [ displayName : string ] : Partial < React . CSSProperties > ;
2014
+ }
2015
+
2016
+ export type StyleRulesCallback = ( theme : Theme ) => StyleRules ;
2017
+
2018
+ export interface WithStylesOptions {
2019
+ withTheme ?: boolean ;
2020
+ name ?: string ;
2021
+ }
2054
2022
2055
2023
const withStyles : < P = { } , ClassNames = { } > (
2056
- stylesheets : StyleSheet | StyleSheet [ ] ,
2057
- options ?: Partial < { withTheme : boolean } >
2024
+ style : StyleRules | StyleRulesCallback ,
2025
+ options ?: WithStylesOptions
2058
2026
) => (
2059
2027
component : React . ComponentType < P & { classes : ClassNames } >
2060
2028
) => React . ComponentClass < P > ;
@@ -2194,10 +2162,8 @@ declare module 'material-ui/test-utils/createShallow' {
2194
2162
}
2195
2163
2196
2164
declare module 'material-ui/test-utils/getClasses' {
2197
- import { StyleSheet } from 'material-ui/styles/createStyleSheet' ;
2198
-
2199
2165
export default function getClasses < T = { [ name : string ] : string } > (
2200
- stylesheets : StyleSheet | StyleSheet [ ] ,
2166
+ element : React . ReactElement < any > ,
2201
2167
options ?: Partial < { withTheme : boolean } >
2202
2168
) : T ;
2203
2169
}
0 commit comments