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