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 { AutoFillType } from './AutoFillType';
2261847f8eSopenharmony_ciimport type CustomData from './CustomData';
2361847f8eSopenharmony_ciimport type AutoFillPopupConfig from './AutoFillPopupConfig';
2461847f8eSopenharmony_ciimport type ViewData from './ViewData';
2561847f8eSopenharmony_ci
2661847f8eSopenharmony_ci/**
2761847f8eSopenharmony_ci * Fill request for automatic filling.
2861847f8eSopenharmony_ci *
2961847f8eSopenharmony_ci * @interface FillRequest
3061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
3161847f8eSopenharmony_ci * @systemapi
3261847f8eSopenharmony_ci * @stagemodelonly
3361847f8eSopenharmony_ci * @since 11
3461847f8eSopenharmony_ci */
3561847f8eSopenharmony_ciexport interface FillRequest {
3661847f8eSopenharmony_ci  /**
3761847f8eSopenharmony_ci   * The auto fill type.
3861847f8eSopenharmony_ci   *
3961847f8eSopenharmony_ci   * @type { AutoFillType }
4061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
4161847f8eSopenharmony_ci   * @systemapi
4261847f8eSopenharmony_ci   * @stagemodelonly
4361847f8eSopenharmony_ci   * @since 11
4461847f8eSopenharmony_ci   */
4561847f8eSopenharmony_ci  type: AutoFillType;
4661847f8eSopenharmony_ci
4761847f8eSopenharmony_ci  /**
4861847f8eSopenharmony_ci   * The view data. Indicates the basic page information for the fill request.
4961847f8eSopenharmony_ci   *
5061847f8eSopenharmony_ci   * @type { ViewData }
5161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
5261847f8eSopenharmony_ci   * @systemapi
5361847f8eSopenharmony_ci   * @stagemodelonly
5461847f8eSopenharmony_ci   * @since 11
5561847f8eSopenharmony_ci   */
5661847f8eSopenharmony_ci  viewData: ViewData;
5761847f8eSopenharmony_ci
5861847f8eSopenharmony_ci  /**
5961847f8eSopenharmony_ci   * The custom data.
6061847f8eSopenharmony_ci   *
6161847f8eSopenharmony_ci   * @type { CustomData }
6261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
6361847f8eSopenharmony_ci   * @systemapi
6461847f8eSopenharmony_ci   * @stagemodelonly
6561847f8eSopenharmony_ci   * @since 13
6661847f8eSopenharmony_ci   */
6761847f8eSopenharmony_ci  customData: CustomData;
6861847f8eSopenharmony_ci
6961847f8eSopenharmony_ci  /**
7061847f8eSopenharmony_ci   * Whether the UI extension window type is popup window.
7161847f8eSopenharmony_ci   *
7261847f8eSopenharmony_ci   * @type { boolean }
7361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
7461847f8eSopenharmony_ci   * @systemapi
7561847f8eSopenharmony_ci   * @stagemodelonly
7661847f8eSopenharmony_ci   * @since 12
7761847f8eSopenharmony_ci   */
7861847f8eSopenharmony_ci  isPopup: boolean;
7961847f8eSopenharmony_ci}
8061847f8eSopenharmony_ci
8161847f8eSopenharmony_ci/**
8261847f8eSopenharmony_ci * Save request for automatic filling.
8361847f8eSopenharmony_ci *
8461847f8eSopenharmony_ci * @interface SaveRequest
8561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
8661847f8eSopenharmony_ci * @systemapi
8761847f8eSopenharmony_ci * @stagemodelonly
8861847f8eSopenharmony_ci * @since 11
8961847f8eSopenharmony_ci */
9061847f8eSopenharmony_ciexport interface SaveRequest {
9161847f8eSopenharmony_ci  /**
9261847f8eSopenharmony_ci   * The view data. Indicates the basic page information for the save request.
9361847f8eSopenharmony_ci   *
9461847f8eSopenharmony_ci   * @type { ViewData }
9561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
9661847f8eSopenharmony_ci   * @systemapi
9761847f8eSopenharmony_ci   * @stagemodelonly
9861847f8eSopenharmony_ci   * @since 11
9961847f8eSopenharmony_ci   */
10061847f8eSopenharmony_ci  viewData: ViewData;
10161847f8eSopenharmony_ci}
10261847f8eSopenharmony_ci
10361847f8eSopenharmony_ci/**
10461847f8eSopenharmony_ci * Update request for automatic filling.
10561847f8eSopenharmony_ci *
10661847f8eSopenharmony_ci * @interface UpdateRequest
10761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
10861847f8eSopenharmony_ci * @systemapi
10961847f8eSopenharmony_ci * @stagemodelonly
11061847f8eSopenharmony_ci * @since 12
11161847f8eSopenharmony_ci */
11261847f8eSopenharmony_ciexport interface UpdateRequest {
11361847f8eSopenharmony_ci  /**
11461847f8eSopenharmony_ci   * The view data. Indicates the basic page information for the update request.
11561847f8eSopenharmony_ci   *
11661847f8eSopenharmony_ci   * @type { ViewData }
11761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
11861847f8eSopenharmony_ci   * @systemapi
11961847f8eSopenharmony_ci   * @stagemodelonly
12061847f8eSopenharmony_ci   * @since 12
12161847f8eSopenharmony_ci   */
12261847f8eSopenharmony_ci  viewData: ViewData;
12361847f8eSopenharmony_ci}
12461847f8eSopenharmony_ci
12561847f8eSopenharmony_ci/**
12661847f8eSopenharmony_ci * Fill response for automatic filling.
12761847f8eSopenharmony_ci *
12861847f8eSopenharmony_ci * @interface FillResponse
12961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
13061847f8eSopenharmony_ci * @systemapi
13161847f8eSopenharmony_ci * @stagemodelonly
13261847f8eSopenharmony_ci * @since 11
13361847f8eSopenharmony_ci */
13461847f8eSopenharmony_ciexport interface FillResponse {
13561847f8eSopenharmony_ci  /**
13661847f8eSopenharmony_ci   * The view data. Contains basic page information and backfill information.
13761847f8eSopenharmony_ci   *
13861847f8eSopenharmony_ci   * @type { ViewData }
13961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
14061847f8eSopenharmony_ci   * @systemapi
14161847f8eSopenharmony_ci   * @stagemodelonly
14261847f8eSopenharmony_ci   * @since 11
14361847f8eSopenharmony_ci   */
14461847f8eSopenharmony_ci  viewData: ViewData;
14561847f8eSopenharmony_ci}
14661847f8eSopenharmony_ci
14761847f8eSopenharmony_ci/**
14861847f8eSopenharmony_ci * Fill request callback for automatic filling.
14961847f8eSopenharmony_ci *
15061847f8eSopenharmony_ci * @interface FillRequestCallback
15161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
15261847f8eSopenharmony_ci * @systemapi
15361847f8eSopenharmony_ci * @stagemodelonly
15461847f8eSopenharmony_ci * @since 11
15561847f8eSopenharmony_ci */
15661847f8eSopenharmony_ciexport interface FillRequestCallback {
15761847f8eSopenharmony_ci  /**
15861847f8eSopenharmony_ci   * Notify the system that a fill request is successfully filled.
15961847f8eSopenharmony_ci   *
16061847f8eSopenharmony_ci   * @param { FillResponse } response - Indicates the fill response.
16161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
16261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Mandatory parameters are left unspecified.
16361847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
16461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
16561847f8eSopenharmony_ci   * @systemapi
16661847f8eSopenharmony_ci   * @stagemodelonly
16761847f8eSopenharmony_ci   * @since 11
16861847f8eSopenharmony_ci   */
16961847f8eSopenharmony_ci  onSuccess(response: FillResponse): void;
17061847f8eSopenharmony_ci
17161847f8eSopenharmony_ci  /**
17261847f8eSopenharmony_ci   * Notification system a fill request failed to be filled.
17361847f8eSopenharmony_ci   *
17461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
17561847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
17661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
17761847f8eSopenharmony_ci   * @systemapi
17861847f8eSopenharmony_ci   * @stagemodelonly
17961847f8eSopenharmony_ci   * @since 11
18061847f8eSopenharmony_ci   */
18161847f8eSopenharmony_ci  onFailure(): void;
18261847f8eSopenharmony_ci
18361847f8eSopenharmony_ci  /**
18461847f8eSopenharmony_ci   * Notification system that filling has been cancelled.
18561847f8eSopenharmony_ci   *
18661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
18761847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
18861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
18961847f8eSopenharmony_ci   * @systemapi
19061847f8eSopenharmony_ci   * @stagemodelonly
19161847f8eSopenharmony_ci   * @since 11
19261847f8eSopenharmony_ci   */
19361847f8eSopenharmony_ci  /**
19461847f8eSopenharmony_ci   * Notification system that filling has been cancelled.
19561847f8eSopenharmony_ci   *
19661847f8eSopenharmony_ci   * @param { string } [fillContent] - Indicates the content to be filled in.
19761847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
19861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: <br>1.The input parameter is not valid parameter; 
19961847f8eSopenharmony_ci   * <br>2. Mandatory parameters are left unspecified.
20061847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
20161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
20261847f8eSopenharmony_ci   * @systemapi
20361847f8eSopenharmony_ci   * @stagemodelonly
20461847f8eSopenharmony_ci   * @since 12
20561847f8eSopenharmony_ci   */
20661847f8eSopenharmony_ci  onCancel(fillContent?: string): void;
20761847f8eSopenharmony_ci
20861847f8eSopenharmony_ci  /**
20961847f8eSopenharmony_ci   * autofill popup config.
21061847f8eSopenharmony_ci   *
21161847f8eSopenharmony_ci   * @param { AutoFillPopupConfig } autoFillPopupConfig - Indicates the autofill popup config.
21261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
21361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Mandatory parameters are left unspecified.
21461847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
21561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
21661847f8eSopenharmony_ci   * @systemapi
21761847f8eSopenharmony_ci   * @stagemodelonly
21861847f8eSopenharmony_ci   * @since 12
21961847f8eSopenharmony_ci   */
22061847f8eSopenharmony_ci   setAutoFillPopupConfig(autoFillPopupConfig: AutoFillPopupConfig): void;
22161847f8eSopenharmony_ci}
22261847f8eSopenharmony_ci
22361847f8eSopenharmony_ci/**
22461847f8eSopenharmony_ci * Save request callback for automatic filling.
22561847f8eSopenharmony_ci *
22661847f8eSopenharmony_ci * @interface SaveRequestCallback
22761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
22861847f8eSopenharmony_ci * @systemapi
22961847f8eSopenharmony_ci * @stagemodelonly
23061847f8eSopenharmony_ci * @since 11
23161847f8eSopenharmony_ci */
23261847f8eSopenharmony_ciexport interface SaveRequestCallback {
23361847f8eSopenharmony_ci  /**
23461847f8eSopenharmony_ci   * Notify the system that a save request is successfully handled.
23561847f8eSopenharmony_ci   *
23661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
23761847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
23861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
23961847f8eSopenharmony_ci   * @systemapi
24061847f8eSopenharmony_ci   * @stagemodelonly
24161847f8eSopenharmony_ci   * @since 11
24261847f8eSopenharmony_ci   */
24361847f8eSopenharmony_ci  onSuccess(): void;
24461847f8eSopenharmony_ci
24561847f8eSopenharmony_ci  /**
24661847f8eSopenharmony_ci   * Notify the system that a save request is failed to be handled.
24761847f8eSopenharmony_ci   *
24861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
24961847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
25061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
25161847f8eSopenharmony_ci   * @systemapi
25261847f8eSopenharmony_ci   * @stagemodelonly
25361847f8eSopenharmony_ci   * @since 11
25461847f8eSopenharmony_ci   */
25561847f8eSopenharmony_ci  onFailure(): void;
25661847f8eSopenharmony_ci}