1 /*
2  * Copyright (c) 2022-2023 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 #ifndef APPEXECFWK_STANDARD_KITS_APPKIT_NAPI_PACKAGE_PACKAGE_H
16 #define APPEXECFWK_STANDARD_KITS_APPKIT_NAPI_PACKAGE_PACKAGE_H
17 #include "napi/native_api.h"
18 #include "napi/native_common.h"
19 #include "napi/native_node_api.h"
20 
21 namespace OHOS {
22 namespace AppExecFwk {
23 struct CheckPackageHasInstalledResponse {
24     bool result = false;
25 };
26 struct CheckPackageHasInstalledOptions {
27     napi_env env = nullptr;
28     napi_async_work asyncWork = nullptr;
29     napi_ref successRef = nullptr;
30     napi_ref failRef = nullptr;
31     napi_ref completeRef = nullptr;
32     std::string bundleName;
33     bool isString = false;
34     CheckPackageHasInstalledResponse response;
35     int32_t errCode = 0;
36     ~CheckPackageHasInstalledOptions();
37 };
38 napi_value HasInstalled(napi_env env, napi_callback_info info);
39 }  // namespace AppExecFwk
40 }  // namespace OHOS
41 #endif /* APPEXECFWK_STANDARD_KITS_APPKIT_NAPI_PACKAGE_PACKAGE_H */
42