• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 Want from '../@ohos.app.ability.Want';
22import wantAgent from '../@ohos.wantAgent';
23import type abilityWantAgent from '../@ohos.app.ability.wantAgent';
24
25/**
26 * Provides the information required for triggering a WantAgent.
27 *
28 * @typedef WantAgentInfo
29 * @syscap SystemCapability.Ability.AbilityRuntime.Core
30 * @since 7
31 */
32/**
33 * Provides the information required for triggering a WantAgent.
34 *
35 * @typedef WantAgentInfo
36 * @syscap SystemCapability.Ability.AbilityRuntime.Core
37 * @atomicservice
38 * @since 12
39 */
40export interface WantAgentInfo {
41  /**
42   * An array of all Wants for starting abilities or sending common events. Only Wants can be displayed.
43   *
44   * @type { Array<Want> }
45   * @syscap SystemCapability.Ability.AbilityRuntime.Core
46   * @since 7
47   */
48  /**
49   * An array of all Wants for starting abilities or sending common events. Only Wants can be displayed.
50   *
51   * @type { Array<Want> }
52   * @syscap SystemCapability.Ability.AbilityRuntime.Core
53   * @atomicservice
54   * @since 12
55   */
56  wants: Array<Want>;
57
58  /**
59   * Type of the action specified in a Want.
60   *
61   * @type { ?wantAgent.OperationType }
62   * @syscap SystemCapability.Ability.AbilityRuntime.Core
63   * @since 7
64   * @deprecated since 11
65   * @useinstead WantAgentInfo#actionType
66   */
67  /**
68   * Type of the action specified in a Want.
69   *
70   * @type { ?wantAgent.OperationType }
71   * @syscap SystemCapability.Ability.AbilityRuntime.Core
72   * @atomicservice
73   * @since 12
74   * @deprecated since 11
75   * @useinstead WantAgentInfo#actionType
76   */
77  operationType?: wantAgent.OperationType;
78
79  /**
80   * Type of the action specified in a Want.
81   *
82   * @type { ?abilityWantAgent.OperationType }
83   * @syscap SystemCapability.Ability.AbilityRuntime.Core
84   * @since 11
85   */
86  /**
87   * Type of the action specified in a Want.
88   *
89   * @type { ?abilityWantAgent.OperationType }
90   * @syscap SystemCapability.Ability.AbilityRuntime.Core
91   * @atomicservice
92   * @since 12
93   */
94  actionType?: abilityWantAgent.OperationType;
95
96  /**
97   * Request code defined by the user.
98   *
99   * @type { number }
100   * @syscap SystemCapability.Ability.AbilityRuntime.Core
101   * @since 7
102   */
103  /**
104   * Request code defined by the user.
105   *
106   * @type { number }
107   * @syscap SystemCapability.Ability.AbilityRuntime.Core
108   * @atomicservice
109   * @since 12
110   */
111  requestCode: number;
112
113  /**
114   * An array of flags for using the WantAgent.
115   *
116   * @type { ?Array<wantAgent.WantAgentFlags> }
117   * @syscap SystemCapability.Ability.AbilityRuntime.Core
118   * @since 7
119   * @deprecated since 11
120   * @useinstead WantAgentInfo#actionFlags
121   */
122  /**
123   * An array of flags for using the WantAgent.
124   *
125   * @type { ?Array<wantAgent.WantAgentFlags> }
126   * @syscap SystemCapability.Ability.AbilityRuntime.Core
127   * @atomicservice
128   * @since 12
129   * @deprecated since 11
130   * @useinstead WantAgentInfo#actionFlags
131   */
132  wantAgentFlags?: Array<wantAgent.WantAgentFlags>;
133
134  /**
135   * An array of flags for using the WantAgent.
136   *
137   * @type { ?Array<abilityWantAgent.WantAgentFlags> }
138   * @syscap SystemCapability.Ability.AbilityRuntime.Core
139   * @since 11
140   */
141  /**
142   * An array of flags for using the WantAgent.
143   *
144   * @type { ?Array<abilityWantAgent.WantAgentFlags> }
145   * @syscap SystemCapability.Ability.AbilityRuntime.Core
146   * @atomicservice
147   * @since 12
148   */
149  actionFlags?: Array<abilityWantAgent.WantAgentFlags>;
150
151  /**
152   * Extra information about how the Want starts an ability.
153   * If there is no extra information to set, this constant can be left empty.
154   *
155   * @type { ?object }
156   * @syscap SystemCapability.Ability.AbilityRuntime.Core
157   * @since 7
158   */
159  /**
160   * Extra information about how the Want starts an ability.
161   * If there is no extra information to set, this constant can be left empty.
162   *
163   * @type { ?object }
164   * @syscap SystemCapability.Ability.AbilityRuntime.Core
165   * @atomicservice
166   * @since 12
167   */
168  extraInfo?: { [key: string]: any };
169
170  /**
171   * Extra information about how the Want starts an ability.
172   * If there is no extra information to set, this constant can be left empty.
173   * The ability of this property is same as extraInfo. If both are set, this property will be used.
174   *
175   * @type { ?Record<string, Object> }
176   * @syscap SystemCapability.Ability.AbilityRuntime.Core
177   * @since 11
178   */
179  /**
180   * Extra information about how the Want starts an ability.
181   * If there is no extra information to set, this constant can be left empty.
182   * The ability of this property is same as extraInfo. If both are set, this property will be used.
183   *
184   * @type { ?Record<string, Object> }
185   * @syscap SystemCapability.Ability.AbilityRuntime.Core
186   * @atomicservice
187   * @since 12
188   */
189  extraInfos?: Record<string, Object>;
190}
191