• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 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 type wantConstant from './@ohos.app.ability.wantConstant';
23
24/**
25 * interface of insightIntent.
26 *
27 * @namespace insightIntent
28 * @syscap SystemCapability.Ability.AbilityRuntime.Core
29 * @StageModelOnly
30 * @atomicservice
31 * @since 11
32 */
33declare namespace insightIntent {
34  /**
35   * Enum for supported execute mode.
36   *
37   * @enum { number }
38   * @syscap SystemCapability.Ability.AbilityRuntime.Core
39   * @StageModelOnly
40   * @atomicservice
41   * @since 11
42   */
43  enum ExecuteMode {
44    /**
45     * UIAbility foreground.
46     *
47     * @syscap SystemCapability.Ability.AbilityRuntime.Core
48     * @StageModelOnly
49     * @atomicservice
50     * @since 11
51     */
52    UI_ABILITY_FOREGROUND = 0,
53
54    /**
55     * UIAbility background.
56     *
57     * @syscap SystemCapability.Ability.AbilityRuntime.Core
58     * @StageModelOnly
59     * @atomicservice
60     * @since 11
61     */
62    UI_ABILITY_BACKGROUND = 1,
63
64    /**
65     * UIExtensionAbility.
66     *
67     * @syscap SystemCapability.Ability.AbilityRuntime.Core
68     * @StageModelOnly
69     * @since 11
70     */
71    UI_EXTENSION_ABILITY = 2,
72
73    /**
74     * ServiceExtensionAbility.
75     *
76     * @syscap SystemCapability.Ability.AbilityRuntime.Core
77     * @systemapi
78     * @StageModelOnly
79     * @since 11
80     */
81    SERVICE_EXTENSION_ABILITY = 3,
82  }
83
84  /**
85   * Result of intent execution.
86   *
87   * @typedef ExecuteResult
88   * @syscap SystemCapability.Ability.AbilityRuntime.Core
89   * @StageModelOnly
90   * @atomicservice
91   * @since 11
92   */
93  interface ExecuteResult {
94    /**
95     * Indicates result code.
96     *
97     * @type { number }
98     * @syscap SystemCapability.Ability.AbilityRuntime.Core
99     * @StageModelOnly
100     * @atomicservice
101     * @since 11
102     */
103    code: number;
104
105    /**
106     * Indicates execute result.
107     *
108     * @type { ?Record<string, Object> }
109     * @syscap SystemCapability.Ability.AbilityRuntime.Core
110     * @StageModelOnly
111     * @atomicservice
112     * @since 11
113     */
114    result?: Record<string, Object>;
115
116    /**
117     * Indicates the URIs will be authorized to the insight intent driver.
118     *
119     * @type { ?Array<string> }
120     * @syscap SystemCapability.Ability.AbilityRuntime.Core
121     * @stagemodelonly
122     * @atomicservice
123     * @since 18
124     */
125    uris?: Array<string>;
126
127    /**
128     * Indicates the URIs read and write permissions which consistent with {@link Want#flags},
129     * flags must be one of {@link wantConstant#Flags#FLAG_AUTH_READ_URI_PERMISSION},
130     * {@link wantConstant#Flags#FLAG_AUTH_WRITE_URI_PERMISSION},
131     * {@link wantConstant#Flags#FLAG_AUTH_READ_URI_PERMISSION}|
132     * {@link wantConstant#Flags#FLAG_AUTH_WRITE_URI_PERMISSION}.
133     *
134     * @type { ?number }
135     * @syscap SystemCapability.Ability.AbilityRuntime.Core
136     * @stagemodelonly
137     * @atomicservice
138     * @since 18
139     */
140    flags?: number;
141  }
142}
143
144export default insightIntent;
145