@react-native-ohos/react-native-system-setting 1.8.0-rc.1 → 1.8.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/harmony/react_native_system_setting/BuildProfile.ets +16 -16
  2. package/harmony/react_native_system_setting/oh-package.json5 +1 -1
  3. package/harmony/react_native_system_setting/src/main/ets/RNSystemSettingTurboModule.ts +19 -12
  4. package/harmony/react_native_system_setting.har +0 -0
  5. package/package.json +1 -1
  6. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.ts_checker_cache +0 -3265
  7. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo +0 -1
  8. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo.linter +0 -1
  9. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/compileInfo.json +0 -1
  10. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-2fddbfa85232e8c40c1136f190876ccc.msgpack +0 -0
  11. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Logger.ts-8e34cf7fa6426785b8ad5585899ed6b1.msgpack +0 -0
  12. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSystemSettingPackage.ts-30c76849c83af152019669e58dba3868.msgpack +0 -0
  13. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSystemSettingTurboModule.ts-7a1b45b73925f478da2aa3d03fb615f7.msgpack +0 -1140
  14. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ReactNativeSystemSetting.ts-8877d7ca6db401765ea2eea734a446fa.msgpack +0 -0
  15. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/index.ets-bee9eb0a0c5d135a91e741ea4b9a65c8.msgpack +0 -0
  16. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-3cbe49cf5f58ba5b139d5dfafe202b93.msgpack +0 -0
  17. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-4dbe8955872e62aac8fffa74b038b1db.msgpack +0 -0
  18. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-9f780c638fd01ebe14b69a7714c4c148.msgpack +0 -0
  19. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-b18f20d502073e5ca84a0eac4a01ef96.msgpack +0 -0
  20. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack +0 -1
  21. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack +0 -0
  22. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/dep_info.json +0 -1
  23. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/BuildProfile.ets +0 -17
  24. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/Index.ets +0 -27
  25. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/ResourceTable.txt +0 -1
  26. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/build-profile.json5 +0 -31
  27. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/consumer-rules.txt +0 -0
  28. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/hvigorfile.ts +0 -6
  29. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/obfuscation-rules.txt +0 -18
  30. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/oh-package-lock.json5 +0 -19
  31. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/oh-package.json5 +0 -1
  32. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/CMakeLists.txt +0 -7
  33. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/RNSystemSettingPackage.h +0 -76
  34. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/ReactNativeSystemSetting.cpp +0 -54
  35. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/ReactNativeSystemSetting.h +0 -21
  36. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/Logger.ts +0 -64
  37. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/RNSystemSettingPackage.ts +0 -52
  38. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/RNSystemSettingTurboModule.ts +0 -362
  39. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/components/ts.ts +0 -5
  40. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/index.ets +0 -8
  41. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/ts.ts +0 -9
  42. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/turboModules/ReactNativeSystemSetting.ts +0 -86
  43. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/turboModules/ts.ts +0 -8
  44. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/module.json +0 -28
  45. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/base/element/string.json +0 -8
  46. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/en_US/element/string.json +0 -8
  47. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/zh_CN/element/string.json +0 -8
  48. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/ts.ts +0 -25
  49. package/harmony/react_native_system_setting/build/default/generated/pm/default/oh-package.json5 +0 -1
  50. package/harmony/react_native_system_setting/build/default/generated/r/default/ResourceTable.h +0 -24
  51. package/harmony/react_native_system_setting/build/default/intermediates/loader/default/loader.json +0 -30
  52. package/harmony/react_native_system_setting/build/default/intermediates/merge_profile/default/module.json +0 -25
  53. package/harmony/react_native_system_setting/build/default/intermediates/patch/default/base_native_libs.json +0 -1
  54. package/harmony/react_native_system_setting/build/default/intermediates/process_profile/default/module.json +0 -28
  55. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ResourceTable.txt +0 -1
  56. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ark_module.json +0 -1
  57. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ids_map/id_defined.json +0 -7
  58. package/harmony/react_native_system_setting/build/default/intermediates/res/default/module.json +0 -26
  59. package/harmony/react_native_system_setting/build/default/intermediates/res/default/opt-compression.json +0 -1
  60. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resConfig.json +0 -1
  61. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resources/rawfile/rnoh.profdata +0 -0
  62. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resources.index +0 -0
  63. package/harmony/react_native_system_setting/build/default/outputs/default/react_native_system_setting.har +0 -0
  64. package/harmony/react_native_system_setting/oh-package-lock.json5 +0 -19
