161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"), 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit AbilityKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type window from './@ohos.window'; 2261847f8eSopenharmony_ciimport type insightIntent from './@ohos.app.ability.insightIntent'; 2361847f8eSopenharmony_ciimport type InsightIntentContext from './@ohos.app.ability.InsightIntentContext'; 2461847f8eSopenharmony_ciimport type UIExtensionContentSession from './@ohos.app.ability.UIExtensionContentSession'; 2561847f8eSopenharmony_ci 2661847f8eSopenharmony_ci/** 2761847f8eSopenharmony_ci * The class of insight intent executor. 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 3061847f8eSopenharmony_ci * @StageModelOnly 3161847f8eSopenharmony_ci * @atomicservice 3261847f8eSopenharmony_ci * @since 11 3361847f8eSopenharmony_ci */ 3461847f8eSopenharmony_ciexport default class InsightIntentExecutor { 3561847f8eSopenharmony_ci /** 3661847f8eSopenharmony_ci * Indicates context of insight intent. 3761847f8eSopenharmony_ci * 3861847f8eSopenharmony_ci * @type { InsightIntentContext } 3961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 4061847f8eSopenharmony_ci * @StageModelOnly 4161847f8eSopenharmony_ci * @atomicservice 4261847f8eSopenharmony_ci * @since 11 4361847f8eSopenharmony_ci */ 4461847f8eSopenharmony_ci context: InsightIntentContext; 4561847f8eSopenharmony_ci 4661847f8eSopenharmony_ci /** 4761847f8eSopenharmony_ci * Called when a UIAbility executes the insight intent in the foreground. 4861847f8eSopenharmony_ci * 4961847f8eSopenharmony_ci * @param { string } name - Indicates the insight intent name. 5061847f8eSopenharmony_ci * @param { Record<string, Object> } param - Indicates the insight intent parameters. 5161847f8eSopenharmony_ci * @param { window.WindowStage } pageLoader - Indicates the page loader. 5261847f8eSopenharmony_ci * @returns { insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult> } The result of insight intent execution, support promise. 5361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore 5461847f8eSopenharmony_ci * @StageModelOnly 5561847f8eSopenharmony_ci * @atomicservice 5661847f8eSopenharmony_ci * @since 11 5761847f8eSopenharmony_ci */ 5861847f8eSopenharmony_ci onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage): 5961847f8eSopenharmony_ci insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>; 6061847f8eSopenharmony_ci 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Called when a UIAbility executes the insight intent in the background. 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @param { string } name - Indicates the insight intent name. 6561847f8eSopenharmony_ci * @param { Record<string, Object> } param - Indicates the insight intent parameters. 6661847f8eSopenharmony_ci * @returns { insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult> } The result of insight intent execution, support promise. 6761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore 6861847f8eSopenharmony_ci * @StageModelOnly 6961847f8eSopenharmony_ci * @atomicservice 7061847f8eSopenharmony_ci * @since 11 7161847f8eSopenharmony_ci */ 7261847f8eSopenharmony_ci onExecuteInUIAbilityBackgroundMode(name: string, param: Record<string, Object>): 7361847f8eSopenharmony_ci insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>; 7461847f8eSopenharmony_ci 7561847f8eSopenharmony_ci /** 7661847f8eSopenharmony_ci * Called when a UIExtensionAbility executes the insight intent. 7761847f8eSopenharmony_ci * 7861847f8eSopenharmony_ci * @param { string } name - Indicates the insight intent name. 7961847f8eSopenharmony_ci * @param { Record<string, Object> } param - Indicates the insight intent parameters. 8061847f8eSopenharmony_ci * @param { UIExtensionContentSession } pageLoader - Indicates the page loader. 8161847f8eSopenharmony_ci * @returns { insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult> } The result of insight intent execution, support promise. 8261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 8361847f8eSopenharmony_ci * @StageModelOnly 8461847f8eSopenharmony_ci * @since 11 8561847f8eSopenharmony_ci */ 8661847f8eSopenharmony_ci onExecuteInUIExtensionAbility(name: string, param: Record<string, Object>, pageLoader: UIExtensionContentSession): 8761847f8eSopenharmony_ci insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>; 8861847f8eSopenharmony_ci 8961847f8eSopenharmony_ci /** 9061847f8eSopenharmony_ci * Called when a ServiceExtensionAbility executes the insight intent. 9161847f8eSopenharmony_ci * 9261847f8eSopenharmony_ci * @param { string } name - Indicates the insight intent name. 9361847f8eSopenharmony_ci * @param { Record<string, Object> } param - Indicates the insight intent parameters. 9461847f8eSopenharmony_ci * @returns { insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult> } The result of insight intent execution, support promise. 9561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 9661847f8eSopenharmony_ci * @StageModelOnly 9761847f8eSopenharmony_ci * @since 11 9861847f8eSopenharmony_ci */ 9961847f8eSopenharmony_ci onExecuteInServiceExtensionAbility(name: string, param: Record<string, Object>): 10061847f8eSopenharmony_ci insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>; 10161847f8eSopenharmony_ci} 102