161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022 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 { AsyncCallback } from './@ohos.base';
2261847f8eSopenharmony_ciimport { ElementName } from './bundleManager/ElementName';
2361847f8eSopenharmony_ciimport { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundleManager/RemoteAbilityInfo';
2461847f8eSopenharmony_ci
2561847f8eSopenharmony_ci/**
2661847f8eSopenharmony_ci * DistributedBundle manager.
2761847f8eSopenharmony_ci *
2861847f8eSopenharmony_ci * @namespace distributedBundleManager
2961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.DistributedBundleFramework
3061847f8eSopenharmony_ci * @systemapi
3161847f8eSopenharmony_ci * @since 9
3261847f8eSopenharmony_ci */
3361847f8eSopenharmony_cideclare namespace distributedBundleManager {
3461847f8eSopenharmony_ci  /**
3561847f8eSopenharmony_ci   * Obtains information about the ability info of the remote device.
3661847f8eSopenharmony_ci   *
3761847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
3861847f8eSopenharmony_ci   * @param { ElementName } elementName - Indicates the elementName.
3961847f8eSopenharmony_ci   * @param { AsyncCallback<RemoteAbilityInfo> } callback - The callback of getting the ability info of the remote device.
4061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
4161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
4261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
4361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
4461847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
4561847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
4661847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
4761847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
4861847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
4961847f8eSopenharmony_ci   * @systemapi
5061847f8eSopenharmony_ci   * @since 9
5161847f8eSopenharmony_ci   */
5261847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void;
5361847f8eSopenharmony_ci
5461847f8eSopenharmony_ci  /**
5561847f8eSopenharmony_ci   * Obtains information about the ability info of the remote device.
5661847f8eSopenharmony_ci   *
5761847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
5861847f8eSopenharmony_ci   * @param { ElementName } elementName - Indicates the elementName.
5961847f8eSopenharmony_ci   * @returns { Promise<RemoteAbilityInfo> } Returns the ability info of the remote device.
6061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
6161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
6261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
6361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
6461847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
6561847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
6661847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
6761847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
6861847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
6961847f8eSopenharmony_ci   * @systemapi
7061847f8eSopenharmony_ci   * @since 9
7161847f8eSopenharmony_ci   */
7261847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementName: ElementName): Promise<RemoteAbilityInfo>;
7361847f8eSopenharmony_ci
7461847f8eSopenharmony_ci  /**
7561847f8eSopenharmony_ci   * Obtains information about the abilities info of the remote device.
7661847f8eSopenharmony_ci   *
7761847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
7861847f8eSopenharmony_ci   * @param { Array<ElementName> } elementNames - Indicates the elementNames, Maximum array length ten.
7961847f8eSopenharmony_ci   * @param { AsyncCallback<Array<RemoteAbilityInfo>> } callback - the callback of getting the abilities info of the remote device.
8061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
8161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
8261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
8361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
8461847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
8561847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
8661847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
8761847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
8861847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
8961847f8eSopenharmony_ci   * @systemapi
9061847f8eSopenharmony_ci   * @since 9
9161847f8eSopenharmony_ci   */
9261847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementNames: Array<ElementName>,
9361847f8eSopenharmony_ci    callback: AsyncCallback<Array<RemoteAbilityInfo>>): void;
9461847f8eSopenharmony_ci
9561847f8eSopenharmony_ci  /**
9661847f8eSopenharmony_ci   * Obtains information about the abilities info of the remote device.
9761847f8eSopenharmony_ci   *
9861847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
9961847f8eSopenharmony_ci   * @param { Array<ElementName> } elementNames - Indicates the elementNames, Maximum array length ten.
10061847f8eSopenharmony_ci   * @returns { Promise<Array<RemoteAbilityInfo>> } The result of getting the abilities info of the remote device.
10161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
10261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
10361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
10461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
10561847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
10661847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
10761847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
10861847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
10961847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
11061847f8eSopenharmony_ci   * @systemapi
11161847f8eSopenharmony_ci   * @since 9
11261847f8eSopenharmony_ci   */
11361847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementNames: Array<ElementName>): Promise<Array<RemoteAbilityInfo>>;
11461847f8eSopenharmony_ci
11561847f8eSopenharmony_ci  /**
11661847f8eSopenharmony_ci   * Obtains information about the ability info of the remote device.
11761847f8eSopenharmony_ci   *
11861847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
11961847f8eSopenharmony_ci   * @param { ElementName } elementName - Indicates the elementName.
12061847f8eSopenharmony_ci   * @param { string } locale - Indicates the locale info
12161847f8eSopenharmony_ci   * @param { AsyncCallback<RemoteAbilityInfo> } callback - The callback of getting the ability info of the remote device.
12261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
12461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
12561847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
12661847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
12761847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
12861847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
12961847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
13061847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
13161847f8eSopenharmony_ci   * @systemapi
13261847f8eSopenharmony_ci   * @since 9
13361847f8eSopenharmony_ci   */
13461847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementName: ElementName,
13561847f8eSopenharmony_ci    locale: string, callback: AsyncCallback<RemoteAbilityInfo>): void;
13661847f8eSopenharmony_ci
13761847f8eSopenharmony_ci  /**
13861847f8eSopenharmony_ci   * Obtains information about the ability info of the remote device.
13961847f8eSopenharmony_ci   *
14061847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
14161847f8eSopenharmony_ci   * @param { ElementName } elementName - Indicates the elementName.
14261847f8eSopenharmony_ci   * @param { string } locale - Indicates the locale info
14361847f8eSopenharmony_ci   * @returns { Promise<RemoteAbilityInfo> } The result of getting the ability info of the remote device.
14461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
14561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
14661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
14761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
14861847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
14961847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
15061847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
15161847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
15261847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
15361847f8eSopenharmony_ci   * @systemapi
15461847f8eSopenharmony_ci   * @since 9
15561847f8eSopenharmony_ci   */
15661847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise<RemoteAbilityInfo>;
15761847f8eSopenharmony_ci
15861847f8eSopenharmony_ci  /**
15961847f8eSopenharmony_ci   * Obtains information about the ability info of the remote device.
16061847f8eSopenharmony_ci   *
16161847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
16261847f8eSopenharmony_ci   * @param { Array<ElementName> } elementNames - Indicates the elementNames, Maximum array length ten.
16361847f8eSopenharmony_ci   * @param { string } locale - Indicates the locale info
16461847f8eSopenharmony_ci   * @param { AsyncCallback<Array<RemoteAbilityInfo>> } callback - Returns the abilities info of the remote device.
16561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
16661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
16761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
16861847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
16961847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
17061847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
17161847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
17261847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
17361847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
17461847f8eSopenharmony_ci   * @systemapi
17561847f8eSopenharmony_ci   * @since 9
17661847f8eSopenharmony_ci   */
17761847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementNames: Array<ElementName>,
17861847f8eSopenharmony_ci    locale: string, callback: AsyncCallback<Array<RemoteAbilityInfo>>): void;
17961847f8eSopenharmony_ci
18061847f8eSopenharmony_ci  /**
18161847f8eSopenharmony_ci   * Obtains information about the abilities info of the remote device.
18261847f8eSopenharmony_ci   *
18361847f8eSopenharmony_ci   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
18461847f8eSopenharmony_ci   * @param { Array<ElementName> } elementNames - Indicates the elementNames, Maximum array length ten.
18561847f8eSopenharmony_ci   * @param { string } locale - Indicates the locale info
18661847f8eSopenharmony_ci   * @returns { Promise<Array<RemoteAbilityInfo>> } Returns the abilities info of the remote device.
18761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
18861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
18961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
19061847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
19161847f8eSopenharmony_ci   * @throws { BusinessError } 17700001 - The specified bundle name is not found.
19261847f8eSopenharmony_ci   * @throws { BusinessError } 17700003 - The specified ability name is not found.
19361847f8eSopenharmony_ci   * @throws { BusinessError } 17700007 - The specified device ID is not found.
19461847f8eSopenharmony_ci   * @throws { BusinessError } 17700027 - The distributed service is not running.
19561847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
19661847f8eSopenharmony_ci   * @systemapi
19761847f8eSopenharmony_ci   * @since 9
19861847f8eSopenharmony_ci   */
19961847f8eSopenharmony_ci  function getRemoteAbilityInfo(elementNames: Array<ElementName>, locale: string): Promise<Array<RemoteAbilityInfo>>;
20061847f8eSopenharmony_ci
20161847f8eSopenharmony_ci  /**
20261847f8eSopenharmony_ci   * Contains basic remote ability information.
20361847f8eSopenharmony_ci   *
20461847f8eSopenharmony_ci   * @typedef { _RemoteAbilityInfo }
20561847f8eSopenharmony_ci   * @syscap SystemCapability.BundleManager.DistributedBundleFramework
20661847f8eSopenharmony_ci   * @systemapi
20761847f8eSopenharmony_ci   * @since 9
20861847f8eSopenharmony_ci   */
20961847f8eSopenharmony_ci  export type RemoteAbilityInfo = _RemoteAbilityInfo;
21061847f8eSopenharmony_ci}
21161847f8eSopenharmony_ci
21261847f8eSopenharmony_ciexport default distributedBundleManager;
213