1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.app.ability.UIExtensionContentSession.d.ts 35.74 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"),
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit AbilityKit
*/
import type { AbilityResult } from './ability/abilityResult';
import type AbilityStartCallback from './application/AbilityStartCallback';
import type { AsyncCallback } from './@ohos.base';
import type Want from './@ohos.app.ability.Want';
import type StartOptions from './@ohos.app.ability.StartOptions';
import type uiExtensionHost from './@ohos.uiExtensionHost';
import type uiExtension from './@ohos.arkui.uiExtension';
/**
* class of ui extension content session.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
export default class UIExtensionContentSession {
/**
* Send data from an ui extension to an ui extension component.
*
* @param { object } data - Indicates the data send to ui extension component.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
/**
* Send data from an ui extension to an ui extension component.
*
* @param { Record<string, Object> } data - Indicates the data send to ui extension component.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
sendData(data: Record<string, Object>): void;
/**
* Sets the callback for the ui extension to receive data from an ui extension component.
*
* @param { function } callback - Indicates the receive data callback to set.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
setReceiveDataCallback(callback: (data: Record<string, Object>) => void): void;
/**
* Sets the callback with return value for the ui extension to receive data from an ui extension component.
*
* @param { function } callback - Indicates the receive data callback to set.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
setReceiveDataForResultCallback(callback: (data: Record<string, Object>) => Record<string, Object>): void;
/**
* Loads an UI extension content.
*
* @param { string } path - Path of the page to which the content will be loaded
* @param { LocalStorage } [storage] - The data object shared within the content instance loaded by the page
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
loadContent(path: string, storage?: LocalStorage): void;
/**
* UI extension uses this method to start a specific ability.If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbility(want: Want, callback: AsyncCallback<void>): void;
/**
* UI extension uses this method to start a specific ability.If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } options - Indicates the start options.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
/**
* UI extension uses this method to start a specific ability.If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } [options] - Indicates the start options.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbility(want: Want, options?: StartOptions): Promise<void>;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
startAbilityAsCaller(want: Want, callback: AsyncCallback<void>): void;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } options - Indicates the start options.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } [options] - Indicates the start options.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
startAbilityAsCaller(want: Want, options?: StartOptions): Promise<void>;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
* If the caller application is in foreground, you can use this method to start ability; If the caller application
* is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
* If the caller application is in foreground, you can use this method to start ability; If the caller application
* is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } options - Indicates the start options.
* @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
* If the caller application is in foreground, you can use this method to start ability; If the caller application
* is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } [options] - Indicates the start options.
* @returns { Promise<AbilityResult> } Returns the result of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
/**
* Destroys the UI extension.
*
* @param { AsyncCallback<void> } callback - The callback of terminateSelf.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
terminateSelf(callback: AsyncCallback<void>): void;
/**
* Destroys the UI extension.
*
* @returns { Promise<void> } The promise returned by the function.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
terminateSelf(): Promise<void>;
/**
* Destroys the UI extension while returning the specified result code and data to the caller.
*
* @param { AbilityResult } parameter - Indicates the result to return.
* @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
/**
* Destroys the UI extension while returning the specified result code and data to the caller.
*
* @param { AbilityResult } parameter - Indicates the result to return.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
/**
* Sets the background color of the UI extension.
*
* @param { string } color - the specified color.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 10
*/
setWindowBackgroundColor(color: string): void;
/**
* Sets whether this window is in privacy mode.
*
* @permission ohos.permission.PRIVACY_WINDOW
* @param { boolean } isPrivacyMode - Whether the window is in privacy mode. The value true means that
* the window is in privacy mode, and false means the opposite.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>;
/**
* Sets whether this window is in privacy mode.
*
* @permission ohos.permission.PRIVACY_WINDOW
* @param { boolean } isPrivacyMode - Whether the window is in privacy mode. The value true means that
* the window is in privacy mode, and false means the opposite.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 10
*/
setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void;
/**
* Starts the UIAbility or UIExtensionAbility by type.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
*
* @param { string } type - The type of target ability.
* @param { Record<string, Object> } wantParam - Indicates the want parameter.
* @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 11
*/
/**
* Starts the UIAbility or UIExtensionAbility by type.
* If the caller application is in the background, it is not allowed to call this interface.
*
* @param { string } type - The type of target ability.
* @param { Record<string, Object> } wantParam - Indicates the want parameter.
* @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 12
*/
startAbilityByType(type: string, wantParam: Record<string, Object>,
abilityStartCallback: AbilityStartCallback, callback: AsyncCallback<void>): void;
/**
* Starts the UIAbility or UIExtensionAbility by type.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
*
* @param { string } type - The type of target ability.
* @param { Record<string, Object> } wantParam - Indicates the want parameter.
* @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 11
*/
/**
* Starts the UIAbility or UIExtensionAbility by type.
* If the caller application is in the background, it is not allowed to call this interface.
*
* @param { string } type - The type of target ability.
* @param { Record<string, Object> } wantParam - Indicates the want parameter.
* @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 12
*/
startAbilityByType(type: string, wantParam: Record<string, Object>,
abilityStartCallback: AbilityStartCallback): Promise<void>;
/**
* Get the UIExtension Host Window proxy.
*
* @returns { uiExtensionHost.UIExtensionHostWindowProxy } Returns the UIExtension Host Window proxy.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 11
*/
getUIExtensionHostWindowProxy(): uiExtensionHost.UIExtensionHostWindowProxy;
/**
* Get the UIExtension Window proxy.
*
* @returns { uiExtension.WindowProxy } Returns the UIExtension Window proxy.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 12
*/
getUIExtensionWindowProxy(): uiExtension.WindowProxy;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助