Skip to content

Commit

Permalink
Merge branch 'fix-exit-handler-type' of https://github.com/stackbuild…
Browse files Browse the repository at this point in the history
…ers/notistack into stackbuilders-fix-exit-handler-type
  • Loading branch information
iamhosseindhv committed Feb 23, 2020
2 parents d22ae1e + c854443 commit d392aa7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ export type SnackbarMessage = string | React.ReactNode;
export type SnackbarAction = SnackbarContentProps['action'] | ((key: OptionsObject['key']) => React.ReactNode);
export type SnackbarContent = React.ReactNode | ((key: OptionsObject['key'], message: SnackbarMessage) => React.ReactNode);

export interface OptionsObject extends Omit<SnackbarProps, 'open' | 'message' | 'classes'> {
type ExitHandler = (node: HTMLElement, key: OptionsObject['key']) => void;
type EnterHandler = (node: HTMLElement, isAppearing: boolean, key: OptionsObject['key']) => void;
type CloseHandler = (event: React.SyntheticEvent, reason: string, key: OptionsObject['key']) => void;

export interface OptionsObject extends Omit<SnackbarProps, 'open' | 'message' | 'classes' | 'onExited' | 'onEntered' | 'onClose'> {
key?: string | number;
variant?: VariantType;
persist?: boolean;
preventDuplicate?: boolean;
children?: SnackbarContent; // To be deprecated
content?: SnackbarContent;
action?: SnackbarAction;
onExited?: ExitHandler;
onEntered?: EnterHandler;
onClose?: CloseHandler;
}

export type ContainerClassKey =
Expand Down

0 comments on commit d392aa7

Please sign in to comment.