@react-native-ohos/ting 1.2.4-rc.1 → 1.3.0-rc.1
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.
- package/LICENSE +20 -20
- package/README.OpenSource +10 -10
- package/README.md +14 -14
- package/harmony/ting/BuildProfile.ets +5 -5
- package/harmony/ting/build-profile.json5 +9 -9
- package/harmony/ting/hvigorfile.ts +2 -2
- package/harmony/ting/index.ets +6 -6
- package/harmony/ting/obfuscation-rules.txt +17 -17
- package/harmony/ting/oh-package.json5 +11 -11
- package/harmony/ting/src/main/cpp/CMakeLists.txt +7 -7
- package/harmony/ting/src/main/cpp/Ting.cpp +23 -23
- package/harmony/ting/src/main/cpp/Ting.h +18 -18
- package/harmony/ting/src/main/cpp/TingPackage.h +31 -31
- package/harmony/ting/src/main/ets/Logger.ets +63 -63
- package/harmony/ting/src/main/ets/TingPackage.ets +45 -45
- package/harmony/ting/src/main/ets/TingTurboModule.ets +531 -514
- package/harmony/ting/src/main/ets/Type.ets +138 -133
- package/harmony/ting/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/ting/src/main/ets/generated/index.ets +5 -5
- package/harmony/ting/src/main/ets/generated/ts.ts +6 -6
- package/harmony/ting/src/main/ets/generated/turboModules/Ting.ts +25 -25
- package/harmony/ting/src/main/ets/generated/turboModules/ts.ts +5 -5
- package/harmony/ting/src/main/module.json5 +6 -6
- package/harmony/ting/src/main/resources/base/element/color.json +7 -7
- package/harmony/ting/src/main/resources/base/element/string.json +15 -15
- package/harmony/ting/src/main/resources/base/profile/backup_config.json +2 -2
- package/harmony/ting/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/ting/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/ting/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/ting.har +0 -0
- package/lib/commonjs/NativeTing.js +4 -4
- package/lib/commonjs/NativeTing.js.map +1 -1
- package/lib/commonjs/Type.js.map +1 -1
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeTing.js +4 -4
- package/lib/module/NativeTing.js.map +1 -1
- package/lib/module/Type.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/package.json +158 -160
- package/src/NativeTing.ts +17 -17
- package/src/Type.ts +108 -108
- package/src/index.tsx +64 -64
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Baron Ha.
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
in the Software without restriction, including without limitation the rights
|
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
furnished to do so, subject to the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Baron Ha.
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.OpenSource
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"Name": "ting",
|
|
4
|
-
"License": "MIT License",
|
|
5
|
-
"License File": "https://github.com/baronha/ting/blob/main/LICENSE",
|
|
6
|
-
"Version Number": "1.2.3",
|
|
7
|
-
"Owner" : "xiafeng@huawei.com",
|
|
8
|
-
"Upstream URL": "https://github.com/NitrogenZLab/ting",
|
|
9
|
-
"Description": "Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin"
|
|
10
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"Name": "ting",
|
|
4
|
+
"License": "MIT License",
|
|
5
|
+
"License File": "https://github.com/baronha/ting/blob/main/LICENSE",
|
|
6
|
+
"Version Number": "1.2.3",
|
|
7
|
+
"Owner" : "xiafeng@huawei.com",
|
|
8
|
+
"Upstream URL": "https://github.com/NitrogenZLab/ting",
|
|
9
|
+
"Description": "Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin"
|
|
10
|
+
}
|
|
11
11
|
]
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# react-native-ohos/ting
|
|
2
|
-
|
|
3
|
-
本项目基于 [@baronha/ting](https://github.com/
|
|
4
|
-
|
|
5
|
-
## 文档地址 / Documentation URL
|
|
6
|
-
|
|
7
|
-
[中文 / Chinese](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/baronha-ting.md)
|
|
8
|
-
|
|
9
|
-
[英文 / English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/baronha-ting.md)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## 请悉知 / Acknowledgements
|
|
13
|
-
|
|
14
|
-
本项目基于 [The MIT License(MIT)](https://github.com/baronha/ting/blob/main/LICENSE) ,请自由地享受和参与开源。
|
|
1
|
+
# react-native-ohos/ting
|
|
2
|
+
|
|
3
|
+
本项目基于 [@baronha/ting@1.2.3](https://github.com/NitrogenZLab/ting/tree/1.2.3)
|
|
4
|
+
|
|
5
|
+
## 文档地址 / Documentation URL
|
|
6
|
+
|
|
7
|
+
[中文 / Chinese](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/baronha-ting.md)
|
|
8
|
+
|
|
9
|
+
[英文 / English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/baronha-ting.md)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## 请悉知 / Acknowledgements
|
|
13
|
+
|
|
14
|
+
本项目基于 [The MIT License(MIT)](https://github.com/baronha/ting/blob/main/LICENSE) ,请自由地享受和参与开源。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default class BuildProfile {
|
|
2
|
-
static readonly HAR_VERSION = '1.
|
|
3
|
-
static readonly BUILD_MODE_NAME = 'debug';
|
|
4
|
-
static readonly DEBUG = true;
|
|
5
|
-
static readonly TARGET_NAME = 'default';
|
|
1
|
+
export default class BuildProfile {
|
|
2
|
+
static readonly HAR_VERSION = '1.3.0-rc.1';
|
|
3
|
+
static readonly BUILD_MODE_NAME = 'debug';
|
|
4
|
+
static readonly DEBUG = true;
|
|
5
|
+
static readonly TARGET_NAME = 'default';
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"apiType": "stageMode",
|
|
3
|
-
"targets": [
|
|
4
|
-
{
|
|
5
|
-
"name": "default",
|
|
6
|
-
"runtimeOS": "HarmonyOS"
|
|
7
|
-
}
|
|
8
|
-
]
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"apiType": "stageMode",
|
|
3
|
+
"targets": [
|
|
4
|
+
{
|
|
5
|
+
"name": "default",
|
|
6
|
+
"runtimeOS": "HarmonyOS"
|
|
7
|
+
}
|
|
8
|
+
]
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
2
|
-
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
|
1
|
+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
2
|
+
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
package/harmony/ting/index.ets
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
7
|
export * from "./src/main/ets/TingPackage";
|
|
@@ -1,18 +1,18 @@
|
|
|
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://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
|
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
|
|
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://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
|
|
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
18
|
# -keep-global-name: specifies names that you want to keep in the global scope
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
license: 'MIT',
|
|
3
|
-
types: '',
|
|
4
|
-
name: '@react-native-oh-tpl/ting',
|
|
5
|
-
description: '',
|
|
6
|
-
main: 'index.ets',
|
|
7
|
-
type: 'module',
|
|
8
|
-
version: '1.
|
|
9
|
-
dependencies: {
|
|
10
|
-
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
|
|
11
|
-
},
|
|
1
|
+
{
|
|
2
|
+
license: 'MIT',
|
|
3
|
+
types: '',
|
|
4
|
+
name: '@react-native-oh-tpl/ting',
|
|
5
|
+
description: '',
|
|
6
|
+
main: 'index.ets',
|
|
7
|
+
type: 'module',
|
|
8
|
+
version: '1.3.0-rc.1',
|
|
9
|
+
dependencies: {
|
|
10
|
+
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
|
|
11
|
+
},
|
|
12
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.13)
|
|
2
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
3
|
-
|
|
4
|
-
file(GLOB rnoh_ting_SRC CONFIGURE_DEPENDS *.cpp)
|
|
5
|
-
add_library(rnoh_ting SHARED ${rnoh_ting_SRC})
|
|
6
|
-
target_include_directories(rnoh_ting PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
7
|
-
target_link_libraries(rnoh_ting PUBLIC rnoh)
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
3
|
+
|
|
4
|
+
file(GLOB rnoh_ting_SRC CONFIGURE_DEPENDS *.cpp)
|
|
5
|
+
add_library(rnoh_ting SHARED ${rnoh_ting_SRC})
|
|
6
|
+
target_include_directories(rnoh_ting PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
7
|
+
target_link_libraries(rnoh_ting PUBLIC rnoh)
|
|
@@ -1,23 +1,23 @@
|
|
|
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 "Ting.h"
|
|
11
|
-
|
|
12
|
-
namespace rnoh {
|
|
13
|
-
using namespace facebook;
|
|
14
|
-
|
|
15
|
-
Ting::Ting(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
|
|
16
|
-
methodMap_ = {
|
|
17
|
-
ARK_METHOD_METADATA(toast, 1),
|
|
18
|
-
ARK_METHOD_METADATA(alert, 1),
|
|
19
|
-
ARK_METHOD_METADATA(dismissAlert, 0),
|
|
20
|
-
ARK_METHOD_METADATA(setup, 1),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
} // namespace rnoh
|
|
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 "Ting.h"
|
|
11
|
+
|
|
12
|
+
namespace rnoh {
|
|
13
|
+
using namespace facebook;
|
|
14
|
+
|
|
15
|
+
Ting::Ting(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
|
|
16
|
+
methodMap_ = {
|
|
17
|
+
ARK_METHOD_METADATA(toast, 1),
|
|
18
|
+
ARK_METHOD_METADATA(alert, 1),
|
|
19
|
+
ARK_METHOD_METADATA(dismissAlert, 0),
|
|
20
|
+
ARK_METHOD_METADATA(setup, 1),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
} // namespace rnoh
|
|
@@ -1,18 +1,18 @@
|
|
|
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
|
-
#include "RNOH/ArkTSTurboModule.h"
|
|
12
|
-
|
|
13
|
-
namespace rnoh {
|
|
14
|
-
class JSI_EXPORT Ting : public ArkTSTurboModule {
|
|
15
|
-
public:
|
|
16
|
-
Ting(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
17
|
-
};
|
|
18
|
-
} // namespace rnoh
|
|
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
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
12
|
+
|
|
13
|
+
namespace rnoh {
|
|
14
|
+
class JSI_EXPORT Ting : public ArkTSTurboModule {
|
|
15
|
+
public:
|
|
16
|
+
Ting(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
17
|
+
};
|
|
18
|
+
} // namespace rnoh
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
#include "Ting.h"
|
|
7
|
-
#include "RNOH/Package.h"
|
|
8
|
-
|
|
9
|
-
using namespace rnoh;
|
|
10
|
-
using namespace facebook;
|
|
11
|
-
|
|
12
|
-
class TingTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
13
|
-
public:
|
|
14
|
-
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
15
|
-
if (name == "Ting") {
|
|
16
|
-
return std::make_shared<Ting>(ctx, name);
|
|
17
|
-
}
|
|
18
|
-
return nullptr;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
namespace rnoh {
|
|
23
|
-
class TingPackage : public Package {
|
|
24
|
-
public:
|
|
25
|
-
TingPackage(Package::Context ctx) : Package(ctx) {}
|
|
26
|
-
|
|
27
|
-
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
|
|
28
|
-
{
|
|
29
|
-
return std::make_unique<TingTurboModuleFactoryDelegate>();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
#include "Ting.h"
|
|
7
|
+
#include "RNOH/Package.h"
|
|
8
|
+
|
|
9
|
+
using namespace rnoh;
|
|
10
|
+
using namespace facebook;
|
|
11
|
+
|
|
12
|
+
class TingTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
13
|
+
public:
|
|
14
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
15
|
+
if (name == "Ting") {
|
|
16
|
+
return std::make_shared<Ting>(ctx, name);
|
|
17
|
+
}
|
|
18
|
+
return nullptr;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
namespace rnoh {
|
|
23
|
+
class TingPackage : public Package {
|
|
24
|
+
public:
|
|
25
|
+
TingPackage(Package::Context ctx) : Package(ctx) {}
|
|
26
|
+
|
|
27
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
|
|
28
|
+
{
|
|
29
|
+
return std::make_unique<TingTurboModuleFactoryDelegate>();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
32
|
} // namespace rnoh
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2025 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 = 'Ting', 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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 = 'Ting', 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
64
|
export default new Logger('Ting', 0xFF00, false)
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2025 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, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
|
|
26
|
-
import { TM } from "../ets/generated/ts";
|
|
27
|
-
import { TingTurboModule } from './TingTurboModule';
|
|
28
|
-
|
|
29
|
-
class TingTurboModulesFactory extends TurboModulesFactory {
|
|
30
|
-
createTurboModule(name: string) {
|
|
31
|
-
if (name === 'Ting' || name === TM.Ting.NAME) {
|
|
32
|
-
return new TingTurboModule(this.ctx);
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
hasTurboModule(name: string): boolean {
|
|
38
|
-
return name === 'Ting' || name === TM.Ting.NAME;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class RNTingPackage extends RNPackage {
|
|
43
|
-
createTurboModulesFactory(ctx: TurboModuleContext) {
|
|
44
|
-
return new TingTurboModulesFactory(ctx);
|
|
45
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
|
|
26
|
+
import { TM } from "../ets/generated/ts";
|
|
27
|
+
import { TingTurboModule } from './TingTurboModule';
|
|
28
|
+
|
|
29
|
+
class TingTurboModulesFactory extends TurboModulesFactory {
|
|
30
|
+
createTurboModule(name: string) {
|
|
31
|
+
if (name === 'Ting' || name === TM.Ting.NAME) {
|
|
32
|
+
return new TingTurboModule(this.ctx);
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
hasTurboModule(name: string): boolean {
|
|
38
|
+
return name === 'Ting' || name === TM.Ting.NAME;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class RNTingPackage extends RNPackage {
|
|
43
|
+
createTurboModulesFactory(ctx: TurboModuleContext) {
|
|
44
|
+
return new TingTurboModulesFactory(ctx);
|
|
45
|
+
}
|
|
46
46
|
}
|