• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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 window from './@ohos.window';
22import insightIntent from './@ohos.app.ability.insightIntent';
23import InsightIntentContext from './@ohos.app.ability.InsightIntentContext';
24import UIExtensionContentSession from './@ohos.app.ability.UIExtensionContentSession';
25
26/**
27 * The class of insight intent entry executor.
28 *
29 * @class InsightIntentEntryExecutor<T>
30 * @syscap SystemCapability.Ability.AbilityRuntime.Core
31 * @stagemodelonly
32 * @atomicservice
33 * @since 20
34 */
35export default class InsightIntentEntryExecutor<T> {
36  /**
37   * The insight intent execute mode.
38   *
39   * @type { insightIntent.ExecuteMode }
40   * @syscap SystemCapability.Ability.AbilityRuntime.Core
41   * @stagemodelonly
42   * @atomicservice
43   * @since 20
44   */
45  executeMode: insightIntent.ExecuteMode;
46
47  /**
48   * The insight intent context.
49   *
50   * @type { InsightIntentContext }
51   * @syscap SystemCapability.Ability.AbilityRuntime.Core
52   * @stagemodelonly
53   * @atomicservice
54   * @since 20
55   */
56  context: InsightIntentContext;
57
58  /**
59   * The window stage.
60   *
61   * @type { ?window.WindowStage }
62   * @syscap SystemCapability.Ability.AbilityRuntime.Core
63   * @stagemodelonly
64   * @atomicservice
65   * @since 20
66   */
67  windowStage?: window.WindowStage;
68
69  /**
70   * The UIExtension content session.
71   *
72   * @type { ?UIExtensionContentSession }
73   * @syscap SystemCapability.Ability.AbilityRuntime.Core
74   * @stagemodelonly
75   * @atomicservice
76   * @since 20
77   */
78  uiExtensionSession?: UIExtensionContentSession;
79
80  /**
81   * Called when insight intent execute.
82   *
83   * @returns { Promise<insightIntent.IntentResult<T>> } The result of insight intent execution, support promise.
84   * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
85   * @stagemodelonly
86   * @atomicservice
87   * @since 20
88   */
89  onExecute(): Promise<insightIntent.IntentResult<T>>;
90}