react-native-video-trim 4.1.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +89 -76
- package/VideoTrim.podspec +3 -3
- package/android/build.gradle +6 -53
- package/android/gradle.properties +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim/VideoTrim.kt → videotrim/VideoTrimModule.kt} +246 -232
- package/android/src/main/java/com/videotrim/VideoTrimPackage.kt +33 -0
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/enums/ErrorCode.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/IVideoTrimmerView.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/VideoTrimListener.java +5 -4
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/MediaMetadataUtil.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/StorageUtil.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/VideoTrimmerUtil.java +20 -18
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/widgets/VideoTrimmerView.java +44 -45
- package/ios/AssetLoader.h +19 -0
- package/ios/AssetLoader.mm +87 -0
- package/ios/ErrorCode.h +9 -0
- package/ios/ProgressAlertController.h +15 -0
- package/ios/ProgressAlertController.mm +78 -0
- package/ios/VideoTrim.h +31 -0
- package/ios/VideoTrim.mm +663 -0
- package/ios/VideoTrimmer.h +67 -0
- package/ios/VideoTrimmer.mm +863 -0
- package/ios/VideoTrimmerThumb.h +23 -0
- package/ios/VideoTrimmerThumb.mm +175 -0
- package/ios/VideoTrimmerViewController.h +52 -0
- package/ios/VideoTrimmerViewController.mm +533 -0
- package/lib/module/NativeVideoTrim.js +5 -0
- package/lib/module/NativeVideoTrim.js.map +1 -0
- package/lib/module/index.js +24 -24
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeVideoTrim.d.ts +107 -0
- package/lib/typescript/src/NativeVideoTrim.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +16 -10
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +15 -18
- package/src/NativeVideoTrim.ts +113 -0
- package/src/index.tsx +29 -31
- package/android/CMakeLists.txt +0 -24
- package/android/src/main/cpp/cpp-adapter.cpp +0 -6
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +0 -22
- package/ios/AssetLoader.swift +0 -99
- package/ios/ErrorCode.swift +0 -17
- package/ios/ProgressAlertController.swift +0 -100
- package/ios/VideoTrim.swift +0 -67
- package/ios/VideoTrimImpl.swift +0 -957
- package/ios/VideoTrimmer.swift +0 -872
- package/ios/VideoTrimmerThumb.swift +0 -175
- package/ios/VideoTrimmerViewController.swift +0 -557
- package/lib/module/VideoTrim.nitro.js +0 -4
- package/lib/module/VideoTrim.nitro.js.map +0 -1
- package/lib/typescript/src/VideoTrim.nitro.d.ts +0 -257
- package/lib/typescript/src/VideoTrim.nitro.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JEditorConfig.hpp +0 -237
- package/nitrogen/generated/android/c++/JFileValidationResult.hpp +0 -61
- package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -74
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +0 -89
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +0 -151
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +0 -68
- package/nitrogen/generated/android/c++/JTrimOptions.hpp +0 -109
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +0 -72
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +0 -28
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +0 -86
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/TrimOptions.kt +0 -40
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +0 -35
- package/nitrogen/generated/android/videotrim+autolinking.cmake +0 -78
- package/nitrogen/generated/android/videotrim+autolinking.gradle +0 -27
- package/nitrogen/generated/android/videotrimOnLoad.cpp +0 -50
- package/nitrogen/generated/android/videotrimOnLoad.hpp +0 -25
- package/nitrogen/generated/ios/VideoTrim+autolinking.rb +0 -60
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +0 -96
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +0 -374
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +0 -56
- package/nitrogen/generated/ios/VideoTrimAutolinking.mm +0 -33
- package/nitrogen/generated/ios/VideoTrimAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +0 -127
- package/nitrogen/generated/ios/swift/EditorConfig.swift +0 -541
- package/nitrogen/generated/ios/swift/FileValidationResult.swift +0 -57
- package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_double.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +0 -54
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +0 -54
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +0 -241
- package/nitrogen/generated/ios/swift/TrimOptions.swift +0 -189
- package/nitrogen/generated/shared/c++/EditorConfig.hpp +0 -253
- package/nitrogen/generated/shared/c++/FileValidationResult.hpp +0 -77
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +0 -27
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +0 -80
- package/nitrogen/generated/shared/c++/TrimOptions.hpp +0 -125
- package/src/VideoTrim.nitro.ts +0 -263
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include <functional>
|
|
12
|
-
|
|
13
|
-
#include <functional>
|
|
14
|
-
#include <string>
|
|
15
|
-
#include <unordered_map>
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::videotrim {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Represents the Java/Kotlin callback `(eventName: String, payload: Map<String, String>) -> Unit`.
|
|
23
|
-
* This can be passed around between C++ and Java/Kotlin.
|
|
24
|
-
*/
|
|
25
|
-
struct JFunc_void_std__string_std__unordered_map_std__string__std__string_: public jni::JavaClass<JFunc_void_std__string_std__unordered_map_std__string__std__string_> {
|
|
26
|
-
public:
|
|
27
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_;";
|
|
28
|
-
|
|
29
|
-
public:
|
|
30
|
-
/**
|
|
31
|
-
* Invokes the function this `JFunc_void_std__string_std__unordered_map_std__string__std__string_` instance holds through JNI.
|
|
32
|
-
*/
|
|
33
|
-
void invoke(const std::string& eventName, const std::unordered_map<std::string, std::string>& payload) const {
|
|
34
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* eventName */, jni::alias_ref<jni::JMap<jni::JString, jni::JString>> /* payload */)>("invoke");
|
|
35
|
-
method(self(), jni::make_jstring(eventName), [&]() -> jni::local_ref<jni::JMap<jni::JString, jni::JString>> {
|
|
36
|
-
auto __map = jni::JHashMap<jni::JString, jni::JString>::create(payload.size());
|
|
37
|
-
for (const auto& __entry : payload) {
|
|
38
|
-
__map->put(jni::make_jstring(__entry.first), jni::make_jstring(__entry.second));
|
|
39
|
-
}
|
|
40
|
-
return __map;
|
|
41
|
-
}());
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* An implementation of Func_void_std__string_std__unordered_map_std__string__std__string_ that is backed by a C++ implementation (using `std::function<...>`)
|
|
47
|
-
*/
|
|
48
|
-
struct JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx final: public jni::HybridClass<JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx, JFunc_void_std__string_std__unordered_map_std__string__std__string_> {
|
|
49
|
-
public:
|
|
50
|
-
static jni::local_ref<JFunc_void_std__string_std__unordered_map_std__string__std__string_::javaobject> fromCpp(const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& func) {
|
|
51
|
-
return JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx::newObjectCxxArgs(func);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
/**
|
|
56
|
-
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx` instance holds.
|
|
57
|
-
*/
|
|
58
|
-
void invoke_cxx(jni::alias_ref<jni::JString> eventName, jni::alias_ref<jni::JMap<jni::JString, jni::JString>> payload) {
|
|
59
|
-
_func(eventName->toStdString(), [&]() {
|
|
60
|
-
std::unordered_map<std::string, std::string> __map;
|
|
61
|
-
__map.reserve(payload->size());
|
|
62
|
-
for (const auto& __entry : *payload) {
|
|
63
|
-
__map.emplace(__entry.first->toStdString(), __entry.second->toStdString());
|
|
64
|
-
}
|
|
65
|
-
return __map;
|
|
66
|
-
}());
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public:
|
|
70
|
-
[[nodiscard]]
|
|
71
|
-
inline const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& getFunction() const {
|
|
72
|
-
return _func;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public:
|
|
76
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string__cxx;";
|
|
77
|
-
static void registerNatives() {
|
|
78
|
-
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx::invoke_cxx)});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
private:
|
|
82
|
-
explicit JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx(const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& func): _func(func) { }
|
|
83
|
-
|
|
84
|
-
private:
|
|
85
|
-
friend HybridBase;
|
|
86
|
-
std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)> _func;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
} // namespace margelo::nitro::videotrim
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JHybridVideoTrimSpec.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "JHybridVideoTrimSpec.hpp"
|
|
9
|
-
|
|
10
|
-
// Forward declaration of `FileValidationResult` to properly resolve imports.
|
|
11
|
-
namespace margelo::nitro::videotrim { struct FileValidationResult; }
|
|
12
|
-
// Forward declaration of `EditorConfig` to properly resolve imports.
|
|
13
|
-
namespace margelo::nitro::videotrim { struct EditorConfig; }
|
|
14
|
-
// Forward declaration of `TrimOptions` to properly resolve imports.
|
|
15
|
-
namespace margelo::nitro::videotrim { struct TrimOptions; }
|
|
16
|
-
|
|
17
|
-
#include <NitroModules/Promise.hpp>
|
|
18
|
-
#include <vector>
|
|
19
|
-
#include <string>
|
|
20
|
-
#include <NitroModules/JPromise.hpp>
|
|
21
|
-
#include "FileValidationResult.hpp"
|
|
22
|
-
#include "JFileValidationResult.hpp"
|
|
23
|
-
#include "EditorConfig.hpp"
|
|
24
|
-
#include "JEditorConfig.hpp"
|
|
25
|
-
#include <functional>
|
|
26
|
-
#include <unordered_map>
|
|
27
|
-
#include "JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp"
|
|
28
|
-
#include "JFunc_void.hpp"
|
|
29
|
-
#include "TrimOptions.hpp"
|
|
30
|
-
#include "JTrimOptions.hpp"
|
|
31
|
-
|
|
32
|
-
namespace margelo::nitro::videotrim {
|
|
33
|
-
|
|
34
|
-
jni::local_ref<JHybridVideoTrimSpec::jhybriddata> JHybridVideoTrimSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
35
|
-
return makeCxxInstance(jThis);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
void JHybridVideoTrimSpec::registerNatives() {
|
|
39
|
-
registerHybrid({
|
|
40
|
-
makeNativeMethod("initHybrid", JHybridVideoTrimSpec::initHybrid),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
size_t JHybridVideoTrimSpec::getExternalMemorySize() noexcept {
|
|
45
|
-
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
46
|
-
return method(_javaPart);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Properties
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// Methods
|
|
53
|
-
void JHybridVideoTrimSpec::showEditor(const std::string& filePath, const EditorConfig& config, const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& onEvent) {
|
|
54
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* filePath */, jni::alias_ref<JEditorConfig> /* config */, jni::alias_ref<JFunc_void_std__string_std__unordered_map_std__string__std__string_::javaobject> /* onEvent */)>("showEditor_cxx");
|
|
55
|
-
method(_javaPart, jni::make_jstring(filePath), JEditorConfig::fromCpp(config), JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx::fromCpp(onEvent));
|
|
56
|
-
}
|
|
57
|
-
std::shared_ptr<Promise<std::vector<std::string>>> JHybridVideoTrimSpec::listFiles() {
|
|
58
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("listFiles");
|
|
59
|
-
auto __result = method(_javaPart);
|
|
60
|
-
return [&]() {
|
|
61
|
-
auto __promise = Promise<std::vector<std::string>>::create();
|
|
62
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
63
|
-
auto __result = jni::static_ref_cast<jni::JArrayClass<jni::JString>>(__boxedResult);
|
|
64
|
-
__promise->resolve([&]() {
|
|
65
|
-
size_t __size = __result->size();
|
|
66
|
-
std::vector<std::string> __vector;
|
|
67
|
-
__vector.reserve(__size);
|
|
68
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
69
|
-
auto __element = __result->getElement(__i);
|
|
70
|
-
__vector.push_back(__element->toStdString());
|
|
71
|
-
}
|
|
72
|
-
return __vector;
|
|
73
|
-
}());
|
|
74
|
-
});
|
|
75
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
76
|
-
jni::JniException __jniError(__throwable);
|
|
77
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
78
|
-
});
|
|
79
|
-
return __promise;
|
|
80
|
-
}();
|
|
81
|
-
}
|
|
82
|
-
std::shared_ptr<Promise<double>> JHybridVideoTrimSpec::cleanFiles() {
|
|
83
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("cleanFiles");
|
|
84
|
-
auto __result = method(_javaPart);
|
|
85
|
-
return [&]() {
|
|
86
|
-
auto __promise = Promise<double>::create();
|
|
87
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
88
|
-
auto __result = jni::static_ref_cast<jni::JDouble>(__boxedResult);
|
|
89
|
-
__promise->resolve(__result->value());
|
|
90
|
-
});
|
|
91
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
92
|
-
jni::JniException __jniError(__throwable);
|
|
93
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
94
|
-
});
|
|
95
|
-
return __promise;
|
|
96
|
-
}();
|
|
97
|
-
}
|
|
98
|
-
std::shared_ptr<Promise<bool>> JHybridVideoTrimSpec::deleteFile(const std::string& filePath) {
|
|
99
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* filePath */)>("deleteFile");
|
|
100
|
-
auto __result = method(_javaPart, jni::make_jstring(filePath));
|
|
101
|
-
return [&]() {
|
|
102
|
-
auto __promise = Promise<bool>::create();
|
|
103
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
104
|
-
auto __result = jni::static_ref_cast<jni::JBoolean>(__boxedResult);
|
|
105
|
-
__promise->resolve(static_cast<bool>(__result->value()));
|
|
106
|
-
});
|
|
107
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
108
|
-
jni::JniException __jniError(__throwable);
|
|
109
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
110
|
-
});
|
|
111
|
-
return __promise;
|
|
112
|
-
}();
|
|
113
|
-
}
|
|
114
|
-
void JHybridVideoTrimSpec::closeEditor(const std::function<void()>& onComplete) {
|
|
115
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onComplete */)>("closeEditor_cxx");
|
|
116
|
-
method(_javaPart, JFunc_void_cxx::fromCpp(onComplete));
|
|
117
|
-
}
|
|
118
|
-
std::shared_ptr<Promise<FileValidationResult>> JHybridVideoTrimSpec::isValidFile(const std::string& url) {
|
|
119
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* url */)>("isValidFile");
|
|
120
|
-
auto __result = method(_javaPart, jni::make_jstring(url));
|
|
121
|
-
return [&]() {
|
|
122
|
-
auto __promise = Promise<FileValidationResult>::create();
|
|
123
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
124
|
-
auto __result = jni::static_ref_cast<JFileValidationResult>(__boxedResult);
|
|
125
|
-
__promise->resolve(__result->toCpp());
|
|
126
|
-
});
|
|
127
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
128
|
-
jni::JniException __jniError(__throwable);
|
|
129
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
130
|
-
});
|
|
131
|
-
return __promise;
|
|
132
|
-
}();
|
|
133
|
-
}
|
|
134
|
-
std::shared_ptr<Promise<std::string>> JHybridVideoTrimSpec::trim(const std::string& url, const TrimOptions& options) {
|
|
135
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* url */, jni::alias_ref<JTrimOptions> /* options */)>("trim");
|
|
136
|
-
auto __result = method(_javaPart, jni::make_jstring(url), JTrimOptions::fromCpp(options));
|
|
137
|
-
return [&]() {
|
|
138
|
-
auto __promise = Promise<std::string>::create();
|
|
139
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
140
|
-
auto __result = jni::static_ref_cast<jni::JString>(__boxedResult);
|
|
141
|
-
__promise->resolve(__result->toStdString());
|
|
142
|
-
});
|
|
143
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
144
|
-
jni::JniException __jniError(__throwable);
|
|
145
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
146
|
-
});
|
|
147
|
-
return __promise;
|
|
148
|
-
}();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
} // namespace margelo::nitro::videotrim
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridVideoTrimSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
-
#include <fbjni/fbjni.h>
|
|
12
|
-
#include "HybridVideoTrimSpec.hpp"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::videotrim {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
class JHybridVideoTrimSpec: public jni::HybridClass<JHybridVideoTrimSpec, JHybridObject>,
|
|
22
|
-
public virtual HybridVideoTrimSpec {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videotrim/HybridVideoTrimSpec;";
|
|
25
|
-
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
-
static void registerNatives();
|
|
27
|
-
|
|
28
|
-
protected:
|
|
29
|
-
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
-
explicit JHybridVideoTrimSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
-
HybridObject(HybridVideoTrimSpec::TAG),
|
|
32
|
-
_javaPart(jni::make_global(jThis)) {}
|
|
33
|
-
|
|
34
|
-
public:
|
|
35
|
-
~JHybridVideoTrimSpec() override {
|
|
36
|
-
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
37
|
-
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public:
|
|
41
|
-
size_t getExternalMemorySize() noexcept override;
|
|
42
|
-
|
|
43
|
-
public:
|
|
44
|
-
inline const jni::global_ref<JHybridVideoTrimSpec::javaobject>& getJavaPart() const noexcept {
|
|
45
|
-
return _javaPart;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public:
|
|
49
|
-
// Properties
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
public:
|
|
53
|
-
// Methods
|
|
54
|
-
void showEditor(const std::string& filePath, const EditorConfig& config, const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& onEvent) override;
|
|
55
|
-
std::shared_ptr<Promise<std::vector<std::string>>> listFiles() override;
|
|
56
|
-
std::shared_ptr<Promise<double>> cleanFiles() override;
|
|
57
|
-
std::shared_ptr<Promise<bool>> deleteFile(const std::string& filePath) override;
|
|
58
|
-
void closeEditor(const std::function<void()>& onComplete) override;
|
|
59
|
-
std::shared_ptr<Promise<FileValidationResult>> isValidFile(const std::string& url) override;
|
|
60
|
-
std::shared_ptr<Promise<std::string>> trim(const std::string& url, const TrimOptions& options) override;
|
|
61
|
-
|
|
62
|
-
private:
|
|
63
|
-
friend HybridBase;
|
|
64
|
-
using HybridBase::HybridBase;
|
|
65
|
-
jni::global_ref<JHybridVideoTrimSpec::javaobject> _javaPart;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
} // namespace margelo::nitro::videotrim
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JTrimOptions.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "TrimOptions.hpp"
|
|
12
|
-
|
|
13
|
-
#include <string>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::videotrim {
|
|
16
|
-
|
|
17
|
-
using namespace facebook;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "TrimOptions" and the the Kotlin data class "TrimOptions".
|
|
21
|
-
*/
|
|
22
|
-
struct JTrimOptions final: public jni::JavaClass<JTrimOptions> {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videotrim/TrimOptions;";
|
|
25
|
-
|
|
26
|
-
public:
|
|
27
|
-
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct TrimOptions by copying all values to C++.
|
|
29
|
-
*/
|
|
30
|
-
[[maybe_unused]]
|
|
31
|
-
[[nodiscard]]
|
|
32
|
-
TrimOptions toCpp() const {
|
|
33
|
-
static const auto clazz = javaClassStatic();
|
|
34
|
-
static const auto fieldStartTime = clazz->getField<double>("startTime");
|
|
35
|
-
double startTime = this->getFieldValue(fieldStartTime);
|
|
36
|
-
static const auto fieldEndTime = clazz->getField<double>("endTime");
|
|
37
|
-
double endTime = this->getFieldValue(fieldEndTime);
|
|
38
|
-
static const auto fieldSaveToPhoto = clazz->getField<jboolean>("saveToPhoto");
|
|
39
|
-
jboolean saveToPhoto = this->getFieldValue(fieldSaveToPhoto);
|
|
40
|
-
static const auto fieldType = clazz->getField<jni::JString>("type");
|
|
41
|
-
jni::local_ref<jni::JString> type = this->getFieldValue(fieldType);
|
|
42
|
-
static const auto fieldOutputExt = clazz->getField<jni::JString>("outputExt");
|
|
43
|
-
jni::local_ref<jni::JString> outputExt = this->getFieldValue(fieldOutputExt);
|
|
44
|
-
static const auto fieldOpenDocumentsOnFinish = clazz->getField<jboolean>("openDocumentsOnFinish");
|
|
45
|
-
jboolean openDocumentsOnFinish = this->getFieldValue(fieldOpenDocumentsOnFinish);
|
|
46
|
-
static const auto fieldOpenShareSheetOnFinish = clazz->getField<jboolean>("openShareSheetOnFinish");
|
|
47
|
-
jboolean openShareSheetOnFinish = this->getFieldValue(fieldOpenShareSheetOnFinish);
|
|
48
|
-
static const auto fieldRemoveAfterSavedToPhoto = clazz->getField<jboolean>("removeAfterSavedToPhoto");
|
|
49
|
-
jboolean removeAfterSavedToPhoto = this->getFieldValue(fieldRemoveAfterSavedToPhoto);
|
|
50
|
-
static const auto fieldRemoveAfterFailedToSavePhoto = clazz->getField<jboolean>("removeAfterFailedToSavePhoto");
|
|
51
|
-
jboolean removeAfterFailedToSavePhoto = this->getFieldValue(fieldRemoveAfterFailedToSavePhoto);
|
|
52
|
-
static const auto fieldRemoveAfterSavedToDocuments = clazz->getField<jboolean>("removeAfterSavedToDocuments");
|
|
53
|
-
jboolean removeAfterSavedToDocuments = this->getFieldValue(fieldRemoveAfterSavedToDocuments);
|
|
54
|
-
static const auto fieldRemoveAfterFailedToSaveDocuments = clazz->getField<jboolean>("removeAfterFailedToSaveDocuments");
|
|
55
|
-
jboolean removeAfterFailedToSaveDocuments = this->getFieldValue(fieldRemoveAfterFailedToSaveDocuments);
|
|
56
|
-
static const auto fieldRemoveAfterShared = clazz->getField<jboolean>("removeAfterShared");
|
|
57
|
-
jboolean removeAfterShared = this->getFieldValue(fieldRemoveAfterShared);
|
|
58
|
-
static const auto fieldRemoveAfterFailedToShare = clazz->getField<jboolean>("removeAfterFailedToShare");
|
|
59
|
-
jboolean removeAfterFailedToShare = this->getFieldValue(fieldRemoveAfterFailedToShare);
|
|
60
|
-
static const auto fieldEnableRotation = clazz->getField<jboolean>("enableRotation");
|
|
61
|
-
jboolean enableRotation = this->getFieldValue(fieldEnableRotation);
|
|
62
|
-
static const auto fieldRotationAngle = clazz->getField<double>("rotationAngle");
|
|
63
|
-
double rotationAngle = this->getFieldValue(fieldRotationAngle);
|
|
64
|
-
return TrimOptions(
|
|
65
|
-
startTime,
|
|
66
|
-
endTime,
|
|
67
|
-
static_cast<bool>(saveToPhoto),
|
|
68
|
-
type->toStdString(),
|
|
69
|
-
outputExt->toStdString(),
|
|
70
|
-
static_cast<bool>(openDocumentsOnFinish),
|
|
71
|
-
static_cast<bool>(openShareSheetOnFinish),
|
|
72
|
-
static_cast<bool>(removeAfterSavedToPhoto),
|
|
73
|
-
static_cast<bool>(removeAfterFailedToSavePhoto),
|
|
74
|
-
static_cast<bool>(removeAfterSavedToDocuments),
|
|
75
|
-
static_cast<bool>(removeAfterFailedToSaveDocuments),
|
|
76
|
-
static_cast<bool>(removeAfterShared),
|
|
77
|
-
static_cast<bool>(removeAfterFailedToShare),
|
|
78
|
-
static_cast<bool>(enableRotation),
|
|
79
|
-
rotationAngle
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public:
|
|
84
|
-
/**
|
|
85
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
86
|
-
*/
|
|
87
|
-
[[maybe_unused]]
|
|
88
|
-
static jni::local_ref<JTrimOptions::javaobject> fromCpp(const TrimOptions& value) {
|
|
89
|
-
return newInstance(
|
|
90
|
-
value.startTime,
|
|
91
|
-
value.endTime,
|
|
92
|
-
value.saveToPhoto,
|
|
93
|
-
jni::make_jstring(value.type),
|
|
94
|
-
jni::make_jstring(value.outputExt),
|
|
95
|
-
value.openDocumentsOnFinish,
|
|
96
|
-
value.openShareSheetOnFinish,
|
|
97
|
-
value.removeAfterSavedToPhoto,
|
|
98
|
-
value.removeAfterFailedToSavePhoto,
|
|
99
|
-
value.removeAfterSavedToDocuments,
|
|
100
|
-
value.removeAfterFailedToSaveDocuments,
|
|
101
|
-
value.removeAfterShared,
|
|
102
|
-
value.removeAfterFailedToShare,
|
|
103
|
-
value.enableRotation,
|
|
104
|
-
value.rotationAngle
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
} // namespace margelo::nitro::videotrim
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// EditorConfig.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.videotrim
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
import com.margelo.nitro.core.*
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "EditorConfig".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class EditorConfig
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
constructor(
|
|
23
|
-
val enableHapticFeedback: Boolean,
|
|
24
|
-
val maxDuration: Double,
|
|
25
|
-
val minDuration: Double,
|
|
26
|
-
val cancelButtonText: String,
|
|
27
|
-
val saveButtonText: String,
|
|
28
|
-
val enableCancelDialog: Boolean,
|
|
29
|
-
val cancelDialogTitle: String,
|
|
30
|
-
val cancelDialogMessage: String,
|
|
31
|
-
val cancelDialogCancelText: String,
|
|
32
|
-
val cancelDialogConfirmText: String,
|
|
33
|
-
val enableSaveDialog: Boolean,
|
|
34
|
-
val saveDialogTitle: String,
|
|
35
|
-
val saveDialogMessage: String,
|
|
36
|
-
val saveDialogCancelText: String,
|
|
37
|
-
val saveDialogConfirmText: String,
|
|
38
|
-
val trimmingText: String,
|
|
39
|
-
val fullScreenModalIOS: Boolean,
|
|
40
|
-
val autoplay: Boolean,
|
|
41
|
-
val jumpToPositionOnLoad: Double,
|
|
42
|
-
val closeWhenFinish: Boolean,
|
|
43
|
-
val enableCancelTrimming: Boolean,
|
|
44
|
-
val cancelTrimmingButtonText: String,
|
|
45
|
-
val enableCancelTrimmingDialog: Boolean,
|
|
46
|
-
val cancelTrimmingDialogTitle: String,
|
|
47
|
-
val cancelTrimmingDialogMessage: String,
|
|
48
|
-
val cancelTrimmingDialogCancelText: String,
|
|
49
|
-
val cancelTrimmingDialogConfirmText: String,
|
|
50
|
-
val headerText: String,
|
|
51
|
-
val headerTextSize: Double,
|
|
52
|
-
val headerTextColor: Double,
|
|
53
|
-
val alertOnFailToLoad: Boolean,
|
|
54
|
-
val alertOnFailTitle: String,
|
|
55
|
-
val alertOnFailMessage: String,
|
|
56
|
-
val alertOnFailCloseText: String,
|
|
57
|
-
val saveToPhoto: Boolean,
|
|
58
|
-
val type: String,
|
|
59
|
-
val outputExt: String,
|
|
60
|
-
val openDocumentsOnFinish: Boolean,
|
|
61
|
-
val openShareSheetOnFinish: Boolean,
|
|
62
|
-
val removeAfterSavedToPhoto: Boolean,
|
|
63
|
-
val removeAfterFailedToSavePhoto: Boolean,
|
|
64
|
-
val removeAfterSavedToDocuments: Boolean,
|
|
65
|
-
val removeAfterFailedToSaveDocuments: Boolean,
|
|
66
|
-
val removeAfterShared: Boolean,
|
|
67
|
-
val removeAfterFailedToShare: Boolean,
|
|
68
|
-
val enableRotation: Boolean,
|
|
69
|
-
val rotationAngle: Double
|
|
70
|
-
) {
|
|
71
|
-
/* main constructor */
|
|
72
|
-
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// FileValidationResult.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.videotrim
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
import com.margelo.nitro.core.*
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "FileValidationResult".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class FileValidationResult
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
constructor(
|
|
23
|
-
val isValid: Boolean,
|
|
24
|
-
val fileType: String,
|
|
25
|
-
val duration: Double
|
|
26
|
-
) {
|
|
27
|
-
/* main constructor */
|
|
28
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.videotrim
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.*
|
|
14
|
-
import dalvik.annotation.optimization.FastNative
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Represents the JavaScript callback `() => void`.
|
|
18
|
-
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
-
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
-
*/
|
|
21
|
-
@DoNotStrip
|
|
22
|
-
@Keep
|
|
23
|
-
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
-
fun interface Func_void: () -> Unit {
|
|
25
|
-
/**
|
|
26
|
-
* Call the given JS callback.
|
|
27
|
-
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
-
*/
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
override fun invoke(): Unit
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Represents the JavaScript callback `() => void`.
|
|
36
|
-
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
-
* The callback might be coming from JS.
|
|
38
|
-
*/
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
@Keep
|
|
41
|
-
@Suppress(
|
|
42
|
-
"KotlinJniMissingFunction", "unused",
|
|
43
|
-
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
-
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
-
)
|
|
46
|
-
class Func_void_cxx: Func_void {
|
|
47
|
-
@DoNotStrip
|
|
48
|
-
@Keep
|
|
49
|
-
private val mHybridData: HybridData
|
|
50
|
-
|
|
51
|
-
@DoNotStrip
|
|
52
|
-
@Keep
|
|
53
|
-
private constructor(hybridData: HybridData) {
|
|
54
|
-
mHybridData = hybridData
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@DoNotStrip
|
|
58
|
-
@Keep
|
|
59
|
-
override fun invoke(): Unit
|
|
60
|
-
= invoke_cxx()
|
|
61
|
-
|
|
62
|
-
@FastNative
|
|
63
|
-
private external fun invoke_cxx(): Unit
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Represents the JavaScript callback `() => void`.
|
|
68
|
-
* This is implemented in Java/Kotlin, via a `() -> Unit`.
|
|
69
|
-
* The callback is always coming from native.
|
|
70
|
-
*/
|
|
71
|
-
@DoNotStrip
|
|
72
|
-
@Keep
|
|
73
|
-
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
-
class Func_void_java(private val function: () -> Unit): Func_void {
|
|
75
|
-
@DoNotStrip
|
|
76
|
-
@Keep
|
|
77
|
-
override fun invoke(): Unit {
|
|
78
|
-
return this.function()
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__string_std__unordered_map_std__string__std__string_.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.videotrim
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.*
|
|
14
|
-
import dalvik.annotation.optimization.FastNative
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Represents the JavaScript callback `(eventName: string, payload: record) => void`.
|
|
18
|
-
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
-
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
-
*/
|
|
21
|
-
@DoNotStrip
|
|
22
|
-
@Keep
|
|
23
|
-
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
-
fun interface Func_void_std__string_std__unordered_map_std__string__std__string_: (String, Map<String, String>) -> Unit {
|
|
25
|
-
/**
|
|
26
|
-
* Call the given JS callback.
|
|
27
|
-
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
-
*/
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
override fun invoke(eventName: String, payload: Map<String, String>): Unit
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Represents the JavaScript callback `(eventName: string, payload: record) => void`.
|
|
36
|
-
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
-
* The callback might be coming from JS.
|
|
38
|
-
*/
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
@Keep
|
|
41
|
-
@Suppress(
|
|
42
|
-
"KotlinJniMissingFunction", "unused",
|
|
43
|
-
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
-
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
-
)
|
|
46
|
-
class Func_void_std__string_std__unordered_map_std__string__std__string__cxx: Func_void_std__string_std__unordered_map_std__string__std__string_ {
|
|
47
|
-
@DoNotStrip
|
|
48
|
-
@Keep
|
|
49
|
-
private val mHybridData: HybridData
|
|
50
|
-
|
|
51
|
-
@DoNotStrip
|
|
52
|
-
@Keep
|
|
53
|
-
private constructor(hybridData: HybridData) {
|
|
54
|
-
mHybridData = hybridData
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@DoNotStrip
|
|
58
|
-
@Keep
|
|
59
|
-
override fun invoke(eventName: String, payload: Map<String, String>): Unit
|
|
60
|
-
= invoke_cxx(eventName,payload)
|
|
61
|
-
|
|
62
|
-
@FastNative
|
|
63
|
-
private external fun invoke_cxx(eventName: String, payload: Map<String, String>): Unit
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Represents the JavaScript callback `(eventName: string, payload: record) => void`.
|
|
68
|
-
* This is implemented in Java/Kotlin, via a `(String, Map<String, String>) -> Unit`.
|
|
69
|
-
* The callback is always coming from native.
|
|
70
|
-
*/
|
|
71
|
-
@DoNotStrip
|
|
72
|
-
@Keep
|
|
73
|
-
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
-
class Func_void_std__string_std__unordered_map_std__string__std__string__java(private val function: (String, Map<String, String>) -> Unit): Func_void_std__string_std__unordered_map_std__string__std__string_ {
|
|
75
|
-
@DoNotStrip
|
|
76
|
-
@Keep
|
|
77
|
-
override fun invoke(eventName: String, payload: Map<String, String>): Unit {
|
|
78
|
-
return this.function(eventName, payload)
|
|
79
|
-
}
|
|
80
|
-
}
|