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 { AsyncCallback } from './@ohos.base';
2261847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want';
2361847f8eSopenharmony_ci
2461847f8eSopenharmony_ci/**
2561847f8eSopenharmony_ci * The context of insight intent executor.
2661847f8eSopenharmony_ci *
2761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core
2861847f8eSopenharmony_ci * @StageModelOnly
2961847f8eSopenharmony_ci * @atomicservice
3061847f8eSopenharmony_ci * @since 11
3161847f8eSopenharmony_ci */
3261847f8eSopenharmony_ciexport default class InsightIntentContext {
3361847f8eSopenharmony_ci  /**
3461847f8eSopenharmony_ci   * Starts a new ability.
3561847f8eSopenharmony_ci   * This interface only allows you to start abilities within the same bundle and specify the bundleName.
3661847f8eSopenharmony_ci   * This interface only allows called in UIAbility insight intent execute mode.
3761847f8eSopenharmony_ci   *
3861847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
3961847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
4061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
4161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
4261847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
4361847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
4461847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
4561847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
4661847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
4761847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
4861847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
4961847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
5061847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
5161847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
5261847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
5361847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
5461847f8eSopenharmony_ci   * @throws { BusinessError } 16000061 - Operation not supported.
5561847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
5661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
5761847f8eSopenharmony_ci   * @StageModelOnly
5861847f8eSopenharmony_ci   * @atomicservice
5961847f8eSopenharmony_ci   * @since 11
6061847f8eSopenharmony_ci   */
6161847f8eSopenharmony_ci  startAbility(want: Want, callback: AsyncCallback<void>): void;
6261847f8eSopenharmony_ci
6361847f8eSopenharmony_ci  /**
6461847f8eSopenharmony_ci   * Starts a new ability.
6561847f8eSopenharmony_ci   * This interface only allows you to start abilities within the same bundle and specify the bundleName.
6661847f8eSopenharmony_ci   * This interface only allows called in UIAbility insight intent execute mode.
6761847f8eSopenharmony_ci   *
6861847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
6961847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
7061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
7161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
7261847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
7361847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
7461847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
7561847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
7661847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
7761847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
7861847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
7961847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
8061847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
8161847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
8261847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
8361847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
8461847f8eSopenharmony_ci   * @throws { BusinessError } 16000061 - Operation not supported.
8561847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
8661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
8761847f8eSopenharmony_ci   * @StageModelOnly
8861847f8eSopenharmony_ci   * @atomicservice
8961847f8eSopenharmony_ci   * @since 11
9061847f8eSopenharmony_ci   */
9161847f8eSopenharmony_ci  startAbility(want: Want): Promise<void>;
9261847f8eSopenharmony_ci}
93