1/* 2 * Copyright (c) 2022 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 * @typedef CheckPackageHasInstalledResponse 18 * @syscap SystemCapability.BundleManager.BundleFramework 19 * @since 3 20 * @deprecated since 9 21 */ 22export interface CheckPackageHasInstalledResponse { 23 /** 24 * Whether the application exists, or whether the native application has been installed. 25 * 26 * @syscap SystemCapability.BundleManager.BundleFramework 27 * @since 3 28 * @deprecated since 9 29 */ 30 result: boolean; 31} 32 33/** 34 * @typedef CheckPackageHasInstalledOptions 35 * @syscap SystemCapability.BundleManager.BundleFramework 36 * @since 3 37 * @deprecated since 9 38 */ 39export interface CheckPackageHasInstalledOptions { 40 /** 41 * Application bundle name. 42 * 43 * @syscap SystemCapability.BundleManager.BundleFramework 44 * @since 3 45 * @deprecated since 9 46 */ 47 bundleName: string; 48 49 /** 50 * Called when native applications are installed. 51 * 52 * @syscap SystemCapability.BundleManager.BundleFramework 53 * @since 3 54 * @deprecated since 9 55 */ 56 success?: (data: CheckPackageHasInstalledResponse) => void; 57 58 /** 59 * Called when native applications fail to be installed. 60 * 61 * @syscap SystemCapability.BundleManager.BundleFramework 62 * @since 3 63 * @deprecated since 9 64 */ 65 fail?: (data: any, code: number) => void; 66 67 /** 68 * Called when the execution is completed. 69 * 70 * @syscap SystemCapability.BundleManager.BundleFramework 71 * @since 3 72 * @deprecated since 9 73 */ 74 complete?: () => void; 75} 76 77/** 78 * @syscap SystemCapability.BundleManager.BundleFramework 79 * @since 3 80 * @deprecated since 9 81 */ 82export default class Package { 83 /** 84 * Checks whether an application exists, or whether a native application has been installed. 85 * 86 * @param { CheckPackageHasInstalledOptions } options Options 87 * @syscap SystemCapability.BundleManager.BundleFramework 88 * @since 3 89 * @deprecated since 9 90 */ 91 static hasInstalled(options: CheckPackageHasInstalledOptions): void; 92} 93