• 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 './@ohos.base';
17import type { BundleStatusCallback as _BundleStatusCallback } from './bundle/bundleStatusCallback';
18import { LauncherAbilityInfo } from './bundle/launcherAbilityInfo';
19import { ShortcutInfo } from './bundle/shortcutInfo';
20
21/**
22 * inner bundle manager.
23 *
24 * @namespace innerBundleManager
25 * @syscap SystemCapability.BundleManager.BundleFramework
26 * @systemapi Hide this for inner system use
27 * @since 8
28 * @deprecated since 9
29 * @useinstead ohos.bundle.launcherBundleManager
30 */
31declare namespace innerBundleManager {
32  /**
33   * Obtains based on a given bundleName and userId.
34   *
35   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
36   * @param { string } bundleName - Indicates the application bundle name to be queried.
37   * @param { number } userId - Indicates the id for the user.
38   * @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback
39   * @syscap SystemCapability.BundleManager.BundleFramework
40   * @systemapi Hide this for inner system use
41   * @since 8
42   * @deprecated since 9
43   * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo
44   */
45  function getLauncherAbilityInfos(bundleName: string,
46    userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>): void;
47
48  /**
49   * Obtains based on a given bundleName and userId.
50   *
51   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
52   * @param { string } bundleName - Indicates the application bundle name to be queried.
53   * @param { number } userId - Indicates the id for the user.
54   * @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array.
55   * @syscap SystemCapability.BundleManager.BundleFramework
56   * @systemapi Hide this for inner system use
57   * @since 8
58   * @deprecated since 9
59   * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo
60   */
61  function getLauncherAbilityInfos(bundleName: string, userId: number): Promise<Array<LauncherAbilityInfo>>;
62
63  /**
64   * Register Callback.
65   *
66   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
67   * @param { 'BundleStatusChange' } type - Indicates the command should be implement.
68   * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register.
69   * @param { AsyncCallback<string> } callback
70   * @syscap SystemCapability.BundleManager.BundleFramework
71   * @systemapi Hide this for inner system use
72   * @since 8
73   * @deprecated since 9
74   * @useinstead ohos.bundle.bundleMonitor#on
75   */
76  function on(type: 'BundleStatusChange',
77    bundleStatusCallback: BundleStatusCallback, callback: AsyncCallback<string>): void;
78
79  /**
80   * Register Callback.
81   *
82   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
83   * @param { 'BundleStatusChange' } type - Indicates the command should be implement.
84   * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register.
85   * @returns { Promise<string> } - Returns the result of register.
86   * @syscap SystemCapability.BundleManager.BundleFramework
87   * @systemapi Hide this for inner system use
88   * @since 8
89   * @deprecated since 9
90   * @useinstead ohos.bundle.bundleMonitor#on
91   */
92  function on(type: 'BundleStatusChange', bundleStatusCallback: BundleStatusCallback): Promise<string>;
93
94  /**
95   * UnRegister Callback.
96   *
97   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
98   * @param { 'BundleStatusChange' } type - Indicates the command should be implement.
99   * @param { AsyncCallback<string> } callback
100   * @syscap SystemCapability.BundleManager.BundleFramework
101   * @systemapi Hide this for inner system use
102   * @since 8
103   * @deprecated since 9
104   * @useinstead ohos.bundle.bundleMonitor#off
105   */
106  function off(type: 'BundleStatusChange', callback: AsyncCallback<string>): void;
107
108  /**
109   * UnRegister Callback.
110   *
111   * @permission ohos.permission.LISTEN_BUNDLE_CHANGE
112   * @param { 'BundleStatusChange' } type - Indicates the command should be implement.
113   * @returns { Promise<string> } Returns the result of unregister.
114   * @syscap SystemCapability.BundleManager.BundleFramework
115   * @systemapi Hide this for inner system use
116   * @since 8
117   * @deprecated since 9
118   * @useinstead ohos.bundle.bundleMonitor#off
119   */
120  function off(type: 'BundleStatusChange'): Promise<string>;
121
122  /**
123   * Obtains based on a given userId.
124   *
125   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
126   * @param { number } userId - Indicates the id for the user.
127   * @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback
128   * @syscap SystemCapability.BundleManager.BundleFramework
129   * @systemapi Hide this for inner system use
130   * @since 8
131   * @deprecated since 9
132   * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos
133   */
134  function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>): void;
135
136  /**
137   * Obtains based on a given userId.
138   *
139   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
140   * @param { number } userId - Indicates the id for the user.
141   * @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array.
142   * @syscap SystemCapability.BundleManager.BundleFramework
143   * @systemapi Hide this for inner system use
144   * @since 8
145   * @deprecated since 9
146   * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos
147   */
148  function getAllLauncherAbilityInfos(userId: number): Promise<Array<LauncherAbilityInfo>>;
149
150  /**
151   * Obtains based on a given bundleName.
152   *
153   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
154   * @param { string } bundleName - Indicates the application bundle name to be queried.
155   * @param { AsyncCallback<Array<ShortcutInfo>> } callback
156   * @syscap SystemCapability.BundleManager.BundleFramework
157   * @systemapi Hide this for inner system use
158   * @since 8
159   * @deprecated since 9
160   * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo
161   */
162  function getShortcutInfos(bundleName: string, callback: AsyncCallback<Array<ShortcutInfo>>): void;
163
164  /**
165   * Obtains based on a given bundleName.
166   *
167   * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
168   * @param { string } bundleName - Indicates the application bundle name to be queried.
169   * @returns { Promise<Array<ShortcutInfo>> } Returns the LauncherShortcutInfo array.
170   * @syscap SystemCapability.BundleManager.BundleFramework
171   * @systemapi Hide this for inner system use
172   * @since 8
173   * @deprecated since 9
174   * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo
175   */
176  function getShortcutInfos(bundleName: string): Promise<Array<ShortcutInfo>>;
177}
178
179/**
180 * Contains basic Ability information, which uniquely identifies a launcher StatusCallback.
181 *
182 * @syscap SystemCapability.BundleManager.BundleFramework
183 * @systemapi Hide this for inner system use
184 * @since 8
185 * @deprecated since 9
186 */
187export type BundleStatusCallback = _BundleStatusCallback;
188
189export default innerBundleManager;
190