1 /* 2 * Copyright (c) 2020-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 16 #ifndef OHOS_ACELITE_OHOS_MODULE_CONFIG_H 17 #define OHOS_ACELITE_OHOS_MODULE_CONFIG_H 18 19 #include "acelite_config.h" 20 #include "jsi_types.h" 21 22 namespace OHOS { 23 namespace ACELite { 24 #if (ENABLE_MODULE_REQUIRE_TEST == 1) 25 extern void InitSampleModule(JSIValue exports); 26 #endif 27 extern void InitRouterModule(JSIValue exports); 28 extern void InitAppModule(JSIValue exports); 29 #if (FEATURE_SUPPORT_HTTP == 1) 30 extern void InitFetchModule(JSIValue exports); 31 #endif // FEATURE_SUPPORT_HTTP 32 #if (FEATURE_MODULE_AUDIO == 1) 33 extern void InitAudioModule(JSIValue exports); 34 #endif // FEATURE_MODULE_AUDIO 35 #if (FEATURE_ACELITE_DFX_MODULE == 1) 36 extern void InitDfxModule(JSIValue exports); 37 #endif // FEATURE_ACELITE_DFX_MODULE 38 #if (ENABLE_MODULE_CIPHER == 1) 39 extern void InitCipherModule(JSIValue exports); 40 #endif 41 #if (FEATURE_MODULE_DIALOG == 1) 42 extern void InitDialogModule(JSIValue exports); 43 #endif // FEATURE_MODULE_DIALOG 44 45 #if (FEATURE_MODULE_STORAGE == 1) 46 extern void InitNativeApiFs(JSIValue exports); 47 extern void InitNativeApiKv(JSIValue exports); 48 #endif 49 50 #if (FEATURE_MODULE_DEVICE == 1) 51 extern void InitDeviceModule(JSIValue exports); 52 #endif 53 54 #if (FEATURE_MODULE_GEO == 1) 55 extern void InitLocationModule(JSIValue exports); 56 #endif 57 58 #if (FEATURE_MODULE_SENSOR == 1) 59 extern void InitVibratorModule(JSIValue exports); 60 extern void InitSensorModule(JSIValue exports); 61 #endif 62 63 #if (FEATURE_MODULE_BRIGHTNESS == 1) 64 extern void InitBrightnessModule(JSIValue exports); 65 #endif 66 67 #if (FEATURE_MODULE_BATTERY == 1) 68 extern void InitBatteryModule(JSIValue exports); 69 #endif 70 71 #if (FEATURE_MODULE_CONFIGURATION == 1) 72 extern void InitLocaleModule(JSIValue exports); 73 #endif 74 75 #if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1) 76 extern void InitCapabilityModule(JSIValue exports); 77 #endif 78 79 #if (ENABLE_MODULE_DM_LITE == 1) 80 extern void InitDeviceManagerModule(JSIValue exports); 81 #endif 82 83 #if (FEATURE_MODULE_OHOS_HILOG == 1) 84 extern void InitHilogModule(JSIValue exports); 85 #endif 86 87 #if (FEATURE_COMPONENT_DEVICE_ATTEST == 1) 88 extern void InitDeviceAttestModule(JSIValue exports); 89 #endif 90 91 // Config information for built-in JS modules of OHOS platform 92 const Module OHOS_MODULES[] = { 93 #if (ENABLE_MODULE_REQUIRE_TEST == 1) 94 {"sample", InitSampleModule}, 95 #endif 96 {"app", InitAppModule}, 97 #if (FEATURE_SUPPORT_HTTP == 1) 98 {"fetch", InitFetchModule}, 99 #endif // FEATURE_SUPPORT_HTTP 100 #if (FEATURE_MODULE_AUDIO == 1) 101 {"audio", InitAudioModule}, 102 #endif // FEATURE_MODULE_AUDIO 103 #if (FEATURE_ACELITE_DFX_MODULE == 1) 104 {"dfx", InitDfxModule}, 105 #endif // FEATURE_ACELITE_DFX_MODULE 106 {"router", InitRouterModule}, 107 #if (ENABLE_MODULE_CIPHER == 1) 108 {"cipher", InitCipherModule}, 109 #endif 110 #if (FEATURE_MODULE_DIALOG == 1) 111 {"prompt", InitDialogModule}, 112 #endif // FEATURE_MODULE_DIALOG 113 114 #if (FEATURE_MODULE_STORAGE == 1) 115 {"file", InitNativeApiFs}, 116 {"storage", InitNativeApiKv}, 117 #endif 118 #if (FEATURE_MODULE_DEVICE == 1) 119 {"device", InitDeviceModule}, 120 #endif 121 #if (FEATURE_MODULE_GEO == 1) 122 {"geolocation", InitLocationModule}, 123 #endif 124 #if (FEATURE_MODULE_SENSOR == 1) 125 {"vibrator", InitVibratorModule}, 126 {"sensor", InitSensorModule}, 127 #endif 128 #if (FEATURE_MODULE_BRIGHTNESS == 1) 129 {"brightness", InitBrightnessModule}, 130 #endif 131 #if (FEATURE_MODULE_BATTERY == 1) 132 {"battery", InitBatteryModule}, 133 #endif 134 #if (FEATURE_MODULE_CONFIGURATION == 1) 135 {"configuration", InitLocaleModule}, 136 #endif 137 #if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1) 138 {"capability", InitCapabilityModule}, 139 #endif 140 #if (ENABLE_MODULE_DM_LITE == 1) 141 {"devicemanager", InitDeviceManagerModule}, 142 #endif 143 #if (FEATURE_MODULE_OHOS_HILOG == 1) 144 {"hilog", InitHilogModule}, 145 #endif 146 #if (FEATURE_COMPONENT_DEVICE_ATTEST == 1) 147 {"deviceAttest", InitDeviceAttestModule}, 148 #endif 149 }; 150 } // namespace ACELite 151 } // namespace OHOS 152 153 #endif // OHOS_ACELITE_OHOS_MODULE_CONFIG_H 154