• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { AsyncCallback } from './basic';
17import { BundleStatusCallback } from './bundle/bundleStatusCallback';
18import { LauncherAbilityInfo } from './bundle/launcherAbilityInfo';
19import { ShortcutInfo } from './bundle/shortcutInfo';
20
21/**
22 * inner bundle manager.
23 * @name innerBundleManager
24 * @since 8
25 * @syscap SystemCapability.BundleManager.BundleFramework
26 * @systemapi Hide this for inner system use
27 * @deprecated since 9
28 * @useinstead ohos.bundle.launcherBundleManager
29 */
30
31declare namespace innerBundleManager {
32  /**
33   * Obtains based on a given bundleName and userId.
34   *
35   * @since 8
36   * @syscap SystemCapability.BundleManager.BundleFramework
37   * @param bundleName Indicates the application bundle name to be queried.
38   * @param userId Indicates the id for the user.
39   * @returns Returns the LauncherAbilityInfo object.
40   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
41   * @systemapi Hide this for inner system use
42   * @deprecated since 9
43   * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo
44   */
45  function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void;
46  function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise<Array<LauncherAbilityInfo>>;
47
48  /**
49   * Register Callback.
50   *
51   * @since 8
52   * @syscap SystemCapability.BundleManager.BundleFramework
53   * @param type Indicates the command should be implement.
54   * @param LauncherStatusCallback Indicates the callback to be register.
55   * @returns { string | Promise<string> } Returns the result of register.
56   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
57   * @systemapi Hide this for inner system use
58   * @deprecated since 9
59   * @useinstead ohos.bundle.bundleMonitor#on
60   */
61  function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback<string>) : void;
62  function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Promise<string>;
63
64  /**
65   * UnRegister Callback.
66   *
67   * @since 8
68   * @syscap SystemCapability.BundleManager.BundleFramework
69   * @param type Indicates the command should be implement.
70   * @returns { string | Promise<string> } Returns the result of unregister.
71   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
72   * @systemapi Hide this for inner system use
73   * @deprecated since 9
74   * @useinstead ohos.bundle.bundleMonitor#off
75   */
76  function off(type:"BundleStatusChange", callback: AsyncCallback<string>) : void;
77  function off(type:"BundleStatusChange"): Promise<string>;
78
79  /**
80   * Obtains based on a given userId.
81   *
82   * @since 8
83   * @syscap SystemCapability.BundleManager.BundleFramework
84   * @param userId Indicates the id for the user.
85   * @returns Returns the LauncherAbilityInfo object.
86   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
87   * @systemapi Hide this for inner system use
88   * @deprecated since 9
89   * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos
90   */
91  function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void;
92  function getAllLauncherAbilityInfos(userId: number) : Promise<Array<LauncherAbilityInfo>>;
93
94  /**
95   * Obtains based on a given bundleName.
96   *
97   * @since 8
98   * @syscap SystemCapability.BundleManager.BundleFramework
99   * @param bundleName Indicates the application bundle name to be queried.
100   * @returns Returns the LauncherShortcutInfo object.
101   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
102   * @systemapi Hide this for inner system use
103   * @deprecated since 9
104   * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo
105   */
106  function getShortcutInfos(bundleName :string, callback: AsyncCallback<Array<ShortcutInfo>>) : void;
107  function getShortcutInfos(bundleName : string) : Promise<Array<ShortcutInfo>>;
108}
109
110export default innerBundleManager;
111