diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 627b634d449d6a8dc3ab08d1c637050c07a78cd3..c76e4447e18ea7221bb5bfa7856bb0d7009198a5 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -129,6 +129,16 @@ export declare interface LifecycleForm { * @FAModelOnly */ onAcquireFormState?(want: Want): formInfo.FormState; + + /** + * Called when the system shares the form. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the WantParams object. + * @FAModelOnly + */ + onShare?(): {[key: string]: any}; } /** diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index 80b685d4b1be32838d951e437dc19d8d33f18541..e6eb90c387d77e6c2e1511e90738d37a263ff967 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -139,4 +139,14 @@ export default class FormExtension { * @StageModelOnly */ onAcquireFormState?(want: Want): formInfo.FormState; + + /** + * Called when the system shares the form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @return Returns the WantParams object. + * @StageModelOnly + */ + onShare(): {[key: string]: any}; } \ No newline at end of file diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts index e60df45a3d0fcaaaf85822510dc1b58c9deee93a..d0aec9b1aa821e6a9f127ff42ce152f0a2ba3585 100644 --- a/api/@ohos.application.formHost.d.ts +++ b/api/@ohos.application.formHost.d.ts @@ -267,5 +267,18 @@ declare namespace formHost { */ function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void; function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise; + + /** + * Share forms by formID and deviceID. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the form ID + * @param deviceId Indicates the device ID + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function shareForm(formId: string, deviceId: string, callback: AsyncCallback): void; + function shareForm(formId: string, deviceId: string): Promise; } export default formHost; \ No newline at end of file