Security upgrades

This commit is contained in:
2020-07-15 19:54:48 +02:00
parent 59cc6c54cd
commit ad8ed283d2
3164 changed files with 408897 additions and 28 deletions

View File

@@ -0,0 +1,36 @@
import * as React from 'react';
import { ConsistentWith, Omit, PropInjector } from '@material-ui/types';
import { DefaultTheme } from '../defaultTheme';
export interface WithThemeCreatorOption<Theme = DefaultTheme> {
defaultTheme?: Theme;
}
export interface WithTheme<Theme = DefaultTheme> {
theme: Theme;
/**
* Deprecated. Will be removed in v5. Refs are now automatically forwarded to
* the inner component.
* @deprecated since version 4.0
*/
innerRef?: React.Ref<any>;
}
export interface ThemedComponentProps extends Partial<WithTheme> {
ref?: React.Ref<unknown>;
}
export function withThemeCreator<Theme = DefaultTheme>(
option?: WithThemeCreatorOption<Theme>
): PropInjector<WithTheme<Theme>, ThemedComponentProps>;
export default function withTheme<
Theme,
C extends React.ComponentType<ConsistentWith<React.ComponentProps<C>, WithTheme<Theme>>>
>(
component: C
): React.ComponentType<
Omit<JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>, keyof WithTheme<Theme>> &
Partial<WithTheme<Theme>> &
ThemedComponentProps
>;