• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 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 AbilityKit
19 */
20
21import type { UIContext } from './@ohos.arkui.UIContext';
22import type * as _ViewData from './application/ViewData';
23import type * as _PageNodeInfo from './application/PageNodeInfo';
24import { AutoFillType } from './application/AutoFillType';
25import type * as _AutoFillRequest from './application/AutoFillRequest';
26import type * as _CustomData from './application/CustomData';
27import type * as _AutoFillRect from './application/AutoFillRect';
28import type * as _AutoFillPopupConfig from './application/AutoFillPopupConfig';
29import { PopupPlacement } from './application/AutoFillPopupConfig';
30
31/**
32 * This module provides the function of auto fill manager.
33 *
34 * @namespace autoFillManager
35 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
36 * @stagemodelonly
37 * @since 11
38 */
39/**
40 * This module provides the function of auto fill manager.
41 *
42 * @namespace autoFillManager
43 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
44 * @stagemodelonly
45 * @atomicservice
46 * @since 12
47 */
48declare namespace autoFillManager {
49  /**
50   * Auto save callback.
51   *
52   * @interface AutoSaveCallback
53   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
54   * @stagemodelonly
55   * @since 11
56   */
57  /**
58   * Auto save callback.
59   *
60   * @interface AutoSaveCallback
61   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
62   * @stagemodelonly
63   * @atomicservice
64   * @since 12
65   */
66  export interface AutoSaveCallback {
67    /**
68     * Called when auto save request is successfully handled.
69     *
70     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
71     * @stagemodelonly
72     * @since 11
73     */
74    /**
75     * Called when auto save request is successfully handled.
76     *
77     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
78     * @stagemodelonly
79     * @atomicservice
80     * @since 12
81     */
82    onSuccess(): void;
83
84    /**
85     * Called when auto save request is failed to be handled.
86     *
87     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
88     * @stagemodelonly
89     * @since 11
90     */
91    /**
92     * Called when auto save request is failed to be handled.
93     *
94     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
95     * @stagemodelonly
96     * @atomicservice
97     * @since 12
98     */
99    onFailure(): void;
100  }
101
102  /**
103   * Trigger an auto save request.
104   *
105   * @param { UIContext } context - Indicates the ui context where the save operation will be performed.
106   * @param { AutoSaveCallback } [callback] - Indicates the callback that used to receive the result.
107   * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Get instance id failed;
108   * <br>2. Parse instance id failed; 3. The second parameter is not of type callback.
109   * @throws { BusinessError } 16000050 - Internal error.
110   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
111   * @stagemodelonly
112   * @since 11
113   */
114  /**
115   * Trigger an auto save request.
116   *
117   * @param { UIContext } context - Indicates the ui context where the save operation will be performed.
118   * @param { AutoSaveCallback } [callback] - Indicates the callback that used to receive the result.
119   * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Get instance id failed;
120   * <br>2. Parse instance id failed; 3. The second parameter is not of type callback.
121   * @throws { BusinessError } 16000050 - Internal error.
122   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
123   * @stagemodelonly
124   * @atomicservice
125   * @since 12
126   */
127  export function requestAutoSave(context: UIContext, callback?: AutoSaveCallback): void;
128
129  /**
130   * The interface of view data.
131   *
132   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
133   * @systemapi
134   * @stagemodelonly
135   * @since 11
136   */
137  /**
138   * The interface of view data.
139   *
140   * @typedef { _ViewData.default } ViewData
141   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
142   * @systemapi
143   * @stagemodelonly
144   * @since 12
145   */
146  export type ViewData = _ViewData.default;
147
148  /**
149   * The interface of page node info.
150   *
151   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
152   * @systemapi
153   * @stagemodelonly
154   * @since 11
155   */
156  /**
157   * The interface of page node info.
158   *
159   * @typedef { _PageNodeInfo.default } PageNodeInfo
160   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
161   * @systemapi
162   * @stagemodelonly
163   * @since 12
164   */
165  export type PageNodeInfo = _PageNodeInfo.default;
166
167  /**
168   * The enum of auto fill type.
169   *
170   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
171   * @systemapi
172   * @stagemodelonly
173   * @since 11
174   */
175  /**
176   * The enum of auto fill type.
177   *
178   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
179   * @systemapi
180   * @stagemodelonly
181   * @since 12
182   */
183  export { AutoFillType };
184
185  /**
186   * The interface of fill request.
187   *
188   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
189   * @systemapi
190   * @stagemodelonly
191   * @since 11
192   */
193  /**
194   * The interface of fill request.
195   *
196   * @typedef { _AutoFillRequest.FillRequest } FillRequest
197   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
198   * @systemapi
199   * @stagemodelonly
200   * @since 12
201   */
202  export type FillRequest = _AutoFillRequest.FillRequest;
203
204  /**
205   * The interface of save request.
206   *
207   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
208   * @systemapi
209   * @stagemodelonly
210   * @since 11
211   */
212  /**
213   * The interface of save request.
214   *
215   * @typedef { _AutoFillRequest.SaveRequest } SaveRequest
216   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
217   * @systemapi
218   * @stagemodelonly
219   * @since 12
220   */
221  export type SaveRequest = _AutoFillRequest.SaveRequest;
222
223  /**
224   * The interface of update request.
225   *
226   * @typedef { _AutoFillRequest.UpdateRequest } UpdateRequest
227   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
228   * @systemapi
229   * @stagemodelonly
230   * @since 12
231   */
232  export type UpdateRequest = _AutoFillRequest.UpdateRequest;
233
234  /**
235   * The interface of fill response.
236   *
237   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
238   * @systemapi
239   * @stagemodelonly
240   * @since 11
241   */
242  /**
243   * The interface of fill response.
244   *
245   * @typedef { _AutoFillRequest.FillResponse } FillResponse
246   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
247   * @systemapi
248   * @stagemodelonly
249   * @since 12
250   */
251  export type FillResponse = _AutoFillRequest.FillResponse;
252
253  /**
254   * The interface of fill request callback.
255   *
256   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
257   * @systemapi
258   * @stagemodelonly
259   * @since 11
260   */
261  /**
262   * The interface of fill request callback.
263   *
264   * @typedef { _AutoFillRequest.FillRequestCallback } FillRequestCallback
265   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
266   * @systemapi
267   * @stagemodelonly
268   * @since 12
269   */
270  export type FillRequestCallback = _AutoFillRequest.FillRequestCallback;
271
272  /**
273   * The interface of save request callback.
274   *
275   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
276   * @systemapi
277   * @stagemodelonly
278   * @since 11
279   */
280  /**
281   * The interface of save request callback.
282   *
283   * @typedef { _AutoFillRequest.SaveRequestCallback } SaveRequestCallback
284   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
285   * @systemapi
286   * @stagemodelonly
287   * @since 12
288   */
289  export type SaveRequestCallback = _AutoFillRequest.SaveRequestCallback;
290
291  /**
292   * The custom data.
293   *
294   * @typedef { _CustomData.default } CustomData
295   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
296   * @systemapi
297   * @stagemodelonly
298   * @since 13
299   */
300  export type CustomData = _CustomData.default;
301
302  /**
303   * Auto fill rectangle.
304   *
305   * @typedef { _AutoFillRect.default } AutoFillRect
306   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
307   * @systemapi
308   * @stagemodelonly
309   * @since 12
310   */
311  export type AutoFillRect = _AutoFillRect.default;
312
313  /**
314   * The auto fill popup config.
315   *
316   * @typedef { _AutoFillPopupConfig.default } AutoFillPopupConfig
317   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
318   * @systemapi
319   * @stagemodelonly
320   * @since 12
321   */
322  export type AutoFillPopupConfig = _AutoFillPopupConfig.default;
323
324  /**
325   * The popup size of auto fill popup config.
326   *
327   * @typedef { _AutoFillPopupConfig.PopupSize } PopupSize
328   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
329   * @systemapi
330   * @stagemodelonly
331   * @since 12
332   */
333  export type PopupSize = _AutoFillPopupConfig.PopupSize;
334
335  /**
336   * The popup placement of auto fill popup config.
337   *
338   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
339   * @systemapi
340   * @stagemodelonly
341   * @since 12
342   */
343  export { PopupPlacement };
344}
345
346export default autoFillManager;
347