From c854443815b93696b890bcd953e8da8d390bd002 Mon Sep 17 00:00:00 2001 From: JoseLion Date: Sat, 18 Jan 2020 10:32:04 -0500 Subject: [PATCH] Fix types for onExited, OnEntered, and onClose handlers --- src/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index c75c659b..0166d030 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -11,7 +11,11 @@ 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 { +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 { key?: string | number; variant?: VariantType; persist?: boolean; @@ -19,6 +23,9 @@ export interface OptionsObject extends Omit