From c76dee91695f78951f44bfa4232942d61d44deba Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 24 May 2022 16:50:09 +0800 Subject: [PATCH] =?UTF-8?q?DESIGN-3918=20feat:=20toast=E6=96=B0=E5=A2=9Elo?= =?UTF-8?q?ading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/foundation/message.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index 63790d1cb..5f847653f 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -1,6 +1,12 @@ +type toastOptions = { + level: "success" | "warning" | "error" | "common" | "loading" + autoClose?: boolean + callback?: Function +} + export type _msg = { - alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void - confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void - prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void - toast: (message: string, options?: object | string, context?: HTMLElement) => void + alert: (title: string, message?: string | { [key: string]: any }, callback?: (result?: boolean) => void) => void + confirm: (title: string, message?: string | { [key: string]: any }, callback?: (result: boolean) => void) => void + prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void + toast: (message: string, options?: toastOptions | string, context?: HTMLElement) => void }