@react-native-ohos/cookies 6.2.2-rc.2 → 6.3.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 (31) hide show
  1. package/README.md +1 -1
  2. package/harmony/rn_cookies/BuildProfile.ets +1 -1
  3. package/harmony/rn_cookies/Index.ets +1 -3
  4. package/harmony/rn_cookies/oh-package.json5 +1 -1
  5. package/harmony/rn_cookies/src/main/cpp/CMakeLists.txt +4 -2
  6. package/harmony/rn_cookies/src/main/cpp/CookiesPackage.h +8 -23
  7. package/harmony/rn_cookies/src/main/cpp/CookiesTurboModule.cpp +17 -23
  8. package/harmony/rn_cookies/src/main/cpp/CookiesTurboModule.h +0 -4
  9. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/BaseReactNativeCookiesPackage.h +72 -0
  10. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/turbo_modules/RTNCookies.cpp +21 -0
  11. package/harmony/rn_cookies/src/main/cpp/generated/RNOH/generated/turbo_modules/RTNCookies.h +16 -0
  12. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ComponentDescriptors.h +24 -0
  13. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/EventEmitters.cpp +16 -0
  14. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/EventEmitters.h +17 -0
  15. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/Props.cpp +19 -0
  16. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/Props.h +18 -0
  17. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ShadowNodes.cpp +17 -0
  18. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/ShadowNodes.h +23 -0
  19. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/States.cpp +16 -0
  20. package/harmony/rn_cookies/src/main/cpp/generated/react/renderer/components/react_native_cookies/States.h +19 -0
  21. package/harmony/rn_cookies/src/main/ets/{CookiesPackage.ets → CookiesPackage.ts} +2 -2
  22. package/harmony/rn_cookies/src/main/ets/generated/components/ts.ts +5 -0
  23. package/harmony/rn_cookies/src/main/ets/generated/index.ets +5 -0
  24. package/harmony/rn_cookies/src/main/ets/generated/ts.ts +6 -0
  25. package/harmony/rn_cookies/src/main/ets/generated/turboModules/RTNCookies.ts +26 -0
  26. package/harmony/rn_cookies/src/main/ets/generated/turboModules/ts.ts +5 -0
  27. package/harmony/rn_cookies.har +0 -0
  28. package/package.json +7 -24
  29. package/src/NativeRTNCookies.tsx +17 -1
  30. package/harmony/rn_cookies/oh-package-lock.json5 +0 -18
  31. /package/harmony/rn_cookies/{ts.ets → ts.ts} +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @react-native-ohos/react-native-cookies
2
2
 
