react-native-mmkv 4.1.0 → 4.1.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.
- package/android/build.gradle +1 -0
- package/nitrogen/generated/android/NitroMmkv+autolinking.cmake +1 -1
- package/nitrogen/generated/android/NitroMmkv+autolinking.gradle +1 -1
- package/nitrogen/generated/android/NitroMmkvOnLoad.cpp +1 -1
- package/nitrogen/generated/android/NitroMmkvOnLoad.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridMMKVPlatformContextSpec.cpp +8 -1
- package/nitrogen/generated/android/c++/JHybridMMKVPlatformContextSpec.hpp +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/mmkv/HybridMMKVPlatformContextSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/mmkv/NitroMmkvOnLoad.kt +1 -1
- package/nitrogen/generated/ios/NitroMmkv+autolinking.rb +2 -2
- package/nitrogen/generated/ios/NitroMmkv-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/NitroMmkv-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/NitroMmkv-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/NitroMmkvAutolinking.mm +1 -1
- package/nitrogen/generated/ios/NitroMmkvAutolinking.swift +9 -8
- package/nitrogen/generated/ios/c++/HybridMMKVPlatformContextSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridMMKVPlatformContextSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/swift/HybridMMKVPlatformContextSpec.swift +3 -3
- package/nitrogen/generated/ios/swift/HybridMMKVPlatformContextSpec_cxx.swift +9 -1
- package/nitrogen/generated/shared/c++/Configuration.hpp +25 -17
- package/nitrogen/generated/shared/c++/HybridMMKVFactorySpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridMMKVFactorySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridMMKVPlatformContextSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridMMKVPlatformContextSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridMMKVSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridMMKVSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/Listener.hpp +13 -5
- package/nitrogen/generated/shared/c++/Mode.hpp +1 -1
- package/package.json +3 -3
package/android/build.gradle
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# NitroMmkv+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroMmkv+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroMmkvOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_NITROMMKV_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridMMKVPlatformContextSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridMMKVPlatformContextSpec.hpp"
|
|
@@ -29,6 +29,13 @@ namespace margelo::nitro::mmkv {
|
|
|
29
29
|
return method(_javaPart);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
bool JHybridMMKVPlatformContextSpec::equals(const std::shared_ptr<HybridObject>& other) {
|
|
33
|
+
if (auto otherCast = std::dynamic_pointer_cast<JHybridMMKVPlatformContextSpec>(other)) {
|
|
34
|
+
return _javaPart == otherCast->_javaPart;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
void JHybridMMKVPlatformContextSpec::dispose() noexcept {
|
|
33
40
|
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
34
41
|
method(_javaPart);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -40,6 +40,7 @@ namespace margelo::nitro::mmkv {
|
|
|
40
40
|
|
|
41
41
|
public:
|
|
42
42
|
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override;
|
|
43
44
|
void dispose() noexcept override;
|
|
44
45
|
std::string toString() override;
|
|
45
46
|
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/mmkv/HybridMMKVPlatformContextSpec.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.mmkv
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# NitroMmkv+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
|
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
|
|
|
52
52
|
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
53
|
# Use C++ 20
|
|
54
54
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroMmkv-Swift-Cxx-Bridge.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "NitroMmkv-Swift-Cxx-Bridge.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroMmkvAutolinking.mm
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
/// NitroMmkvAutolinking.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
8
12
|
public final class NitroMmkvAutolinking {
|
|
9
13
|
public typealias bridge = margelo.nitro.mmkv.bridge.swift
|
|
10
14
|
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of a Swift class that implements `HybridMMKVPlatformContextSpec`,
|
|
13
|
-
* and wraps it in a Swift class that can directly interop with C++ (`HybridMMKVPlatformContextSpec_cxx`)
|
|
14
|
-
*
|
|
15
|
-
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
-
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridMMKVPlatformContext`).
|
|
17
|
-
*/
|
|
18
15
|
public static func createMMKVPlatformContext() -> bridge.std__shared_ptr_HybridMMKVPlatformContextSpec_ {
|
|
19
16
|
let hybridObject = HybridMMKVPlatformContext()
|
|
20
17
|
return { () -> bridge.std__shared_ptr_HybridMMKVPlatformContextSpec_ in
|
|
@@ -22,4 +19,8 @@ public final class NitroMmkvAutolinking {
|
|
|
22
19
|
return __cxxWrapped.getCxxPart()
|
|
23
20
|
}()
|
|
24
21
|
}
|
|
22
|
+
|
|
23
|
+
public static func isMMKVPlatformContextRecyclable() -> Bool {
|
|
24
|
+
return HybridMMKVPlatformContext.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
25
26
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridMMKVPlatformContextSpecSwift.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -48,6 +48,12 @@ namespace margelo::nitro::mmkv {
|
|
|
48
48
|
inline size_t getExternalMemorySize() noexcept override {
|
|
49
49
|
return _swiftPart.getMemorySize();
|
|
50
50
|
}
|
|
51
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
52
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridMMKVPlatformContextSpecSwift>(other)) {
|
|
53
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
51
57
|
void dispose() noexcept override {
|
|
52
58
|
_swiftPart.dispose();
|
|
53
59
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpec.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -31,14 +31,14 @@ open class HybridMMKVPlatformContextSpec_base {
|
|
|
31
31
|
public init() { }
|
|
32
32
|
public func getCxxWrapper() -> HybridMMKVPlatformContextSpec_cxx {
|
|
33
33
|
#if DEBUG
|
|
34
|
-
guard self is HybridMMKVPlatformContextSpec else {
|
|
34
|
+
guard self is any HybridMMKVPlatformContextSpec else {
|
|
35
35
|
fatalError("`self` is not a `HybridMMKVPlatformContextSpec`! Did you accidentally inherit from `HybridMMKVPlatformContextSpec_base` instead of `HybridMMKVPlatformContextSpec`?")
|
|
36
36
|
}
|
|
37
37
|
#endif
|
|
38
38
|
if let cxxWrapper = self.cxxWrapper {
|
|
39
39
|
return cxxWrapper
|
|
40
40
|
} else {
|
|
41
|
-
let cxxWrapper = HybridMMKVPlatformContextSpec_cxx(self as! HybridMMKVPlatformContextSpec)
|
|
41
|
+
let cxxWrapper = HybridMMKVPlatformContextSpec_cxx(self as! any HybridMMKVPlatformContextSpec)
|
|
42
42
|
self.cxxWrapper = cxxWrapper
|
|
43
43
|
return cxxWrapper
|
|
44
44
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -96,6 +96,14 @@ open class HybridMMKVPlatformContextSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Compares this object with the given [other] object for reference equality.
|
|
101
|
+
*/
|
|
102
|
+
@inline(__always)
|
|
103
|
+
public func equals(other: HybridMMKVPlatformContextSpec_cxx) -> Bool {
|
|
104
|
+
return self.__implementation === other.__implementation
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
/**
|
|
100
108
|
* Call dispose() on the Swift class.
|
|
101
109
|
* This _may_ be called manually from JS.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Configuration.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
// Forward declaration of `Mode` to properly resolve imports.
|
|
27
32
|
namespace margelo::nitro::mmkv { enum class Mode; }
|
|
@@ -35,7 +40,7 @@ namespace margelo::nitro::mmkv {
|
|
|
35
40
|
/**
|
|
36
41
|
* A struct which can be represented as a JavaScript object (Configuration).
|
|
37
42
|
*/
|
|
38
|
-
struct Configuration {
|
|
43
|
+
struct Configuration final {
|
|
39
44
|
public:
|
|
40
45
|
std::string id SWIFT_PRIVATE;
|
|
41
46
|
std::optional<std::string> path SWIFT_PRIVATE;
|
|
@@ -46,6 +51,9 @@ namespace margelo::nitro::mmkv {
|
|
|
46
51
|
public:
|
|
47
52
|
Configuration() = default;
|
|
48
53
|
explicit Configuration(std::string id, std::optional<std::string> path, std::optional<std::string> encryptionKey, std::optional<Mode> mode, std::optional<bool> readOnly): id(id), path(path), encryptionKey(encryptionKey), mode(mode), readOnly(readOnly) {}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
friend bool operator==(const Configuration& lhs, const Configuration& rhs) = default;
|
|
49
57
|
};
|
|
50
58
|
|
|
51
59
|
} // namespace margelo::nitro::mmkv
|
|
@@ -58,20 +66,20 @@ namespace margelo::nitro {
|
|
|
58
66
|
static inline margelo::nitro::mmkv::Configuration fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
59
67
|
jsi::Object obj = arg.asObject(runtime);
|
|
60
68
|
return margelo::nitro::mmkv::Configuration(
|
|
61
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
62
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "path")),
|
|
63
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "encryptionKey")),
|
|
64
|
-
JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::fromJSI(runtime, obj.getProperty(runtime, "mode")),
|
|
65
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "readOnly"))
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id"))),
|
|
70
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path"))),
|
|
71
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptionKey"))),
|
|
72
|
+
JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode"))),
|
|
73
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readOnly")))
|
|
66
74
|
);
|
|
67
75
|
}
|
|
68
76
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::mmkv::Configuration& arg) {
|
|
69
77
|
jsi::Object obj(runtime);
|
|
70
|
-
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
71
|
-
obj.setProperty(runtime, "path", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.path));
|
|
72
|
-
obj.setProperty(runtime, "encryptionKey", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.encryptionKey));
|
|
73
|
-
obj.setProperty(runtime, "mode", JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::toJSI(runtime, arg.mode));
|
|
74
|
-
obj.setProperty(runtime, "readOnly", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.readOnly));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "id"), JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "path"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.path));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "encryptionKey"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.encryptionKey));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mode"), JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::toJSI(runtime, arg.mode));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "readOnly"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.readOnly));
|
|
75
83
|
return obj;
|
|
76
84
|
}
|
|
77
85
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -82,11 +90,11 @@ namespace margelo::nitro {
|
|
|
82
90
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
83
91
|
return false;
|
|
84
92
|
}
|
|
85
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
86
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "path"))) return false;
|
|
87
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "encryptionKey"))) return false;
|
|
88
|
-
if (!JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::canConvert(runtime, obj.getProperty(runtime, "mode"))) return false;
|
|
89
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "readOnly"))) return false;
|
|
93
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id")))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path")))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptionKey")))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<margelo::nitro::mmkv::Mode>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode")))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readOnly")))) return false;
|
|
90
98
|
return true;
|
|
91
99
|
}
|
|
92
100
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVFactorySpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridMMKVFactorySpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridMMKVPlatformContextSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridMMKVPlatformContextSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Listener.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,13 +37,16 @@ namespace margelo::nitro::mmkv {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (Listener).
|
|
34
39
|
*/
|
|
35
|
-
struct Listener {
|
|
40
|
+
struct Listener final {
|
|
36
41
|
public:
|
|
37
42
|
std::function<void()> remove SWIFT_PRIVATE;
|
|
38
43
|
|
|
39
44
|
public:
|
|
40
45
|
Listener() = default;
|
|
41
46
|
explicit Listener(std::function<void()> remove): remove(remove) {}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
// Listener is not equatable because these properties are not equatable: remove
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
} // namespace margelo::nitro::mmkv
|
|
@@ -51,12 +59,12 @@ namespace margelo::nitro {
|
|
|
51
59
|
static inline margelo::nitro::mmkv::Listener fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
60
|
jsi::Object obj = arg.asObject(runtime);
|
|
53
61
|
return margelo::nitro::mmkv::Listener(
|
|
54
|
-
JSIConverter<std::function<void()>>::fromJSI(runtime, obj.getProperty(runtime, "remove"))
|
|
62
|
+
JSIConverter<std::function<void()>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remove")))
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::mmkv::Listener& arg) {
|
|
58
66
|
jsi::Object obj(runtime);
|
|
59
|
-
obj.setProperty(runtime, "remove", JSIConverter<std::function<void()>>::toJSI(runtime, arg.remove));
|
|
67
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "remove"), JSIConverter<std::function<void()>>::toJSI(runtime, arg.remove));
|
|
60
68
|
return obj;
|
|
61
69
|
}
|
|
62
70
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -67,7 +75,7 @@ namespace margelo::nitro {
|
|
|
67
75
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
68
76
|
return false;
|
|
69
77
|
}
|
|
70
|
-
if (!JSIConverter<std::function<void()>>::canConvert(runtime, obj.getProperty(runtime, "remove"))) return false;
|
|
78
|
+
if (!JSIConverter<std::function<void()>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remove")))) return false;
|
|
71
79
|
return true;
|
|
72
80
|
}
|
|
73
81
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-mmkv",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "⚡️ The fastest key/value storage for React Native.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"eslint": "^8.57.0",
|
|
68
68
|
"eslint-config-prettier": "^9.1.0",
|
|
69
69
|
"eslint-plugin-prettier": "^5.2.1",
|
|
70
|
-
"nitrogen": "0.
|
|
70
|
+
"nitrogen": "0.33.2",
|
|
71
71
|
"prettier": "^3.3.3",
|
|
72
72
|
"react": "19.1.1",
|
|
73
73
|
"react-native": "0.82.0",
|
|
74
|
-
"react-native-nitro-modules": "0.
|
|
74
|
+
"react-native-nitro-modules": "0.33.2",
|
|
75
75
|
"typescript": "^5.8.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|