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; };