@react-native-ohos/cookies 6.3.0-rc.1 → 6.3.0

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 (44) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +14 -14
  3. package/harmony/rn_cookies/BuildProfile.ets +16 -16
  4. package/harmony/rn_cookies/build-profile.json5 +28 -28
  5. package/harmony/rn_cookies/hvigorfile.ts +6 -6
  6. package/harmony/rn_cookies/obfuscation-rules.txt +17 -17
  7. package/harmony/rn_cookies/oh-package.json5 +11 -11
  8. package/harmony/rn_cookies/src/main/cpp/CMakeLists.txt +9 -9
  9. package/harmony/rn_cookies/src/main/cpp/CookiesPackage.h +19 -19
  10. package/harmony/rn_cookies/src/main/cpp/CookiesTurboModule.cpp +57 -57
  11. package/harmony/rn_cookies/src/main/cpp/CookiesTurboModule.h +25 -25
  12. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/BaseReactNativeCookiesPackage.h +72 -72
  13. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/turbo_modules/RTNCookies.cpp +21 -21
  14. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/turbo_modules/RTNCookies.h +16 -16
  15. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ComponentDescriptors.h +24 -24
  16. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/EventEmitters.cpp +16 -16
  17. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/EventEmitters.h +17 -17
  18. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/Props.cpp +19 -19
  19. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/Props.h +18 -18
  20. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ShadowNodes.cpp +17 -17
  21. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ShadowNodes.h +23 -23
  22. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/States.cpp +16 -16
  23. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/States.h +18 -18
  24. package/harmony/rn_cookies/src/main/ets/CookiesModule.ts +177 -177
  25. package/harmony/rn_cookies/src/main/ets/CookiesPackage.ts +26 -26
  26. package/harmony/rn_cookies/src/main/ets/Logger.ets +63 -63
  27. package/harmony/rn_cookies/src/main/ets/generated/components/ts.ts +5 -5
  28. package/harmony/rn_cookies/src/main/ets/generated/index.ets +5 -5
  29. package/harmony/rn_cookies/src/main/ets/generated/ts.ts +6 -6
  30. package/harmony/rn_cookies/src/main/ets/generated/turboModules/RTNCookies.ts +26 -26
  31. package/harmony/rn_cookies/src/main/ets/generated/turboModules/ts.ts +5 -5
  32. package/harmony/rn_cookies/src/main/module.json5 +11 -11
  33. package/harmony/rn_cookies/src/main/resources/base/element/string.json +8 -8
  34. package/harmony/rn_cookies/src/main/resources/en_US/element/string.json +8 -8
  35. package/harmony/rn_cookies/src/main/resources/zh_CN/element/string.json +8 -8
  36. package/harmony/rn_cookies/src/test/List.test.ets +4 -4
  37. package/harmony/rn_cookies/src/test/LocalUnit.test.ets +32 -32
  38. package/harmony/rn_cookies/ts.ts +1 -1
  39. package/harmony/rn_cookies.har +0 -0
  40. package/index.d.ts +42 -42
  41. package/index.js +62 -62
  42. package/package.json +54 -54
  43. package/react-native-cookies.podspec +18 -18
  44. package/src/NativeRTNCookies.tsx +60 -60
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 React Native Community
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 React Native Community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # @react-native-ohos/react-native-cookies
2
-
3
- This project is based on [cookies](https://github.com/react-native-cookies/cookies)
4
-
5
- ## Documentation
6
-
7
- - [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-cookies-cookies.md)
8
-
9
- - [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-cookies-cookies.md)
10
-
11
- ## License
12
-
13
- This library is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-cookies/blob/sig/LICENSE)
14
-
1
+ # @react-native-ohos/react-native-cookies
2
+
3
+ This project is based on [cookies](https://github.com/react-native-cookies/cookies)
4
+
5
+ ## Documentation
6
+
7
+ - [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-cookies-cookies.md)
8
+
9
+ - [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-cookies-cookies.md)
10
+
11
+ ## License
12
+
13
+ This library is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-cookies/blob/sig/LICENSE)
14
+
@@ -1,17 +1,17 @@
1
- /**
2
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
- */
4
- export const HAR_VERSION = '6.3.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;
1
+ /**
2
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
+ */
4
+ export const HAR_VERSION = '6.3.0';
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
17
  }
@@ -1,28 +1,28 @@
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
- }
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
+ }
@@ -1,6 +1,6 @@
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
+ 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 +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://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
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
18
  # -keep-global-name: specifies names that you want to keep in the global scope
