diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts index b2b3fff73c6773abdbb9de305a194b47c49bf4e8..629008d5de06919f6e35f57c408b5d7651cad393 100644 --- a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -113,27 +113,14 @@ declare class ServiceExtensionAbility { * Called back when all abilities connected to a service extension are disconnected. * * @param { Want } want - Indicates disconnection information about the service extension. - * @returns { void } the promise returned by the function. + * @returns { Promise | undefined } the promise returned by the function. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 20 * @arkts 1.2 */ - onDisconnect(want: Want): void; - - /** - * Called back when all abilities connected to a service extension are disconnected. - * - * @param { Want } want - Indicates disconnection information about the service extension. - * @returns { Promise } the promise returned by the function. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 20 - * @arkts 1.2 - */ - onDisconnectAsync(want: Want): Promise; + onDisconnect(want: Want): Promise | undefined; /** * Called when a new client attempts to connect to a service extension after all previous client connections to it diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index 8c714ff6a6fd0e094e456ad65490ad5b0ac675f0..3d1fde8c92ac3156686b2d0740e143c7d4a05eb8 100644 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -524,46 +524,19 @@ declare class UIAbility extends Ability { onDestroy(): void | Promise; /** - * Called to clear resources when this UIAbility is destroyed. - * This API returns the result synchronously or uses a promise to return the result. - * - *

**NOTE**: - *
After the onDestroy() lifecycle callback is executed, the application may exit. Consequently, - * the asynchronous function (for example, asynchronously writing data to the database) in onDestroy() may fail to be - * executed. You can use the asynchronous lifecycle to ensure that the subsequent lifecycle continues only after the - * asynchronous function in onDestroy() finishes the execution. - *

- * - * @returns { void } the promise returned by the function. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onDestroy(): void; - - /** - * Called to clear resources when this UIAbility is destroyed. - * This API returns the result synchronously or uses a promise to return the result. - * - *

**NOTE**: - *
After the onDestroyAsync() lifecycle callback is executed, the application may exit. Consequently, - * the asynchronous function (for example, asynchronously writing data to the database) in onDestroyAsync() may fail to be - * executed. You can use the asynchronous lifecycle to ensure that the subsequent lifecycle continues only after the - * asynchronous function in onDestroyAsync() finishes the execution. - *

+ * Called back before an ability is destroyed. + * After the onDestroy() lifecycle callback is executed, the application may exit. Consequently, + * the asynchronous function (for example, asynchronously writing data to the database) in synchronous onDestroy() + * may fail to be executed. You can use the asynchronous lifecycle to ensure that the subsequent lifecycle + * continues only after the asynchronous function in onDestroy() finishes the execution. * - * @returns { Promise } the promise returned by the function. + * @returns { Promise | undefined } the promise returned by the function. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly - * @crossplatform - * @atomicservice * @since 20 * @arkts 1.2 */ - onDestroyAsync(): Promise; + onDestroy(): Promise | undefined; /** * Called back when the state of an ability changes to foreground. diff --git a/api/@ohos.app.ability.UIExtensionAbility.d.ts b/api/@ohos.app.ability.UIExtensionAbility.d.ts index 4b7de8200f33f98922164bf11b34d6ebeef1321f..616c210e8d1902b1a659299f14e150c92bd3aee0 100755 --- a/api/@ohos.app.ability.UIExtensionAbility.d.ts +++ b/api/@ohos.app.ability.UIExtensionAbility.d.ts @@ -119,24 +119,13 @@ declare class UIExtensionAbility extends ExtensionAbility { /** * Called back before an UI extension is destroyed. * - * @returns { void } the promise returned by the function. + * @returns { Promise | undefined } the promise returned by the function. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 20 - * @arkts 1.2 - */ - onDestroy(): void; - - /** - * Called back before an UI extension is destroyed. - * - * @returns { Promise } the promise returned by the function. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly * @since 20 * @arkts 1.2 */ - onDestroyAsync(): Promise; + onDestroy(): Promise | undefined; } export default UIExtensionAbility; \ No newline at end of file