From 576441c82ef5e29fa87b2e6852fceb9669d39dc7 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 11 Oct 2022 11:12:26 +0800 Subject: [PATCH] https://gitee.com/openharmony/interface_sdk-js/issues/I5V12A Signed-off-by: yangzk Change-Id: Ia45851e51eb5527d221971ddf97448180dde8758 --- api/@ohos.app.form.formBindingData.d.ts | 45 ++ api/@ohos.app.form.formHost.d.ts | 502 +++++++++++++++++++++ api/@ohos.app.form.formProvider.d.ts | 161 +++++++ api/@ohos.application.FormExtension.d.ts | 2 +- api/@ohos.application.formBindingData.d.ts | 2 + api/@ohos.application.formHost.d.ts | 2 + api/@ohos.application.formProvider.d.ts | 2 + api/application/FormExtensionContext.d.ts | 20 +- 8 files changed, 724 insertions(+), 12 deletions(-) create mode 100644 api/@ohos.app.form.formBindingData.d.ts create mode 100644 api/@ohos.app.form.formHost.d.ts create mode 100644 api/@ohos.app.form.formProvider.d.ts diff --git a/api/@ohos.app.form.formBindingData.d.ts b/api/@ohos.app.form.formBindingData.d.ts new file mode 100644 index 000000000..ca2f215d4 --- /dev/null +++ b/api/@ohos.app.form.formBindingData.d.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from './basic'; + +/** + * interface of formBindingData. + * @namespace formBindingData + * @syscap SystemCapability.Ability.Form + * @since 9 + */ +declare namespace formBindingData { + /** + * Create an FormBindingData instance. + * @param { Object | string } obj - Indicates the FormBindingData instance data. + * @returns { FormBindingData } Returns the FormBindingData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function createFormBindingData(obj?: Object | string): FormBindingData; + + /** + * Defines the createFormBindingData result interface. + * @typedef FormBindingData + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + interface FormBindingData { + data: Object + } +} +export default formBindingData; \ No newline at end of file diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts new file mode 100644 index 000000000..da71eab1e --- /dev/null +++ b/api/@ohos.app.form.formHost.d.ts @@ -0,0 +1,502 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import { Callback } from "./basic"; +import Want from './@ohos.application.Want'; +import formInfo from './@ohos.application.formInfo' + +/** + * interface of formHost. + * @namespace formHost + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ +declare namespace formHost { + /** + * Deletes an obtained form by its ID. + *

After this method is called, the form won't be available for use by the application and the Form Manager + * Service no longer keeps the cache information about the form.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID. + * @param { AsyncCallback } callback - The callback of deleteForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function deleteForm(formId: string, callback: AsyncCallback): void; + + /** + * Deletes an obtained form by its ID. + *

After this method is called, the form won't be available for use by the application and the Form Manager + * Service no longer keeps the cache information about the form.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function deleteForm(formId: string): Promise; + + /** + * Releases an obtained form by its ID. + *

After this method is called, the form won't be available for use by the application, but the Form Manager + * Service still keeps the cache information about the form, so that the application can quickly obtain it based on + * the {@code formId}.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID + * @param { AsyncCallback } callback - The callback of releaseForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function releaseForm(formId: string, callback: AsyncCallback): void; + + /** + * Releases an obtained form by its ID. + *

After this method is called, the form won't be available for use by the application, but the Form Manager + * Service still keeps the cache information about the form, so that the application can quickly obtain it based on + * the {@code formId}.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID + * @param { boolean } isReleaseCache - Indicates whether release cache or not. + * @param { AsyncCallback } callback - The callback of releaseForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void; + + /** + * Releases an obtained form by its ID. + *

After this method is called, the form won't be available for use by the application, but the Form Manager + * Service still keeps the cache information about the form, so that the application can quickly obtain it based on + * the {@code formId}.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID + * @param { boolean } isReleaseCache - Indicates whether release cache or not. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function releaseForm(formId: string, isReleaseCache?: boolean): Promise; + + /** + * Requests for form update. + *

