From f72c72e5b1e61ca4b5f7c7d1cbb5ddd9b6f27030 Mon Sep 17 00:00:00 2001 From: xuchenghua09 Date: Mon, 16 May 2022 17:00:07 +0000 Subject: [PATCH 1/2] update d.s Signed-off-by: xuchenghua09 --- api/@internal/ets/lifecycle.d.ts | 10 ++++++++++ api/@ohos.application.FormExtension.d.ts | 10 ++++++++++ api/@ohos.application.formHost.d.ts | 13 +++++++++++++ 3 files changed, 33 insertions(+) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 627b634d44..c76e4447e1 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 80b685d4b1..e6eb90c387 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 e60df45a3d..d0aec9b1aa 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 -- Gitee From 5906630ab772ddbdafde02846abed8784a364341 Mon Sep 17 00:00:00 2001 From: xuchenghua09 Date: Wed, 18 May 2022 15:51:51 +0000 Subject: [PATCH 2/2] update form d.s Signed-off-by: xuchenghua09 --- api/@internal/ets/lifecycle.d.ts | 3 ++- api/@ohos.application.FormExtension.d.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index c76e4447e1..505eb501d3 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -135,10 +135,11 @@ export declare interface LifecycleForm { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param formId Indicates the ID of the deleted form. * @return Returns the WantParams object. * @FAModelOnly */ - onShare?(): {[key: string]: any}; + onShare?(formId: string): {[key: string]: any}; } /** diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index e6eb90c387..c5361d8aa7 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -145,8 +145,9 @@ export default class FormExtension { * * @since 9 * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form. * @return Returns the WantParams object. * @StageModelOnly */ - onShare(): {[key: string]: any}; + onShare(formId: string): {[key: string]: any}; } \ No newline at end of file -- Gitee