diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts index e60df45a3d0fcaaaf85822510dc1b58c9deee93a..b312fc7c7295971bea72fa6850d47380f11f9d93 100644 --- a/api/@ohos.application.formHost.d.ts +++ b/api/@ohos.application.formHost.d.ts @@ -166,11 +166,13 @@ declare namespace formHost { * * @since 8 * @syscap SystemCapability.Ability.Form + * @param FormInfoType Indicates the form type (dynamic/static/all) the form infos belong to. * @return Returns the {@link FormInfo} * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ function getAllFormsInfo(callback: AsyncCallback>): void; - function getAllFormsInfo(): Promise>; + function getAllFormsInfo(FormInfoType: formInfo.FormInfoType, callback: AsyncCallback>): void; + function getAllFormsInfo(FormInfoType?: formInfo.FormInfoType): Promise>; /** * Obtains the FormInfo objects provided by a specified application on the device. @@ -185,6 +187,18 @@ declare namespace formHost { function getFormsInfo(bundleName: string, callback: AsyncCallback>): void; function getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void; function getFormsInfo(bundleName: string, moduleName?: string): Promise>; + /** + * Obtains the FormInfo objects provided by a specified application on the device. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param bundleName Indicates the bundle name of the application. + * @param filter Indicates the requirements the forms that the formInfos belong to have to meet. + * @return Returns the {@link FormInfo} + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getFormsInfo(bundleName: string, filter: formInfo.FormInfoFilter, callback: AsyncCallback>): void; + function getFormsInfo(bundleName: string, filter: formInfo.FormInfoFilter): void; /** * Deletes invalid forms of the application in the Form Manager Service based on the list of. diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts index b7b33bb4a21628392ee9da76ef7720b34ecd32e3..df0a1f82f1ab73bab894fafaa0ad98b1c0f4210b 100644 --- a/api/@ohos.application.formInfo.d.ts +++ b/api/@ohos.application.formInfo.d.ts @@ -386,5 +386,65 @@ declare namespace formInfo { */ TEMPORARY_KEY = "ohos.extra.param.key.form_temporary" } + + /** + * The type of Form the info belongs to. + * + * @name FormInfoType + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + enum FormInfoType { + /** + * form infos from static forms. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + STATIC = 0, + /** + * form infos from dynamic forms. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + DYNAMIC, + /** + * form infos from static and dynamic forms. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + ALL + } + + /** + * The optional options used as filters to ask + * getFormsInfo to return formInfos from only forms that match the options. + * + * @name FormInfoFilter + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + //TODO: + interface FormInfoFilter { + /** + * optional moduleName that used to ask getFormsInfo to return + * form infos with the same moduleName. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + moduleName?: string; + /** + * optional formInfoType that used to ask getFormsInfo to return + * form infos belong to the same form type. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + formInfoType?: formInfo.FormInfoType; + } } export default formInfo; \ No newline at end of file diff --git a/api/@ohos.application.formProvider.d.ts b/api/@ohos.application.formProvider.d.ts index 22390cf910c099f0861eaf6a0d8c44f94f74c08b..9423c87942532c56212f537285890f8af9771665 100644 --- a/api/@ohos.application.formProvider.d.ts +++ b/api/@ohos.application.formProvider.d.ts @@ -15,6 +15,7 @@ import { AsyncCallback } from "./basic"; import formBindingData from "./@ohos.application.formBindingData"; +import formInfo from "./@ohos.application.formInfo"; /** * interface of formProvider. @@ -50,5 +51,20 @@ declare namespace formProvider { function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; + + /** + * Get infos of all forms belonging to current bundle. + * + * Client to communication with FormManagerService. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param filter Indicates the requirements the forms that the formInfos belong to have to meet. + * @return Infos of all forms. + */ + function getFormsInfo(filter: formInfo.FormInfoFilter, callback: AsyncCallback>): void; + function getFormsInfo(callback: AsyncCallback>): void; + function getFormsInfo(filter?: formInfo.FormInfoFilter): Promise>; + } export default formProvider; \ No newline at end of file