@@ -1,11 +1,11 @@
1
- {
2
- "name": "@react-native-ohos/cookies",
3
- "version": "6.3.0-rc.1",
4
- "description": "Please describe the basic information.",
5
- "main": "Index.ets",
6
- "author": "",
7
- "license": "Apache-2.0",
8
- "dependencies": {
9
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony"
10
- }
11
- }
1
+ {
2
+ "name": "@react-native-ohos/cookies",
3
+ "version": "6.3.0",
4
+ "description": "Please describe the basic information.",
5
+ "main": "Index.ets",
6
+ "author": "",
7
+ "license": "Apache-2.0",
8
+ "dependencies": {
9
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony"
10
+ }
11
+ }
@@ -1,10 +1,10 @@
1
- # the minimum version of CMake
2
- cmake_minimum_required(VERSION 3.13)
3
- set(CMAKE_VERBOSE_MAKEFILE on)
4
-
5
- set(rnoh_cookies_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
6
- file(GLOB_RECURSE rnoh_cookies_generated_SRC "${rnoh_cookies_generated_dir}/**/*.cpp")
7
- file(GLOB rnoh_cookies_SRC CONFIGURE_DEPENDS *.cpp)
8
- add_library(rnoh_cookies SHARED ${rnoh_cookies_SRC} ${rnoh_cookies_generated_SRC})
9
- target_include_directories(rnoh_cookies PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_cookies_generated_dir} ${CMAKE_CURRENT_SOURCE_DIR}/generated/RNOH/generated)
1
+ # the minimum version of CMake
2
+ cmake_minimum_required(VERSION 3.13)
3
+ set(CMAKE_VERBOSE_MAKEFILE on)
4
+
5
+ set(rnoh_cookies_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
6
+ file(GLOB_RECURSE rnoh_cookies_generated_SRC "${rnoh_cookies_generated_dir}/**/*.cpp")
7
+ file(GLOB rnoh_cookies_SRC CONFIGURE_DEPENDS *.cpp)
8
+ add_library(rnoh_cookies SHARED ${rnoh_cookies_SRC} ${rnoh_cookies_generated_SRC})
9
+ target_include_directories(rnoh_cookies PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_cookies_generated_dir} ${CMAKE_CURRENT_SOURCE_DIR}/generated/RNOH/generated)
10
10
  target_link_libraries(rnoh_cookies PUBLIC rnoh)
