161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022-2023 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 { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ciimport Want from './@ohos.app.ability.Want';
2361847f8eSopenharmony_ciimport { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo';
2461847f8eSopenharmony_ciimport { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo';
2561847f8eSopenharmony_ci
2661847f8eSopenharmony_ci/**
2761847f8eSopenharmony_ci * Provide the method obtain trigger, cancel, and compare and to obtain
2861847f8eSopenharmony_ci * the bundle name, UID of an {@link WantAgent} object.
2961847f8eSopenharmony_ci *
3061847f8eSopenharmony_ci * @namespace wantAgent
3161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core
3261847f8eSopenharmony_ci * @since 9
3361847f8eSopenharmony_ci */
3461847f8eSopenharmony_ci/**
3561847f8eSopenharmony_ci * Provide the method obtain trigger, cancel, and compare and to obtain
3661847f8eSopenharmony_ci * the bundle name, UID of an {@link WantAgent} object.
3761847f8eSopenharmony_ci *
3861847f8eSopenharmony_ci * @namespace wantAgent
3961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core
4061847f8eSopenharmony_ci * @atomicservice
4161847f8eSopenharmony_ci * @since 12
4261847f8eSopenharmony_ci */
4361847f8eSopenharmony_cideclare namespace wantAgent {
4461847f8eSopenharmony_ci  /**
4561847f8eSopenharmony_ci   * Obtains the bundle name of a WantAgent.
4661847f8eSopenharmony_ci   *
4761847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
4861847f8eSopenharmony_ci   * @param { AsyncCallback<string> } callback - The callback is used to return the bundle name.
4961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
5061847f8eSopenharmony_ci   * 2. Incorrect parameter types.
5161847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
5261847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
5361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
5461847f8eSopenharmony_ci   * @since 9
5561847f8eSopenharmony_ci   */
5661847f8eSopenharmony_ci  /**
5761847f8eSopenharmony_ci   * Obtains the bundle name of a WantAgent.
5861847f8eSopenharmony_ci   *
5961847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
6061847f8eSopenharmony_ci   * @param { AsyncCallback<string> } callback - The callback is used to return the bundle name.
6161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
6261847f8eSopenharmony_ci   * 2. Incorrect parameter types.
6361847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
6461847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
6561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
6661847f8eSopenharmony_ci   * @atomicservice
6761847f8eSopenharmony_ci   * @since 12
6861847f8eSopenharmony_ci   */
6961847f8eSopenharmony_ci  function getBundleName(agent: WantAgent, callback: AsyncCallback<string>): void;
7061847f8eSopenharmony_ci
7161847f8eSopenharmony_ci  /**
7261847f8eSopenharmony_ci   * Obtains the bundle name of a WantAgent.
7361847f8eSopenharmony_ci   *
7461847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
7561847f8eSopenharmony_ci   * @returns { Promise<string> } Returns the bundle name.
7661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
7761847f8eSopenharmony_ci   * 2. Incorrect parameter types.
7861847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
7961847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
8061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
8161847f8eSopenharmony_ci   * @since 9
8261847f8eSopenharmony_ci   */
8361847f8eSopenharmony_ci  /**
8461847f8eSopenharmony_ci   * Obtains the bundle name of a WantAgent.
8561847f8eSopenharmony_ci   *
8661847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
8761847f8eSopenharmony_ci   * @returns { Promise<string> } Returns the bundle name.
8861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
8961847f8eSopenharmony_ci   * 2. Incorrect parameter types.
9061847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
9161847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
9261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
9361847f8eSopenharmony_ci   * @atomicservice
9461847f8eSopenharmony_ci   * @since 12
9561847f8eSopenharmony_ci   */
9661847f8eSopenharmony_ci  function getBundleName(agent: WantAgent): Promise<string>;
9761847f8eSopenharmony_ci
9861847f8eSopenharmony_ci  /**
9961847f8eSopenharmony_ci   * Obtains the UID of a WantAgent.
10061847f8eSopenharmony_ci   *
10161847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
10261847f8eSopenharmony_ci   * @param { AsyncCallback<number> } callback - The callback is used to return the UID.
10361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
10461847f8eSopenharmony_ci   * 2. Incorrect parameter types.
10561847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
10661847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
10761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
10861847f8eSopenharmony_ci   * @since 9
10961847f8eSopenharmony_ci   */
11061847f8eSopenharmony_ci  /**
11161847f8eSopenharmony_ci   * Obtains the UID of a WantAgent.
11261847f8eSopenharmony_ci   *
11361847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
11461847f8eSopenharmony_ci   * @param { AsyncCallback<number> } callback - The callback is used to return the UID.
11561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
11661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
11761847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
11861847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
11961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
12061847f8eSopenharmony_ci   * @atomicservice
12161847f8eSopenharmony_ci   * @since 12
12261847f8eSopenharmony_ci   */
12361847f8eSopenharmony_ci  function getUid(agent: WantAgent, callback: AsyncCallback<number>): void;
12461847f8eSopenharmony_ci
12561847f8eSopenharmony_ci  /**
12661847f8eSopenharmony_ci   * Obtains the UID of a WantAgent.
12761847f8eSopenharmony_ci   *
12861847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
12961847f8eSopenharmony_ci   * @returns { Promise<number> } Returns the UID.
13061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
13161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
13261847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
13361847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
13461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
13561847f8eSopenharmony_ci   * @since 9
13661847f8eSopenharmony_ci   */
13761847f8eSopenharmony_ci  /**
13861847f8eSopenharmony_ci   * Obtains the UID of a WantAgent.
13961847f8eSopenharmony_ci   *
14061847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
14161847f8eSopenharmony_ci   * @returns { Promise<number> } Returns the UID.
14261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
14361847f8eSopenharmony_ci   * 2. Incorrect parameter types.
14461847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
14561847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
14661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
14761847f8eSopenharmony_ci   * @atomicservice
14861847f8eSopenharmony_ci   * @since 12
14961847f8eSopenharmony_ci   */
15061847f8eSopenharmony_ci  function getUid(agent: WantAgent): Promise<number>;
15161847f8eSopenharmony_ci
15261847f8eSopenharmony_ci  /**
15361847f8eSopenharmony_ci   * Obtains the {@link Want} of an {@link WantAgent}.
15461847f8eSopenharmony_ci   *
15561847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
15661847f8eSopenharmony_ci   * @param { AsyncCallback<Want> } callback - The callback is used to return the Want.
15761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
15861847f8eSopenharmony_ci   * 2. Incorrect parameter types.
15961847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
16161847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
16261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
16361847f8eSopenharmony_ci   * @systemapi
16461847f8eSopenharmony_ci   * @since 9
16561847f8eSopenharmony_ci   */
16661847f8eSopenharmony_ci  function getWant(agent: WantAgent, callback: AsyncCallback<Want>): void;
16761847f8eSopenharmony_ci
16861847f8eSopenharmony_ci  /**
16961847f8eSopenharmony_ci   * Obtains the {@link Want} of an {@link WantAgent}.
17061847f8eSopenharmony_ci   *
17161847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
17261847f8eSopenharmony_ci   * @returns { Promise<Want> } Returns the Want.
17361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
17461847f8eSopenharmony_ci   * 2. Incorrect parameter types.
17561847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
17661847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
17761847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
17861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
17961847f8eSopenharmony_ci   * @systemapi
18061847f8eSopenharmony_ci   * @since 9
18161847f8eSopenharmony_ci   */
18261847f8eSopenharmony_ci  function getWant(agent: WantAgent): Promise<Want>;
18361847f8eSopenharmony_ci
18461847f8eSopenharmony_ci  /**
18561847f8eSopenharmony_ci   * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it.
18661847f8eSopenharmony_ci   *
18761847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
18861847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of cancel.
18961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
19061847f8eSopenharmony_ci   * 2. Incorrect parameter types.
19161847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
19261847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
19361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
19461847f8eSopenharmony_ci   * @since 9
19561847f8eSopenharmony_ci   */
19661847f8eSopenharmony_ci  /**
19761847f8eSopenharmony_ci   * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it.
19861847f8eSopenharmony_ci   *
19961847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
20061847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of cancel.
20161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
20261847f8eSopenharmony_ci   * 2. Incorrect parameter types.
20361847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
20461847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
20561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
20661847f8eSopenharmony_ci   * @atomicservice
20761847f8eSopenharmony_ci   * @since 12
20861847f8eSopenharmony_ci   */
20961847f8eSopenharmony_ci  function cancel(agent: WantAgent, callback: AsyncCallback<void>): void;
21061847f8eSopenharmony_ci
21161847f8eSopenharmony_ci  /**
21261847f8eSopenharmony_ci   * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it.
21361847f8eSopenharmony_ci   *
21461847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
21561847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
21661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
21761847f8eSopenharmony_ci   * 2. Incorrect parameter types.
21861847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
21961847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
22061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
22161847f8eSopenharmony_ci   * @since 9
22261847f8eSopenharmony_ci   */
22361847f8eSopenharmony_ci  /**
22461847f8eSopenharmony_ci   * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it.
22561847f8eSopenharmony_ci   *
22661847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
22761847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
22861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
22961847f8eSopenharmony_ci   * 2. Incorrect parameter types.
23061847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
23161847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
23261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
23361847f8eSopenharmony_ci   * @atomicservice
23461847f8eSopenharmony_ci   * @since 12
23561847f8eSopenharmony_ci   */
23661847f8eSopenharmony_ci  function cancel(agent: WantAgent): Promise<void>;
23761847f8eSopenharmony_ci
23861847f8eSopenharmony_ci  /**
23961847f8eSopenharmony_ci   * Triggers a WantAgent.
24061847f8eSopenharmony_ci   *
24161847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
24261847f8eSopenharmony_ci   * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent.
24361847f8eSopenharmony_ci   * @param { AsyncCallback<CompleteData> } [callback] - The callback is used to return the CompleteData.
24461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
24561847f8eSopenharmony_ci   * 2. Incorrect parameter types.
24661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
24761847f8eSopenharmony_ci   * @since 9
24861847f8eSopenharmony_ci   */
24961847f8eSopenharmony_ci  /**
25061847f8eSopenharmony_ci   * Triggers a WantAgent.
25161847f8eSopenharmony_ci   *
25261847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
25361847f8eSopenharmony_ci   * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent.
25461847f8eSopenharmony_ci   * @param { AsyncCallback<CompleteData> } [callback] - The callback is used to return the CompleteData.
25561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
25661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
25761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
25861847f8eSopenharmony_ci   * @atomicservice
25961847f8eSopenharmony_ci   * @since 12
26061847f8eSopenharmony_ci   */
26161847f8eSopenharmony_ci  function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void;
26261847f8eSopenharmony_ci
26361847f8eSopenharmony_ci  /**
26461847f8eSopenharmony_ci   * Checks whether two WantAgent objects are equal.
26561847f8eSopenharmony_ci   *
26661847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
26761847f8eSopenharmony_ci   * @param { WantAgent } otherAgent - Indicates the other WantAgent.
26861847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - Returns true if the two WantAgents are the same.
26961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
27061847f8eSopenharmony_ci   * 2. Incorrect parameter types.
27161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
27261847f8eSopenharmony_ci   * @since 9
27361847f8eSopenharmony_ci   */
27461847f8eSopenharmony_ci  /**
27561847f8eSopenharmony_ci   * Checks whether two WantAgent objects are equal.
27661847f8eSopenharmony_ci   *
27761847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
27861847f8eSopenharmony_ci   * @param { WantAgent } otherAgent - Indicates the other WantAgent.
27961847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - Returns true if the two WantAgents are the same.
28061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
28161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
28261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
28361847f8eSopenharmony_ci   * @atomicservice
28461847f8eSopenharmony_ci   * @since 12
28561847f8eSopenharmony_ci   */
28661847f8eSopenharmony_ci  function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback<boolean>): void;
28761847f8eSopenharmony_ci
28861847f8eSopenharmony_ci  /**
28961847f8eSopenharmony_ci   * Checks whether two WantAgent objects are equal.
29061847f8eSopenharmony_ci   *
29161847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
29261847f8eSopenharmony_ci   * @param { WantAgent } otherAgent - Indicates the other WantAgent.
29361847f8eSopenharmony_ci   * @returns { Promise<boolean> } Returns true if the two WantAgents are the same.
29461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
29561847f8eSopenharmony_ci   * 2. Incorrect parameter types.
29661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
29761847f8eSopenharmony_ci   * @since 9
29861847f8eSopenharmony_ci   */
29961847f8eSopenharmony_ci  /**
30061847f8eSopenharmony_ci   * Checks whether two WantAgent objects are equal.
30161847f8eSopenharmony_ci   *
30261847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
30361847f8eSopenharmony_ci   * @param { WantAgent } otherAgent - Indicates the other WantAgent.
30461847f8eSopenharmony_ci   * @returns { Promise<boolean> } Returns true if the two WantAgents are the same.
30561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
30661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
30761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
30861847f8eSopenharmony_ci   * @atomicservice
30961847f8eSopenharmony_ci   * @since 12
31061847f8eSopenharmony_ci   */
31161847f8eSopenharmony_ci  function equal(agent: WantAgent, otherAgent: WantAgent): Promise<boolean>;
31261847f8eSopenharmony_ci
31361847f8eSopenharmony_ci  /**
31461847f8eSopenharmony_ci   * Obtains a WantAgent object.
31561847f8eSopenharmony_ci   *
31661847f8eSopenharmony_ci   * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
31761847f8eSopenharmony_ci   * @param { AsyncCallback<WantAgent> } callback - The callback is used to return the created WantAgent.
31861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
31961847f8eSopenharmony_ci   * 2. Incorrect parameter types.
32061847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
32161847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
32261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
32361847f8eSopenharmony_ci   * @since 9
32461847f8eSopenharmony_ci   */
32561847f8eSopenharmony_ci  /**
32661847f8eSopenharmony_ci   * Obtains a WantAgent object.
32761847f8eSopenharmony_ci   *
32861847f8eSopenharmony_ci   * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
32961847f8eSopenharmony_ci   * @param { AsyncCallback<WantAgent> } callback - The callback is used to return the created WantAgent.
33061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
33161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
33261847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
33361847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
33461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
33561847f8eSopenharmony_ci   * @atomicservice
33661847f8eSopenharmony_ci   * @since 12
33761847f8eSopenharmony_ci   */
33861847f8eSopenharmony_ci  function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void;
33961847f8eSopenharmony_ci
34061847f8eSopenharmony_ci  /**
34161847f8eSopenharmony_ci   * Obtains a WantAgent object.
34261847f8eSopenharmony_ci   *
34361847f8eSopenharmony_ci   * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
34461847f8eSopenharmony_ci   * @returns { Promise<WantAgent> } Returns the created WantAgent.
34561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
34661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
34761847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
34861847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
34961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
35061847f8eSopenharmony_ci   * @since 9
35161847f8eSopenharmony_ci   */
35261847f8eSopenharmony_ci  /**
35361847f8eSopenharmony_ci   * Obtains a WantAgent object.
35461847f8eSopenharmony_ci   *
35561847f8eSopenharmony_ci   * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
35661847f8eSopenharmony_ci   * @returns { Promise<WantAgent> } Returns the created WantAgent.
35761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
35861847f8eSopenharmony_ci   * 2. Incorrect parameter types.
35961847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
36061847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
36161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
36261847f8eSopenharmony_ci   * @atomicservice
36361847f8eSopenharmony_ci   * @since 12
36461847f8eSopenharmony_ci   */
36561847f8eSopenharmony_ci  function getWantAgent(info: WantAgentInfo): Promise<WantAgent>;
36661847f8eSopenharmony_ci
36761847f8eSopenharmony_ci  /**
36861847f8eSopenharmony_ci   * Obtains the {@link OperationType} of a {@link WantAgent}.
36961847f8eSopenharmony_ci   *
37061847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
37161847f8eSopenharmony_ci   * @param { AsyncCallback<number> } callback - The callback is used to return the OperationType of the WantAgent.
37261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
37361847f8eSopenharmony_ci   * 2. Incorrect parameter types.
37461847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
37561847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
37661847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
37761847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
37861847f8eSopenharmony_ci   * @since 9
37961847f8eSopenharmony_ci   */
38061847f8eSopenharmony_ci  /**
38161847f8eSopenharmony_ci   * Obtains the {@link OperationType} of a {@link WantAgent}.
38261847f8eSopenharmony_ci   *
38361847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
38461847f8eSopenharmony_ci   * @param { AsyncCallback<number> } callback - The callback is used to return the OperationType of the WantAgent.
38561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
38661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
38761847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
38861847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
38961847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
39061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
39161847f8eSopenharmony_ci   * @atomicservice
39261847f8eSopenharmony_ci   * @since 12
39361847f8eSopenharmony_ci   */
39461847f8eSopenharmony_ci  function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void;
39561847f8eSopenharmony_ci
39661847f8eSopenharmony_ci  /**
39761847f8eSopenharmony_ci   * Obtains the {@link OperationType} of a {@link WantAgent}.
39861847f8eSopenharmony_ci   *
39961847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
40061847f8eSopenharmony_ci   * @returns { Promise<number> } Returns the OperationType of the WantAgent.
40161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
40261847f8eSopenharmony_ci   * 2. Incorrect parameter types.
40361847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry.
40461847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
40561847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
40661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
40761847f8eSopenharmony_ci   * @since 9
40861847f8eSopenharmony_ci   */
40961847f8eSopenharmony_ci  /**
41061847f8eSopenharmony_ci   * Obtains the {@link OperationType} of a {@link WantAgent}.
41161847f8eSopenharmony_ci   *
41261847f8eSopenharmony_ci   * @param { WantAgent } agent - Indicates the WantAgent.
41361847f8eSopenharmony_ci   * @returns { Promise<number> } Returns the OperationType of the WantAgent.
41461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
41561847f8eSopenharmony_ci   * 2. Incorrect parameter types.
41661847f8eSopenharmony_ci   * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later.
41761847f8eSopenharmony_ci   * @throws { BusinessError } 16000015 - Service timeout.
41861847f8eSopenharmony_ci   * @throws { BusinessError } 16000151 - Invalid wantagent object.
41961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
42061847f8eSopenharmony_ci   * @atomicservice
42161847f8eSopenharmony_ci   * @since 12
42261847f8eSopenharmony_ci   */
42361847f8eSopenharmony_ci  function getOperationType(agent: WantAgent): Promise<number>;
42461847f8eSopenharmony_ci
42561847f8eSopenharmony_ci  /**
42661847f8eSopenharmony_ci   * Enumerates flags for using a WantAgent.
42761847f8eSopenharmony_ci   *
42861847f8eSopenharmony_ci   * @enum { number }
42961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
43061847f8eSopenharmony_ci   * @since 9
43161847f8eSopenharmony_ci   */
43261847f8eSopenharmony_ci  /**
43361847f8eSopenharmony_ci   * Enumerates flags for using a WantAgent.
43461847f8eSopenharmony_ci   *
43561847f8eSopenharmony_ci   * @enum { number }
43661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
43761847f8eSopenharmony_ci   * @atomicservice
43861847f8eSopenharmony_ci   * @since 12
43961847f8eSopenharmony_ci   */
44061847f8eSopenharmony_ci  export enum WantAgentFlags {
44161847f8eSopenharmony_ci    /**
44261847f8eSopenharmony_ci     * Indicates that the WantAgent can be used only once.
44361847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
44461847f8eSopenharmony_ci     *
44561847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
44661847f8eSopenharmony_ci     * @since 9
44761847f8eSopenharmony_ci     */
44861847f8eSopenharmony_ci    /**
44961847f8eSopenharmony_ci     * Indicates that the WantAgent can be used only once.
45061847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
45161847f8eSopenharmony_ci     *
45261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
45361847f8eSopenharmony_ci     * @atomicservice
45461847f8eSopenharmony_ci     * @since 12
45561847f8eSopenharmony_ci     */
45661847f8eSopenharmony_ci    ONE_TIME_FLAG = 0,
45761847f8eSopenharmony_ci
45861847f8eSopenharmony_ci    /**
45961847f8eSopenharmony_ci     * Indicates that null is returned if the WantAgent does not exist.
46061847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
46161847f8eSopenharmony_ci     *
46261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
46361847f8eSopenharmony_ci     * @since 9
46461847f8eSopenharmony_ci     */
46561847f8eSopenharmony_ci    /**
46661847f8eSopenharmony_ci     * Indicates that null is returned if the WantAgent does not exist.
46761847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
46861847f8eSopenharmony_ci     *
46961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
47061847f8eSopenharmony_ci     * @atomicservice
47161847f8eSopenharmony_ci     * @since 12
47261847f8eSopenharmony_ci     */
47361847f8eSopenharmony_ci    NO_BUILD_FLAG,
47461847f8eSopenharmony_ci
47561847f8eSopenharmony_ci    /**
47661847f8eSopenharmony_ci     * Indicates that the existing WantAgent should be canceled before a new object is generated.
47761847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
47861847f8eSopenharmony_ci     *
47961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
48061847f8eSopenharmony_ci     * @since 9
48161847f8eSopenharmony_ci     */
48261847f8eSopenharmony_ci    /**
48361847f8eSopenharmony_ci     * Indicates that the existing WantAgent should be canceled before a new object is generated.
48461847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
48561847f8eSopenharmony_ci     *
48661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
48761847f8eSopenharmony_ci     * @atomicservice
48861847f8eSopenharmony_ci     * @since 12
48961847f8eSopenharmony_ci     */
49061847f8eSopenharmony_ci    CANCEL_PRESENT_FLAG,
49161847f8eSopenharmony_ci
49261847f8eSopenharmony_ci    /**
49361847f8eSopenharmony_ci     * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object.
49461847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
49561847f8eSopenharmony_ci     *
49661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
49761847f8eSopenharmony_ci     * @since 9
49861847f8eSopenharmony_ci     */
49961847f8eSopenharmony_ci    /**
50061847f8eSopenharmony_ci     * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object.
50161847f8eSopenharmony_ci     * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
50261847f8eSopenharmony_ci     *
50361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
50461847f8eSopenharmony_ci     * @atomicservice
50561847f8eSopenharmony_ci     * @since 12
50661847f8eSopenharmony_ci     */
50761847f8eSopenharmony_ci    UPDATE_PRESENT_FLAG,
50861847f8eSopenharmony_ci
50961847f8eSopenharmony_ci    /**
51061847f8eSopenharmony_ci     * Indicates that the created WantAgent should be immutable.
51161847f8eSopenharmony_ci     *
51261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
51361847f8eSopenharmony_ci     * @since 9
51461847f8eSopenharmony_ci     */
51561847f8eSopenharmony_ci    /**
51661847f8eSopenharmony_ci     * Indicates that the created WantAgent should be immutable.
51761847f8eSopenharmony_ci     *
51861847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
51961847f8eSopenharmony_ci     * @atomicservice
52061847f8eSopenharmony_ci     * @since 12
52161847f8eSopenharmony_ci     */
52261847f8eSopenharmony_ci    CONSTANT_FLAG,
52361847f8eSopenharmony_ci
52461847f8eSopenharmony_ci    /**
52561847f8eSopenharmony_ci     * Indicates that the current value of element can be replaced when the WantAgent is triggered.
52661847f8eSopenharmony_ci     *
52761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
52861847f8eSopenharmony_ci     * @since 9
52961847f8eSopenharmony_ci     */
53061847f8eSopenharmony_ci    /**
53161847f8eSopenharmony_ci     * Indicates that the current value of element can be replaced when the WantAgent is triggered.
53261847f8eSopenharmony_ci     *
53361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
53461847f8eSopenharmony_ci     * @atomicservice
53561847f8eSopenharmony_ci     * @since 12
53661847f8eSopenharmony_ci     */
53761847f8eSopenharmony_ci    REPLACE_ELEMENT,
53861847f8eSopenharmony_ci
53961847f8eSopenharmony_ci    /**
54061847f8eSopenharmony_ci     * Indicates that the current value of action can be replaced when the WantAgent is triggered.
54161847f8eSopenharmony_ci     *
54261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
54361847f8eSopenharmony_ci     * @since 9
54461847f8eSopenharmony_ci     */
54561847f8eSopenharmony_ci    /**
54661847f8eSopenharmony_ci     * Indicates that the current value of action can be replaced when the WantAgent is triggered.
54761847f8eSopenharmony_ci     *
54861847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
54961847f8eSopenharmony_ci     * @atomicservice
55061847f8eSopenharmony_ci     * @since 12
55161847f8eSopenharmony_ci     */
55261847f8eSopenharmony_ci    REPLACE_ACTION,
55361847f8eSopenharmony_ci
55461847f8eSopenharmony_ci    /**
55561847f8eSopenharmony_ci     * Indicates that the current value of uri can be replaced when the WantAgent is triggered.
55661847f8eSopenharmony_ci     *
55761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
55861847f8eSopenharmony_ci     * @since 9
55961847f8eSopenharmony_ci     */
56061847f8eSopenharmony_ci    /**
56161847f8eSopenharmony_ci     * Indicates that the current value of uri can be replaced when the WantAgent is triggered.
56261847f8eSopenharmony_ci     *
56361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
56461847f8eSopenharmony_ci     * @atomicservice
56561847f8eSopenharmony_ci     * @since 12
56661847f8eSopenharmony_ci     */
56761847f8eSopenharmony_ci    REPLACE_URI,
56861847f8eSopenharmony_ci
56961847f8eSopenharmony_ci    /**
57061847f8eSopenharmony_ci     * Indicates that the current value of entities can be replaced when the WantAgent is triggered.
57161847f8eSopenharmony_ci     *
57261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
57361847f8eSopenharmony_ci     * @since 9
57461847f8eSopenharmony_ci     */
57561847f8eSopenharmony_ci    /**
57661847f8eSopenharmony_ci     * Indicates that the current value of entities can be replaced when the WantAgent is triggered.
57761847f8eSopenharmony_ci     *
57861847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
57961847f8eSopenharmony_ci     * @atomicservice
58061847f8eSopenharmony_ci     * @since 12
58161847f8eSopenharmony_ci     */
58261847f8eSopenharmony_ci    REPLACE_ENTITIES,
58361847f8eSopenharmony_ci
58461847f8eSopenharmony_ci    /**
58561847f8eSopenharmony_ci     * Indicates that the current value of packageName can be replaced when the WantAgent is triggered.
58661847f8eSopenharmony_ci     *
58761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
58861847f8eSopenharmony_ci     * @since 9
58961847f8eSopenharmony_ci     */
59061847f8eSopenharmony_ci    /**
59161847f8eSopenharmony_ci     * Indicates that the current value of packageName can be replaced when the WantAgent is triggered.
59261847f8eSopenharmony_ci     *
59361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
59461847f8eSopenharmony_ci     * @atomicservice
59561847f8eSopenharmony_ci     * @since 12
59661847f8eSopenharmony_ci     */
59761847f8eSopenharmony_ci    REPLACE_BUNDLE
59861847f8eSopenharmony_ci  }
59961847f8eSopenharmony_ci
60061847f8eSopenharmony_ci  /**
60161847f8eSopenharmony_ci   * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event.
60261847f8eSopenharmony_ci   *
60361847f8eSopenharmony_ci   * @enum { number }
60461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
60561847f8eSopenharmony_ci   * @since 9
60661847f8eSopenharmony_ci   */
60761847f8eSopenharmony_ci  /**
60861847f8eSopenharmony_ci   * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event.
60961847f8eSopenharmony_ci   *
61061847f8eSopenharmony_ci   * @enum { number }
61161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
61261847f8eSopenharmony_ci   * @atomicservice
61361847f8eSopenharmony_ci   * @since 12
61461847f8eSopenharmony_ci   */
61561847f8eSopenharmony_ci  export enum OperationType {
61661847f8eSopenharmony_ci    /**
61761847f8eSopenharmony_ci     * Unknown operation.
61861847f8eSopenharmony_ci     *
61961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
62061847f8eSopenharmony_ci     * @since 9
62161847f8eSopenharmony_ci     */
62261847f8eSopenharmony_ci    /**
62361847f8eSopenharmony_ci     * Unknown operation.
62461847f8eSopenharmony_ci     *
62561847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
62661847f8eSopenharmony_ci     * @atomicservice
62761847f8eSopenharmony_ci     * @since 12
62861847f8eSopenharmony_ci     */
62961847f8eSopenharmony_ci    UNKNOWN_TYPE = 0,
63061847f8eSopenharmony_ci
63161847f8eSopenharmony_ci    /**
63261847f8eSopenharmony_ci     * Starts an ability with a UI.
63361847f8eSopenharmony_ci     *
63461847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
63561847f8eSopenharmony_ci     * @since 9
63661847f8eSopenharmony_ci     */
63761847f8eSopenharmony_ci    /**
63861847f8eSopenharmony_ci     * Starts an ability with a UI.
63961847f8eSopenharmony_ci     *
64061847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
64161847f8eSopenharmony_ci     * @atomicservice
64261847f8eSopenharmony_ci     * @since 12
64361847f8eSopenharmony_ci     */
64461847f8eSopenharmony_ci    START_ABILITY,
64561847f8eSopenharmony_ci
64661847f8eSopenharmony_ci    /**
64761847f8eSopenharmony_ci     * Starts multiple abilities with a UI.
64861847f8eSopenharmony_ci     *
64961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
65061847f8eSopenharmony_ci     * @since 9
65161847f8eSopenharmony_ci     */
65261847f8eSopenharmony_ci    /**
65361847f8eSopenharmony_ci     * Starts multiple abilities with a UI.
65461847f8eSopenharmony_ci     *
65561847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
65661847f8eSopenharmony_ci     * @atomicservice
65761847f8eSopenharmony_ci     * @since 12
65861847f8eSopenharmony_ci     */
65961847f8eSopenharmony_ci    START_ABILITIES,
66061847f8eSopenharmony_ci
66161847f8eSopenharmony_ci    /**
66261847f8eSopenharmony_ci     * Starts an ability without a UI.
66361847f8eSopenharmony_ci     *
66461847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
66561847f8eSopenharmony_ci     * @since 9
66661847f8eSopenharmony_ci     */
66761847f8eSopenharmony_ci    /**
66861847f8eSopenharmony_ci     * Starts an ability without a UI.
66961847f8eSopenharmony_ci     *
67061847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
67161847f8eSopenharmony_ci     * @atomicservice
67261847f8eSopenharmony_ci     * @since 12
67361847f8eSopenharmony_ci     */
67461847f8eSopenharmony_ci    START_SERVICE,
67561847f8eSopenharmony_ci
67661847f8eSopenharmony_ci    /**
67761847f8eSopenharmony_ci     * Sends a common event.
67861847f8eSopenharmony_ci     *
67961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
68061847f8eSopenharmony_ci     * @since 9
68161847f8eSopenharmony_ci     */
68261847f8eSopenharmony_ci    /**
68361847f8eSopenharmony_ci     * Sends a common event.
68461847f8eSopenharmony_ci     *
68561847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
68661847f8eSopenharmony_ci     * @atomicservice
68761847f8eSopenharmony_ci     * @since 12
68861847f8eSopenharmony_ci     */
68961847f8eSopenharmony_ci    SEND_COMMON_EVENT,
69061847f8eSopenharmony_ci
69161847f8eSopenharmony_ci    /**
69261847f8eSopenharmony_ci     * Starts a service extension.
69361847f8eSopenharmony_ci     *
69461847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
69561847f8eSopenharmony_ci     * @systemapi
69661847f8eSopenharmony_ci     * @stagemodelonly
69761847f8eSopenharmony_ci     * @since 12
69861847f8eSopenharmony_ci     */
69961847f8eSopenharmony_ci    START_SERVICE_EXTENSION = 6
70061847f8eSopenharmony_ci  }
70161847f8eSopenharmony_ci
70261847f8eSopenharmony_ci  /**
70361847f8eSopenharmony_ci   * Describes the data returned by after wantAgent.trigger is called.
70461847f8eSopenharmony_ci   *
70561847f8eSopenharmony_ci   * @typedef CompleteData
70661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
70761847f8eSopenharmony_ci   * @since 9
70861847f8eSopenharmony_ci   */
70961847f8eSopenharmony_ci  /**
71061847f8eSopenharmony_ci   * Describes the data returned by after wantAgent.trigger is called.
71161847f8eSopenharmony_ci   *
71261847f8eSopenharmony_ci   * @typedef CompleteData
71361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
71461847f8eSopenharmony_ci   * @atomicservice
71561847f8eSopenharmony_ci   * @since 12
71661847f8eSopenharmony_ci   */
71761847f8eSopenharmony_ci  export interface CompleteData {
71861847f8eSopenharmony_ci    /**
71961847f8eSopenharmony_ci     * Triggered WantAgent.
72061847f8eSopenharmony_ci     *
72161847f8eSopenharmony_ci     * @type { WantAgent }
72261847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
72361847f8eSopenharmony_ci     * @since 9
72461847f8eSopenharmony_ci     */
72561847f8eSopenharmony_ci    /**
72661847f8eSopenharmony_ci     * Triggered WantAgent.
72761847f8eSopenharmony_ci     *
72861847f8eSopenharmony_ci     * @type { WantAgent }
72961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
73061847f8eSopenharmony_ci     * @atomicservice
73161847f8eSopenharmony_ci     * @since 12
73261847f8eSopenharmony_ci     */
73361847f8eSopenharmony_ci    info: WantAgent;
73461847f8eSopenharmony_ci
73561847f8eSopenharmony_ci    /**
73661847f8eSopenharmony_ci     * Existing Want that is triggered.
73761847f8eSopenharmony_ci     *
73861847f8eSopenharmony_ci     * @type { Want }
73961847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
74061847f8eSopenharmony_ci     * @since 9
74161847f8eSopenharmony_ci     */
74261847f8eSopenharmony_ci    /**
74361847f8eSopenharmony_ci     * Existing Want that is triggered.
74461847f8eSopenharmony_ci     *
74561847f8eSopenharmony_ci     * @type { Want }
74661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
74761847f8eSopenharmony_ci     * @atomicservice
74861847f8eSopenharmony_ci     * @since 12
74961847f8eSopenharmony_ci     */
75061847f8eSopenharmony_ci    want: Want;
75161847f8eSopenharmony_ci
75261847f8eSopenharmony_ci    /**
75361847f8eSopenharmony_ci     * Request code used to trigger the WantAgent.
75461847f8eSopenharmony_ci     *
75561847f8eSopenharmony_ci     * @type { number }
75661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
75761847f8eSopenharmony_ci     * @since 9
75861847f8eSopenharmony_ci     */
75961847f8eSopenharmony_ci    /**
76061847f8eSopenharmony_ci     * Request code used to trigger the WantAgent.
76161847f8eSopenharmony_ci     *
76261847f8eSopenharmony_ci     * @type { number }
76361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
76461847f8eSopenharmony_ci     * @atomicservice
76561847f8eSopenharmony_ci     * @since 12
76661847f8eSopenharmony_ci     */
76761847f8eSopenharmony_ci    finalCode: number;
76861847f8eSopenharmony_ci
76961847f8eSopenharmony_ci    /**
77061847f8eSopenharmony_ci     * Final data collected by the common event.
77161847f8eSopenharmony_ci     *
77261847f8eSopenharmony_ci     * @type { string }
77361847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
77461847f8eSopenharmony_ci     * @since 9
77561847f8eSopenharmony_ci     */
77661847f8eSopenharmony_ci    /**
77761847f8eSopenharmony_ci     * Final data collected by the common event.
77861847f8eSopenharmony_ci     *
77961847f8eSopenharmony_ci     * @type { string }
78061847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
78161847f8eSopenharmony_ci     * @atomicservice
78261847f8eSopenharmony_ci     * @since 12
78361847f8eSopenharmony_ci     */
78461847f8eSopenharmony_ci    finalData: string;
78561847f8eSopenharmony_ci
78661847f8eSopenharmony_ci    /**
78761847f8eSopenharmony_ci     * Extra data collected by the common event.
78861847f8eSopenharmony_ci     *
78961847f8eSopenharmony_ci     * @type { ?object }
79061847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
79161847f8eSopenharmony_ci     * @since 9
79261847f8eSopenharmony_ci     */
79361847f8eSopenharmony_ci    /**
79461847f8eSopenharmony_ci     * Extra data collected by the common event.
79561847f8eSopenharmony_ci     *
79661847f8eSopenharmony_ci     * @type { ?Record<string, Object> }
79761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
79861847f8eSopenharmony_ci     * @since 11
79961847f8eSopenharmony_ci     */
80061847f8eSopenharmony_ci    /**
80161847f8eSopenharmony_ci     * Extra data collected by the common event.
80261847f8eSopenharmony_ci     *
80361847f8eSopenharmony_ci     * @type { ?Record<string, Object> }
80461847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.Core
80561847f8eSopenharmony_ci     * @atomicservice
80661847f8eSopenharmony_ci     * @since 12
80761847f8eSopenharmony_ci     */
80861847f8eSopenharmony_ci    extraInfo?: Record<string, Object>;
80961847f8eSopenharmony_ci  }
81061847f8eSopenharmony_ci
81161847f8eSopenharmony_ci  /**
81261847f8eSopenharmony_ci   * Provides the information required for triggering a WantAgent.
81361847f8eSopenharmony_ci   *
81461847f8eSopenharmony_ci   * @typedef { _TriggerInfo }
81561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
81661847f8eSopenharmony_ci   * @since 9
81761847f8eSopenharmony_ci   */
81861847f8eSopenharmony_ci  /**
81961847f8eSopenharmony_ci   * Provides the information required for triggering a WantAgent.
82061847f8eSopenharmony_ci   *
82161847f8eSopenharmony_ci   * @typedef { _TriggerInfo }
82261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
82361847f8eSopenharmony_ci   * @atomicservice
82461847f8eSopenharmony_ci   * @since 12
82561847f8eSopenharmony_ci   */
82661847f8eSopenharmony_ci  export type TriggerInfo = _TriggerInfo;
82761847f8eSopenharmony_ci
82861847f8eSopenharmony_ci  /**
82961847f8eSopenharmony_ci   * Provides the information required for triggering a WantAgent.
83061847f8eSopenharmony_ci   *
83161847f8eSopenharmony_ci   * @typedef { _WantAgentInfo }
83261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
83361847f8eSopenharmony_ci   * @since 9
83461847f8eSopenharmony_ci   */
83561847f8eSopenharmony_ci  /**
83661847f8eSopenharmony_ci   * Provides the information required for triggering a WantAgent.
83761847f8eSopenharmony_ci   *
83861847f8eSopenharmony_ci   * @typedef { _WantAgentInfo }
83961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
84061847f8eSopenharmony_ci   * @atomicservice
84161847f8eSopenharmony_ci   * @since 12
84261847f8eSopenharmony_ci   */
84361847f8eSopenharmony_ci  export type WantAgentInfo = _WantAgentInfo;
84461847f8eSopenharmony_ci}
84561847f8eSopenharmony_ci
84661847f8eSopenharmony_ci/**
84761847f8eSopenharmony_ci * WantAgent object.
84861847f8eSopenharmony_ci *
84961847f8eSopenharmony_ci * @typedef { object }
85061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core
85161847f8eSopenharmony_ci * @since 9
85261847f8eSopenharmony_ci */
85361847f8eSopenharmony_ciexport type WantAgent = object;
85461847f8eSopenharmony_ci
85561847f8eSopenharmony_ciexport default wantAgent;
856