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 bundle from './../@ohos.bundle'; 18 19/** 20 * @name Provides parameters required for installing or uninstalling an application. 21 * @since 7 22 * @syscap SystemCapability.BundleManager.BundleFramework 23 * @systemapi Hide this for inner system use 24 * @deprecated since 9 25 * @useinstead ohos.bundle.installer#InstallParam 26 */ 27export interface InstallParam { 28 /** 29 * @default Indicates the user id 30 * @since 7 31 * @syscap SystemCapability.BundleManager.BundleFramework 32 * @deprecated since 9 33 * @useinstead ohos.bundle.installer.InstallParam#userId 34 */ 35 userId: number; 36 37 /** 38 * @default Indicates the install flag 39 * @since 7 40 * @syscap SystemCapability.BundleManager.BundleFramework 41 * @deprecated since 9 42 * @useinstead ohos.bundle.installer.InstallParam#installFlag 43 */ 44 installFlag: number; 45 46 /** 47 * @default Indicates whether the param has data 48 * @since 7 49 * @syscap SystemCapability.BundleManager.BundleFramework 50 * @deprecated since 9 51 * @useinstead ohos.bundle.installer.InstallParam#isKeepData 52 */ 53 isKeepData: boolean; 54} 55 56/** 57 * @name Indicates the install or uninstall status 58 * @since 7 59 * @syscap SystemCapability.BundleManager.BundleFramework 60 * @systemapi Hide this for inner system use 61 * @deprecated since 9 62 */ 63export interface InstallStatus { 64 65 /** 66 * @default Indicates the install or uninstall error code 67 * @since 7 68 * @syscap SystemCapability.BundleManager.BundleFramework 69 * @deprecated since 9 70 */ 71 status: bundle.InstallErrorCode; 72 73 /** 74 * @default Indicates the install or uninstall result string message 75 * @since 7 76 * @syscap SystemCapability.BundleManager.BundleFramework 77 * @deprecated since 9 78 */ 79 statusMessage: string; 80} 81 82/** 83 * @name Offers install, upgrade, and remove bundles on the devices. 84 * @since 7 85 * @syscap SystemCapability.BundleManager.BundleFramework 86 * @systemapi Hide this for inner system use 87 * @deprecated since 9 88 * @useinstead ohos.bundle.installer#BundleInstaller 89 */ 90export interface BundleInstaller { 91 /** 92 * Install an application in a HAP. 93 * 94 * @since 7 95 * @syscap SystemCapability.BundleManager.BundleFramework 96 * 97 * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the 98 * relative path to the data directory of the current application. 99 * @param param Indicates other parameters required for the installation. 100 * @returns InstallStatus 101 * @permission ohos.permission.INSTALL_BUNDLE 102 * @deprecated since 9 103 * @useinstead ohos.bundle.installer.BundleInstaller#install 104 */ 105 install(bundleFilePaths: Array<string>, param: InstallParam, callback: AsyncCallback<InstallStatus>): void; 106 107 /** 108 * Uninstall an application. 109 * 110 * @since 7 111 * @syscap SystemCapability.BundleManager.BundleFramework 112 * 113 * @param bundleName Indicates the bundle name of the application to be uninstalled. 114 * @param param Indicates other parameters required for the uninstall. 115 * @returns InstallStatus 116 * @permission ohos.permission.INSTALL_BUNDLE 117 * @deprecated since 9 118 * @useinstead ohos.bundle.installer.BundleInstaller#uninstall 119 */ 120 uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback<InstallStatus>): void; 121 122 /** 123 * recover an application. 124 * 125 * @since 8 126 * @syscap SystemCapability.BundleManager.BundleFramework 127 * 128 * @param bundleName Indicates the bundle name of the application to be recovered. 129 * @param param Indicates other parameters required for the recover. 130 * @returns InstallStatus 131 * @permission ohos.permission.INSTALL_BUNDLE 132 * @systemapi Hide this for inner system use 133 * @deprecated since 9 134 * @useinstead ohos.bundle.installer.BundleInstaller#recover 135 */ 136 recover(bundleName: string, param: InstallParam, callback: AsyncCallback<InstallStatus>): void; 137}