• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# WantAgentInfo
2
3The module defines the information required for triggering the WantAgent.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## Modules to Import
10
11```ts
12import { wantAgent as abilityWantAgent } from '@kit.AbilityKit';
13```
14
15## WantAgentInfo
16
17Defines the information required for triggering a WantAgent object. The information can be used as an input parameter in [getWantAgent](js-apis-app-ability-wantAgent.md#wantagentgetwantagent) to obtain a specified WantAgent object.
18
19**Atomic service API**: This API can be used in atomic services since API version 12.
20
21**System capability**: SystemCapability.Ability.AbilityRuntime.Core
22
23| Name          | Type                           | Read-Only| Optional| Description                  |
24| -------------- | ------------------------------ | ---- | ---- |---------------------- |
25| wants          | Array\<[Want](js-apis-app-ability-want.md)\>                   | No| No| Array of all Want objects. Currently, only one Want is supported. The array is reserved for future capability expansion. If multiple values are passed in, only the first member in the array is used.   |
26| operationType<sup>(deprecated)</sup>  | [wantAgent.OperationType](js-apis-wantAgent.md#operationtype)         | No| Yes| Operation type.<br>This attribute is supported since API version 7 and deprecated since API version 11. You are advised to use actionType<sup>11+</sup> instead.              |
27| actionType<sup>11+</sup> | [abilityWantAgent.OperationType](js-apis-app-ability-wantAgent.md#operationtype)         | No| Yes| Operation type.              |
28| requestCode    | number                          | No| No| Custom request code, which is used to identify the operation to execute.|
29| wantAgentFlags<sup>(deprecated)</sup> | Array<[wantAgent.WantAgentFlags](js-apis-wantAgent.md#wantagentflags)> | No| Yes| Array of flags for using the WantAgent object.<br>This attribute is supported since API version 7 and deprecated since API version 11. You are advised to use actionFlags<sup>11+</sup> instead.          |
30| actionFlags<sup>11+</sup> | Array<[abilityWantAgent.WantAgentFlags](js-apis-app-ability-wantAgent.md#wantagentflags)> | No| Yes| Array of flags for using the WantAgent object.          |
31| extraInfo      | { [key: string]: any }            | No| Yes| Extra information.              |
32| extraInfos<sup>11+</sup> | Record\<string, Object>            | No| Yes| Extra information. You are advised to use this property to replace **extraInfo**. When this property is set, **extraInfo** does not take effect.              |
33