/* * Copyright (c) 2022-2023 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. */ /** * @file * @kit FormKit */ import { AsyncCallback } from './@ohos.base'; import { Callback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import formInfo from './@ohos.app.form.formInfo'; /** * Interface of formHost. * * @namespace formHost * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ declare namespace formHost { /** * Add a form. *

You can use this method to create a theme form.

* * @permission ohos.permission.REQUIRE_FORM * @param { Want } want - Indicates want of the form. * @returns { Promise } Return the form info. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 12 */ function addForm(want: Want): Promise; /** * 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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function requestForm(formId: string): 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 { Record } [wantParams] - Indicates want params of the form to update. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 12 */ function requestFormWithParams(formId: string, wantParams?: Record): 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 castToNormalForm. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501002 - The number of forms exceeds the maximum allowed. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function castToNormalForm(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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501002 - The number of forms exceeds the maximum allowed. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function castToNormalForm(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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function enableFormsUpdate(formIds: Array): Promise; /** * Notify 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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function disableFormsUpdate(formIds: Array, callback: AsyncCallback): void; /** * Notify 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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @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 } 202 - The application is not a system application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function getFormsInfo(bundleName: string, moduleName?: string): Promise>; /** * Obtains the FormInfo objects provided by all application with filter on the device. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { formInfo.FormInfoFilter } filter - Indicates the requirements the forms that the formInfos belong to have to meet. * @returns { Promise> } Returns the FormInfo. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @since 12 */ function getFormsInfo(filter: formInfo.FormInfoFilter): 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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @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 { 'formUninstall' } type - Indicates event type. * @param { Callback } callback - The callback of formUninstall. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @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 { 'formUninstall' } type - Indicates event type. * @param { Callback } [callback] - The callback of formUninstall. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function off(type: 'formUninstall', callback?: Callback): void; /** * Listens to the event of form's overflow. *

You can use this method to listen to the event of form's overflow.

* * @param { 'formOverflow' } type - Indicates event type. * @param { Callback } callback - The callback of formOverflow. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function on(type: 'formOverflow', callback: Callback): void; /** * Cancels listening to the event of form's overflow. *

You can use this method to cancel listening to the event of form's overflow.

* * @param { 'formOverflow' } type - Indicates event type. * @param { Callback } callback - The callback of formOverflow. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function off(type: 'formOverflow', callback?: Callback): void; /** * Listens to the event of change scene animation state. *

You can use this method to listen to the event of change scene animation state.

* * @param { 'changeSceneAnimationState' } type - Indicates event type. * @param { Callback } callback - The callback of * change scene animation state. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function on(type: 'changeSceneAnimationState', callback: Callback): void; /** * Cancels listening to the event of change scene animation state. *

You can use this method to cancel listening to the event of change scene animation state.

* * @param { 'changeSceneAnimationState' } type - Indicates event type. * @param { Callback } callback - The callback of * change scene animation state. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ 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. * @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. * @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.

* * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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 } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @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. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function shareForm(formId: string, deviceId: string, callback: AsyncCallback): void; /** * 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. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function shareForm(formId: string, deviceId: string): Promise; /** * Notify form that privacy whether to be protected. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the specified form id. * @param { boolean } isProtected - Indicates whether to be protected. * @param { AsyncCallback } callback - The callback of notifyFormsPrivacyProtected. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function notifyFormsPrivacyProtected( formIds: Array, isProtected: boolean, callback: AsyncCallback ): void; /** * Notify form that privacy whether to be protected. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the specified form id. * @param { boolean } isProtected - Indicates whether to be protected. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise; /** * Acquire form data by formId. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form ID. * @param { AsyncCallback<{ [key: string]: Object }> } callback - The callback of acquireFormData. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - An IPC connection error happened. * @throws { BusinessError } 16500060 - A service connection error happened, please try again later. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * invalid input parameter during form operation * @syscap SystemCapability.Ability.Form * @systemapi * @StageModelOnly * @since 10 */ /** * Acquire form data by formId. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form ID. * @param { AsyncCallback> } callback - The callback of acquireFormData. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * invalid input parameter during form operation * @syscap SystemCapability.Ability.Form * @systemapi * @StageModelOnly * @since 11 */ function acquireFormData(formId: string, callback: AsyncCallback>): void; /** * Acquire form data by formId. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form ID. * @returns { Promise<{ [key: string]: Object }> } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - An IPC connection error happened. * @throws { BusinessError } 16500060 - A service connection error happened, please try again later. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * invalid input parameter during form operation * @syscap SystemCapability.Ability.Form * @systemapi * @StageModelOnly * @since 10 */ /** * Acquire form data by formId. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form ID. * @returns { Promise> } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. * @throws { BusinessError } 16501000 - An internal functional error occurred. * invalid input parameter during form operation * @syscap SystemCapability.Ability.Form * @systemapi * @StageModelOnly * @since 11 */ function acquireFormData(formId: string): Promise>; /** * Notify the form framework to set a router proxy for the specified cards. *

Once a card sets up a router proxy, the form framework will no longer invoke its onRouter callback, * and FMS will not trigger the actual jump.

* * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the IDs of the forms that requires setting up a router proxy. * @param { Callback } proxy - Indicates the router proxy to be set up. * @param { AsyncCallback } callback - The callback of setRouterProxy. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 11 */ function setRouterProxy(formIds: Array, proxy: Callback, callback: AsyncCallback): void; /** * Notify the form framework to set a router proxy for the specified cards. *

Once a card sets up a router proxy, the form framework will no longer invoke its onRouter callback, * and FMS will not trigger the actual jump.

* * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the IDs of the forms that requires setting up a router proxy. * @param { Callback } proxy - Indicates the router proxy to be set up. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 11 */ function setRouterProxy(formIds: Array, proxy: Callback): Promise; /** * Notify the form framework to clear the router proxy set for the specified cards. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the IDs of the forms that requires clearing of router proxy. * @param { AsyncCallback } callback - The callback of clearRouterProxy. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 11 */ function clearRouterProxy(formIds: Array, callback: AsyncCallback): void; /** * Notify the form framework to clear the router proxy set for the specified cards. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the IDs of the forms that requires clearing of router proxy. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 11 */ function clearRouterProxy(formIds: Array): Promise; /** * Set result of publish form. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form id. * @param { formInfo.PublishFormResult } result - The result of publish form. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 12 */ function setPublishFormResult(formId: string, result: formInfo.PublishFormResult): void; /** * Set permanent dynamic ArkTS forms recyclable, they will be recycled when memory is low. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the form id list of permanent dynamic ArkTS forms. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 11 */ function setFormsRecyclable(formIds: Array): Promise; /** * Set permanent dynamic ArkTS forms recyclable, they will be recycled when memory is low. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the form id list of permanent dynamic ArkTS forms. * @param { AsyncCallback } callback - The callback of setFormsRecyclable. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 11 */ function setFormsRecyclable(formIds: Array, callback: AsyncCallback): void; /** * Recycle permanent dynamic ArkTS forms. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the IDs of the forms to be recycled. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - The application is not a system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 12 */ function recycleForms(formIds: Array): Promise; /** * Recover recycled permanent dynamic ArkTS forms. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the form id list of recycled permanent dynamic ArkTS forms. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 11 */ function recoverForms(formIds: Array): Promise; /** * Recover recycled permanent dynamic ArkTS forms. * * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the form id list of recycled permanent dynamic ArkTS forms. * @param { AsyncCallback } callback - The callback of recoverForms. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 11 */ function recoverForms(formIds: Array, callback: AsyncCallback): void; /** * Update location of the form. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form id. * @param { formInfo.FormLocation } location - The location of the form. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16500050 - IPC connection error. * @throws { BusinessError } 16500060 - Service connection error. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @systemapi * @stagemodelonly * @since 12 */ function updateFormLocation(formId: string, location: formInfo.FormLocation): void; /** * Listens to the event of get live form status. * * @param { 'getLiveFormStatus' } type - Indicates event type. * @param { formInfo.GetLiveFormStatusCallback } callback - The callback of get live form status. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function on(type: 'getLiveFormStatus', callback: formInfo.GetLiveFormStatusCallback): void; /** * Cancels Listening to the event of get live form status. * * @param { 'getLiveFormStatus' } type - Indicates event type. * @param { formInfo.GetLiveFormStatusCallback } [callback] - The callback of get live form status. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function off(type: 'getLiveFormStatus', callback?: formInfo.GetLiveFormStatusCallback): void; /** * Update size of the form. * * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the form id. * @param { formInfo.FormDimension } newDimension - The new dimension of the form. * @param { formInfo.Rect } newRect - The new size of the form. * @throws { BusinessError } 201 - Permissions denied. * @throws { BusinessError } 202 - caller is not system app. * @throws { BusinessError } 16501000 - An internal functional error occurred. * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501012 - The dimension parameter is incorrect * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ function updateFormSize(formId: string, newDimension: formInfo.FormDimension, newRect: formInfo.Rect): void; } export default formHost;