Skip to content

Commit 98263e7

Browse files
authored
[core] Fix support for older versions of TypeScript (#20443)
1 parent 5c3cfb2 commit 98263e7

File tree

39 files changed

+63
-52
lines changed

39 files changed

+63
-52
lines changed

packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,5 @@ export type AutocompleteClassKey =
208208
* - [Autocomplete API](https://material-ui.com/api/autocomplete/)
209209
*/
210210
export default function Autocomplete<T>(
211-
props: AutocompleteProps<T> & UseAutocompleteProps<T>,
211+
props: AutocompleteProps<T> & UseAutocompleteProps<T>
212212
): JSX.Element;

packages/material-ui-lab/src/Pagination/Pagination.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface PaginationProps
2222
getItemAriaLabel?: (
2323
type: 'page' | 'first' | 'last' | 'next' | 'previous',
2424
page: number,
25-
selected: boolean,
25+
selected: boolean
2626
) => string;
2727
/**
2828
* Render the item.

packages/material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface FilterOptionsState<T> {
1515
}
1616

1717
export function createFilterOptions<T>(
18-
config?: CreateFilterOptionsConfig<T>,
18+
config?: CreateFilterOptionsConfig<T>
1919
): (options: T[], state: FilterOptionsState<T>) => T[];
2020

2121
export interface UseAutocompleteCommonProps<T> {
@@ -143,7 +143,7 @@ export interface UseAutocompleteCommonProps<T> {
143143
onInputChange?: (
144144
event: React.ChangeEvent<{}>,
145145
value: string,
146-
reason: AutocompleteInputChangeReason,
146+
reason: AutocompleteInputChangeReason
147147
) => void;
148148
/**
149149
* Callback fired when the popup requests to be opened.
@@ -210,7 +210,7 @@ export interface UseAutocompleteMultipleProps<T> extends UseAutocompleteCommonPr
210210
event: React.ChangeEvent<{}>,
211211
value: T[],
212212
reason: AutocompleteChangeReason,
213-
details?: AutocompleteChangeDetails<T>,
213+
details?: AutocompleteChangeDetails<T>
214214
) => void;
215215
}
216216

@@ -241,7 +241,7 @@ export interface UseAutocompleteSingleProps<T> extends UseAutocompleteCommonProp
241241
event: React.ChangeEvent<{}>,
242242
value: T | null,
243243
reason: AutocompleteChangeReason,
244-
details?: AutocompleteChangeDetails<T>,
244+
details?: AutocompleteChangeDetails<T>
245245
) => void;
246246
}
247247

@@ -250,7 +250,7 @@ export type UseAutocompleteProps<T> =
250250
| UseAutocompleteMultipleProps<T>;
251251

252252
export default function useAutocomplete<T>(
253-
props: UseAutocompleteProps<T>,
253+
props: UseAutocompleteProps<T>
254254
): {
255255
getRootProps: () => {};
256256
getInputProps: () => {};

packages/material-ui-styles/src/ThemeProvider/ThemeProvider.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export interface ThemeProviderProps<Theme = DefaultTheme> {
55
theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
66
}
77
export default function ThemeProvider<T = DefaultTheme>(
8-
props: ThemeProviderProps<T>,
8+
props: ThemeProviderProps<T>
99
): React.ReactElement<ThemeProviderProps<T>>;

packages/material-ui-styles/src/createStyles/createStyles.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import { StyleRules } from '@material-ui/styles/withStyles';
1212
// See https://github.com/mui-org/material-ui/issues/15942
1313
// and https://github.com/microsoft/TypeScript/issues/31735
1414
export default function createStyles<ClassKey extends string, Props extends {}>(
15-
styles: StyleRules<Props, ClassKey>,
15+
styles: StyleRules<Props, ClassKey>
1616
): StyleRules<Props, ClassKey>;

packages/material-ui-styles/src/getStylesCreator/getStylesCreator.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export interface StylesCreator<Theme, Props extends object, ClassKey extends str
77
}
88

99
export default function getStylesCreator<S extends Styles<any, any>>(
10-
style: S,
10+
style: S
1111
): StylesCreator<any, any>;

packages/material-ui-styles/src/makeStyles/makeStyles.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DefaultTheme } from '../defaultTheme';
1212
*/
1313
export default function makeStyles<Theme = DefaultTheme, ClassKey extends string = string>(
1414
style: Styles<Theme, {}, ClassKey>,
15-
options?: Omit<WithStylesOptions<Theme>, 'withTheme'>,
15+
options?: Omit<WithStylesOptions<Theme>, 'withTheme'>
1616
): (props?: any) => ClassNameMap<ClassKey>;
1717
/**
1818
* `makeStyles` where the passed `styles` do depend on props
@@ -23,5 +23,5 @@ export default function makeStyles<
2323
ClassKey extends string = string
2424
>(
2525
styles: Styles<Theme, Props, ClassKey>,
26-
options?: Omit<WithStylesOptions<Theme>, 'withTheme'>,
26+
options?: Omit<WithStylesOptions<Theme>, 'withTheme'>
2727
): (props: Props) => ClassNameMap<ClassKey>;

packages/material-ui-styles/src/styled/styled.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type ComponentCreator<Component extends React.ElementType> = <
1717
styles:
1818
| CreateCSSProperties<Props>
1919
| ((props: { theme: Theme } & Props) => CreateCSSProperties<Props>),
20-
options?: WithStylesOptions<Theme>,
20+
options?: WithStylesOptions<Theme>
2121
) => React.ComponentType<
2222
Omit<
2323
JSX.LibraryManagedAttributes<Component, React.ComponentProps<Component>>,
@@ -33,5 +33,5 @@ export interface StyledProps {
3333
}
3434

3535
export default function styled<Component extends React.ElementType>(
36-
Component: Component,
36+
Component: Component
3737
): ComponentCreator<Component>;

packages/material-ui-styles/src/withStyles/withStyles.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export type StyleRules<Props extends object = {}, ClassKey extends string = stri
6464
* @internal
6565
*/
6666
export type StyleRulesCallback<Theme, Props extends object, ClassKey extends string = string> = (
67-
theme: Theme,
67+
theme: Theme
6868
) => StyleRules<Props, ClassKey>;
6969

7070
export type Styles<Theme, Props extends object, ClassKey extends string = string> =
@@ -123,7 +123,7 @@ export default function withStyles<
123123
Options extends WithStylesOptions<ThemeOfStyles<StylesType>> = {}
124124
>(
125125
style: StylesType,
126-
options?: Options,
126+
options?: Options
127127
): PropInjector<
128128
WithStyles<StylesType, Options['withTheme']>,
129129
StyledComponentProps<ClassKeyOfStyles<StylesType>> & PropsOfStyles<StylesType>

packages/material-ui-styles/src/withTheme/withTheme.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export interface ThemedComponentProps extends Partial<WithTheme> {
2121
}
2222

2323
export function withThemeCreator<Theme = DefaultTheme>(
24-
option?: WithThemeCreatorOption<Theme>,
24+
option?: WithThemeCreatorOption<Theme>
2525
): PropInjector<WithTheme<Theme>, ThemedComponentProps>;
2626

2727
export default function withTheme<
2828
Theme,
2929
C extends React.ComponentType<ConsistentWith<React.ComponentProps<C>, WithTheme<Theme>>>
3030
>(
31-
component: C,
31+
component: C
3232
): React.ComponentType<
3333
Omit<JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>, keyof WithTheme<Theme>> &
3434
Partial<WithTheme<Theme>> &

0 commit comments

Comments
 (0)