react-native-picture-selector 1.0.25 → 1.0.27
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/NitroPictureSelector.podspec +0 -1
- package/android/src/main/cpp/cpp-adapter.cpp +1 -1
- package/ios/NitroPictureSelectorOnLoad.mm +2 -2
- package/nitro.json +1 -1
- package/nitrogen/generated/android/NitroPictureSelectorOnLoad.cpp +5 -5
- package/nitrogen/generated/android/NitroPictureSelectorOnLoad.hpp +3 -3
- package/nitrogen/generated/android/c++/JCompressOptions.hpp +2 -2
- package/nitrogen/generated/android/c++/JCropOptions.hpp +2 -2
- package/nitrogen/generated/android/c++/JHybridHybridPictureSelectorSpec.cpp +8 -8
- package/nitrogen/generated/android/c++/JHybridHybridPictureSelectorSpec.hpp +2 -2
- package/nitrogen/generated/android/c++/JMediaAsset.hpp +2 -2
- package/nitrogen/generated/android/c++/JMediaType.hpp +2 -2
- package/nitrogen/generated/android/c++/JPickerTheme.hpp +2 -2
- package/nitrogen/generated/android/c++/JPictureSelectorOptions.hpp +2 -2
- package/nitrogen/generated/ios/NitroPictureSelector-Swift-Cxx-Bridge.cpp +4 -4
- package/nitrogen/generated/ios/NitroPictureSelector-Swift-Cxx-Bridge.hpp +8 -8
- package/nitrogen/generated/ios/NitroPictureSelector-Swift-Cxx-Umbrella.hpp +7 -7
- package/nitrogen/generated/ios/c++/HybridHybridPictureSelectorSpecSwift.cpp +2 -2
- package/nitrogen/generated/ios/c++/HybridHybridPictureSelectorSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/CompressOptions.swift +2 -2
- package/nitrogen/generated/ios/swift/CropOptions.swift +2 -2
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MediaAsset_.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHybridPictureSelectorSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/MediaAsset.swift +2 -2
- package/nitrogen/generated/ios/swift/MediaType.swift +1 -1
- package/nitrogen/generated/ios/swift/PickerTheme.swift +1 -1
- package/nitrogen/generated/ios/swift/PictureSelectorOptions.swift +2 -2
- package/nitrogen/generated/shared/c++/CompressOptions.hpp +6 -6
- package/nitrogen/generated/shared/c++/CropOptions.hpp +6 -6
- package/nitrogen/generated/shared/c++/HybridHybridPictureSelectorSpec.cpp +2 -2
- package/nitrogen/generated/shared/c++/HybridHybridPictureSelectorSpec.hpp +4 -4
- package/nitrogen/generated/shared/c++/MediaAsset.hpp +6 -6
- package/nitrogen/generated/shared/c++/MediaType.hpp +11 -11
- package/nitrogen/generated/shared/c++/PickerTheme.hpp +13 -13
- package/nitrogen/generated/shared/c++/PictureSelectorOptions.hpp +22 -22
- package/package.json +1 -1
|
@@ -32,7 +32,6 @@ Pod::Spec.new do |s|
|
|
|
32
32
|
s.pod_target_xcconfig = {
|
|
33
33
|
"SWIFT_ACTIVE_COMPILATION_CONDITIONS" =>
|
|
34
34
|
"HXPICKER_ENABLE_CORE HXPICKER_ENABLE_PICKER HXPICKER_ENABLE_EDITOR HXPICKER_ENABLE_CAMERA",
|
|
35
|
-
"OTHER_SWIFT_FLAGS" => "-enable-experimental-cxx-interop",
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
# ── Nitrogen ─────────────────────────────────────────────────────────────
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
extern "C" void* NitroPictureSelectorMakeHybrid();
|
|
21
21
|
|
|
22
22
|
using namespace margelo::nitro;
|
|
23
|
-
using namespace margelo::nitro::
|
|
24
|
-
using namespace margelo::nitro::
|
|
23
|
+
using namespace margelo::nitro::pictureselector;
|
|
24
|
+
using namespace margelo::nitro::pictureselector::bridge::swift;
|
|
25
25
|
|
|
26
26
|
@interface NitroPictureSelectorOnLoad: NSObject
|
|
27
27
|
@end
|
package/nitro.json
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
#include "JHybridHybridPictureSelectorSpec.hpp"
|
|
19
19
|
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::pictureselector {
|
|
21
21
|
|
|
22
22
|
int initialize(JavaVM* vm) {
|
|
23
23
|
return facebook::jni::initialize(vm, []() {
|
|
24
|
-
::margelo::nitro::
|
|
24
|
+
::margelo::nitro::pictureselector::registerAllNatives();
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -29,13 +29,13 @@ int initialize(JavaVM* vm) {
|
|
|
29
29
|
|
|
30
30
|
void registerAllNatives() {
|
|
31
31
|
using namespace margelo::nitro;
|
|
32
|
-
using namespace margelo::nitro::
|
|
32
|
+
using namespace margelo::nitro::pictureselector;
|
|
33
33
|
|
|
34
34
|
// Register native JNI methods
|
|
35
|
-
margelo::nitro::
|
|
35
|
+
margelo::nitro::pictureselector::JHybridHybridPictureSelectorSpec::CxxPart::registerNatives();
|
|
36
36
|
|
|
37
37
|
// Register Nitro Hybrid Objects
|
|
38
38
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
} // namespace margelo::nitro::
|
|
41
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#include <functional>
|
|
10
10
|
#include <NitroModules/NitroDefines.hpp>
|
|
11
11
|
|
|
12
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::pictureselector {
|
|
13
13
|
|
|
14
14
|
[[deprecated("Use registerNatives() instead.")]]
|
|
15
15
|
int initialize(JavaVM* vm);
|
|
@@ -23,7 +23,7 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
23
23
|
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
24
24
|
* return facebook::jni::initialize(vm, []() {
|
|
25
25
|
* // register all NitroPictureSelector HybridObjects
|
|
26
|
-
* margelo::nitro::
|
|
26
|
+
* margelo::nitro::pictureselector::registerNatives();
|
|
27
27
|
* // any other custom registrations go here.
|
|
28
28
|
* });
|
|
29
29
|
* }
|
|
@@ -31,4 +31,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
31
31
|
*/
|
|
32
32
|
void registerAllNatives();
|
|
33
33
|
|
|
34
|
-
} // namespace margelo::nitro::
|
|
34
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include <optional>
|
|
14
14
|
|
|
15
|
-
namespace margelo::nitro::
|
|
15
|
+
namespace margelo::nitro::pictureselector {
|
|
16
16
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
@@ -66,4 +66,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
} // namespace margelo::nitro::
|
|
69
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include <optional>
|
|
14
14
|
|
|
15
|
-
namespace margelo::nitro::
|
|
15
|
+
namespace margelo::nitro::pictureselector {
|
|
16
16
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
@@ -70,4 +70,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
} // namespace margelo::nitro::
|
|
73
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
#include "JHybridHybridPictureSelectorSpec.hpp"
|
|
9
9
|
|
|
10
10
|
// Forward declaration of `MediaAsset` to properly resolve imports.
|
|
11
|
-
namespace margelo::nitro::
|
|
11
|
+
namespace margelo::nitro::pictureselector { struct MediaAsset; }
|
|
12
12
|
// Forward declaration of `PictureSelectorOptions` to properly resolve imports.
|
|
13
|
-
namespace margelo::nitro::
|
|
13
|
+
namespace margelo::nitro::pictureselector { struct PictureSelectorOptions; }
|
|
14
14
|
// Forward declaration of `MediaType` to properly resolve imports.
|
|
15
|
-
namespace margelo::nitro::
|
|
15
|
+
namespace margelo::nitro::pictureselector { enum class MediaType; }
|
|
16
16
|
// Forward declaration of `CropOptions` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::
|
|
17
|
+
namespace margelo::nitro::pictureselector { struct CropOptions; }
|
|
18
18
|
// Forward declaration of `CompressOptions` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::
|
|
19
|
+
namespace margelo::nitro::pictureselector { struct CompressOptions; }
|
|
20
20
|
// Forward declaration of `PickerTheme` to properly resolve imports.
|
|
21
|
-
namespace margelo::nitro::
|
|
21
|
+
namespace margelo::nitro::pictureselector { enum class PickerTheme; }
|
|
22
22
|
|
|
23
23
|
#include "MediaAsset.hpp"
|
|
24
24
|
#include <vector>
|
|
@@ -38,7 +38,7 @@ namespace margelo::nitro::margelo::pictureselector { enum class PickerTheme; }
|
|
|
38
38
|
#include "PickerTheme.hpp"
|
|
39
39
|
#include "JPickerTheme.hpp"
|
|
40
40
|
|
|
41
|
-
namespace margelo::nitro::
|
|
41
|
+
namespace margelo::nitro::pictureselector {
|
|
42
42
|
|
|
43
43
|
std::shared_ptr<JHybridHybridPictureSelectorSpec> JHybridHybridPictureSelectorSpec::JavaPart::getJHybridHybridPictureSelectorSpec() {
|
|
44
44
|
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
@@ -122,4 +122,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
122
122
|
}();
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
} // namespace margelo::nitro::
|
|
125
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
namespace margelo::nitro::
|
|
17
|
+
namespace margelo::nitro::pictureselector {
|
|
18
18
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
@@ -61,4 +61,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
61
61
|
jni::global_ref<JHybridHybridPictureSelectorSpec::JavaPart> _javaPart;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
} // namespace margelo::nitro::
|
|
64
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#include <optional>
|
|
14
14
|
#include <string>
|
|
15
15
|
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::pictureselector {
|
|
17
17
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
@@ -95,4 +95,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
} // namespace margelo::nitro::
|
|
98
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "MediaType.hpp"
|
|
12
12
|
|
|
13
|
-
namespace margelo::nitro::
|
|
13
|
+
namespace margelo::nitro::pictureselector {
|
|
14
14
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
@@ -58,4 +58,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
} // namespace margelo::nitro::
|
|
61
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "PickerTheme.hpp"
|
|
12
12
|
|
|
13
|
-
namespace margelo::nitro::
|
|
13
|
+
namespace margelo::nitro::pictureselector {
|
|
14
14
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
@@ -61,4 +61,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
} // namespace margelo::nitro::
|
|
64
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
#include <string>
|
|
23
23
|
#include <vector>
|
|
24
24
|
|
|
25
|
-
namespace margelo::nitro::
|
|
25
|
+
namespace margelo::nitro::pictureselector {
|
|
26
26
|
|
|
27
27
|
using namespace facebook;
|
|
28
28
|
|
|
@@ -118,4 +118,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
} // namespace margelo::nitro::
|
|
121
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
#include "NitroPictureSelector-Swift-Cxx-Umbrella.hpp"
|
|
13
13
|
#include <NitroModules/NitroDefines.hpp>
|
|
14
14
|
|
|
15
|
-
namespace margelo::nitro::
|
|
15
|
+
namespace margelo::nitro::pictureselector::bridge::swift {
|
|
16
16
|
|
|
17
17
|
// pragma MARK: std::function<void(const std::vector<MediaAsset>& /* result */)>
|
|
18
18
|
Func_void_std__vector_MediaAsset_ create_Func_void_std__vector_MediaAsset_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
@@ -33,10 +33,10 @@ namespace margelo::nitro::margelo::pictureselector::bridge::swift {
|
|
|
33
33
|
// pragma MARK: std::shared_ptr<HybridHybridPictureSelectorSpec>
|
|
34
34
|
std::shared_ptr<HybridHybridPictureSelectorSpec> create_std__shared_ptr_HybridHybridPictureSelectorSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
35
|
NitroPictureSelector::HybridHybridPictureSelectorSpec_cxx swiftPart = NitroPictureSelector::HybridHybridPictureSelectorSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
-
return std::make_shared<margelo::nitro::
|
|
36
|
+
return std::make_shared<margelo::nitro::pictureselector::HybridHybridPictureSelectorSpecSwift>(swiftPart);
|
|
37
37
|
}
|
|
38
38
|
void* NON_NULL get_std__shared_ptr_HybridHybridPictureSelectorSpec_(std__shared_ptr_HybridHybridPictureSelectorSpec_ cppType) {
|
|
39
|
-
std::shared_ptr<margelo::nitro::
|
|
39
|
+
std::shared_ptr<margelo::nitro::pictureselector::HybridHybridPictureSelectorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::pictureselector::HybridHybridPictureSelectorSpecSwift>(cppType);
|
|
40
40
|
#ifdef NITRO_DEBUG
|
|
41
41
|
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
42
|
throw std::runtime_error("Class \"HybridHybridPictureSelectorSpec\" is not implemented in Swift!");
|
|
@@ -46,4 +46,4 @@ namespace margelo::nitro::margelo::pictureselector::bridge::swift {
|
|
|
46
46
|
return swiftPart.toUnsafe();
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
} // namespace margelo::nitro::
|
|
49
|
+
} // namespace margelo::nitro::pictureselector::bridge::swift
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `CompressOptions` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::pictureselector { struct CompressOptions; }
|
|
13
13
|
// Forward declaration of `CropOptions` to properly resolve imports.
|
|
14
|
-
namespace margelo::nitro::
|
|
14
|
+
namespace margelo::nitro::pictureselector { struct CropOptions; }
|
|
15
15
|
// Forward declaration of `HybridHybridPictureSelectorSpec` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::pictureselector { class HybridHybridPictureSelectorSpec; }
|
|
17
17
|
// Forward declaration of `MediaAsset` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::
|
|
18
|
+
namespace margelo::nitro::pictureselector { struct MediaAsset; }
|
|
19
19
|
// Forward declaration of `MediaType` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::pictureselector { enum class MediaType; }
|
|
21
21
|
// Forward declaration of `PickerTheme` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::
|
|
22
|
+
namespace margelo::nitro::pictureselector { enum class PickerTheme; }
|
|
23
23
|
|
|
24
24
|
// Forward declarations of Swift defined types
|
|
25
25
|
// Forward declaration of `HybridHybridPictureSelectorSpec_cxx` to properly resolve imports.
|
|
@@ -46,7 +46,7 @@ namespace NitroPictureSelector { class HybridHybridPictureSelectorSpec_cxx; }
|
|
|
46
46
|
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
47
47
|
* as well as helper functions to interact with those C++ types from Swift.
|
|
48
48
|
*/
|
|
49
|
-
namespace margelo::nitro::
|
|
49
|
+
namespace margelo::nitro::pictureselector::bridge::swift {
|
|
50
50
|
|
|
51
51
|
// pragma MARK: std::optional<std::string>
|
|
52
52
|
/**
|
|
@@ -267,4 +267,4 @@ namespace margelo::nitro::margelo::pictureselector::bridge::swift {
|
|
|
267
267
|
return Result<std::shared_ptr<Promise<std::vector<MediaAsset>>>>::withError(error);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
} // namespace margelo::nitro::
|
|
270
|
+
} // namespace margelo::nitro::pictureselector::bridge::swift
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `CompressOptions` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::pictureselector { struct CompressOptions; }
|
|
13
13
|
// Forward declaration of `CropOptions` to properly resolve imports.
|
|
14
|
-
namespace margelo::nitro::
|
|
14
|
+
namespace margelo::nitro::pictureselector { struct CropOptions; }
|
|
15
15
|
// Forward declaration of `HybridHybridPictureSelectorSpec` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::pictureselector { class HybridHybridPictureSelectorSpec; }
|
|
17
17
|
// Forward declaration of `MediaAsset` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::
|
|
18
|
+
namespace margelo::nitro::pictureselector { struct MediaAsset; }
|
|
19
19
|
// Forward declaration of `MediaType` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::pictureselector { enum class MediaType; }
|
|
21
21
|
// Forward declaration of `PickerTheme` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::
|
|
22
|
+
namespace margelo::nitro::pictureselector { enum class PickerTheme; }
|
|
23
23
|
// Forward declaration of `PictureSelectorOptions` to properly resolve imports.
|
|
24
|
-
namespace margelo::nitro::
|
|
24
|
+
namespace margelo::nitro::pictureselector { struct PictureSelectorOptions; }
|
|
25
25
|
|
|
26
26
|
// Include C++ defined types
|
|
27
27
|
#include "CompressOptions.hpp"
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
namespace NitroPictureSelector { class HybridHybridPictureSelectorSpec_cxx; }
|
|
14
14
|
|
|
15
15
|
// Forward declaration of `MediaAsset` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::pictureselector { struct MediaAsset; }
|
|
17
17
|
// Forward declaration of `PictureSelectorOptions` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::
|
|
18
|
+
namespace margelo::nitro::pictureselector { struct PictureSelectorOptions; }
|
|
19
19
|
// Forward declaration of `MediaType` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::pictureselector { enum class MediaType; }
|
|
21
21
|
// Forward declaration of `CropOptions` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::
|
|
22
|
+
namespace margelo::nitro::pictureselector { struct CropOptions; }
|
|
23
23
|
// Forward declaration of `CompressOptions` to properly resolve imports.
|
|
24
|
-
namespace margelo::nitro::
|
|
24
|
+
namespace margelo::nitro::pictureselector { struct CompressOptions; }
|
|
25
25
|
// Forward declaration of `PickerTheme` to properly resolve imports.
|
|
26
|
-
namespace margelo::nitro::
|
|
26
|
+
namespace margelo::nitro::pictureselector { enum class PickerTheme; }
|
|
27
27
|
|
|
28
28
|
#include "MediaAsset.hpp"
|
|
29
29
|
#include <vector>
|
|
@@ -38,7 +38,7 @@ namespace margelo::nitro::margelo::pictureselector { enum class PickerTheme; }
|
|
|
38
38
|
|
|
39
39
|
#include "NitroPictureSelector-Swift-Cxx-Umbrella.hpp"
|
|
40
40
|
|
|
41
|
-
namespace margelo::nitro::
|
|
41
|
+
namespace margelo::nitro::pictureselector {
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The C++ part of HybridHybridPictureSelectorSpec_cxx.swift.
|
|
@@ -107,4 +107,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
107
107
|
NitroPictureSelector::HybridHybridPictureSelectorSpec_cxx _swiftPart;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
} // namespace margelo::nitro::
|
|
110
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `CompressOptions`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias CompressOptions = margelo.nitro.
|
|
13
|
+
public typealias CompressOptions = margelo.nitro.pictureselector.CompressOptions
|
|
14
14
|
|
|
15
15
|
public extension CompressOptions {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `CompressOptions`.
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `CropOptions`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias CropOptions = margelo.nitro.
|
|
13
|
+
public typealias CropOptions = margelo.nitro.pictureselector.CropOptions
|
|
14
14
|
|
|
15
15
|
public extension CropOptions {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `CropOptions`.
|
|
@@ -12,7 +12,7 @@ import NitroModules
|
|
|
12
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
13
|
*/
|
|
14
14
|
public final class Func_void_std__exception_ptr {
|
|
15
|
-
public typealias bridge = margelo.nitro.
|
|
15
|
+
public typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
16
16
|
|
|
17
17
|
private let closure: (_ error: Error) -> Void
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import NitroModules
|
|
|
12
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
13
|
*/
|
|
14
14
|
public final class Func_void_std__vector_MediaAsset_ {
|
|
15
|
-
public typealias bridge = margelo.nitro.
|
|
15
|
+
public typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
16
16
|
|
|
17
17
|
private let closure: (_ value: [MediaAsset]) -> Void
|
|
18
18
|
|
|
@@ -18,11 +18,11 @@ import NitroModules
|
|
|
18
18
|
*/
|
|
19
19
|
open class HybridHybridPictureSelectorSpec_cxx {
|
|
20
20
|
/**
|
|
21
|
-
* The Swift <> C++ bridge's namespace (`margelo::nitro::
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::pictureselector::bridge::swift`)
|
|
22
22
|
* from `NitroPictureSelector-Swift-Cxx-Bridge.hpp`.
|
|
23
23
|
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
24
|
*/
|
|
25
|
-
public typealias bridge = margelo.nitro.
|
|
25
|
+
public typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Holds an instance of the `HybridHybridPictureSelectorSpec` Swift protocol.
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `MediaAsset`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias MediaAsset = margelo.nitro.
|
|
13
|
+
public typealias MediaAsset = margelo.nitro.pictureselector.MediaAsset
|
|
14
14
|
|
|
15
15
|
public extension MediaAsset {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `MediaAsset`.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents the JS union `MediaType`, backed by a C++ enum.
|
|
10
10
|
*/
|
|
11
|
-
public typealias MediaType = margelo.nitro.
|
|
11
|
+
public typealias MediaType = margelo.nitro.pictureselector.MediaType
|
|
12
12
|
|
|
13
13
|
public extension MediaType {
|
|
14
14
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents the JS union `PickerTheme`, backed by a C++ enum.
|
|
10
10
|
*/
|
|
11
|
-
public typealias PickerTheme = margelo.nitro.
|
|
11
|
+
public typealias PickerTheme = margelo.nitro.pictureselector.PickerTheme
|
|
12
12
|
|
|
13
13
|
public extension PickerTheme {
|
|
14
14
|
/**
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `PictureSelectorOptions`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias PictureSelectorOptions = margelo.nitro.
|
|
13
|
+
public typealias PictureSelectorOptions = margelo.nitro.pictureselector.PictureSelectorOptions
|
|
14
14
|
|
|
15
15
|
public extension PictureSelectorOptions {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.pictureselector.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `PictureSelectorOptions`.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include <optional>
|
|
34
34
|
|
|
35
|
-
namespace margelo::nitro::
|
|
35
|
+
namespace margelo::nitro::pictureselector {
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* A struct which can be represented as a JavaScript object (CompressOptions).
|
|
@@ -52,23 +52,23 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
52
52
|
friend bool operator==(const CompressOptions& lhs, const CompressOptions& rhs) = default;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
} // namespace margelo::nitro::
|
|
55
|
+
} // namespace margelo::nitro::pictureselector
|
|
56
56
|
|
|
57
57
|
namespace margelo::nitro {
|
|
58
58
|
|
|
59
59
|
// C++ CompressOptions <> JS CompressOptions (object)
|
|
60
60
|
template <>
|
|
61
|
-
struct JSIConverter<margelo::nitro::
|
|
62
|
-
static inline margelo::nitro::
|
|
61
|
+
struct JSIConverter<margelo::nitro::pictureselector::CompressOptions> final {
|
|
62
|
+
static inline margelo::nitro::pictureselector::CompressOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
63
|
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
-
return margelo::nitro::
|
|
64
|
+
return margelo::nitro::pictureselector::CompressOptions(
|
|
65
65
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled"))),
|
|
66
66
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "quality"))),
|
|
67
67
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxWidth"))),
|
|
68
68
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxHeight")))
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pictureselector::CompressOptions& arg) {
|
|
72
72
|
jsi::Object obj(runtime);
|
|
73
73
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "enabled"), JSIConverter<bool>::toJSI(runtime, arg.enabled));
|
|
74
74
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "quality"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.quality));
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include <optional>
|
|
34
34
|
|
|
35
|
-
namespace margelo::nitro::
|
|
35
|
+
namespace margelo::nitro::pictureselector {
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* A struct which can be represented as a JavaScript object (CropOptions).
|
|
@@ -53,16 +53,16 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
53
53
|
friend bool operator==(const CropOptions& lhs, const CropOptions& rhs) = default;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
} // namespace margelo::nitro::
|
|
56
|
+
} // namespace margelo::nitro::pictureselector
|
|
57
57
|
|
|
58
58
|
namespace margelo::nitro {
|
|
59
59
|
|
|
60
60
|
// C++ CropOptions <> JS CropOptions (object)
|
|
61
61
|
template <>
|
|
62
|
-
struct JSIConverter<margelo::nitro::
|
|
63
|
-
static inline margelo::nitro::
|
|
62
|
+
struct JSIConverter<margelo::nitro::pictureselector::CropOptions> final {
|
|
63
|
+
static inline margelo::nitro::pictureselector::CropOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
64
64
|
jsi::Object obj = arg.asObject(runtime);
|
|
65
|
-
return margelo::nitro::
|
|
65
|
+
return margelo::nitro::pictureselector::CropOptions(
|
|
66
66
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled"))),
|
|
67
67
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "freeStyle"))),
|
|
68
68
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "circular"))),
|
|
@@ -70,7 +70,7 @@ namespace margelo::nitro {
|
|
|
70
70
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ratioY")))
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
73
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pictureselector::CropOptions& arg) {
|
|
74
74
|
jsi::Object obj(runtime);
|
|
75
75
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "enabled"), JSIConverter<bool>::toJSI(runtime, arg.enabled));
|
|
76
76
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "freeStyle"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.freeStyle));
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#include "HybridHybridPictureSelectorSpec.hpp"
|
|
9
9
|
|
|
10
|
-
namespace margelo::nitro::
|
|
10
|
+
namespace margelo::nitro::pictureselector {
|
|
11
11
|
|
|
12
12
|
void HybridHybridPictureSelectorSpec::loadHybridMethods() {
|
|
13
13
|
// load base methods/properties
|
|
@@ -19,4 +19,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
} // namespace margelo::nitro::
|
|
22
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
16
|
// Forward declaration of `MediaAsset` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::
|
|
17
|
+
namespace margelo::nitro::pictureselector { struct MediaAsset; }
|
|
18
18
|
// Forward declaration of `PictureSelectorOptions` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::
|
|
19
|
+
namespace margelo::nitro::pictureselector { struct PictureSelectorOptions; }
|
|
20
20
|
|
|
21
21
|
#include "MediaAsset.hpp"
|
|
22
22
|
#include <vector>
|
|
23
23
|
#include <NitroModules/Promise.hpp>
|
|
24
24
|
#include "PictureSelectorOptions.hpp"
|
|
25
25
|
|
|
26
|
-
namespace margelo::nitro::
|
|
26
|
+
namespace margelo::nitro::pictureselector {
|
|
27
27
|
|
|
28
28
|
using namespace margelo::nitro;
|
|
29
29
|
|
|
@@ -66,4 +66,4 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
66
66
|
static constexpr auto TAG = "HybridPictureSelector";
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
} // namespace margelo::nitro::
|
|
69
|
+
} // namespace margelo::nitro::pictureselector
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
#include <string>
|
|
34
34
|
#include <optional>
|
|
35
35
|
|
|
36
|
-
namespace margelo::nitro::
|
|
36
|
+
namespace margelo::nitro::pictureselector {
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* A struct which can be represented as a JavaScript object (MediaAsset).
|
|
@@ -60,16 +60,16 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
60
60
|
friend bool operator==(const MediaAsset& lhs, const MediaAsset& rhs) = default;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
} // namespace margelo::nitro::
|
|
63
|
+
} // namespace margelo::nitro::pictureselector
|
|
64
64
|
|
|
65
65
|
namespace margelo::nitro {
|
|
66
66
|
|
|
67
67
|
// C++ MediaAsset <> JS MediaAsset (object)
|
|
68
68
|
template <>
|
|
69
|
-
struct JSIConverter<margelo::nitro::
|
|
70
|
-
static inline margelo::nitro::
|
|
69
|
+
struct JSIConverter<margelo::nitro::pictureselector::MediaAsset> final {
|
|
70
|
+
static inline margelo::nitro::pictureselector::MediaAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
71
71
|
jsi::Object obj = arg.asObject(runtime);
|
|
72
|
-
return margelo::nitro::
|
|
72
|
+
return margelo::nitro::pictureselector::MediaAsset(
|
|
73
73
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri"))),
|
|
74
74
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
75
75
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mimeType"))),
|
|
@@ -83,7 +83,7 @@ namespace margelo::nitro {
|
|
|
83
83
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bucketName")))
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
86
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pictureselector::MediaAsset& arg) {
|
|
87
87
|
jsi::Object obj(runtime);
|
|
88
88
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uri"), JSIConverter<std::string>::toJSI(runtime, arg.uri));
|
|
89
89
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<std::string>::toJSI(runtime, arg.type));
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
namespace margelo::nitro::
|
|
26
|
+
namespace margelo::nitro::pictureselector {
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* An enum which can be represented as a JavaScript union (MediaType).
|
|
@@ -34,28 +34,28 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
34
34
|
ALL SWIFT_NAME(all) = 2,
|
|
35
35
|
} CLOSED_ENUM;
|
|
36
36
|
|
|
37
|
-
} // namespace margelo::nitro::
|
|
37
|
+
} // namespace margelo::nitro::pictureselector
|
|
38
38
|
|
|
39
39
|
namespace margelo::nitro {
|
|
40
40
|
|
|
41
41
|
// C++ MediaType <> JS MediaType (union)
|
|
42
42
|
template <>
|
|
43
|
-
struct JSIConverter<margelo::nitro::
|
|
44
|
-
static inline margelo::nitro::
|
|
43
|
+
struct JSIConverter<margelo::nitro::pictureselector::MediaType> final {
|
|
44
|
+
static inline margelo::nitro::pictureselector::MediaType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
45
|
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
46
|
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
-
case hashString("image"): return margelo::nitro::
|
|
48
|
-
case hashString("video"): return margelo::nitro::
|
|
49
|
-
case hashString("all"): return margelo::nitro::
|
|
47
|
+
case hashString("image"): return margelo::nitro::pictureselector::MediaType::IMAGE;
|
|
48
|
+
case hashString("video"): return margelo::nitro::pictureselector::MediaType::VIDEO;
|
|
49
|
+
case hashString("all"): return margelo::nitro::pictureselector::MediaType::ALL;
|
|
50
50
|
default: [[unlikely]]
|
|
51
51
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MediaType - invalid value!");
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::pictureselector::MediaType arg) {
|
|
55
55
|
switch (arg) {
|
|
56
|
-
case margelo::nitro::
|
|
57
|
-
case margelo::nitro::
|
|
58
|
-
case margelo::nitro::
|
|
56
|
+
case margelo::nitro::pictureselector::MediaType::IMAGE: return JSIConverter<std::string>::toJSI(runtime, "image");
|
|
57
|
+
case margelo::nitro::pictureselector::MediaType::VIDEO: return JSIConverter<std::string>::toJSI(runtime, "video");
|
|
58
|
+
case margelo::nitro::pictureselector::MediaType::ALL: return JSIConverter<std::string>::toJSI(runtime, "all");
|
|
59
59
|
default: [[unlikely]]
|
|
60
60
|
throw std::invalid_argument("Cannot convert MediaType to JS - invalid value: "
|
|
61
61
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
namespace margelo::nitro::
|
|
26
|
+
namespace margelo::nitro::pictureselector {
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* An enum which can be represented as a JavaScript union (PickerTheme).
|
|
@@ -35,30 +35,30 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
35
35
|
DARK SWIFT_NAME(dark) = 3,
|
|
36
36
|
} CLOSED_ENUM;
|
|
37
37
|
|
|
38
|
-
} // namespace margelo::nitro::
|
|
38
|
+
} // namespace margelo::nitro::pictureselector
|
|
39
39
|
|
|
40
40
|
namespace margelo::nitro {
|
|
41
41
|
|
|
42
42
|
// C++ PickerTheme <> JS PickerTheme (union)
|
|
43
43
|
template <>
|
|
44
|
-
struct JSIConverter<margelo::nitro::
|
|
45
|
-
static inline margelo::nitro::
|
|
44
|
+
struct JSIConverter<margelo::nitro::pictureselector::PickerTheme> final {
|
|
45
|
+
static inline margelo::nitro::pictureselector::PickerTheme fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
46
46
|
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
47
47
|
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
48
|
-
case hashString("default"): return margelo::nitro::
|
|
49
|
-
case hashString("wechat"): return margelo::nitro::
|
|
50
|
-
case hashString("white"): return margelo::nitro::
|
|
51
|
-
case hashString("dark"): return margelo::nitro::
|
|
48
|
+
case hashString("default"): return margelo::nitro::pictureselector::PickerTheme::DEFAULT;
|
|
49
|
+
case hashString("wechat"): return margelo::nitro::pictureselector::PickerTheme::WECHAT;
|
|
50
|
+
case hashString("white"): return margelo::nitro::pictureselector::PickerTheme::WHITE;
|
|
51
|
+
case hashString("dark"): return margelo::nitro::pictureselector::PickerTheme::DARK;
|
|
52
52
|
default: [[unlikely]]
|
|
53
53
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum PickerTheme - invalid value!");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::pictureselector::PickerTheme arg) {
|
|
57
57
|
switch (arg) {
|
|
58
|
-
case margelo::nitro::
|
|
59
|
-
case margelo::nitro::
|
|
60
|
-
case margelo::nitro::
|
|
61
|
-
case margelo::nitro::
|
|
58
|
+
case margelo::nitro::pictureselector::PickerTheme::DEFAULT: return JSIConverter<std::string>::toJSI(runtime, "default");
|
|
59
|
+
case margelo::nitro::pictureselector::PickerTheme::WECHAT: return JSIConverter<std::string>::toJSI(runtime, "wechat");
|
|
60
|
+
case margelo::nitro::pictureselector::PickerTheme::WHITE: return JSIConverter<std::string>::toJSI(runtime, "white");
|
|
61
|
+
case margelo::nitro::pictureselector::PickerTheme::DARK: return JSIConverter<std::string>::toJSI(runtime, "dark");
|
|
62
62
|
default: [[unlikely]]
|
|
63
63
|
throw std::invalid_argument("Cannot convert PickerTheme to JS - invalid value: "
|
|
64
64
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
31
|
// Forward declaration of `MediaType` to properly resolve imports.
|
|
32
|
-
namespace margelo::nitro::
|
|
32
|
+
namespace margelo::nitro::pictureselector { enum class MediaType; }
|
|
33
33
|
// Forward declaration of `CropOptions` to properly resolve imports.
|
|
34
|
-
namespace margelo::nitro::
|
|
34
|
+
namespace margelo::nitro::pictureselector { struct CropOptions; }
|
|
35
35
|
// Forward declaration of `CompressOptions` to properly resolve imports.
|
|
36
|
-
namespace margelo::nitro::
|
|
36
|
+
namespace margelo::nitro::pictureselector { struct CompressOptions; }
|
|
37
37
|
// Forward declaration of `PickerTheme` to properly resolve imports.
|
|
38
|
-
namespace margelo::nitro::
|
|
38
|
+
namespace margelo::nitro::pictureselector { enum class PickerTheme; }
|
|
39
39
|
|
|
40
40
|
#include "MediaType.hpp"
|
|
41
41
|
#include <optional>
|
|
@@ -45,7 +45,7 @@ namespace margelo::nitro::margelo::pictureselector { enum class PickerTheme; }
|
|
|
45
45
|
#include <string>
|
|
46
46
|
#include <vector>
|
|
47
47
|
|
|
48
|
-
namespace margelo::nitro::
|
|
48
|
+
namespace margelo::nitro::pictureselector {
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* A struct which can be represented as a JavaScript object (PictureSelectorOptions).
|
|
@@ -71,38 +71,38 @@ namespace margelo::nitro::margelo::pictureselector {
|
|
|
71
71
|
friend bool operator==(const PictureSelectorOptions& lhs, const PictureSelectorOptions& rhs) = default;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
} // namespace margelo::nitro::
|
|
74
|
+
} // namespace margelo::nitro::pictureselector
|
|
75
75
|
|
|
76
76
|
namespace margelo::nitro {
|
|
77
77
|
|
|
78
78
|
// C++ PictureSelectorOptions <> JS PictureSelectorOptions (object)
|
|
79
79
|
template <>
|
|
80
|
-
struct JSIConverter<margelo::nitro::
|
|
81
|
-
static inline margelo::nitro::
|
|
80
|
+
struct JSIConverter<margelo::nitro::pictureselector::PictureSelectorOptions> final {
|
|
81
|
+
static inline margelo::nitro::pictureselector::PictureSelectorOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
82
82
|
jsi::Object obj = arg.asObject(runtime);
|
|
83
|
-
return margelo::nitro::
|
|
84
|
-
JSIConverter<std::optional<margelo::nitro::
|
|
83
|
+
return margelo::nitro::pictureselector::PictureSelectorOptions(
|
|
84
|
+
JSIConverter<std::optional<margelo::nitro::pictureselector::MediaType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mediaType"))),
|
|
85
85
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxCount"))),
|
|
86
86
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enableCamera"))),
|
|
87
|
-
JSIConverter<std::optional<margelo::nitro::
|
|
88
|
-
JSIConverter<std::optional<margelo::nitro::
|
|
87
|
+
JSIConverter<std::optional<margelo::nitro::pictureselector::CropOptions>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "crop"))),
|
|
88
|
+
JSIConverter<std::optional<margelo::nitro::pictureselector::CompressOptions>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compress"))),
|
|
89
89
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxVideoDuration"))),
|
|
90
90
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minVideoDuration"))),
|
|
91
|
-
JSIConverter<std::optional<margelo::nitro::
|
|
91
|
+
JSIConverter<std::optional<margelo::nitro::pictureselector::PickerTheme>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "theme"))),
|
|
92
92
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themeColor"))),
|
|
93
93
|
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "selectedAssets")))
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
96
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pictureselector::PictureSelectorOptions& arg) {
|
|
97
97
|
jsi::Object obj(runtime);
|
|
98
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mediaType"), JSIConverter<std::optional<margelo::nitro::
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mediaType"), JSIConverter<std::optional<margelo::nitro::pictureselector::MediaType>>::toJSI(runtime, arg.mediaType));
|
|
99
99
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxCount"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxCount));
|
|
100
100
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "enableCamera"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.enableCamera));
|
|
101
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "crop"), JSIConverter<std::optional<margelo::nitro::
|
|
102
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "compress"), JSIConverter<std::optional<margelo::nitro::
|
|
101
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "crop"), JSIConverter<std::optional<margelo::nitro::pictureselector::CropOptions>>::toJSI(runtime, arg.crop));
|
|
102
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "compress"), JSIConverter<std::optional<margelo::nitro::pictureselector::CompressOptions>>::toJSI(runtime, arg.compress));
|
|
103
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxVideoDuration"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxVideoDuration));
|
|
104
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "minVideoDuration"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.minVideoDuration));
|
|
105
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "theme"), JSIConverter<std::optional<margelo::nitro::
|
|
105
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "theme"), JSIConverter<std::optional<margelo::nitro::pictureselector::PickerTheme>>::toJSI(runtime, arg.theme));
|
|
106
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "themeColor"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.themeColor));
|
|
107
107
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "selectedAssets"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.selectedAssets));
|
|
108
108
|
return obj;
|
|
@@ -115,14 +115,14 @@ namespace margelo::nitro {
|
|
|
115
115
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
116
116
|
return false;
|
|
117
117
|
}
|
|
118
|
-
if (!JSIConverter<std::optional<margelo::nitro::
|
|
118
|
+
if (!JSIConverter<std::optional<margelo::nitro::pictureselector::MediaType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mediaType")))) return false;
|
|
119
119
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxCount")))) return false;
|
|
120
120
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enableCamera")))) return false;
|
|
121
|
-
if (!JSIConverter<std::optional<margelo::nitro::
|
|
122
|
-
if (!JSIConverter<std::optional<margelo::nitro::
|
|
121
|
+
if (!JSIConverter<std::optional<margelo::nitro::pictureselector::CropOptions>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "crop")))) return false;
|
|
122
|
+
if (!JSIConverter<std::optional<margelo::nitro::pictureselector::CompressOptions>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compress")))) return false;
|
|
123
123
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxVideoDuration")))) return false;
|
|
124
124
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minVideoDuration")))) return false;
|
|
125
|
-
if (!JSIConverter<std::optional<margelo::nitro::
|
|
125
|
+
if (!JSIConverter<std::optional<margelo::nitro::pictureselector::PickerTheme>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "theme")))) return false;
|
|
126
126
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themeColor")))) return false;
|
|
127
127
|
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "selectedAssets")))) return false;
|
|
128
128
|
return true;
|
package/package.json
CHANGED