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