Skip to content

Commit

Permalink
[typescript] Disallow spreading TransitionHandlerProps (#26927)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 24, 2021
1 parent 9e09527 commit 4196d99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
5 changes: 2 additions & 3 deletions packages/material-ui/src/Dialog/Dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { SxProps, Breakpoint } from '@material-ui/system';
import { InternalStandardProps as StandardProps, Theme } from '..';
import { PaperProps } from '../Paper';
import { ModalProps } from '../Modal';
import { TransitionHandlerProps, TransitionProps } from '../transitions/transition';
import { TransitionProps } from '../transitions/transition';
import { DialogClasses } from './dialogClasses';

export interface DialogProps
extends StandardProps<ModalProps & Partial<TransitionHandlerProps>, 'children'> {
export interface DialogProps extends StandardProps<ModalProps, 'children'> {
/**
* The id(s) of the element(s) that describe the dialog.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/Menu/Menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { InternalStandardProps as StandardProps } from '..';
import { PopoverProps } from '../Popover';
import { MenuListProps } from '../MenuList';
import { Theme } from '../styles';
import { TransitionHandlerProps, TransitionProps } from '../transitions/transition';
import { TransitionProps } from '../transitions/transition';
import { MenuClasses } from './menuClasses';

export interface MenuProps extends StandardProps<PopoverProps & Partial<TransitionHandlerProps>> {
export interface MenuProps extends StandardProps<PopoverProps> {
/**
* An HTML element, or a function that returns one.
* It's used to set the position of the menu.
Expand Down
5 changes: 2 additions & 3 deletions packages/material-ui/src/Popover/Popover.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InternalStandardProps as StandardProps } from '..';
import { PaperProps } from '../Paper';
import { ModalProps } from '../Modal';
import { Theme } from '../styles';
import { TransitionHandlerProps, TransitionProps } from '../transitions/transition';
import { TransitionProps } from '../transitions/transition';
import { PopoverClasses } from './popoverClasses';

export interface PopoverOrigin {
Expand All @@ -19,8 +19,7 @@ export interface PopoverPosition {

export type PopoverReference = 'anchorEl' | 'anchorPosition' | 'none';

export interface PopoverProps
extends StandardProps<ModalProps & Partial<TransitionHandlerProps>, 'children'> {
export interface PopoverProps extends StandardProps<ModalProps, 'children'> {
/**
* A ref for imperative actions.
* It currently only supports updatePosition() action.
Expand Down
5 changes: 2 additions & 3 deletions packages/material-ui/src/Snackbar/Snackbar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SxProps } from '@material-ui/system';
import { Theme } from '../styles';
import { InternalStandardProps as StandardProps } from '..';
import { SnackbarContentProps } from '../SnackbarContent';
import { TransitionHandlerProps, TransitionProps } from '../transitions/transition';
import { TransitionProps } from '../transitions/transition';
import { ClickAwayListenerProps } from '../ClickAwayListener';
import { SnackbarClasses } from './snackbarClasses';

Expand All @@ -14,8 +14,7 @@ export interface SnackbarOrigin {

export type SnackbarCloseReason = 'timeout' | 'clickaway';

export interface SnackbarProps
extends StandardProps<React.HTMLAttributes<HTMLDivElement> & Partial<TransitionHandlerProps>> {
export interface SnackbarProps extends StandardProps<React.HTMLAttributes<HTMLDivElement>> {
/**
* The action to display. It renders after the message, at the end of the snackbar.
*/
Expand Down
7 changes: 2 additions & 5 deletions packages/material-ui/src/SpeedDial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import { SxProps } from '@material-ui/system';
import { Theme } from '../styles';
import { InternalStandardProps as StandardProps } from '..';
import { FabProps } from '../Fab';
import { TransitionHandlerProps, TransitionProps } from '../transitions';
import { TransitionProps } from '../transitions';
import { SpeedDialClasses } from './speedDialClasses';

export type CloseReason = 'toggle' | 'blur' | 'mouseLeave' | 'escapeKeyDown';
export type OpenReason = 'toggle' | 'focus' | 'mouseEnter';

export interface SpeedDialProps
extends StandardProps<
React.HTMLAttributes<HTMLDivElement> & Partial<TransitionHandlerProps>,
'children'
> {
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, 'children'> {
/**
* SpeedDialActions to display when the SpeedDial is `open`.
*/
Expand Down

0 comments on commit 4196d99

Please sign in to comment.