1/* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit FormKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import formBindingData from './@ohos.application.formBindingData'; 23import formInfo from './@ohos.app.form.formInfo'; 24import Want from './@ohos.app.ability.Want'; 25 26/** 27 * interface of formProvider. 28 * 29 * @namespace formProvider 30 * @syscap SystemCapability.Ability.Form 31 * @since 8 32 * @deprecated since 9 33 * @useinstead ohos.app.form.formProvider/formProvider 34 */ 35declare namespace formProvider { 36 /** 37 * Set next update time for a specified form. 38 * 39 * @param { string } formId - Indicates the form ID. 40 * @param { number } minute - Indicates duration minute before next update. 41 * @param { AsyncCallback<void> } callback - Callback function. 42 * @syscap SystemCapability.Ability.Form 43 * @since 8 44 * @deprecated since 9 45 * @useinstead ohos.app.form.formProvider/formProvider#setFormNextRefreshTime 46 */ 47 function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback<void>): void; 48 49 /** 50 * Set next update time for a specified form. 51 * 52 * @param { string } formId - Indicates the form ID. 53 * @param { number } minute - Indicates duration minute before next update. 54 * @returns { Promise<void> } The promise returned by the function. 55 * @syscap SystemCapability.Ability.Form 56 * @since 8 57 * @deprecated since 9 58 * @useinstead ohos.app.form.formProvider/formProvider#setFormNextRefreshTime 59 */ 60 function setFormNextRefreshTime(formId: string, minute: number): Promise<void>; 61 62 /** 63 * Update a specified form. 64 * Client to communication with FormManagerService. 65 * 66 * @param { string } formId - Indicates the form ID 67 * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data 68 * @param { AsyncCallback<void> } callback - Callback function. 69 * @syscap SystemCapability.Ability.Form 70 * @since 8 71 * @deprecated since 9 72 * @useinstead ohos.app.form.formProvider/formProvider#updateForm 73 */ 74 function updateForm( 75 formId: string, 76 formBindingData: formBindingData.FormBindingData, 77 callback: AsyncCallback<void> 78 ): void; 79 80 /** 81 * Update a specified form. 82 * Client to communication with FormManagerService. 83 * 84 * @param { string } formId - Indicates the form ID 85 * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data 86 * @returns { Promise<void> } The promise returned by the function. 87 * @syscap SystemCapability.Ability.Form 88 * @since 8 89 * @deprecated since 9 90 * @useinstead ohos.app.form.formProvider/formProvider#updateForm 91 */ 92 function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise<void>; 93} 94export default formProvider; 95