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 { AbilityResult } from './ability/abilityResult';
2261847f8eSopenharmony_ciimport type AbilityStartCallback from './application/AbilityStartCallback';
2361847f8eSopenharmony_ciimport type { AsyncCallback } from './@ohos.base';
2461847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want';
2561847f8eSopenharmony_ciimport type StartOptions from './@ohos.app.ability.StartOptions';
2661847f8eSopenharmony_ciimport type uiExtensionHost from './@ohos.uiExtensionHost';
2761847f8eSopenharmony_ciimport type uiExtension from './@ohos.arkui.uiExtension';
2861847f8eSopenharmony_ci
2961847f8eSopenharmony_ci/**
3061847f8eSopenharmony_ci * class of ui extension content session.
3161847f8eSopenharmony_ci *
3261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core
3361847f8eSopenharmony_ci * @stagemodelonly
3461847f8eSopenharmony_ci * @since 10
3561847f8eSopenharmony_ci */
3661847f8eSopenharmony_ciexport default class UIExtensionContentSession {
3761847f8eSopenharmony_ci  /**
3861847f8eSopenharmony_ci   * Send data from an ui extension to an ui extension component.
3961847f8eSopenharmony_ci   *
4061847f8eSopenharmony_ci   * @param { object } data - Indicates the data send to ui extension component.
4161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
4261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
4361847f8eSopenharmony_ci   * 2. Incorrect parameter types.
4461847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
4561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
4661847f8eSopenharmony_ci   * @systemapi
4761847f8eSopenharmony_ci   * @stagemodelonly
4861847f8eSopenharmony_ci   * @since 10
4961847f8eSopenharmony_ci   */
5061847f8eSopenharmony_ci  /**
5161847f8eSopenharmony_ci   * Send data from an ui extension to an ui extension component.
5261847f8eSopenharmony_ci   *
5361847f8eSopenharmony_ci   * @param { Record<string, Object> } data - Indicates the data send to ui extension component.
5461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
5561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
5661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
5761847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
5861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
5961847f8eSopenharmony_ci   * @systemapi
6061847f8eSopenharmony_ci   * @stagemodelonly
6161847f8eSopenharmony_ci   * @since 11
6261847f8eSopenharmony_ci   */
6361847f8eSopenharmony_ci  sendData(data: Record<string, Object>): void;
6461847f8eSopenharmony_ci
6561847f8eSopenharmony_ci  /**
6661847f8eSopenharmony_ci   * Sets the callback for the ui extension to receive data from an ui extension component.
6761847f8eSopenharmony_ci   *
6861847f8eSopenharmony_ci   * @param { function } callback - Indicates the receive data callback to set.
6961847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
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 } 16000050 - Internal error.
7361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
7461847f8eSopenharmony_ci   * @systemapi
7561847f8eSopenharmony_ci   * @stagemodelonly
7661847f8eSopenharmony_ci   * @since 10
7761847f8eSopenharmony_ci   */
7861847f8eSopenharmony_ci  setReceiveDataCallback(callback: (data: Record<string, Object>) => void): void;
7961847f8eSopenharmony_ci
8061847f8eSopenharmony_ci  /**
8161847f8eSopenharmony_ci   * Sets the callback with return value for the ui extension to receive data from an ui extension component.
8261847f8eSopenharmony_ci   *
8361847f8eSopenharmony_ci   * @param { function } callback - Indicates the receive data callback to set.
8461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
8561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
8661847f8eSopenharmony_ci   * 2. Incorrect parameter types.
8761847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
8861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
8961847f8eSopenharmony_ci   * @systemapi
9061847f8eSopenharmony_ci   * @stagemodelonly
9161847f8eSopenharmony_ci   * @since 11
9261847f8eSopenharmony_ci   */
9361847f8eSopenharmony_ci  setReceiveDataForResultCallback(callback: (data: Record<string, Object>) => Record<string, Object>): void;
9461847f8eSopenharmony_ci
9561847f8eSopenharmony_ci  /**
9661847f8eSopenharmony_ci   * Loads an UI extension content.
9761847f8eSopenharmony_ci   *
9861847f8eSopenharmony_ci   * @param { string } path - Path of the page to which the content will be loaded
9961847f8eSopenharmony_ci   * @param { LocalStorage } [storage] - The data object shared within the content instance loaded by the page
10061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
10161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
10261847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
10361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
10461847f8eSopenharmony_ci   * @stagemodelonly
10561847f8eSopenharmony_ci   * @since 10
10661847f8eSopenharmony_ci   */
10761847f8eSopenharmony_ci  loadContent(path: string, storage?: LocalStorage): void;
10861847f8eSopenharmony_ci
10961847f8eSopenharmony_ci  /**
11061847f8eSopenharmony_ci   * UI extension uses this method to start a specific ability.If the caller application is in foreground,
11161847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
11261847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
11361847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
11461847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
11561847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
11661847f8eSopenharmony_ci   *
11761847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
11861847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
11961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
12061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
12161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
12261847f8eSopenharmony_ci   * 2. Incorrect parameter types.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
12461847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
12561847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
12661847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
12761847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
12861847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
12961847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
13061847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
13161847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
13261847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
13361847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
13461847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
13561847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
13661847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
13761847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
13861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
13961847f8eSopenharmony_ci   * @systemapi
14061847f8eSopenharmony_ci   * @stagemodelonly
14161847f8eSopenharmony_ci   * @since 10
14261847f8eSopenharmony_ci   */
14361847f8eSopenharmony_ci  startAbility(want: Want, callback: AsyncCallback<void>): void;
14461847f8eSopenharmony_ci
14561847f8eSopenharmony_ci  /**
14661847f8eSopenharmony_ci   * UI extension uses this method to start a specific ability.If the caller application is in foreground,
14761847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
14861847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
14961847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
15061847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
15161847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
15261847f8eSopenharmony_ci   *
15361847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
15461847f8eSopenharmony_ci   * @param { StartOptions } options - Indicates the start options.
15561847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
15661847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
15761847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
15861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
15961847f8eSopenharmony_ci   * 2. Incorrect parameter types.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
16161847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
16261847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
16361847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
16461847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
16561847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
16661847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
16761847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
16861847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
16961847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
17061847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
17161847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
17261847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
17361847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
17461847f8eSopenharmony_ci   * @systemapi
17561847f8eSopenharmony_ci   * @stagemodelonly
17661847f8eSopenharmony_ci   * @since 10
17761847f8eSopenharmony_ci   */
17861847f8eSopenharmony_ci  startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
17961847f8eSopenharmony_ci
18061847f8eSopenharmony_ci  /**
18161847f8eSopenharmony_ci   * UI extension uses this method to start a specific ability.If the caller application is in foreground,
18261847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
18361847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
18461847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
18561847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
18661847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
18761847f8eSopenharmony_ci   *
18861847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
18961847f8eSopenharmony_ci   * @param { StartOptions } [options] - Indicates the start options.
19061847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
19161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
19261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
19361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
19461847f8eSopenharmony_ci   * 2. Incorrect parameter types.
19561847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
19661847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
19761847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
19861847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
19961847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
20061847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
20161847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
20261847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
20361847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
20461847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
20561847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
20661847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
20761847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
20861847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
20961847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
21061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
21161847f8eSopenharmony_ci   * @systemapi
21261847f8eSopenharmony_ci   * @stagemodelonly
21361847f8eSopenharmony_ci   * @since 10
21461847f8eSopenharmony_ci   */
21561847f8eSopenharmony_ci  startAbility(want: Want, options?: StartOptions): Promise<void>;
21661847f8eSopenharmony_ci
21761847f8eSopenharmony_ci  /**
21861847f8eSopenharmony_ci   * Starts a new ability using the original caller information. If the caller application is in foreground,
21961847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
22061847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
22161847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
22261847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
22361847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
22461847f8eSopenharmony_ci   *
22561847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
22661847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
22761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
22861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
22961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
23061847f8eSopenharmony_ci   * 2. Incorrect parameter types.
23161847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
23261847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
23361847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
23461847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
23561847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
23661847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
23761847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
23861847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
23961847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
24061847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
24161847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
24261847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
24361847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
24461847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
24561847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
24661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
24761847f8eSopenharmony_ci   * @systemapi
24861847f8eSopenharmony_ci   * @stagemodelonly
24961847f8eSopenharmony_ci   * @since 11
25061847f8eSopenharmony_ci   */
25161847f8eSopenharmony_ci  startAbilityAsCaller(want: Want, callback: AsyncCallback<void>): void;
25261847f8eSopenharmony_ci
25361847f8eSopenharmony_ci  /**
25461847f8eSopenharmony_ci   * Starts a new ability using the original caller information. If the caller application is in foreground,
25561847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
25661847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
25761847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
25861847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
25961847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
26061847f8eSopenharmony_ci   *
26161847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
26261847f8eSopenharmony_ci   * @param { StartOptions } options - Indicates the start options.
26361847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
26461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
26561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
26661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
26761847f8eSopenharmony_ci   * 2. Incorrect parameter types.
26861847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
26961847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
27061847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
27161847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
27261847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
27361847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
27461847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
27561847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
27661847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
27761847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
27861847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
27961847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
28061847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
28161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
28261847f8eSopenharmony_ci   * @systemapi
28361847f8eSopenharmony_ci   * @stagemodelonly
28461847f8eSopenharmony_ci   * @since 11
28561847f8eSopenharmony_ci   */
28661847f8eSopenharmony_ci  startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
28761847f8eSopenharmony_ci
28861847f8eSopenharmony_ci  /**
28961847f8eSopenharmony_ci   * Starts a new ability using the original caller information. If the caller application is in foreground,
29061847f8eSopenharmony_ci   * you can use this method to start ability; If the caller application is in the background,
29161847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
29261847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
29361847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
29461847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
29561847f8eSopenharmony_ci   *
29661847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
29761847f8eSopenharmony_ci   * @param { StartOptions } [options] - Indicates the start options.
29861847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
29961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
30061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
30161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
30261847f8eSopenharmony_ci   * 2. Incorrect parameter types.
30361847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
30461847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
30561847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
30661847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
30761847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
30861847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
30961847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
31061847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
31161847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
31261847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
31361847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
31461847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
31561847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
31661847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
31761847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
31861847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
31961847f8eSopenharmony_ci   * @systemapi
32061847f8eSopenharmony_ci   * @stagemodelonly
32161847f8eSopenharmony_ci   * @since 11
32261847f8eSopenharmony_ci   */
32361847f8eSopenharmony_ci  startAbilityAsCaller(want: Want, options?: StartOptions): Promise<void>;
32461847f8eSopenharmony_ci
32561847f8eSopenharmony_ci  /**
32661847f8eSopenharmony_ci   * Starts an ability and returns the execution result when the ability is destroyed.
32761847f8eSopenharmony_ci   * If the caller application is in foreground, you can use this method to start ability; If the caller application
32861847f8eSopenharmony_ci   * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
32961847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
33061847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
33161847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
33261847f8eSopenharmony_ci   *
33361847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
33461847f8eSopenharmony_ci   * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility.
33561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
33661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
33761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
33861847f8eSopenharmony_ci   * 2. Incorrect parameter types.
33961847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
34061847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
34161847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
34261847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
34361847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
34461847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
34561847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
34661847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
34761847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
34861847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
34961847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
35061847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
35161847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
35261847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
35361847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
35461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
35561847f8eSopenharmony_ci   * @systemapi
35661847f8eSopenharmony_ci   * @stagemodelonly
35761847f8eSopenharmony_ci   * @since 10
35861847f8eSopenharmony_ci   */
35961847f8eSopenharmony_ci  startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
36061847f8eSopenharmony_ci
36161847f8eSopenharmony_ci  /**
36261847f8eSopenharmony_ci   * Starts an ability and returns the execution result when the ability is destroyed.
36361847f8eSopenharmony_ci   * If the caller application is in foreground, you can use this method to start ability; If the caller application
36461847f8eSopenharmony_ci   * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
36561847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
36661847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
36761847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
36861847f8eSopenharmony_ci   *
36961847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
37061847f8eSopenharmony_ci   * @param { StartOptions } options - Indicates the start options.
37161847f8eSopenharmony_ci   * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility.
37261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
37361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
37461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
37561847f8eSopenharmony_ci   * 2. Incorrect parameter types.
37661847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
37761847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
37861847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
37961847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
38061847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
38161847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
38261847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
38361847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
38461847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
38561847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
38661847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
38761847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
38861847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
38961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
39061847f8eSopenharmony_ci   * @systemapi
39161847f8eSopenharmony_ci   * @stagemodelonly
39261847f8eSopenharmony_ci   * @since 10
39361847f8eSopenharmony_ci   */
39461847f8eSopenharmony_ci  startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
39561847f8eSopenharmony_ci
39661847f8eSopenharmony_ci  /**
39761847f8eSopenharmony_ci   * Starts an ability and returns the execution result when the ability is destroyed.
39861847f8eSopenharmony_ci   * If the caller application is in foreground, you can use this method to start ability; If the caller application
39961847f8eSopenharmony_ci   * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
40061847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
40161847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
40261847f8eSopenharmony_ci   * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
40361847f8eSopenharmony_ci   *
40461847f8eSopenharmony_ci   * @param { Want } want - Indicates the ability to start.
40561847f8eSopenharmony_ci   * @param { StartOptions } [options] - Indicates the start options.
40661847f8eSopenharmony_ci   * @returns { Promise<AbilityResult> } Returns the result of startAbility.
40761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
40861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
40961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
41061847f8eSopenharmony_ci   * 2. Incorrect parameter types.
41161847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
41261847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
41361847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Failed to start the invisible ability.
41461847f8eSopenharmony_ci   * @throws { BusinessError } 16000005 - The specified process does not have the permission.
41561847f8eSopenharmony_ci   * @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
41661847f8eSopenharmony_ci   * @throws { BusinessError } 16000008 - The crowdtesting application expires.
41761847f8eSopenharmony_ci   * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
41861847f8eSopenharmony_ci   * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
41961847f8eSopenharmony_ci   * @throws { BusinessError } 16000011 - The context does not exist.
42061847f8eSopenharmony_ci   * @throws { BusinessError } 16000012 - The application is controlled.
42161847f8eSopenharmony_ci   * @throws { BusinessError } 16000013 - The application is controlled by EDM.
42261847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
42361847f8eSopenharmony_ci   * @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
42461847f8eSopenharmony_ci   * @throws { BusinessError } 16000055 - Installation-free timed out.
42561847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
42661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
42761847f8eSopenharmony_ci   * @systemapi
42861847f8eSopenharmony_ci   * @stagemodelonly
42961847f8eSopenharmony_ci   * @since 10
43061847f8eSopenharmony_ci   */
43161847f8eSopenharmony_ci  startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
43261847f8eSopenharmony_ci
43361847f8eSopenharmony_ci  /**
43461847f8eSopenharmony_ci   * Destroys the UI extension.
43561847f8eSopenharmony_ci   *
43661847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of terminateSelf.
43761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
43861847f8eSopenharmony_ci   * 2. Incorrect parameter types.
43961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
44061847f8eSopenharmony_ci   * @stagemodelonly
44161847f8eSopenharmony_ci   * @since 10
44261847f8eSopenharmony_ci   */
44361847f8eSopenharmony_ci  terminateSelf(callback: AsyncCallback<void>): void;
44461847f8eSopenharmony_ci
44561847f8eSopenharmony_ci  /**
44661847f8eSopenharmony_ci   * Destroys the UI extension.
44761847f8eSopenharmony_ci   *
44861847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
44961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
45061847f8eSopenharmony_ci   * @stagemodelonly
45161847f8eSopenharmony_ci   * @since 10
45261847f8eSopenharmony_ci   */
45361847f8eSopenharmony_ci  terminateSelf(): Promise<void>;
45461847f8eSopenharmony_ci
45561847f8eSopenharmony_ci  /**
45661847f8eSopenharmony_ci   * Destroys the UI extension while returning the specified result code and data to the caller.
45761847f8eSopenharmony_ci   *
45861847f8eSopenharmony_ci   * @param { AbilityResult } parameter - Indicates the result to return.
45961847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult.
46061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
46161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
46261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
46361847f8eSopenharmony_ci   * @stagemodelonly
46461847f8eSopenharmony_ci   * @since 10
46561847f8eSopenharmony_ci   */
46661847f8eSopenharmony_ci  terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
46761847f8eSopenharmony_ci
46861847f8eSopenharmony_ci  /**
46961847f8eSopenharmony_ci   * Destroys the UI extension while returning the specified result code and data to the caller.
47061847f8eSopenharmony_ci   *
47161847f8eSopenharmony_ci   * @param { AbilityResult } parameter - Indicates the result to return.
47261847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
47361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
47461847f8eSopenharmony_ci   * 2. Incorrect parameter types.
47561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
47661847f8eSopenharmony_ci   * @stagemodelonly
47761847f8eSopenharmony_ci   * @since 10
47861847f8eSopenharmony_ci   */
47961847f8eSopenharmony_ci  terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
48061847f8eSopenharmony_ci
48161847f8eSopenharmony_ci  /**
48261847f8eSopenharmony_ci   * Sets the background color of the UI extension.
48361847f8eSopenharmony_ci   *
48461847f8eSopenharmony_ci   * @param { string } color - the specified color.
48561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
48661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
48761847f8eSopenharmony_ci   * 2. Incorrect parameter types.
48861847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
48961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
49061847f8eSopenharmony_ci   * @systemapi
49161847f8eSopenharmony_ci   * @stagemodelonly
49261847f8eSopenharmony_ci   * @since 10
49361847f8eSopenharmony_ci   */
49461847f8eSopenharmony_ci  setWindowBackgroundColor(color: string): void;
49561847f8eSopenharmony_ci
49661847f8eSopenharmony_ci  /**
49761847f8eSopenharmony_ci   * Sets whether this window is in privacy mode.
49861847f8eSopenharmony_ci   *
49961847f8eSopenharmony_ci   * @permission ohos.permission.PRIVACY_WINDOW
50061847f8eSopenharmony_ci   * @param { boolean } isPrivacyMode - Whether the window is in privacy mode. The value true means that
50161847f8eSopenharmony_ci   *                                    the window is in privacy mode, and false means the opposite.
50261847f8eSopenharmony_ci   * @returns { Promise<void> } Promise that returns no value.
50361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
50461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
50561847f8eSopenharmony_ci   * 2. Incorrect parameter types.
50661847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
50761847f8eSopenharmony_ci   * @stagemodelonly
50861847f8eSopenharmony_ci   * @since 10
50961847f8eSopenharmony_ci   */
51061847f8eSopenharmony_ci  setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>;
51161847f8eSopenharmony_ci
51261847f8eSopenharmony_ci  /**
51361847f8eSopenharmony_ci   * Sets whether this window is in privacy mode.
51461847f8eSopenharmony_ci   *
51561847f8eSopenharmony_ci   * @permission ohos.permission.PRIVACY_WINDOW
51661847f8eSopenharmony_ci   * @param { boolean } isPrivacyMode - Whether the window is in privacy mode. The value true means that
51761847f8eSopenharmony_ci   *                                    the window is in privacy mode, and false means the opposite.
51861847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - Callback used to return the result.
51961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
52061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
52161847f8eSopenharmony_ci   * 2. Incorrect parameter types.
52261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
52361847f8eSopenharmony_ci   * @stagemodelonly
52461847f8eSopenharmony_ci   * @since 10
52561847f8eSopenharmony_ci   */
52661847f8eSopenharmony_ci  setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void;
52761847f8eSopenharmony_ci
52861847f8eSopenharmony_ci  /**
52961847f8eSopenharmony_ci   * Starts the UIAbility or UIExtensionAbility by type.
53061847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
53161847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
53261847f8eSopenharmony_ci   *
53361847f8eSopenharmony_ci   * @param { string } type - The type of target ability.
53461847f8eSopenharmony_ci   * @param { Record<string, Object> } wantParam - Indicates the want parameter.
53561847f8eSopenharmony_ci   * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
53661847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
53761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
53861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
53961847f8eSopenharmony_ci   * 2. Incorrect parameter types.
54061847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
54161847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
54261847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Can not start invisible component.
54361847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
54461847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
54561847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
54661847f8eSopenharmony_ci   * @stagemodelonly
54761847f8eSopenharmony_ci   * @since 11
54861847f8eSopenharmony_ci   */
54961847f8eSopenharmony_ci  /**
55061847f8eSopenharmony_ci   * Starts the UIAbility or UIExtensionAbility by type.
55161847f8eSopenharmony_ci   * If the caller application is in the background, it is not allowed to call this interface.
55261847f8eSopenharmony_ci   *
55361847f8eSopenharmony_ci   * @param { string } type - The type of target ability.
55461847f8eSopenharmony_ci   * @param { Record<string, Object> } wantParam - Indicates the want parameter.
55561847f8eSopenharmony_ci   * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
55661847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - The callback of startAbility.
55761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
55861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
55961847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
56061847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
56161847f8eSopenharmony_ci   * @stagemodelonly
56261847f8eSopenharmony_ci   * @since 12
56361847f8eSopenharmony_ci   */
56461847f8eSopenharmony_ci  startAbilityByType(type: string, wantParam: Record<string, Object>,
56561847f8eSopenharmony_ci    abilityStartCallback: AbilityStartCallback, callback: AsyncCallback<void>): void;
56661847f8eSopenharmony_ci
56761847f8eSopenharmony_ci  /**
56861847f8eSopenharmony_ci   * Starts the UIAbility or UIExtensionAbility by type.
56961847f8eSopenharmony_ci   * If the target ability is visible, you can start the target ability; If the target ability is invisible,
57061847f8eSopenharmony_ci   * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
57161847f8eSopenharmony_ci   *
57261847f8eSopenharmony_ci   * @param { string } type - The type of target ability.
57361847f8eSopenharmony_ci   * @param { Record<string, Object> } wantParam - Indicates the want parameter.
57461847f8eSopenharmony_ci   * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
57561847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
57661847f8eSopenharmony_ci   * @throws { BusinessError } 201 - The application does not have permission to call the interface.
57761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
57861847f8eSopenharmony_ci   * 2. Incorrect parameter types.
57961847f8eSopenharmony_ci   * @throws { BusinessError } 16000001 - The specified ability does not exist.
58061847f8eSopenharmony_ci   * @throws { BusinessError } 16000002 - Incorrect ability type.
58161847f8eSopenharmony_ci   * @throws { BusinessError } 16000004 - Can not start invisible component.
58261847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
58361847f8eSopenharmony_ci   * @throws { BusinessError } 16200001 - The caller has been released.
58461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
58561847f8eSopenharmony_ci   * @stagemodelonly
58661847f8eSopenharmony_ci   * @since 11
58761847f8eSopenharmony_ci   */
58861847f8eSopenharmony_ci  /**
58961847f8eSopenharmony_ci   * Starts the UIAbility or UIExtensionAbility by type.
59061847f8eSopenharmony_ci   * If the caller application is in the background, it is not allowed to call this interface.
59161847f8eSopenharmony_ci   *
59261847f8eSopenharmony_ci   * @param { string } type - The type of target ability.
59361847f8eSopenharmony_ci   * @param { Record<string, Object> } wantParam - Indicates the want parameter.
59461847f8eSopenharmony_ci   * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
59561847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
59661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
59761847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
59861847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
59961847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
60061847f8eSopenharmony_ci   * @stagemodelonly
60161847f8eSopenharmony_ci   * @since 12
60261847f8eSopenharmony_ci   */
60361847f8eSopenharmony_ci  startAbilityByType(type: string, wantParam: Record<string, Object>,
60461847f8eSopenharmony_ci    abilityStartCallback: AbilityStartCallback): Promise<void>;
60561847f8eSopenharmony_ci
60661847f8eSopenharmony_ci  /**
60761847f8eSopenharmony_ci   * Get the UIExtension Host Window proxy.
60861847f8eSopenharmony_ci   *
60961847f8eSopenharmony_ci   * @returns { uiExtensionHost.UIExtensionHostWindowProxy } Returns the UIExtension Host Window proxy.
61061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
61161847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
61261847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
61361847f8eSopenharmony_ci   * @systemapi
61461847f8eSopenharmony_ci   * @stagemodelonly
61561847f8eSopenharmony_ci   * @since 11
61661847f8eSopenharmony_ci   */
61761847f8eSopenharmony_ci  getUIExtensionHostWindowProxy(): uiExtensionHost.UIExtensionHostWindowProxy;
61861847f8eSopenharmony_ci
61961847f8eSopenharmony_ci  /**
62061847f8eSopenharmony_ci   * Get the UIExtension Window proxy.
62161847f8eSopenharmony_ci   *
62261847f8eSopenharmony_ci   * @returns { uiExtension.WindowProxy } Returns the UIExtension Window proxy.
62361847f8eSopenharmony_ci   * @throws { BusinessError } 16000050 - Internal error.
62461847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
62561847f8eSopenharmony_ci   * @stagemodelonly
62661847f8eSopenharmony_ci   * @since 12
62761847f8eSopenharmony_ci   */
62861847f8eSopenharmony_ci  getUIExtensionWindowProxy(): uiExtension.WindowProxy;
62961847f8eSopenharmony_ci}
630