161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit AbilityKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport type { UIContext } from './@ohos.arkui.UIContext';
2261847f8eSopenharmony_ciimport type * as _ViewData from './application/ViewData';
2361847f8eSopenharmony_ciimport type * as _PageNodeInfo from './application/PageNodeInfo';
2461847f8eSopenharmony_ciimport { AutoFillType } from './application/AutoFillType';
2561847f8eSopenharmony_ciimport type * as _AutoFillRequest from './application/AutoFillRequest';
2661847f8eSopenharmony_ciimport type * as _CustomData from './application/CustomData';
2761847f8eSopenharmony_ciimport type * as _AutoFillRect from './application/AutoFillRect';
2861847f8eSopenharmony_ciimport type * as _AutoFillPopupConfig from './application/AutoFillPopupConfig';
2961847f8eSopenharmony_ciimport { PopupPlacement } from './application/AutoFillPopupConfig';
3061847f8eSopenharmony_ci
3161847f8eSopenharmony_ci/**
3261847f8eSopenharmony_ci * This module provides the function of auto fill manager.
3361847f8eSopenharmony_ci *
3461847f8eSopenharmony_ci * @namespace autoFillManager
3561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
3661847f8eSopenharmony_ci * @stagemodelonly
3761847f8eSopenharmony_ci * @since 11
3861847f8eSopenharmony_ci */
3961847f8eSopenharmony_ci/**
4061847f8eSopenharmony_ci * This module provides the function of auto fill manager.
4161847f8eSopenharmony_ci *
4261847f8eSopenharmony_ci * @namespace autoFillManager
4361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
4461847f8eSopenharmony_ci * @stagemodelonly
4561847f8eSopenharmony_ci * @atomicservice
4661847f8eSopenharmony_ci * @since 12
4761847f8eSopenharmony_ci */
4861847f8eSopenharmony_cideclare namespace autoFillManager {
4961847f8eSopenharmony_ci  /**
5061847f8eSopenharmony_ci   * Auto save callback.
5161847f8eSopenharmony_ci   *
5261847f8eSopenharmony_ci   * @interface AutoSaveCallback
5361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
5461847f8eSopenharmony_ci   * @stagemodelonly
5561847f8eSopenharmony_ci   * @since 11
5661847f8eSopenharmony_ci   */
5761847f8eSopenharmony_ci  /**
5861847f8eSopenharmony_ci   * Auto save callback.
5961847f8eSopenharmony_ci   *
6061847f8eSopenharmony_ci   * @interface AutoSaveCallback
6161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
6261847f8eSopenharmony_ci   * @stagemodelonly
6361847f8eSopenharmony_ci   * @atomicservice
6461847f8eSopenharmony_ci   * @since 12
6561847f8eSopenharmony_ci   */
6661847f8eSopenharmony_ci  export interface AutoSaveCallback {
6761847f8eSopenharmony_ci    /**
6861847f8eSopenharmony_ci     * Called when auto save request is successfully handled.
6961847f8eSopenharmony_ci     *
7061847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
7161847f8eSopenharmony_ci     * @stagemodelonly
7261847f8eSopenharmony_ci     * @since 11
7361847f8eSopenharmony_ci     */
7461847f8eSopenharmony_ci    /**
7561847f8eSopenharmony_ci     * Called when auto save request is successfully handled.
7661847f8eSopenharmony_ci     *
7761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
7861847f8eSopenharmony_ci     * @stagemodelonly
7961847f8eSopenharmony_ci     * @atomicservice
8061847f8eSopenharmony_ci     * @since 12
8161847f8eSopenharmony_ci     */
8261847f8eSopenharmony_ci    onSuccess(): void;
8361847f8eSopenharmony_ci
8461847f8eSopenharmony_ci    /**
8561847f8eSopenharmony_ci     * Called when auto save request is failed to be handled.
8661847f8eSopenharmony_ci     *
8761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
8861847f8eSopenharmony_ci     * @stagemodelonly
8961847f8eSopenharmony_ci     * @since 11
9061847f8eSopenharmony_ci     */
9161847f8eSopenharmony_ci    /**
9261847f8eSopenharmony_ci     * Called when auto save request is failed to be handled.
9361847f8eSopenharmony_ci     *
9461847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
9561847f8eSopenharmony_ci     * @stagemodelonly
9661847f8eSopenharmony_ci     * @atomicservice
9761847f8eSopenharmony_ci     * @since 12
9861847f8eSopenharmony_ci     */
9961847f8eSopenharmony_ci    onFailure(): void;
10061847f8eSopenharmony_ci  }
10161847f8eSopenharmony_ci
10261847f8eSopenharmony_ci  /**
10361847f8eSopenharmony_ci   * Trigger an auto save request.
10461847f8eSopenharmony_ci   *
10561847f8eSopenharmony_ci   * @param { UIContext } context - Indicates the ui context where the save operation will be performed.
10661847f8eSopenharmony_ci   * @param { AutoSaveCallback } [callback] - Indicates the callback that used to receive the result.
10761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Get instance id failed;
10861847f8eSopenharmony_ci   * <br>2. Parse instance id failed; 3. The second parameter is not of type callback.
10961847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
11061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
11161847f8eSopenharmony_ci   * @stagemodelonly
11261847f8eSopenharmony_ci   * @since 11
11361847f8eSopenharmony_ci   */
11461847f8eSopenharmony_ci  /**
11561847f8eSopenharmony_ci   * Trigger an auto save request.
11661847f8eSopenharmony_ci   *
11761847f8eSopenharmony_ci   * @param { UIContext } context - Indicates the ui context where the save operation will be performed.
11861847f8eSopenharmony_ci   * @param { AutoSaveCallback } [callback] - Indicates the callback that used to receive the result.
11961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Get instance id failed;
12061847f8eSopenharmony_ci   * <br>2. Parse instance id failed; 3. The second parameter is not of type callback.
12161847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
12261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
12361847f8eSopenharmony_ci   * @stagemodelonly
12461847f8eSopenharmony_ci   * @atomicservice
12561847f8eSopenharmony_ci   * @since 12
12661847f8eSopenharmony_ci   */
12761847f8eSopenharmony_ci  export function requestAutoSave(context: UIContext, callback?: AutoSaveCallback): void;
12861847f8eSopenharmony_ci
12961847f8eSopenharmony_ci  /**
13061847f8eSopenharmony_ci   * The interface of view data.
13161847f8eSopenharmony_ci   *
13261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
13361847f8eSopenharmony_ci   * @systemapi
13461847f8eSopenharmony_ci   * @stagemodelonly
13561847f8eSopenharmony_ci   * @since 11
13661847f8eSopenharmony_ci   */
13761847f8eSopenharmony_ci  /**
13861847f8eSopenharmony_ci   * The interface of view data.
13961847f8eSopenharmony_ci   *
14061847f8eSopenharmony_ci   * @typedef { _ViewData.default } ViewData
14161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
14261847f8eSopenharmony_ci   * @systemapi
14361847f8eSopenharmony_ci   * @stagemodelonly
14461847f8eSopenharmony_ci   * @since 12
14561847f8eSopenharmony_ci   */
14661847f8eSopenharmony_ci  export type ViewData = _ViewData.default;
14761847f8eSopenharmony_ci
14861847f8eSopenharmony_ci  /**
14961847f8eSopenharmony_ci   * The interface of page node info.
15061847f8eSopenharmony_ci   *
15161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
15261847f8eSopenharmony_ci   * @systemapi
15361847f8eSopenharmony_ci   * @stagemodelonly
15461847f8eSopenharmony_ci   * @since 11
15561847f8eSopenharmony_ci   */
15661847f8eSopenharmony_ci  /**
15761847f8eSopenharmony_ci   * The interface of page node info.
15861847f8eSopenharmony_ci   *
15961847f8eSopenharmony_ci   * @typedef { _PageNodeInfo.default } PageNodeInfo
16061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
16161847f8eSopenharmony_ci   * @systemapi
16261847f8eSopenharmony_ci   * @stagemodelonly
16361847f8eSopenharmony_ci   * @since 12
16461847f8eSopenharmony_ci   */
16561847f8eSopenharmony_ci  export type PageNodeInfo = _PageNodeInfo.default;
16661847f8eSopenharmony_ci
16761847f8eSopenharmony_ci  /**
16861847f8eSopenharmony_ci   * The enum of auto fill type.
16961847f8eSopenharmony_ci   *
17061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
17161847f8eSopenharmony_ci   * @systemapi
17261847f8eSopenharmony_ci   * @stagemodelonly
17361847f8eSopenharmony_ci   * @since 11
17461847f8eSopenharmony_ci   */
17561847f8eSopenharmony_ci  /**
17661847f8eSopenharmony_ci   * The enum of auto fill type.
17761847f8eSopenharmony_ci   *
17861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
17961847f8eSopenharmony_ci   * @systemapi
18061847f8eSopenharmony_ci   * @stagemodelonly
18161847f8eSopenharmony_ci   * @since 12
18261847f8eSopenharmony_ci   */
18361847f8eSopenharmony_ci  export { AutoFillType };
18461847f8eSopenharmony_ci
18561847f8eSopenharmony_ci  /**
18661847f8eSopenharmony_ci   * The interface of fill request.
18761847f8eSopenharmony_ci   *
18861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
18961847f8eSopenharmony_ci   * @systemapi
19061847f8eSopenharmony_ci   * @stagemodelonly
19161847f8eSopenharmony_ci   * @since 11
19261847f8eSopenharmony_ci   */
19361847f8eSopenharmony_ci  /**
19461847f8eSopenharmony_ci   * The interface of fill request.
19561847f8eSopenharmony_ci   *
19661847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.FillRequest } FillRequest
19761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
19861847f8eSopenharmony_ci   * @systemapi
19961847f8eSopenharmony_ci   * @stagemodelonly
20061847f8eSopenharmony_ci   * @since 12
20161847f8eSopenharmony_ci   */
20261847f8eSopenharmony_ci  export type FillRequest = _AutoFillRequest.FillRequest;
20361847f8eSopenharmony_ci
20461847f8eSopenharmony_ci  /**
20561847f8eSopenharmony_ci   * The interface of save request.
20661847f8eSopenharmony_ci   *
20761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
20861847f8eSopenharmony_ci   * @systemapi
20961847f8eSopenharmony_ci   * @stagemodelonly
21061847f8eSopenharmony_ci   * @since 11
21161847f8eSopenharmony_ci   */
21261847f8eSopenharmony_ci  /**
21361847f8eSopenharmony_ci   * The interface of save request.
21461847f8eSopenharmony_ci   *
21561847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.SaveRequest } SaveRequest
21661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
21761847f8eSopenharmony_ci   * @systemapi
21861847f8eSopenharmony_ci   * @stagemodelonly
21961847f8eSopenharmony_ci   * @since 12
22061847f8eSopenharmony_ci   */
22161847f8eSopenharmony_ci  export type SaveRequest = _AutoFillRequest.SaveRequest;
22261847f8eSopenharmony_ci
22361847f8eSopenharmony_ci  /**
22461847f8eSopenharmony_ci   * The interface of update request.
22561847f8eSopenharmony_ci   *
22661847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.UpdateRequest } UpdateRequest
22761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
22861847f8eSopenharmony_ci   * @systemapi
22961847f8eSopenharmony_ci   * @stagemodelonly
23061847f8eSopenharmony_ci   * @since 12
23161847f8eSopenharmony_ci   */
23261847f8eSopenharmony_ci  export type UpdateRequest = _AutoFillRequest.UpdateRequest;
23361847f8eSopenharmony_ci
23461847f8eSopenharmony_ci  /**
23561847f8eSopenharmony_ci   * The interface of fill response.
23661847f8eSopenharmony_ci   *
23761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
23861847f8eSopenharmony_ci   * @systemapi
23961847f8eSopenharmony_ci   * @stagemodelonly
24061847f8eSopenharmony_ci   * @since 11
24161847f8eSopenharmony_ci   */
24261847f8eSopenharmony_ci  /**
24361847f8eSopenharmony_ci   * The interface of fill response.
24461847f8eSopenharmony_ci   *
24561847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.FillResponse } FillResponse
24661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
24761847f8eSopenharmony_ci   * @systemapi
24861847f8eSopenharmony_ci   * @stagemodelonly
24961847f8eSopenharmony_ci   * @since 12
25061847f8eSopenharmony_ci   */
25161847f8eSopenharmony_ci  export type FillResponse = _AutoFillRequest.FillResponse;
25261847f8eSopenharmony_ci
25361847f8eSopenharmony_ci  /**
25461847f8eSopenharmony_ci   * The interface of fill request callback.
25561847f8eSopenharmony_ci   *
25661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
25761847f8eSopenharmony_ci   * @systemapi
25861847f8eSopenharmony_ci   * @stagemodelonly
25961847f8eSopenharmony_ci   * @since 11
26061847f8eSopenharmony_ci   */
26161847f8eSopenharmony_ci  /**
26261847f8eSopenharmony_ci   * The interface of fill request callback.
26361847f8eSopenharmony_ci   *
26461847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.FillRequestCallback } FillRequestCallback
26561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
26661847f8eSopenharmony_ci   * @systemapi
26761847f8eSopenharmony_ci   * @stagemodelonly
26861847f8eSopenharmony_ci   * @since 12
26961847f8eSopenharmony_ci   */
27061847f8eSopenharmony_ci  export type FillRequestCallback = _AutoFillRequest.FillRequestCallback;
27161847f8eSopenharmony_ci
27261847f8eSopenharmony_ci  /**
27361847f8eSopenharmony_ci   * The interface of save request callback.
27461847f8eSopenharmony_ci   *
27561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
27661847f8eSopenharmony_ci   * @systemapi
27761847f8eSopenharmony_ci   * @stagemodelonly
27861847f8eSopenharmony_ci   * @since 11
27961847f8eSopenharmony_ci   */
28061847f8eSopenharmony_ci  /**
28161847f8eSopenharmony_ci   * The interface of save request callback.
28261847f8eSopenharmony_ci   *
28361847f8eSopenharmony_ci   * @typedef { _AutoFillRequest.SaveRequestCallback } SaveRequestCallback
28461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
28561847f8eSopenharmony_ci   * @systemapi
28661847f8eSopenharmony_ci   * @stagemodelonly
28761847f8eSopenharmony_ci   * @since 12
28861847f8eSopenharmony_ci   */
28961847f8eSopenharmony_ci  export type SaveRequestCallback = _AutoFillRequest.SaveRequestCallback;
29061847f8eSopenharmony_ci
29161847f8eSopenharmony_ci  /**
29261847f8eSopenharmony_ci   * The custom data.
29361847f8eSopenharmony_ci   *
29461847f8eSopenharmony_ci   * @typedef { _CustomData.default } CustomData
29561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
29661847f8eSopenharmony_ci   * @systemapi
29761847f8eSopenharmony_ci   * @stagemodelonly
29861847f8eSopenharmony_ci   * @since 13
29961847f8eSopenharmony_ci   */
30061847f8eSopenharmony_ci  export type CustomData = _CustomData.default;
30161847f8eSopenharmony_ci
30261847f8eSopenharmony_ci  /**
30361847f8eSopenharmony_ci   * Auto fill rectangle.
30461847f8eSopenharmony_ci   *
30561847f8eSopenharmony_ci   * @typedef { _AutoFillRect.default } AutoFillRect
30661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
30761847f8eSopenharmony_ci   * @systemapi
30861847f8eSopenharmony_ci   * @stagemodelonly
30961847f8eSopenharmony_ci   * @since 12
31061847f8eSopenharmony_ci   */
31161847f8eSopenharmony_ci  export type AutoFillRect = _AutoFillRect.default;
31261847f8eSopenharmony_ci
31361847f8eSopenharmony_ci  /**
31461847f8eSopenharmony_ci   * The auto fill popup config.
31561847f8eSopenharmony_ci   *
31661847f8eSopenharmony_ci   * @typedef { _AutoFillPopupConfig.default } AutoFillPopupConfig
31761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
31861847f8eSopenharmony_ci   * @systemapi
31961847f8eSopenharmony_ci   * @stagemodelonly
32061847f8eSopenharmony_ci   * @since 12
32161847f8eSopenharmony_ci   */
32261847f8eSopenharmony_ci  export type AutoFillPopupConfig = _AutoFillPopupConfig.default;
32361847f8eSopenharmony_ci
32461847f8eSopenharmony_ci  /**
32561847f8eSopenharmony_ci   * The popup size of auto fill popup config.
32661847f8eSopenharmony_ci   *
32761847f8eSopenharmony_ci   * @typedef { _AutoFillPopupConfig.PopupSize } PopupSize
32861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
32961847f8eSopenharmony_ci   * @systemapi
33061847f8eSopenharmony_ci   * @stagemodelonly
33161847f8eSopenharmony_ci   * @since 12
33261847f8eSopenharmony_ci   */
33361847f8eSopenharmony_ci  export type PopupSize = _AutoFillPopupConfig.PopupSize;
33461847f8eSopenharmony_ci
33561847f8eSopenharmony_ci  /**
33661847f8eSopenharmony_ci   * The popup placement of auto fill popup config.
33761847f8eSopenharmony_ci   *
33861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
33961847f8eSopenharmony_ci   * @systemapi
34061847f8eSopenharmony_ci   * @stagemodelonly
34161847f8eSopenharmony_ci   * @since 12
34261847f8eSopenharmony_ci   */
34361847f8eSopenharmony_ci  export { PopupPlacement };
34461847f8eSopenharmony_ci}
34561847f8eSopenharmony_ci
34661847f8eSopenharmony_ciexport default autoFillManager;
347