!10127 全局自定义弹窗api

Merge pull request !10127 from luoying_ace/ly321
This commit is contained in:
openharmony_ci 2024-03-30 10:07:49 +00:00 committed by Gitee
commit caefa9b3f7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 115 additions and 0 deletions

View File

@ -961,6 +961,50 @@ export class PromptAction {
* @since 11
*/
showActionMenu(options: promptAction.ActionMenuOptions): Promise<promptAction.ActionMenuSuccessResponse>;
/**
* Open the custom dialog with frameNode.
*
* @param { ComponentContent } dialogContent - the content of custom dialog.
* @param { promptAction.BaseDialogOptions } options - Options.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 401 - if the number of parameters or the type of parameters is incorrect.
* @throws { BusinessError } 103301 - the ComponentContent is incorrect.
* @throws { BusinessError } 103302 - the ComponentContent has already been opened.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
openCustomDialog(dialogContent: ComponentContent, options?: promptAction.BaseDialogOptions): Promise<void>;
/**
* Update the custom dialog with frameNode.
*
* @param { ComponentContent } dialogContent - the content of custom dialog.
* @param { promptAction.BaseDialogOptions } options - Options.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 401 - if the number of parameters or the type of parameters is incorrect.
* @throws { BusinessError } 103301 - the ComponentContent is incorrect.
* @throws { BusinessError } 103303 - the ComponentContent cannot be found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
updateCustomDialog(dialogContent: ComponentContent, options: promptAction.BaseDialogOptions): Promise<void>;
/**
* Close the custom dialog with frameNode.
*
* @param { ComponentContent } dialogContent - the content of custom dialog.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 401 - if the number of parameters or the type of parameters is incorrect.
* @throws { BusinessError } 103301 - the ComponentContent is incorrect.
* @throws { BusinessError } 103303 - the ComponentContent cannot be found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
closeCustomDialog(dialogContent: ComponentContent): Promise<void>;
}
/**

View File

@ -668,6 +668,37 @@ declare namespace promptAction {
* @since 12
*/
isModal?: boolean;
/**
* Allows users to click the mask layer to exit.
*
* @type { ?boolean }
* @default true
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
autoCancel?: boolean;
/**
* Transition parameters of opening/closing custom dialog.
*
* @type { ?TransitionEffect }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
transition?: TransitionEffect;
/**
* Defines custom dialog maskColor
*
* @type { ?ResourceColor }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
maskColor?: ResourceColor;
/**
* Callback function when the CustomDialog interactive dismiss.
@ -678,6 +709,46 @@ declare namespace promptAction {
* @since 12
*/
onWillDismiss?: Callback<DismissDialogAction>;
/**
* Callback function when the dialog appears.
*
* @type { ?function }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
onDidAppear?: () => void;
/**
* Callback function when the dialog disappears.
*
* @type { ?function }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
onDidDisappear?: () => void;
/**
* Callback function before the dialog openAnimation starts.
*
* @type { ?function }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
onWillAppear?: () => void;
/**
* Callback function before the dialog closeAnimation starts.
*
* @type { ?function }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
onWillDisappear?: () => void;
}
/**