This method must be called when the application has detected that a system setting item (such as the language, + * resolution, or screen orientation) being listened for has changed. Upon receiving the update request, the form + * provider automatically updates the form data (if there is any update) through the form framework, with the update + * process being unperceivable by the application.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the ID of the form to update. + * @param { AsyncCallback } callback - The callback of requestForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function requestForm(formId: string, callback: AsyncCallback): void; + + /** + * Requests for form update. + *

This method must be called when the application has detected that a system setting item (such as the language, + * resolution, or screen orientation) being listened for has changed. Upon receiving the update request, the form + * provider automatically updates the form data (if there is any update) through the form framework, with the update + * process being unperceivable by the application.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the ID of the form to update. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function requestForm(formId: string): Promise; + + /** + * Converts a specified temporary form that has been obtained by the application into a normal form. + * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the ID of the temporary form to convert. + * @param { AsyncCallback } callback - The callback of castTempForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function castTempForm(formId: string, callback: AsyncCallback): void; + + /** + * Converts a specified temporary form that has been obtained by the application into a normal form. + * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the ID of the temporary form to convert. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function castTempForm(formId: string): Promise; + + /** + * Sends a notification to the form framework to make the specified forms visible. + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made visible. + * @param { AsyncCallback } callback - The callback of notifyVisibleForms. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyVisibleForms(formIds: Array, callback: AsyncCallback): void; + + /** + * Sends a notification to the form framework to make the specified forms visible. + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made visible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyVisibleForms(formIds: Array): Promise; + + /** + * Sends a notification to the form framework to make the specified forms invisible. + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @param { AsyncCallback } callback - The callback of notifyInvisibleForms. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void; + + /** + * Sends a notification to the form framework to make the specified forms invisible. + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyInvisibleForms(formIds: Array): Promise; + + /** + * Notify the form framework to make the specified forms updatable. + *

You can use this method to set form refresh state to true, the form can receive new + * update from service.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @param { AsyncCallback } callback - The callback of enableFormsUpdate. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function enableFormsUpdate(formIds: Array, callback: AsyncCallback): void; + + /** + * Notify the form framework to make the specified forms updatable. + *

You can use this method to set form refresh state to true, the form can receive new + * update from service.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function enableFormsUpdate(formIds: Array): Promise; + + /** + * Notifys the form framework to make the specified forms non updatable. + *

You can use this method to set form refresh state to false, the form do not receive + * new update from service.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @param { AsyncCallback } callback - The callback of disableFormsUpdate. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function disableFormsUpdate(formIds: Array, callback: AsyncCallback): void; + + /** + * Notifys the form framework to make the specified forms non updatable. + *

You can use this method to set form refresh state to false, the form do not receive + * new update from service.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the IDs of the forms to be made invisible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function disableFormsUpdate(formIds: Array): Promise; + + /** + * Checks whether the system is ready. + *

You can use this method to obtain the system is ready.

+ * @param { AsyncCallback } callback - The callback of isSystemReady. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function isSystemReady(callback: AsyncCallback): void; + + /** + * Checks whether the system is ready. + *

You can use this method to obtain the system is ready.

+ * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function isSystemReady(): Promise; + + /** + * Obtains the FormInfo objects provided by all applications on the device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { AsyncCallback> } callback - The callback is used to return the FormInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function getAllFormsInfo(callback: AsyncCallback>): void; + + /** + * Obtains the FormInfo objects provided by all applications on the device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @returns { Promise> } Returns the FormInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function getAllFormsInfo(): Promise>; + + /** + * Obtains the FormInfo objects provided by a specified application on the device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback> } callback - The callback is used to return the FormInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function getFormsInfo(bundleName: string, callback: AsyncCallback>): void; + + /** + * Obtains the FormInfo objects provided by a specified application on the device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { AsyncCallback> } callback - The callback is used to return the FormInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void; + + /** + * Obtains the FormInfo objects provided by a specified application on the device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @returns { Promise> } Returns the FormInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function getFormsInfo(bundleName: string, moduleName?: string): Promise>; + + /** + * Deletes invalid forms of the application in the Form Manager Service based on the list of. + *

You can use this method to delete invalid forms of the application.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @param { AsyncCallback } callback - The callback is used to return the number of invalid forms deleted + * by the Form Manager Service. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function deleteInvalidForms(formIds: Array, callback: AsyncCallback): void; + + /** + * Deletes invalid forms of the application in the Form Manager Service based on the list of. + *

You can use this method to delete invalid forms of the application.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @returns { Promise } Returns the number of invalid forms deleted by the Form Manager Service. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function deleteInvalidForms(formIds: Array): Promise; + + /** + * Obtains the Form state. + *

You can use this method to obtains the form state.

+ * @permission ohos.permission.REQUIRE_FORM and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Want } want - Indicates want of the form. + * @param { AsyncCallback } callback - The callback is used to return the form state. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function acquireFormState(want: Want, callback: AsyncCallback): void; + + /** + * Obtains the Form state. + *

You can use this method to obtains the form state.

+ * @permission ohos.permission.REQUIRE_FORM and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Want } want - Indicates want of the form. + * @returns { Promise } Returns the form state. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function acquireFormState(want: Want): Promise; + + /** + * Listens to the event of uninstall form. + *

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

+ * @param { string } type - Indicates event type. + * @param { Callback } callback - The callback of formUninstall. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function on(type: "formUninstall", callback: Callback): void; + + /** + * Cancels listening to the event of uninstall form. + *

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

+ * @param { string } type - Indicates event type. + * @param { Callback } callback - The callback of formUninstall. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function off(type: "formUninstall", callback?: Callback): void; + + /** + * notify form is Visible + *

You can use this method to notify form visible state.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isVisible - Indicates whether visible. + * @param { AsyncCallback } callback - The callback of notifyFormsVisible. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void; + + /** + * notify form is Visible + *

You can use this method to notify form visible state.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isVisible - Indicates whether visible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsVisible(formIds: Array, isVisible: boolean): Promise; + + /** + * notify form enable update state. + *

You can use this method to notify form enable update state.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isEnableUpdate - Indicates whether enable update. + * @param { AsyncCallback } callback - The callback of notifyFormsEnableUpdate. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void; + + /** + * notify form enable update state. + *

You can use this method to notify form enable update state.

+ * @permission ohos.permission.REQUIRE_FORM + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isEnableUpdate - Indicates whether enable update. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise; + + /** + * Share form by formId and deviceId. + * @permission ohos.permission.REQUIRE_FORM and ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } formId - Indicates the form ID. + * @param { string } deviceId - Indicates the remote device ID. + * @param { AsyncCallback } callback - The callback of shareForm. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + 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 diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts new file mode 100644 index 000000000..61096b377 --- /dev/null +++ b/api/@ohos.app.form.formProvider.d.ts @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import formBindingData from "./@ohos.app.form.formBindingData"; +import formInfo from "./@ohos.application.formInfo"; +import Want from "./@ohos.application.Want" + +/** + * interface of formProvider. + * @namespace formProvider + * @syscap SystemCapability.Ability.Form + * @since 9 + */ +declare namespace formProvider { + /** + * Set next update time for a specified form. + * @param { string } formId - Indicates the form ID. + * @param { number } minute - Indicates duration minute before next update. + * @param { AsyncCallback } callback - The callback of setFormNextRefreshTime. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback): void; + + /** + * Set next update time for a specified form. + * @param { string } formId - Indicates the form ID. + * @param { number } minute - Indicates duration minute before next update. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function setFormNextRefreshTime(formId: string, minute: number): Promise; + + /** + * Update a specified form. + * Client to communication with FormManagerService. + * @param { string } formId - Indicates the form ID. + * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data. + * @param { AsyncCallback } callback - The callback of updateForm. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; + + /** + * Update a specified form. + * Client to communication with FormManagerService. + * @param { string } formId - Indicates the form ID. + * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; + + /** + * Get infos of all forms belonging to current bundle. + * Client to communication with FormManagerService. + * @param { formInfo.FormInfoFilter } filter - Indicates the requirements the forms that the formInfos belong to have to meet. + * @param { AsyncCallback> } callback - The callback is used to return the formInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function getFormsInfo(filter: formInfo.FormInfoFilter, callback: AsyncCallback>): void; + + /** + * Get infos of all forms belonging to current bundle. + * Client to communication with FormManagerService. + * @param { AsyncCallback> } callback - The callback is used to return the formInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function getFormsInfo(callback: AsyncCallback>): void; + + /** + * Get infos of all forms belonging to current bundle. + * Client to communication with FormManagerService. + * @param { formInfo.FormInfoFilter } filter - Indicates the requirements the forms that the formInfos belong to have to meet. + * @returns { Promise> } Returns the formInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + function getFormsInfo(filter?: formInfo.FormInfoFilter): Promise>; + + /** + * Request to publish a form to the form host. + * @param { Want } want - The want of the form to publish. + * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data. + * @param { AsyncCallback } callback - The callback is used to return the form id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; + + /** + * Request to publish a form to the form host. + * @param { Want } want - The want of the form to publish. + * @param { AsyncCallback } callback - The callback is used to return the form id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function requestPublishForm(want: Want, callback: AsyncCallback): void; + + /** + * Request to publish a form to the form host. + * @param { Want } want - The want of the form to publish. + * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data. + * @returns { Promise } Returns the form id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise; + + /** + * Check if the request of publishing a form is supported by the host + * @param { AsyncCallback } callback - The callback is used to return true if the request is supported. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function isRequestPublishFormSupported(callback: AsyncCallback): void; + + /** + * Check if the request of publishing a form is supported by the host + * @returns { Promise } Returns true if the request is supported. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function isRequestPublishFormSupported(): Promise; +} +export default formProvider; \ No newline at end of file diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index c24bf532c..4c52a8387 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import formBindingData from './@ohos.application.formBindingData'; +import formBindingData from './@ohos.app.form.formBindingData'; import formInfo from "./@ohos.application.formInfo"; import FormExtensionContext from "./application/FormExtensionContext"; import Want from './@ohos.application.Want'; diff --git a/api/@ohos.application.formBindingData.d.ts b/api/@ohos.application.formBindingData.d.ts index f96124474..502fc6d5c 100644 --- a/api/@ohos.application.formBindingData.d.ts +++ b/api/@ohos.application.formBindingData.d.ts @@ -19,6 +19,8 @@ * @name formBindingData * @since 8 * @syscap SystemCapability.Ability.Form + * @deprecated since 9 + * @useinstead @ohos.app.form.formBindingData */ declare namespace formBindingData { /** diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts index c410a898e..127a9a8ef 100644 --- a/api/@ohos.application.formHost.d.ts +++ b/api/@ohos.application.formHost.d.ts @@ -25,6 +25,8 @@ import formInfo from './@ohos.application.formInfo' * @since 8 * @syscap SystemCapability.Ability.Form * @systemapi hide for inner use. + * @deprecated since 9 + * @useinstead @ohos.app.form.formHost */ declare namespace formHost { /** diff --git a/api/@ohos.application.formProvider.d.ts b/api/@ohos.application.formProvider.d.ts index 8cf49dc98..250323da7 100644 --- a/api/@ohos.application.formProvider.d.ts +++ b/api/@ohos.application.formProvider.d.ts @@ -24,6 +24,8 @@ import Want from './@ohos.application.Want'; * @name formProvider * @since 8 * @syscap SystemCapability.Ability.Form + * @deprecated since 9 + * @useinstead @ohos.app.form.formProvider */ declare namespace formProvider { /** diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts index 2f43e55ca..95952a3bb 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.d.ts @@ -15,28 +15,26 @@ import { AsyncCallback } from "../basic"; import ExtensionContext from "./ExtensionContext"; -import formBindingData from '../@ohos.application.formBindingData'; +import formBindingData from '../@ohos.app.form.formBindingData'; import Want from '../@ohos.application.Want'; /** * The context of form extension. It allows access to * formExtension-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.Form - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class FormExtensionContext extends ExtensionContext { /** * start an ability within the same bundle. - * - * @since 9 + * @param { Want } want - includes ability name, parameters and relative info sending to an ability. + * @param { AsyncCallback } callback - The callback of startAbility. + * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Ability.Form - * @systemapi hide for inner use - * @param want includes ability name, parameters and relative info sending to an ability. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; startAbility(want: Want): Promise;