• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16import { AsyncCallback } from './@ohos.base';
17import formBindingData from './@ohos.application.formBindingData';
18import formInfo from './@ohos.app.form.formInfo';
19import Want from './@ohos.app.ability.Want';
20
21/**
22 * interface of formProvider.
23 *
24 * @namespace formProvider
25 * @syscap SystemCapability.Ability.Form
26 * @since 8
27 * @deprecated since 9
28 * @useinstead ohos.app.form.formProvider/formProvider
29 */
30declare namespace formProvider {
31  /**
32   * Set next update time for a specified form.
33   *
34   * @param { string } formId - Indicates the form ID.
35   * @param { number } minute - Indicates duration minute before next update.
36   * @param { AsyncCallback<void> } callback - Callback function.
37   * @syscap SystemCapability.Ability.Form
38   * @since 8
39   * @deprecated since 9
40   * @useinstead ohos.app.form.formProvider/formProvider#setFormNextRefreshTime
41   */
42  function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback<void>): void;
43
44  /**
45   * Set next update time for a specified form.
46   *
47   * @param { string } formId - Indicates the form ID.
48   * @param { number } minute - Indicates duration minute before next update.
49   * @returns { Promise<void> } The promise returned by the function.
50   * @syscap SystemCapability.Ability.Form
51   * @since 8
52   * @deprecated since 9
53   * @useinstead ohos.app.form.formProvider/formProvider#setFormNextRefreshTime
54   */
55  function setFormNextRefreshTime(formId: string, minute: number): Promise<void>;
56
57  /**
58   * Update a specified form.
59   * Client to communication with FormManagerService.
60   *
61   * @param { string } formId - Indicates the form ID
62   * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data
63   * @param { AsyncCallback<void> } callback - Callback function.
64   * @syscap SystemCapability.Ability.Form
65   * @since 8
66   * @deprecated since 9
67   * @useinstead ohos.app.form.formProvider/formProvider#updateForm
68   */
69  function updateForm(
70    formId: string,
71    formBindingData: formBindingData.FormBindingData,
72    callback: AsyncCallback<void>
73  ): void;
74
75  /**
76   * Update a specified form.
77   * Client to communication with FormManagerService.
78   *
79   * @param { string } formId - Indicates the form ID
80   * @param { formBindingData.FormBindingData } formBindingData - Indicates the form data
81   * @returns { Promise<void> } The promise returned by the function.
82   * @syscap SystemCapability.Ability.Form
83   * @since 8
84   * @deprecated since 9
85   * @useinstead ohos.app.form.formProvider/formProvider#updateForm
86   */
87  function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise<void>;
88}
89export default formProvider;
90