@@ -1 +0,0 @@
1
- {"resolveConflictMode":true,"depName2RootPath":{"@rnoh/react-native-openharmony":"D:\\dev\\rnt77_cmt\\25P1_3\\harmony\\oh_modules\\.ohpm\\@rnoh+react-native-openharmony@4+ohuo6yfmj3imxybqamz3+78szehrybukrhgc7nzee=\\oh_modules\\@rnoh\\react-native-openharmony","@ohos/hypium":"D:\\dev\\rnt77_cmt\\25P1_3\\harmony\\oh_modules\\.ohpm\\@ohos+hypium@1.0.6\\oh_modules\\@ohos\\hypium"},"depName2DepInfo":{"react_native_system_setting":{"dependencyType":"har","isByteCodeHar":false,"pkgRootPath":"D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting","pkgName":"@react-native-ohos/react-native-system-setting","pkgVersion":"1.8.0-rc.1"},"@rnoh/react-native-openharmony":{"dependencyType":"har","isByteCodeHar":false,"pkgRootPath":"D:\\dev\\rnt77_cmt\\25P1_3\\harmony\\oh_modules\\.ohpm\\@rnoh+react-native-openharmony@4+ohuo6yfmj3imxybqamz3+78szehrybukrhgc7nzee=\\oh_modules\\@rnoh\\react-native-openharmony","pkgName":"@rnoh/react-native-openharmony","pkgVersion":"0.77.26"},"@ohos/hypium":{"dependencyType":"other","isByteCodeHar":false,"pkgRootPath":"D:\\dev\\rnt77_cmt\\25P1_3\\harmony\\oh_modules\\.ohpm\\@ohos+hypium@1.0.6\\oh_modules\\@ohos\\hypium","pkgName":"@ohos/hypium","pkgVersion":"1.0.6"}}}
@@ -1,17 +0,0 @@
1
- /**
2
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
- */
4
- export const HAR_VERSION = '1.8.0-rc.1';
5
- export const BUILD_MODE_NAME = 'debug';
6
- export const DEBUG = true;
7
- export const TARGET_NAME = 'default';
8
-
9
- /**
10
- * BuildProfile Class is used only for compatibility purposes.
11
- */
12
- export default class BuildProfile {
13
- static readonly HAR_VERSION = HAR_VERSION;
14
- static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
- static readonly DEBUG = DEBUG;
16
- static readonly TARGET_NAME = TARGET_NAME;
17
- }
@@ -1,27 +0,0 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2024 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- export * from './ts';
26
- export * from "./src/main/ets/RNSystemSettingPackage";
27
- export * from "./src/main/ets/RNSystemSettingTurboModule";
@@ -1,31 +0,0 @@
1
- {
2
- "apiType": "stageMode",
3
- "buildOption": {
4
- },
5
- "buildOptionSet": [
6
- {
7
- "name": "release",
8
- "arkOptions": {
9
- "obfuscation": {
10
- "ruleOptions": {
11
- "enable": true,
12
- "files": [
13
- "./obfuscation-rules.txt"
14
- ]
15
- },
16
- "consumerFiles": [
17
- "./consumer-rules.txt"
18
- ]
19
- }
20
- },
21
- },
22
- ],
23
- "targets": [
24
- {
25
- "name": "default"
26
- },
27
- {
28
- "name": "ohosTest"
29
- }
30
- ]
31
- }
@@ -1,6 +0,0 @@
1
- import { harTasks } from '@ohos/hvigor-ohos-plugin';
2
-
3
- export default {
4
- system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
- }
@@ -1,18 +0,0 @@
1
- # Define project specific obfuscation rules here.
2
- # You can include the obfuscation configuration files in the current module's build-profile.json5.
3
- #
4
- # For more details, see
5
- # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6
-
7
- # Obfuscation options:
8
- # -disable-obfuscation: disable all obfuscations
9
- # -enable-property-obfuscation: obfuscate the property names
10
- # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11
- # -compact: remove unnecessary blank spaces and all line feeds
12
- # -remove-log: remove all console.* statements
13
- # -print-namecache: print the name cache that contains the mapping from the old names to new names
14
- # -apply-namecache: reuse the given cache file
15
-
16
- # Keep options:
17
- # -keep-property-name: specifies property names that you want to keep
18
- # -keep-global-name: specifies names that you want to keep in the global scope
@@ -1,19 +0,0 @@
1
- {
2
- "meta": {
3
- "stableOrder": true,
4
- "enableUnifiedLockfile": false
5
- },
6
- "lockfileVersion": 3,
7
- "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
8
- "specifiers": {
9
- "@rnoh/react-native-openharmony@../../../../dev/rnt77_cmt/25P1_3/harmony/react_native_openharmony/react_native_openharmony.har": "@rnoh/react-native-openharmony@../../../../dev/rnt77_cmt/25P1_3/harmony/react_native_openharmony/react_native_openharmony.har"
10
- },
11
- "packages": {
12
- "@rnoh/react-native-openharmony@../../../../dev/rnt77_cmt/25P1_3/harmony/react_native_openharmony/react_native_openharmony.har": {
13
- "name": "@rnoh/react-native-openharmony",
14
- "version": "0.77.26",
15
- "resolved": "../../../../dev/rnt77_cmt/25P1_3/harmony/react_native_openharmony/react_native_openharmony.har",
16
- "registryType": "local"
17
- }
18
- }
19
- }
@@ -1 +0,0 @@
1
- {"name":"@react-native-ohos/react-native-system-setting","version":"1.8.0-rc.1","description":"Please describe the basic information.","main":"Index.ets","author":"","license":"MIT","dependencies":{"@rnoh/react-native-openharmony":"file:../react_native_openharmony"},"metadata":{"sourceRoots":["./src/main"],"debug":true},"compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","obfuscated":false}
@@ -1,7 +0,0 @@
1
- cmake_minimum_required(VERSION 3.13)
2
- set(CMAKE_VERBOSE_MAKEFILE on)
3
-
4
- file(GLOB RNOH_SYSTEM_SETTING_SRC CONFIGURE_DEPENDS *.cpp)
5
- add_library(rnoh_system_setting SHARED ${RNOH_SYSTEM_SETTING_SRC})
6
- target_include_directories(rnoh_system_setting PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
7
- target_link_libraries(rnoh_system_setting PUBLIC rnoh)
@@ -1,76 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- *
7
- * @generatorVersion: 1
8
- */
9
-
10
- #pragma once
11
-
12
- #include "RNOH/Package.h"
13
- #include "RNOH/ArkTSTurboModule.h"
14
- #include "./ReactNativeSystemSetting.h"
15
-
16
- namespace rnoh {
17
-
18
- class RNSystemSettingFactoryDelegate : public TurboModuleFactoryDelegate {
19
- public:
20
- SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
21
- if (name == "ReactNativeSystemSetting") {
22
- return std::make_shared<ReactNativeSystemSetting>(ctx, name);
23
- }
24
- return nullptr;
25
- };
26
- };
27
-
28
- class RNSystemSettingEventEmitRequestHandler : public EventEmitRequestHandler {
29
- public:
30
- void handleEvent(Context const &ctx) override {
31
- auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
32
- auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
33
-
34
- if (eventEmitter == nullptr) {
35
- return;
36
- }
37
-
38
- std::vector<std::string> supportedComponentNames = {
39
- };
40
-
41
- std::vector<std::string> supportedEventNames = {
42
- };
43
-
44
- if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
45
- std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
46
- eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
47
- }
48
- }
49
- };
50
-
51
- class RNSystemSettingPackage : public Package {
52
- public:
53
-
54
- RNSystemSettingPackage(Package::Context ctx) : Package(ctx){};
55
- std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
56
- return std::make_unique<RNSystemSettingFactoryDelegate>();
57
- }
58
-
59
- std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
60
- return {
61
- };
62
- }
63
-
64
- ComponentJSIBinderByString createComponentJSIBinderByName() override {
65
- return {
66
- };
67
- };
68
-
69
- EventEmitRequestHandlers createEventEmitRequestHandlers() override {
70
- return {
71
- std::make_shared<RNSystemSettingEventEmitRequestHandler>(),
72
- };
73
- }
74
- };
75
-
76
- } // namespace rnoh
@@ -1,54 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- *
7
- * @generatorVersion: 1
8
- */
9
-
10
- #include "ReactNativeSystemSetting.h"
11
-
12
- namespace rnoh {
13
- using namespace facebook;
14
-
15
- ReactNativeSystemSetting::ReactNativeSystemSetting(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
16
- methodMap_ = {
17
- ARK_ASYNC_METHOD_METADATA(getBrightness, 0),
18
- ARK_ASYNC_METHOD_METADATA(setBrightness, 1),
19
- ARK_ASYNC_METHOD_METADATA(setBrightnessForce, 1),
20
- ARK_ASYNC_METHOD_METADATA(getAppBrightness, 0),
21
- ARK_ASYNC_METHOD_METADATA(setAppBrightness, 1),
22
- ARK_METHOD_METADATA(grantWriteSettingPremission, 0),
23
- ARK_ASYNC_METHOD_METADATA(getScreenMode, 0),
24
- ARK_ASYNC_METHOD_METADATA(setScreenMode, 1),
25
- ARK_ASYNC_METHOD_METADATA(saveBrightness, 0),
26
- ARK_METHOD_METADATA(restoreBrightness, 0),
27
- ARK_ASYNC_METHOD_METADATA(getVolume, 1),
28
- ARK_METHOD_METADATA(setVolume, 2),
29
- ARK_METHOD_METADATA(addVolumeListener, 0),
30
- ARK_METHOD_METADATA(removeVolumeListener, 1),
31
- ARK_ASYNC_METHOD_METADATA(isWifiEnabled, 0),
32
- ARK_METHOD_METADATA(switchWifiSilence, 1),
33
- ARK_METHOD_METADATA(switchWifi, 1),
34
- ARK_ASYNC_METHOD_METADATA(isLocationEnabled, 0),
35
- ARK_ASYNC_METHOD_METADATA(getLocationMode, 0),
36
- ARK_METHOD_METADATA(switchLocation, 1),
37
- ARK_ASYNC_METHOD_METADATA(isBluetoothEnabled, 0),
38
- ARK_METHOD_METADATA(switchBluetooth, 1),
39
- ARK_METHOD_METADATA(switchBluetoothSilence, 1),
40
- ARK_ASYNC_METHOD_METADATA(isAirplaneEnabled, 0),
41
- ARK_METHOD_METADATA(switchAirplane, 1),
42
- ARK_METHOD_METADATA(openAppSystemSettings, 0),
43
- ARK_METHOD_METADATA(addBluetoothListener, 0),
44
- ARK_ASYNC_METHOD_METADATA(addWifiListener, 1),
45
- ARK_ASYNC_METHOD_METADATA(addLocationListener, 1),
46
- ARK_ASYNC_METHOD_METADATA(addLocationModeListener, 1),
47
- ARK_ASYNC_METHOD_METADATA(addAirplaneListener, 1),
48
- ARK_METHOD_METADATA(removeListener, 1),
49
- ARK_METHOD_METADATA(addListener, 1),
50
- ARK_METHOD_METADATA(removeListeners, 1),
51
- };
52
- }
53
-
54
- } // namespace rnoh
@@ -1,21 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- *
7
- * @generatorVersion: 1
8
- */
9
-
10
- #pragma once
11
-
12
- #include "RNOH/ArkTSTurboModule.h"
13
-
14
- namespace rnoh {
15
-
16
- class JSI_EXPORT ReactNativeSystemSetting : public ArkTSTurboModule {
17
- public:
18
- ReactNativeSystemSetting(const ArkTSTurboModule::Context ctx, const std::string name);
19
- };
20
-
21
- } // namespace rnoh
@@ -1,64 +0,0 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2024 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import hilog from '@ohos.hilog';
26
-
27
- class Logger {
28
- private domain : number;
29
- private prefix : string;
30
- private format : string = '%{public}s, %{public}s';
31
- private isDebug : boolean;
32
-
33
- /**
34
- * constructor.
35
- *
36
- * @param Prefix Identifies the log tag.
37
- * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF.
38
- */
39
- constructor(prefix: string = 'MyApp', domain: number = 0xFF00, isDebug = false) {
40
- this.prefix = prefix;
41
- this.domain = domain;
42
- this.isDebug = isDebug;
43
- }
44
-
45
- debug(...args: string[]): void {
46
- if (this.isDebug) {
47
- hilog.debug(this.domain, this.prefix, this.format, args);
48
- }
49
- }
50
-
51
- info(...args: string[]): void {
52
- hilog.info(this.domain, this.prefix, this.format, args);
53
- }
54
-
55
- warn(...args: string[]) : void {
56
- hilog.warn(this.domain, this.prefix, this.format, args);
57
- }
58
-
59
- error(...args: string[]) : void {
60
- hilog.error(this.domain, this.prefix, this.format, args);
61
- }
62
- }
63
-
64
- export default new Logger('RNCSlider', 0xFF00, false)
@@ -1,52 +0,0 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2024 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
26
- import type {
27
- TurboModule,
28
- TurboModuleContext,
29
- } from '@rnoh/react-native-openharmony/ts';
30
- import { TM, RNC } from "./generated/ts"
31
- import { RNSystemSettingTurboModule } from './RNSystemSettingTurboModule';
32
-
33
-
34
- class RNSystemSettingTurboModuleFactory extends TurboModulesFactory {
35
- createTurboModule(name: string): TurboModule | null {
36
- if (this.hasTurboModule(name)) {
37
- globalThis.uiAbilityContext = this.ctx.uiAbilityContext;
38
- return new RNSystemSettingTurboModule(this.ctx);
39
- }
40
- return null;
41
- }
42
-
43
- hasTurboModule(name: string): boolean {
44
- return name === TM.ReactNativeSystemSetting.NAME;
45
- }
46
- }
47
-
48
- export class RNSystemSettingPackage extends RNPackage {
49
- createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
50
- return new RNSystemSettingTurboModuleFactory(ctx);
51
- }
52
- }