@@ -1,19 +1,19 @@
1
- // Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
2
- // Use of this source code is governed by a Apache-2.0 license that can be
3
- // found in the LICENSE file.
4
-
5
- #ifndef COOKIESPACKAGE_H
6
- #define COOKIESPACKAGE_H
7
-
8
-
9
- #include "generated/RNOH/generated/BaseReactNativeCookiesPackage.h"
10
- #pragma once
11
-
12
-
13
- namespace rnoh {
14
- class CookiesPackage : public BaseReactNativeCookiesPackage {
15
- using Super = BaseReactNativeCookiesPackage;
16
- using Super::Super;
17
- };
18
- } // namespace rnoh
19
- #endif //COOKIESPACKAGE_H
1
+ // Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a Apache-2.0 license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef COOKIESPACKAGE_H
6
+ #define COOKIESPACKAGE_H
7
+
8
+
9
+ #include "generated/RNOH/generated/BaseReactNativeCookiesPackage.h"
10
+ #pragma once
11
+
12
+
13
+ namespace rnoh {
14
+ class CookiesPackage : public BaseReactNativeCookiesPackage {
15
+ using Super = BaseReactNativeCookiesPackage;
16
+ using Super::Super;
17
+ };
18
+ } // namespace rnoh
19
+ #endif //COOKIESPACKAGE_H
@@ -1,57 +1,57 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd.
3
-
4
- * Licensed under the The MIT License (MIT) (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
-
8
- * https://github.com/react-native-cookies/cookies/blob/master/LICENSE
9
-
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- #include "CookiesTurboModule.h"
18
- #include "RNOH/ArkTSTurboModule.h"
19
-
20
- using namespace rnoh;
21
- using namespace facebook;
22
-
23
- static jsi::Value __hostFunction_RTNCookiesTurboModule_get(jsi::Runtime &rt, react::TurboModule &turboModule,
24
- const jsi::Value *args, size_t count) {
25
- return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "get", args, count);
26
- }
27
-
28
- static jsi::Value __hostFunction_RTNCookiesTurboModule_set(jsi::Runtime &rt, react::TurboModule &turboModule,
29
- const jsi::Value *args, size_t count) {
30
- return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "set", args, count);
31
- }
32
-
33
- static jsi::Value __hostFunction_RTNCookiesTurboModule_clearByName(jsi::Runtime &rt, react::TurboModule &turboModule,
34
- const jsi::Value *args, size_t count) {
35
- return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearByName", args, count);
36
- }
37
-
38
- static jsi::Value __hostFunction_RTNCookiesTurboModule_clearAll(jsi::Runtime &rt, react::TurboModule &turboModule,
39
- const jsi::Value *args, size_t count) {
40
- return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearAll", args, count);
41
- }
42
-
43
- static jsi::Value __hostFunction_RTNCookiesTurboModule_removeSessionCookies(jsi::Runtime &rt,
44
- react::TurboModule &turboModule,
45
- const jsi::Value *args, size_t count) {
46
- return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "removeSessionCookies", args, count);
47
- }
48
-
49
-
50
- RTNCookiesTurboModule::RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name)
51
- : ArkTSTurboModule(ctx, name) {
52
- methodMap_["get"] = MethodMetadata{2, __hostFunction_RTNCookiesTurboModule_get};
53
- methodMap_["set"] = MethodMetadata{3, __hostFunction_RTNCookiesTurboModule_set};
54
- methodMap_["clearByName"] = MethodMetadata{3, __hostFunction_RTNCookiesTurboModule_clearByName};
55
- methodMap_["clearAll"] = MethodMetadata{1, __hostFunction_RTNCookiesTurboModule_clearAll};
56
- methodMap_["removeSessionCookies"] = MethodMetadata{0, __hostFunction_RTNCookiesTurboModule_removeSessionCookies};
57
- }
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
3
+
4
+ * Licensed under the The MIT License (MIT) (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+
8
+ * https://github.com/react-native-cookies/cookies/blob/master/LICENSE
9
+
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #include "CookiesTurboModule.h"
18
+ #include "RNOH/ArkTSTurboModule.h"
19
+
20
+ using namespace rnoh;
21
+ using namespace facebook;
22
+
23
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_get(jsi::Runtime &rt, react::TurboModule &turboModule,
24
+ const jsi::Value *args, size_t count) {
25
+ return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "get", args, count);
26
+ }
27
+
28
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_set(jsi::Runtime &rt, react::TurboModule &turboModule,
29
+ const jsi::Value *args, size_t count) {
30
+ return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "set", args, count);
31
+ }
32
+
33
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_clearByName(jsi::Runtime &rt, react::TurboModule &turboModule,
34
+ const jsi::Value *args, size_t count) {
35
+ return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearByName", args, count);
36
+ }
37
+
38
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_clearAll(jsi::Runtime &rt, react::TurboModule &turboModule,
39
+ const jsi::Value *args, size_t count) {
40
+ return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearAll", args, count);
41
+ }
42
+
43
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_removeSessionCookies(jsi::Runtime &rt,
44
+ react::TurboModule &turboModule,
45
+ const jsi::Value *args, size_t count) {
46
+ return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "removeSessionCookies", args, count);
47
+ }
48
+
49
+
50
+ RTNCookiesTurboModule::RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name)
51
+ : ArkTSTurboModule(ctx, name) {
52
+ methodMap_["get"] = MethodMetadata{2, __hostFunction_RTNCookiesTurboModule_get};
53
+ methodMap_["set"] = MethodMetadata{3, __hostFunction_RTNCookiesTurboModule_set};
54
+ methodMap_["clearByName"] = MethodMetadata{3, __hostFunction_RTNCookiesTurboModule_clearByName};
55
+ methodMap_["clearAll"] = MethodMetadata{1, __hostFunction_RTNCookiesTurboModule_clearAll};
56
+ methodMap_["removeSessionCookies"] = MethodMetadata{0, __hostFunction_RTNCookiesTurboModule_removeSessionCookies};
57
+ }
@@ -1,25 +1,25 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd.
3
-
4
- * Licensed under the The MIT License (MIT) (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
-
8
- * https://github.com/react-native-cookies/cookies/blob/master/LICENSE
9
-
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- #pragma once
18
- #include "RNOH/ArkTSTurboModule.h"
19
-
20
- namespace rnoh {
21
- class JSI_EXPORT RTNCookiesTurboModule : public ArkTSTurboModule {
22
- public:
23
- RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name);
24
- };
25
- } // namespace rnoh
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
3
+
4
+ * Licensed under the The MIT License (MIT) (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+
8
+ * https://github.com/react-native-cookies/cookies/blob/master/LICENSE
9
+
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #pragma once
18
+ #include "RNOH/ArkTSTurboModule.h"
19
+
20
+ namespace rnoh {
21
+ class JSI_EXPORT RTNCookiesTurboModule : public ArkTSTurboModule {
22
+ public:
23
+ RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name);
24
+ };
25
+ } // namespace rnoh
@@ -1,72 +1,72 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #pragma once
6
-
7
- #include "RNOH/Package.h"
8
- #include "RNOH/ArkTSTurboModule.h"
9
- #include "RNOH/generated/turbo_modules/RTNCookies.h"
10
-
11
- namespace rnoh {
12
-
13
- class BaseReactNativeCookiesPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
14
- public:
15
- SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
16
- if (name == "RTNCookies") {
17
- return std::make_shared<RTNCookies>(ctx, name);
18
- }
19
- return nullptr;
20
- };
21
- };
22
-
23
- class BaseReactNativeCookiesPackageEventEmitRequestHandler : public EventEmitRequestHandler {
24
- public:
25
- void handleEvent(Context const &ctx) override {
26
- auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
27
- auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
28
-
29
- if (eventEmitter == nullptr) {
30
- return;
31
- }
32
-
33
- std::vector<std::string> supportedComponentNames = {
34
- };
35
-
36
- std::vector<std::string> supportedEventNames = {
37
- };
38
-
39
- if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
40
- std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
41
- eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
42
- }
43
- }
44
- };
45
-
46
-
47
- class BaseReactNativeCookiesPackage : public Package {
48
- public:
49
- BaseReactNativeCookiesPackage(Package::Context ctx) : Package(ctx){};
50
-
51
- std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
52
- return std::make_unique<BaseReactNativeCookiesPackageTurboModuleFactoryDelegate>();
53
- }
54
-
55
- std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
56
- return {
57
- };
58
- }
59
-
60
- ComponentJSIBinderByString createComponentJSIBinderByName() override {
61
- return {
62
- };
63
- };
64
-
65
- EventEmitRequestHandlers createEventEmitRequestHandlers() override {
66
- return {
67
- std::make_shared<BaseReactNativeCookiesPackageEventEmitRequestHandler>(),
68
- };
69
- }
70
- };
71
-
72
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/Package.h"
8
+ #include "RNOH/ArkTSTurboModule.h"
9
+ #include "RNOH/generated/turbo_modules/RTNCookies.h"
10
+
11
+ namespace rnoh {
12
+
13
+ class BaseReactNativeCookiesPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
14
+ public:
15
+ SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
16
+ if (name == "RTNCookies") {
17
+ return std::make_shared<RTNCookies>(ctx, name);
18
+ }
19
+ return nullptr;
20
+ };
21
+ };
22
+
23
+ class BaseReactNativeCookiesPackageEventEmitRequestHandler : public EventEmitRequestHandler {
24
+ public:
25
+ void handleEvent(Context const &ctx) override {
26
+ auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
27
+ auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
28
+
29
+ if (eventEmitter == nullptr) {
30
+ return;
31
+ }
32
+
33
+ std::vector<std::string> supportedComponentNames = {
34
+ };
35
+
36
+ std::vector<std::string> supportedEventNames = {
37
+ };
38
+
39
+ if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
40
+ std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
41
+ eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
42
+ }
43
+ }
44
+ };
45
+
46
+
47
+ class BaseReactNativeCookiesPackage : public Package {
48
+ public:
49
+ BaseReactNativeCookiesPackage(Package::Context ctx) : Package(ctx){};
50
+
51
+ std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
52
+ return std::make_unique<BaseReactNativeCookiesPackageTurboModuleFactoryDelegate>();
53
+ }
54
+
55
+ std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
56
+ return {
57
+ };
58
+ }
59
+
60
+ ComponentJSIBinderByString createComponentJSIBinderByName() override {
61
+ return {
62
+ };
63
+ };
64
+
65
+ EventEmitRequestHandlers createEventEmitRequestHandlers() override {
66
+ return {
67
+ std::make_shared<BaseReactNativeCookiesPackageEventEmitRequestHandler>(),
68
+ };
69
+ }
70
+ };
71
+
72
+ } // namespace rnoh