diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index cbd0d1bd9cb2c650659b82cb974681ac3c4e3f13..0f307a4d94b5eb4c7b28273888048f8e3225978a 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -19,14 +19,28 @@ */ import formBindingData from './@ohos.app.form.formBindingData'; -/*** if arkts 1.1 */ import formInfo from './@ohos.app.form.formInfo'; -/*** endif */ import FormExtensionContext from './application/FormExtensionContext'; import Want from './@ohos.app.ability.Want'; -/*** if arkts 1.1 */ import { Configuration } from './@ohos.app.ability.Configuration'; -/*** endif */ + +/** + * Called to return a {@link FormState} object. + *
You must override this callback if you want this ability to return the actual form state. Otherwise, + * this method returns {@link FormState#DEFAULT} by default.
+ * + * @typedef { function } + * @param { Want } want - Indicates the description of the form for which the {@link formInfo#FormState} + * is obtained. The description covers the bundle name, ability name, module name, + * form name, and form dimensions. + * @returns { formInfo.FormState } Returns the {@link formInfo#FormState} object. + * @syscap SystemCapability.Ability.Form + * @stagemodelonly + * @atomicservice + * @since 20 + * @arkts 1.2 + */ +type OnAcquireFormStateFn = (want: Want) => formInfo.FormState; /** * Called when this ability breaks the last link, notifying the provider that the provider process is about to stop. @@ -254,7 +268,8 @@ declare class FormExtensionAbility { * @syscap SystemCapability.Ability.Form * @stagemodelonly * @atomicservice - * @since 11 + * @since arkts{ '1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ onConfigurationUpdate(newConfig: Configuration): void; @@ -341,6 +356,20 @@ declare class FormExtensionAbility { */ onStop?(): void; + /** + * Called to return a {@link FormState} object. + *You must override this callback if you want this ability to return the actual form state. Otherwise, + * this method returns {@link FormState#DEFAULT} by default.
+ * + * @type { ?OnAcquireFormStateFn } + * @syscap SystemCapability.Ability.Form + * @stagemodelonly + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onAcquireFormState?: OnAcquireFormStateFn; + /** * Called when this ability breaks the last link, notifying the provider that the provider process is about to stop. *