From fb7dbf72f48f89fbba80e8fd0d23d1cb4c06c130 Mon Sep 17 00:00:00 2001 From: Allan Rafael Date: Mon, 19 Jun 2023 16:40:54 -0300 Subject: [PATCH] chore: update types --- react-native-toast.d.ts | 40 ++++++++++++++++++++-------------------- src/Toast.tsx | 8 ++++---- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/react-native-toast.d.ts b/react-native-toast.d.ts index 2dab40c..420c395 100644 --- a/react-native-toast.d.ts +++ b/react-native-toast.d.ts @@ -24,7 +24,7 @@ declare module "@platformbuilders/react-native-toast" { translateY: number; }; - export type ToastConfig = { + export type ToastConfigProps = { fontFamily?: string; textColor?: string; backgroundColor?: { @@ -33,39 +33,39 @@ declare module "@platformbuilders/react-native-toast" { error?: string; custom?: string; }; - icon: { - success: { - icon?: ImageSourcePropType; + icon?: { + success?: { + icon: ImageSourcePropType; height?: number; width?: number; }; - warning: { - icon?: ImageSourcePropType; + warning?: { + icon: ImageSourcePropType; height?: number; width?: number; }; - error: { - icon?: ImageSourcePropType; + error?: { + icon: ImageSourcePropType; height?: number; width?: number; }; - custom: { - icon?: ImageSourcePropType; + custom?: { + icon: ImageSourcePropType; height?: number; width?: number; }; }; - autoHide: { - success: boolean; - warning: boolean; - error: boolean; - custom: boolean; + autoHide?: { + success?: boolean; + warning?: boolean; + error?: boolean; + custom?: boolean; }; - showCloseButton: { - success: boolean; - warning: boolean; - error: boolean; - custom: boolean; + showCloseButton?: { + success?: boolean; + warning?: boolean; + error?: boolean; + custom?: boolean; }; showIcon?: boolean; }; diff --git a/src/Toast.tsx b/src/Toast.tsx index 1ddef8a..0918b3e 100644 --- a/src/Toast.tsx +++ b/src/Toast.tsx @@ -95,22 +95,22 @@ export type ToastConfigProps = { }; icon?: { success?: { - icon?: ImageSourcePropType; + icon: ImageSourcePropType; height?: number; width?: number; }; warning?: { - icon?: ImageSourcePropType; + icon: ImageSourcePropType; height?: number; width?: number; }; error?: { - icon?: ImageSourcePropType; + icon: ImageSourcePropType; height?: number; width?: number; }; custom?: { - icon?: ImageSourcePropType; + icon: ImageSourcePropType; height?: number; width?: number; };