• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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
21/**
22 * interface of insightIntent.
23 *
24 * @namespace insightIntent
25 * @syscap SystemCapability.Ability.AbilityRuntime.Core
26 * @StageModelOnly
27 * @atomicservice
28 * @since 11
29 */
30declare namespace insightIntent {
31  /**
32   * Enum for supported execute mode.
33   *
34   * @enum { number }
35   * @syscap SystemCapability.Ability.AbilityRuntime.Core
36   * @StageModelOnly
37   * @atomicservice
38   * @since 11
39   */
40  enum ExecuteMode {
41    /**
42     * UIAbility foreground.
43     *
44     * @syscap SystemCapability.Ability.AbilityRuntime.Core
45     * @StageModelOnly
46     * @atomicservice
47     * @since 11
48     */
49    UI_ABILITY_FOREGROUND = 0,
50
51    /**
52     * UIAbility background.
53     *
54     * @syscap SystemCapability.Ability.AbilityRuntime.Core
55     * @StageModelOnly
56     * @atomicservice
57     * @since 11
58     */
59    UI_ABILITY_BACKGROUND = 1,
60
61    /**
62     * UIExtensionAbility.
63     *
64     * @syscap SystemCapability.Ability.AbilityRuntime.Core
65     * @StageModelOnly
66     * @since 11
67     */
68    UI_EXTENSION_ABILITY = 2,
69
70    /**
71     * ServiceExtensionAbility.
72     *
73     * @syscap SystemCapability.Ability.AbilityRuntime.Core
74     * @systemapi
75     * @StageModelOnly
76     * @since 11
77     */
78    SERVICE_EXTENSION_ABILITY = 3,
79  }
80
81  /**
82   * Result of intent execution.
83   *
84   * @typedef ExecuteResult
85   * @syscap SystemCapability.Ability.AbilityRuntime.Core
86   * @StageModelOnly
87   * @atomicservice
88   * @since 11
89   */
90  interface ExecuteResult {
91    /**
92     * Indicates result code.
93     *
94     * @type { number }
95     * @syscap SystemCapability.Ability.AbilityRuntime.Core
96     * @StageModelOnly
97     * @atomicservice
98     * @since 11
99     */
100    code: number;
101
102    /**
103     * Indicates execute result.
104     *
105     * @type { ?Record<string, Object> }
106     * @syscap SystemCapability.Ability.AbilityRuntime.Core
107     * @StageModelOnly
108     * @atomicservice
109     * @since 11
110     */
111    result?: Record<string, Object>;
112  }
113}
114
115export default insightIntent;
116