• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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 '../ability/want';
17
18/**
19 * Provides the information required for triggering a WantAgent.
20 *
21 * @name TriggerInfo
22 * @since 7
23 * @devices phone, tablet, tv, wearable, car
24 * @permission N/A
25 */
26export interface TriggerInfo {
27  /**
28   * Result code.
29   */
30  code: number;
31
32  /**
33   * Extra Want.
34   * If flags in WantAgentInfo contain CONSTANT_FLAG, this parameter is invalid.
35   * If flags contain REPLACE_ELEMENT, REPLACE_ACTION, REPLACE_URI, REPLACE_ENTITIES, and REPLACE_BUNDLE,
36   * the element, action, uri, entities, and bundleName attributes of the Want specified in this parameter
37   * will be used to replace the corresponding attributes in the original Want, respectively.
38   * If this parameter is null, the original Want remains unchanged.
39   */
40  want?: Want;
41
42  /**
43   * Permission required for a WantAgent recipient.
44   * This parameter is valid only when the WantAgent is triggered to send common events.
45   * If permission is null, no permission is required on the recipient.
46   */
47  permission?: string;
48
49  /**
50   * Custom extra data you want to add for triggering a WantAgent.
51   */
52  extraInfo?: {[key: string]: any};
53}