3
- This project is based on [cookies](https://github.com/react-native-cookies/cookies/tree/v6.2.1)@6.2.1
3
+ This project is based on [cookies](https://github.com/react-native-cookies/cookies)
4
4
 
5
5
  ## Documentation
6
6
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
3
  */
4
- export const HAR_VERSION = '6.2.1-0.0.8';
4
+ export const HAR_VERSION = '6.3.0-rc.2';
5
5
  export const BUILD_MODE_NAME = 'debug';
6
6
  export const DEBUG = true;
7
7
  export const TARGET_NAME = 'default';
@@ -1,3 +1 @@
1
- import { CookiesPackage } from './src/main/ets/CookiesPackage';
2
- export * from './ts'
3
- export default CookiesPackage;
1
+ export * from './ts'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-ohos/cookies",
3
- "version": "6.2.2-rc.2",
3
+ "version": "6.3.0-rc.2",
4
4
  "description": "Please describe the basic information.",
5
5
  "main": "Index.ets",
6
6
  "author": "",
@@ -2,7 +2,9 @@
2
2
  cmake_minimum_required(VERSION 3.13)
3
3
  set(CMAKE_VERBOSE_MAKEFILE on)
4
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")
5
7
  file(GLOB rnoh_cookies_SRC CONFIGURE_DEPENDS *.cpp)
6
- add_library(rnoh_cookies SHARED ${rnoh_cookies_SRC})
7
- target_include_directories(rnoh_cookies PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
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)
8
10
  target_link_libraries(rnoh_cookies PUBLIC rnoh)
@@ -5,30 +5,15 @@
5
5
  #ifndef COOKIESPACKAGE_H
6
6
  #define COOKIESPACKAGE_H
7
7
 
8
- #include "RNOH/Package.h"
9
- #include "CookiesTurboModule.h"
10
8
 
11
- using namespace rnoh;
12
- using namespace facebook;
13
- class NativeRTNCookiesFactoryDelegate : public TurboModuleFactoryDelegate {
14
- public:
15
- SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override
16
- {
17
- if (name == "RTNCookies") {
18
- return std::make_shared<RTNCookiesTurboModule>(ctx, name);
19
- }
20
- return nullptr;
21
- }
22
- };
9
+ #include "generated/RNOH/generated/BaseReactNativeCookiesPackage.h"
10
+ #pragma once
11
+
23
12
 
24
13
  namespace rnoh {
25
- class CookiesPackage : public Package {
26
- public:
27
- CookiesPackage(Package::Context ctx) : Package(ctx) {}
28
- std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
29
- {
30
- return std::make_unique<NativeRTNCookiesFactoryDelegate>();
31
- }
32
- };
14
+ class CookiesPackage : public BaseReactNativeCookiesPackage {
15
+ using Super = BaseReactNativeCookiesPackage;
16
+ using Super::Super;
17
+ };
33
18
  } // namespace rnoh
34
- #endif
19
+ #endif //COOKIESPACKAGE_H
@@ -20,44 +20,38 @@
20
20
  using namespace rnoh;
21
21
  using namespace facebook;
22
22
 
23
- static jsi::Value hostFunction_RTNCookiesTurboModule_get(jsi::Runtime &rt, react::TurboModule &turboModule,
24
- const jsi::Value *args, size_t count)
25
- {
23
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_get(jsi::Runtime &rt, react::TurboModule &turboModule,
24
+ const jsi::Value *args, size_t count) {
26
25
  return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "get", args, count);
27
26
  }
28
27
 
29
- static jsi::Value hostFunction_RTNCookiesTurboModule_set(jsi::Runtime &rt, react::TurboModule &turboModule,
30
- const jsi::Value *args, size_t count)
31
- {
28
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_set(jsi::Runtime &rt, react::TurboModule &turboModule,
29
+ const jsi::Value *args, size_t count) {
32
30
  return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "set", args, count);
33
31
  }
34
32
 
35
- static jsi::Value hostFunction_RTNCookiesTurboModule_clearByName(jsi::Runtime &rt, react::TurboModule &turboModule,
36
- const jsi::Value *args, size_t count)
37
- {
33
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_clearByName(jsi::Runtime &rt, react::TurboModule &turboModule,
34
+ const jsi::Value *args, size_t count) {
38
35
  return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearByName", args, count);
39
36
  }
40
37
 
41
- static jsi::Value hostFunction_RTNCookiesTurboModule_clearAll(jsi::Runtime &rt, react::TurboModule &turboModule,
42
- const jsi::Value *args, size_t count)
43
- {
38
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_clearAll(jsi::Runtime &rt, react::TurboModule &turboModule,
39
+ const jsi::Value *args, size_t count) {
44
40
  return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "clearAll", args, count);
45
41
  }
46
42
 
47
- static jsi::Value hostFunction_RTNCookiesTurboModule_removeSessionCookies(jsi::Runtime &rt,
48
- react::TurboModule &turboModule,
49
- const jsi::Value *args, size_t count)
50
- {
43
+ static jsi::Value __hostFunction_RTNCookiesTurboModule_removeSessionCookies(jsi::Runtime &rt,
44
+ react::TurboModule &turboModule,
45
+ const jsi::Value *args, size_t count) {
51
46
  return static_cast<ArkTSTurboModule &>(turboModule).callAsync(rt, "removeSessionCookies", args, count);
52
47
  }
53
48
 
54
49
 
55
50
  RTNCookiesTurboModule::RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name)
56
- : ArkTSTurboModule(ctx, name)
57
- {
58
- methodMap_["get"] = MethodMetadata{ 2, hostFunction_RTNCookiesTurboModule_get };
59
- methodMap_["set"] = MethodMetadata{ 3, hostFunction_RTNCookiesTurboModule_set };
60
- methodMap_["clearByName"] = MethodMetadata{ 3, hostFunction_RTNCookiesTurboModule_clearByName };
61
- methodMap_["clearAll"] = MethodMetadata{ 1, hostFunction_RTNCookiesTurboModule_clearAll };
62
- methodMap_["removeSessionCookies"] = MethodMetadata{ 0, hostFunction_RTNCookiesTurboModule_removeSessionCookies };
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};
63
57
  }
@@ -14,9 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- #ifndef COOKIESTURBOMODULE_H
18
- #define COOKIESTURBOMODULE_H
19
-
20
17
  #pragma once
21
18
  #include "RNOH/ArkTSTurboModule.h"
22
19
 
@@ -26,4 +23,3 @@ namespace rnoh {
26
23
  RTNCookiesTurboModule(const ArkTSTurboModule::Context ctx, const std::string name);
27
24
  };
28
25
  } // namespace rnoh
29
- #endif
@@ -0,0 +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
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #include "RTNCookies.h"
6
+
7
+ namespace rnoh {
8
+ using namespace facebook;
9
+
10
+ RTNCookies::RTNCookies(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
+ methodMap_ = {
12
+ ARK_ASYNC_METHOD_METADATA(clearAll, 1),
13
+ ARK_ASYNC_METHOD_METADATA(get, 2),
14
+ ARK_ASYNC_METHOD_METADATA(set, 3),
15
+ ARK_ASYNC_METHOD_METADATA(clearByName, 3),
16
+ ARK_ASYNC_METHOD_METADATA(flush, 0),
17
+ ARK_ASYNC_METHOD_METADATA(removeSessionCookies, 0),
18
+ };
19
+ }
20
+
21
+ } // namespace rnoh
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/ArkTSTurboModule.h"
8
+
9
+ namespace rnoh {
10
+
11
+ class JSI_EXPORT RTNCookies : public ArkTSTurboModule {
12
+ public:
13
+ RTNCookies(const ArkTSTurboModule::Context ctx, const std::string name);
14
+ };
15
+
16
+ } // namespace rnoh
@@ -0,0 +1,24 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateComponentDescriptorH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "ShadowNodes.h"
14
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
+
17
+ namespace facebook::react {
18
+
19
+
20
+
21
+ void react_native_cookies_registerComponentDescriptorsFromCodegen(
22
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
+
24
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include "EventEmitters.h"
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewEventEmitter.h>
13
+
14
+
15
+ namespace facebook::react {
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsCpp.js
9
+ */
10
+
11
+ #include "Props.h"
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/propsConversions.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,18 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsH.js
9
+ */
10
+ #pragma once
11
+
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+
17
+
18
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include "ShadowNodes.h"
12
+
13
+ namespace facebook::react {
14
+
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,23 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "EventEmitters.h"
14
+ #include "Props.h"
15
+ #include "States.h"
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+
22
+
23
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateStateCpp.js
9
+ */
10
+ #include "States.h"
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -2,7 +2,7 @@
2
2
  // Use of this source code is governed by a Apache-2.0 license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import { RNOHPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony';
5
+ import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
6
6
  import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
7
7
  import { CookiesModule } from './CookiesModule';
8
8
 
@@ -19,7 +19,7 @@ class CookiesModulesFactory extends TurboModulesFactory {
19
19
  }
20
20
  }
21
21
 
22
- export class CookiesPackage extends RNOHPackage {
22
+ export class CookiesPackage extends RNPackage {
23
23
  createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
24
24
  return new CookiesModulesFactory(ctx);
25
25
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./ts"
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * as RNC from "./components/ts"
6
+ export * as TM from "./turboModules/ts"
@@ -0,0 +1,26 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ import { Tag } from "@rnoh/react-native-openharmony/ts"
6
+
7
+ export namespace RTNCookies {
8
+ export const NAME = 'RTNCookies' as const
9
+
10
+ export type Cookie = {name: string, value: string, path?: string, domain?: string, version?: string, expires?: string, secure?: boolean, httpOnly?: boolean}
11
+
12
+ export interface Spec {
13
+ clearAll(useWebKit: boolean): Promise<boolean>;
14
+
15
+ get(url: string, useWebKit: boolean): Promise<void>;
16
+
17
+ set(url: string, cookie: Cookie, useWebKit: boolean): Promise<boolean>;
18
+
19
+ clearByName(url: string, name: string, useWebKit: boolean): Promise<boolean>;
20
+
21
+ flush(): Promise<boolean>;
22
+
23
+ removeSessionCookies(): Promise<boolean>;
24
+
25
+ }
26
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./RTNCookies"
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-ohos/cookies",
3
- "version": "6.2.2-rc.2",
3
+ "version": "6.3.0-rc.2",
4
4
  "description": "Cookie Manager for React Native",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,10 +19,6 @@
19
19
  "index.d.ts",
20
20
  "react-native-cookies.podspec"
21
21
  ],
22
- "author": {
23
- "name": "Jason Safaiyeh",
24
- "email": "safaiyeh@protonmail.com"
25
- },
26
22
  "license": "MIT",
27
23
  "licenseFilename": "LICENSE",
28
24
  "readmeFilename": "README.md",
@@ -34,7 +30,8 @@
34
30
  "types": "index.d.ts",
35
31
  "scripts": {
36
32
  "lint": "eslint index.js",
37
- "semantic-release": "semantic-release"
33
+ "semantic-release": "semantic-release",
34
+ "codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name react-native-cookies --cpp-output-path ./harmony/rn_cookies/src/main/cpp/generated --ets-output-path ./harmony/rn_cookies/src/main/ets/generated --turbo-modules-spec-paths ./src/NativeRTNCookies.tsx"
38
35
  },
39
36
  "dependencies": {
40
37
  "invariant": "^2.2.4"
@@ -49,24 +46,10 @@
49
46
  "@semantic-release/git": "^8.0.0",
50
47
  "eslint": "^6.8.0",
51
48
  "rtn-cookies": "file:rtn-cookies",
52
- "semantic-release": "*"
53
- },
54
- "codegenConfig": {
55
- "name": "RNCookiesSpec",
56
- "type": "all",
57
- "jsSrcsDir": "src"
49
+ "semantic-release": "*",
50
+ "react-native-harmony-cli": "npm:@react-native-oh/react-native-harmony-cli@^0.0.27"
58
51
  },
59
52
  "harmony": {
60
- "alias": "@react-native-cookies/cookies",
61
- "autolinking": {
62
- "etsPackageClassName":"CookiesPackage",
63
- "cppPackageClassName":"CookiesPackage",
64
- "cmakeLibraryTargetName": "rnoh_cookies",
65
- "ohPackageName": "@react-native-ohos/cookies"
66
- }
67
- },
68
- "publishConfig": {
69
- "registry": "https://registry.npmjs.org/",
70
- "access": "public"
53
+ "alias": "@react-native-cookies/cookies"
71
54
  }
72
- }
55
+ }
@@ -14,6 +14,22 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ /*
18
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
19
+ *
20
+ * Licensed under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License.
22
+ * You may obtain a copy of the License at
23
+ *
24
+ * http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software
27
+ * distributed under the License is distributed on an "AS IS" BASIS,
28
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ * See the License for the specific language governing permissions and
30
+ * limitations under the License.
31
+ */
32
+
17
33
  import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
18
34
  import { TurboModuleRegistry, NativeModules, Platform } from "react-native";
19
35
 
@@ -37,7 +53,7 @@ export interface Spec extends TurboModule {
37
53
  get(url: string, useWebKit?: boolean): Promise<Cookies>;
38
54
  set(url: string, cookie: Cookie, useWebKit?: boolean): Promise<boolean>;
39
55
  clearByName(url: string, name: string, useWebKit?: boolean): Promise<boolean>;
40
- flush(func: Function): Promise<boolean>;
56
+ flush(): Promise<boolean>;
41
57
  removeSessionCookies(): Promise<boolean>;
42
58
  }
43
59
 
@@ -1,18 +0,0 @@
1
- {
2
- "meta": {
3
- "stableOrder": false
4
- },
5
- "lockfileVersion": 3,
6
- "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7
- "specifiers": {
8
- "@rnoh/react-native-openharmony@../libs/react_native_openharmony-5.0.0.491.har": "@rnoh/react-native-openharmony@../libs/react_native_openharmony-5.0.0.491.har"
9
- },
10
- "packages": {
11
- "@rnoh/react-native-openharmony@../libs/react_native_openharmony-5.0.0.491.har": {
12
- "name": "@rnoh/react-native-openharmony",
13
- "version": "0.72.28",
14
- "resolved": "../libs/react_native_openharmony-5.0.0.491.har",
15
- "registryType": "local"
16
- }
17
- }
18
- }
File without changes