From 31f3c1186c0bc0e24a1b351a247c5252d285855d Mon Sep 17 00:00:00 2001 From: yangziyong Date: Tue, 18 Jun 2024 09:01:52 +0800 Subject: [PATCH] =?UTF-8?q?promptAction,UIcontext=20=E6=B7=BB=E5=8A=A0=20o?= =?UTF-8?q?penToast=EF=BC=8CcloseToast=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangziyong --- api/@ohos.arkui.UIContext.d.ts | 33 +++++++++++++++++++++++++++++++++ api/@ohos.promptAction.d.ts | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/api/@ohos.arkui.UIContext.d.ts b/api/@ohos.arkui.UIContext.d.ts index 9c8d7b253..430d3e26b 100644 --- a/api/@ohos.arkui.UIContext.d.ts +++ b/api/@ohos.arkui.UIContext.d.ts @@ -965,6 +965,39 @@ export class PromptAction { */ showToast(options: promptAction.ShowToastOptions): void; + /** + * Displays the notification text. + * + * @param { promptAction.ShowToastOptions } options - Options. + * @returns { Promise } return the toast id that will be used by closeToast. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + openToast(options: promptAction.ShowToastOptions): Promise; + + /** + * Close the notification text. + * + * @param { number } toastId - the toast id that returned by openToast. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeToast(toastId: number): void; + /** * Displays the dialog box. * diff --git a/api/@ohos.promptAction.d.ts b/api/@ohos.promptAction.d.ts index 7dbfff8e8..9fdf486ca 100644 --- a/api/@ohos.promptAction.d.ts +++ b/api/@ohos.promptAction.d.ts @@ -1115,6 +1115,39 @@ declare namespace promptAction { */ function showToast(options: ShowToastOptions): void; + /** + * Displays the notification text. + * + * @param { ShowToastOptions } options - Options. + * @returns { Promise } return the toast id that will be used by closeToast. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function openToast(options: ShowToastOptions): Promise; + + /** + * Close the notification text. + * + * @param { number } toastId - the toast id that returned by openToast. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function closeToast(toastId: number): void; + /** * Displays the dialog box. *