From 3867c1d1ddde43b5db89d2db60252e15761f87da Mon Sep 17 00:00:00 2001 From: Utopia Date: Tue, 12 Aug 2025 11:00:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20utils-toast,=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20options=20=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/toast.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/toast.ts b/src/utils/toast.ts index e524b00..6d5a8e8 100644 --- a/src/utils/toast.ts +++ b/src/utils/toast.ts @@ -53,13 +53,15 @@ export function showToast(options: ToastOptions | string) { }) } +type _ToastOptions = Omit + export const toast = { - success: (message: string, options?: Omit) => + success: (message: string, options?: _ToastOptions) => showToast({ ...options, type: 'success', message }), - error: (message: string, options?: Omit) => + error: (message: string, options?: _ToastOptions) => showToast({ ...options, type: 'error', message }), - warning: (message: string, options?: Omit) => + warning: (message: string, options?: _ToastOptions) => showToast({ ...options, type: 'warning', message }), - info: (message: string, options?: Omit) => + info: (message: string, options?: _ToastOptions) => showToast({ ...options, type: 'info', message }), }