Skip to content

Commit

Permalink
Add onClose reason types
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhosseindhv committed Feb 23, 2020
1 parent f2e68a4 commit ccb13bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export type SnackbarMessage = string | React.ReactNode;
export type SnackbarAction = SnackbarContentProps['action'] | ((key: SnackbarKey) => React.ReactNode);
export type SnackbarContent = React.ReactNode | ((key: SnackbarKey, message: SnackbarMessage) => React.ReactNode);

export type TransitionCloseHandler = (event: React.SyntheticEvent<any>, reason: string, key: SnackbarKey) => void;
export type CloseReason = 'timeout' | 'clickaway' | 'maxsnack' | null;
export type TransitionCloseHandler = (event: React.SyntheticEvent<any>, reason: CloseReason, key: SnackbarKey) => void;
export type TransitionEnterHandler = (node: HTMLElement, isAppearing: boolean, key: SnackbarKey) => void;
export type TransitionExitHandler = (node: HTMLElement, key: SnackbarKey) => void;
export type TransitionHandlerProps = {
Expand Down

0 comments on commit ccb13bf

Please sign in to comment.