diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index cb7a9402a3de617a456a10315fbae2ee9f30e7bf..5745bdcd0c30916f48f16f41ac6ad3be9a31c004 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -788,6 +788,36 @@ declare namespace formHost { function off(type: 'changeSceneAnimationState', callback?: Callback): void; + /** + * Listens to the event of get form rect. + *

You can use this method to listen to the event of get form rect.

+ * + * @param { 'getFormRect' } type - Indicates event type. + * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @throws { BusinessError } 202 - The application is not a system application. + * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly + * due to limited device capabilities. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + function on(type: 'getFormRect', callback: formInfo.GetFormRectInfoCallback): void; + + /** + * Cancels listening to the event of get form rect. + *

You can use this method to cancel listening to the event of get form rect.

+ * + * @param { 'getFormRect' } type - Indicates event type. + * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @throws { BusinessError } 202 - The application is not a system application. + * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly + * due to limited device capabilities. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + function off(type: 'getFormRect', callback?: formInfo.GetFormRectInfoCallback): void; + /** * Notify form is Visible *

You can use this method to notify form visible state.

diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index c6c6e9245bc506618b3bef00cfa9932114d7438f..994823be51ff342620be21a8b1f81c73e487021d 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1936,6 +1936,15 @@ declare namespace formInfo { * @since 20 */ duration: number; + + /** + * Whether use default animate + * + * @type { boolean } + * @syscap SystemCapability.Ability.Form + * @since 20 + */ + useDefaultAnimate?: boolean; } /** @@ -2132,5 +2141,28 @@ declare namespace formInfo { */ disabledDesktopBehaviors?: string; } + + /** + * Get form rect info callback + * + * @typedef GetFormRectInfoCallback + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + interface GetFormRectInfoCallback { + /** + * Get form rect info + * + * @param { T } data + * @returns { Promise } + * + * @throws { BusinessError } 202 - The application is not a system application. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + (data: T): Promise; + } } export default formInfo;