diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 9347e97d8852a64251cf3fc9a3978380bfc5e8ce..dd466c1a99131080951933364043a772f5c6ceed 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -227,4 +227,31 @@ export default class AbilityStage { * @since 15 */ onPrepareTerminationAsync(): Promise; + + /** + * Called back asynchronously upon starting specified ability. + * + * @param { Want } want - Indicates the want info of the started ability. + * @returns { Promise } The user returns an ability string ID. If the ability of this ID has been started before, + * do not create a new instance and pull it back to the top of the stack. + * Otherwise, create a new instance and start it. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 20 + */ + onAcceptWantAsync(want: Want): Promise; + + /** + * Called back asynchronously upon starting UIAbility in specified process. + * + * @param { Want } want - Indicates the want info of the started ability. + * @returns { Promise } The user returns an ability string ID. If the ability of this ID has been started before, + * let the ability run in this process. Otherwise, create a new process. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 20 + */ + onNewProcessRequestAsync(want: Want): Promise; } diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index bf815f511216219a1da46b8e04a24fbdb418de85..e49fe51d26064498b28508f5ca1b968e17b76aa4 100644 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -794,4 +794,18 @@ export default class UIAbility extends Ability { * @since 18 */ onCollaborate(wantParam: Record): AbilityConstant.CollaborateResult; + + /** + * Called back asynchronously when an ability prepares to save. + * + * @param { AbilityConstant.StateType } stateType - state type when save. + * @param { Record } wantParam - Indicates the want parameter. + * @returns { Promise } agree with the current UIAbility status or not.return 0 if ability + * agrees to save data successfully, otherwise errcode. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @atomicservice + * @since 20 + */ + onSaveStateAsync(stateType: AbilityConstant.StateType, wantParam: Record): Promise; }