• 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
16import Want from '../@ohos.app.ability.Want';
17import wantAgent from '../@ohos.wantAgent';
18
19/**
20 * Provides the information required for triggering a WantAgent.
21 *
22 * @typedef WantAgentInfo
23 * @syscap SystemCapability.Ability.AbilityRuntime.Core
24 * @since 7
25 */
26export interface WantAgentInfo {
27  /**
28   * An array of all Wants for starting abilities or sending common events. Only Wants can be displayed.
29   *
30   * @type { Array<Want> }
31   * @syscap SystemCapability.Ability.AbilityRuntime.Core
32   * @since 7
33   */
34  wants: Array<Want>;
35
36  /**
37   * Type of the action specified in a Want.
38   *
39   * @type { wantAgent.OperationType }
40   * @syscap SystemCapability.Ability.AbilityRuntime.Core
41   * @since 7
42   */
43  operationType: wantAgent.OperationType;
44
45  /**
46   * Request code defined by the user.
47   *
48   * @type { number }
49   * @syscap SystemCapability.Ability.AbilityRuntime.Core
50   * @since 7
51   */
52  requestCode: number;
53
54  /**
55   * An array of flags for using the WantAgent.
56   *
57   * @type { ?Array<wantAgent.WantAgentFlags> }
58   * @syscap SystemCapability.Ability.AbilityRuntime.Core
59   * @since 7
60   */
61  wantAgentFlags?: Array<wantAgent.WantAgentFlags>;
62
63  /**
64   * Extra information about how the Want starts an ability.
65   * If there is no extra information to set, this constant can be left empty.
66   *
67   * @type { ?object }
68   * @syscap SystemCapability.Ability.AbilityRuntime.Core
69   * @since 7
70   */
71  extraInfo?: { [key: string]: any };
72}
73