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