react-native-pdf-sdk 0.0.0-stage → 0.1.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.
Files changed (178) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/PdfSdk.podspec +32 -0
  4. package/README.md +270 -2
  5. package/android/CMakeLists.txt +24 -0
  6. package/android/build.gradle +132 -0
  7. package/android/gradle.properties +4 -0
  8. package/android/src/main/AndroidManifest.xml +1 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +9 -0
  10. package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfDocument.kt +72 -0
  11. package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfSdk.kt +17 -0
  12. package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfView.kt +194 -0
  13. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfDocumentLayout.kt +109 -0
  14. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfFailure.kt +36 -0
  15. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfPageSource.kt +141 -0
  16. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSdkPackage.kt +35 -0
  17. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSourceLoader.kt +117 -0
  18. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSurface.kt +839 -0
  19. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfTileStore.kt +210 -0
  20. package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfViewport.kt +255 -0
  21. package/android/src/main/java/com/margelo/nitro/pdfsdk/TileGrid.kt +276 -0
  22. package/ios/HybridPdfDocument.swift +71 -0
  23. package/ios/HybridPdfSdk.swift +10 -0
  24. package/ios/HybridPdfView.swift +202 -0
  25. package/ios/PdfDocumentLayout.swift +174 -0
  26. package/ios/PdfFailure.swift +46 -0
  27. package/ios/PdfImageCache.swift +83 -0
  28. package/ios/PdfPageSource.swift +221 -0
  29. package/ios/PdfScrollPlan.swift +108 -0
  30. package/ios/PdfSourceLoader.swift +120 -0
  31. package/ios/PdfSurface.swift +711 -0
  32. package/ios/PdfTileCanvas.swift +148 -0
  33. package/ios/PdfTileGrid.swift +518 -0
  34. package/ios/PdfTileStore.swift +346 -0
  35. package/ios/PdfViewport.swift +200 -0
  36. package/lib/commonjs/PdfView.js +149 -0
  37. package/lib/commonjs/PdfView.js.map +1 -0
  38. package/lib/commonjs/document.js +38 -0
  39. package/lib/commonjs/document.js.map +1 -0
  40. package/lib/commonjs/index.js +26 -0
  41. package/lib/commonjs/index.js.map +1 -0
  42. package/lib/commonjs/package.json +1 -0
  43. package/lib/commonjs/specs/PdfSdk.nitro.js +6 -0
  44. package/lib/commonjs/specs/PdfSdk.nitro.js.map +1 -0
  45. package/lib/commonjs/specs/PdfView.nitro.js +6 -0
  46. package/lib/commonjs/specs/PdfView.nitro.js.map +1 -0
  47. package/lib/module/PdfView.js +143 -0
  48. package/lib/module/PdfView.js.map +1 -0
  49. package/lib/module/document.js +34 -0
  50. package/lib/module/document.js.map +1 -0
  51. package/lib/module/index.js +5 -0
  52. package/lib/module/index.js.map +1 -0
  53. package/lib/module/specs/PdfSdk.nitro.js +4 -0
  54. package/lib/module/specs/PdfSdk.nitro.js.map +1 -0
  55. package/lib/module/specs/PdfView.nitro.js +4 -0
  56. package/lib/module/specs/PdfView.nitro.js.map +1 -0
  57. package/lib/typescript/src/PdfView.d.ts +65 -0
  58. package/lib/typescript/src/PdfView.d.ts.map +1 -0
  59. package/lib/typescript/src/document.d.ts +22 -0
  60. package/lib/typescript/src/document.d.ts.map +1 -0
  61. package/lib/typescript/src/index.d.ts +6 -0
  62. package/lib/typescript/src/index.d.ts.map +1 -0
  63. package/lib/typescript/src/specs/PdfSdk.nitro.d.ts +60 -0
  64. package/lib/typescript/src/specs/PdfSdk.nitro.d.ts.map +1 -0
  65. package/lib/typescript/src/specs/PdfView.nitro.d.ts +131 -0
  66. package/lib/typescript/src/specs/PdfView.nitro.d.ts.map +1 -0
  67. package/nitro.json +40 -0
  68. package/nitrogen/generated/.gitattributes +1 -0
  69. package/nitrogen/generated/android/PdfSdk+autolinking.cmake +87 -0
  70. package/nitrogen/generated/android/PdfSdk+autolinking.gradle +27 -0
  71. package/nitrogen/generated/android/PdfSdkOnLoad.cpp +84 -0
  72. package/nitrogen/generated/android/PdfSdkOnLoad.hpp +34 -0
  73. package/nitrogen/generated/android/c++/JFunc_void_PdfErrorEvent.hpp +80 -0
  74. package/nitrogen/generated/android/c++/JFunc_void_PdfLoadEvent.hpp +77 -0
  75. package/nitrogen/generated/android/c++/JFunc_void_PdfPageEvent.hpp +77 -0
  76. package/nitrogen/generated/android/c++/JFunc_void_PdfTapEvent.hpp +77 -0
  77. package/nitrogen/generated/android/c++/JFunc_void_PdfZoomEvent.hpp +77 -0
  78. package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.cpp +266 -0
  79. package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.hpp +92 -0
  80. package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.cpp +87 -0
  81. package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.hpp +65 -0
  82. package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.cpp +58 -0
  83. package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.hpp +63 -0
  84. package/nitrogen/generated/android/c++/JPdfErrorCode.hpp +67 -0
  85. package/nitrogen/generated/android/c++/JPdfErrorEvent.hpp +63 -0
  86. package/nitrogen/generated/android/c++/JPdfFit.hpp +64 -0
  87. package/nitrogen/generated/android/c++/JPdfLoadEvent.hpp +65 -0
  88. package/nitrogen/generated/android/c++/JPdfPageEvent.hpp +61 -0
  89. package/nitrogen/generated/android/c++/JPdfPageSize.hpp +61 -0
  90. package/nitrogen/generated/android/c++/JPdfRenderRequest.hpp +86 -0
  91. package/nitrogen/generated/android/c++/JPdfTapEvent.hpp +65 -0
  92. package/nitrogen/generated/android/c++/JPdfViewSource.hpp +84 -0
  93. package/nitrogen/generated/android/c++/JPdfZoomEvent.hpp +61 -0
  94. package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.cpp +108 -0
  95. package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.hpp +49 -0
  96. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent.kt +80 -0
  97. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent.kt +80 -0
  98. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfPageEvent.kt +80 -0
  99. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfTapEvent.kt +80 -0
  100. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent.kt +80 -0
  101. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridNativePdfViewSpec.kt +185 -0
  102. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfDocumentSpec.kt +65 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfSdkSpec.kt +54 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorCode.kt +26 -0
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorEvent.kt +56 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfFit.kt +25 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfLoadEvent.kt +61 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageEvent.kt +56 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageSize.kt +56 -0
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfRenderRequest.kt +86 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfSdkOnLoad.kt +35 -0
  112. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfTapEvent.kt +61 -0
  113. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfViewSource.kt +66 -0
  114. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfZoomEvent.kt +56 -0
  115. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewManager.kt +80 -0
  116. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewStateUpdater.kt +23 -0
  117. package/nitrogen/generated/ios/PdfSdk+autolinking.rb +62 -0
  118. package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.cpp +123 -0
  119. package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.hpp +474 -0
  120. package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Umbrella.hpp +88 -0
  121. package/nitrogen/generated/ios/PdfSdkAutolinking.mm +41 -0
  122. package/nitrogen/generated/ios/PdfSdkAutolinking.swift +38 -0
  123. package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.cpp +11 -0
  124. package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.hpp +209 -0
  125. package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.cpp +11 -0
  126. package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.hpp +105 -0
  127. package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.cpp +11 -0
  128. package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.hpp +86 -0
  129. package/nitrogen/generated/ios/c++/views/HybridNativePdfViewComponent.mm +187 -0
  130. package/nitrogen/generated/ios/swift/Func_void_PdfErrorEvent.swift +46 -0
  131. package/nitrogen/generated/ios/swift/Func_void_PdfLoadEvent.swift +46 -0
  132. package/nitrogen/generated/ios/swift/Func_void_PdfPageEvent.swift +46 -0
  133. package/nitrogen/generated/ios/swift/Func_void_PdfTapEvent.swift +46 -0
  134. package/nitrogen/generated/ios/swift/Func_void_PdfZoomEvent.swift +46 -0
  135. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  136. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  137. package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec.swift +70 -0
  138. package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec_cxx.swift +438 -0
  139. package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec.swift +57 -0
  140. package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec_cxx.swift +173 -0
  141. package/nitrogen/generated/ios/swift/HybridPdfSdkSpec.swift +55 -0
  142. package/nitrogen/generated/ios/swift/HybridPdfSdkSpec_cxx.swift +148 -0
  143. package/nitrogen/generated/ios/swift/PdfErrorCode.swift +52 -0
  144. package/nitrogen/generated/ios/swift/PdfErrorEvent.swift +34 -0
  145. package/nitrogen/generated/ios/swift/PdfFit.swift +48 -0
  146. package/nitrogen/generated/ios/swift/PdfLoadEvent.swift +39 -0
  147. package/nitrogen/generated/ios/swift/PdfPageEvent.swift +34 -0
  148. package/nitrogen/generated/ios/swift/PdfPageSize.swift +34 -0
  149. package/nitrogen/generated/ios/swift/PdfRenderRequest.swift +129 -0
  150. package/nitrogen/generated/ios/swift/PdfTapEvent.swift +39 -0
  151. package/nitrogen/generated/ios/swift/PdfViewSource.swift +97 -0
  152. package/nitrogen/generated/ios/swift/PdfZoomEvent.swift +34 -0
  153. package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.cpp +51 -0
  154. package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.hpp +112 -0
  155. package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.cpp +24 -0
  156. package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.hpp +70 -0
  157. package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.cpp +21 -0
  158. package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.hpp +66 -0
  159. package/nitrogen/generated/shared/c++/PdfErrorCode.hpp +88 -0
  160. package/nitrogen/generated/shared/c++/PdfErrorEvent.hpp +89 -0
  161. package/nitrogen/generated/shared/c++/PdfFit.hpp +84 -0
  162. package/nitrogen/generated/shared/c++/PdfLoadEvent.hpp +91 -0
  163. package/nitrogen/generated/shared/c++/PdfPageEvent.hpp +87 -0
  164. package/nitrogen/generated/shared/c++/PdfPageSize.hpp +87 -0
  165. package/nitrogen/generated/shared/c++/PdfRenderRequest.hpp +112 -0
  166. package/nitrogen/generated/shared/c++/PdfTapEvent.hpp +91 -0
  167. package/nitrogen/generated/shared/c++/PdfViewSource.hpp +97 -0
  168. package/nitrogen/generated/shared/c++/PdfZoomEvent.hpp +87 -0
  169. package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.cpp +226 -0
  170. package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.hpp +130 -0
  171. package/nitrogen/generated/shared/json/NativePdfViewConfig.json +23 -0
  172. package/package.json +80 -4
  173. package/react-native.config.js +10 -0
  174. package/src/PdfView.tsx +221 -0
  175. package/src/document.ts +34 -0
  176. package/src/index.ts +16 -0
  177. package/src/specs/PdfSdk.nitro.ts +60 -0
  178. package/src/specs/PdfView.nitro.ts +149 -0
@@ -0,0 +1,108 @@
1
+ ///
2
+ /// JHybridNativePdfViewStateUpdater.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "JHybridNativePdfViewStateUpdater.hpp"
9
+ #include "views/HybridNativePdfViewComponent.hpp"
10
+ #include <NitroModules/NitroDefines.hpp>
11
+ #include <react/fabric/StateWrapperImpl.h>
12
+
13
+ namespace margelo::nitro::pdfsdk::views {
14
+
15
+ using namespace facebook;
16
+ using ConcreteStateData = react::ConcreteState<HybridNativePdfViewState>;
17
+
18
+ void JHybridNativePdfViewStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
19
+ jni::alias_ref<JHybridNativePdfViewSpec::JavaPart> javaView,
20
+ jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
21
+ std::shared_ptr<JHybridNativePdfViewSpec> hybridView = javaView->getJHybridNativePdfViewSpec();
22
+
23
+ // Get concrete StateWrapperImpl from passed StateWrapper interface object
24
+ jobject rawStateWrapper = stateWrapperInterface.get();
25
+ if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) [[unlikely]] {
26
+ throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
27
+ }
28
+ auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
29
+ static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
30
+ std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
31
+ auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
32
+ const HybridNativePdfViewState& data = concreteState->getData();
33
+ const std::shared_ptr<HybridNativePdfViewProps>& props = data.getProps();
34
+ if (props == nullptr) [[unlikely]] {
35
+ // Props aren't set yet!
36
+ throw std::runtime_error("HybridNativePdfViewState's data doesn't contain any props!");
37
+ }
38
+
39
+ // Update all props if they are dirty
40
+ if (props->source.isDirty) {
41
+ hybridView->setSource(props->source.value);
42
+ props->source.isDirty = false;
43
+ }
44
+ if (props->page.isDirty) {
45
+ hybridView->setPage(props->page.value);
46
+ props->page.isDirty = false;
47
+ }
48
+ if (props->fit.isDirty) {
49
+ hybridView->setFit(props->fit.value);
50
+ props->fit.isDirty = false;
51
+ }
52
+ if (props->minZoom.isDirty) {
53
+ hybridView->setMinZoom(props->minZoom.value);
54
+ props->minZoom.isDirty = false;
55
+ }
56
+ if (props->maxZoom.isDirty) {
57
+ hybridView->setMaxZoom(props->maxZoom.value);
58
+ props->maxZoom.isDirty = false;
59
+ }
60
+ if (props->doubleTapZoom.isDirty) {
61
+ hybridView->setDoubleTapZoom(props->doubleTapZoom.value);
62
+ props->doubleTapZoom.isDirty = false;
63
+ }
64
+ if (props->pageGap.isDirty) {
65
+ hybridView->setPageGap(props->pageGap.value);
66
+ props->pageGap.isDirty = false;
67
+ }
68
+ if (props->backdropColor.isDirty) {
69
+ hybridView->setBackdropColor(props->backdropColor.value);
70
+ props->backdropColor.isDirty = false;
71
+ }
72
+ if (props->scrollIndicators.isDirty) {
73
+ hybridView->setScrollIndicators(props->scrollIndicators.value);
74
+ props->scrollIndicators.isDirty = false;
75
+ }
76
+ if (props->onLoad.isDirty) {
77
+ hybridView->setOnLoad(props->onLoad.value);
78
+ props->onLoad.isDirty = false;
79
+ }
80
+ if (props->onPageChange.isDirty) {
81
+ hybridView->setOnPageChange(props->onPageChange.value);
82
+ props->onPageChange.isDirty = false;
83
+ }
84
+ if (props->onZoom.isDirty) {
85
+ hybridView->setOnZoom(props->onZoom.value);
86
+ props->onZoom.isDirty = false;
87
+ }
88
+ if (props->onError.isDirty) {
89
+ hybridView->setOnError(props->onError.value);
90
+ props->onError.isDirty = false;
91
+ }
92
+ if (props->onTap.isDirty) {
93
+ hybridView->setOnTap(props->onTap.value);
94
+ props->onTap.isDirty = false;
95
+ }
96
+
97
+ // Update hybridRef if it changed
98
+ if (props->hybridRef.isDirty) {
99
+ // hybridRef changed - call it with new this
100
+ const auto& maybeFunc = props->hybridRef.value;
101
+ if (maybeFunc.has_value()) {
102
+ maybeFunc.value()(hybridView);
103
+ }
104
+ props->hybridRef.isDirty = false;
105
+ }
106
+ }
107
+
108
+ } // namespace margelo::nitro::pdfsdk::views
@@ -0,0 +1,49 @@
1
+ ///
2
+ /// JHybridNativePdfViewStateUpdater.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #ifndef RN_SERIALIZABLE_STATE
11
+ #error PdfSdk was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
12
+ #endif
13
+
14
+ #include <fbjni/fbjni.h>
15
+ #include <react/fabric/CoreComponentsRegistry.h>
16
+ #include <react/fabric/StateWrapperImpl.h>
17
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
18
+ #include <NitroModules/NitroDefines.hpp>
19
+ #include <NitroModules/JStateWrapper.hpp>
20
+ #include "JHybridNativePdfViewSpec.hpp"
21
+ #include "views/HybridNativePdfViewComponent.hpp"
22
+
23
+ namespace margelo::nitro::pdfsdk::views {
24
+
25
+ using namespace facebook;
26
+
27
+ class JHybridNativePdfViewStateUpdater final: public jni::JavaClass<JHybridNativePdfViewStateUpdater> {
28
+ public:
29
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfsdk/views/HybridNativePdfViewStateUpdater;";
30
+
31
+ public:
32
+ static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
33
+ jni::alias_ref<JHybridNativePdfViewSpec::JavaPart> view,
34
+ jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
35
+
36
+ public:
37
+ static void registerNatives() {
38
+ // Register JNI calls
39
+ javaClassStatic()->registerNatives({
40
+ makeNativeMethod("updateViewProps", JHybridNativePdfViewStateUpdater::updateViewProps),
41
+ });
42
+ // Register React Native view component descriptor
43
+ auto provider = react::concreteComponentDescriptorProvider<HybridNativePdfViewComponentDescriptor>();
44
+ auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
45
+ providerRegistry->add(provider);
46
+ }
47
+ };
48
+
49
+ } // namespace margelo::nitro::pdfsdk::views
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_PdfErrorEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfsdk
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(event: struct) => 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_PdfErrorEvent: (PdfErrorEvent) -> 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(event: PdfErrorEvent): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(event: struct) => 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_PdfErrorEvent_cxx: Func_void_PdfErrorEvent {
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(event: PdfErrorEvent): Unit
60
+ = invoke_cxx(event)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(event: PdfErrorEvent): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(event: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(PdfErrorEvent) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_PdfErrorEvent_java(private val function: (PdfErrorEvent) -> Unit): Func_void_PdfErrorEvent {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(event: PdfErrorEvent): Unit {
78
+ return this.function(event)
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_PdfLoadEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfsdk
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(event: struct) => 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_PdfLoadEvent: (PdfLoadEvent) -> 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(event: PdfLoadEvent): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(event: struct) => 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_PdfLoadEvent_cxx: Func_void_PdfLoadEvent {
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(event: PdfLoadEvent): Unit
60
+ = invoke_cxx(event)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(event: PdfLoadEvent): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(event: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(PdfLoadEvent) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_PdfLoadEvent_java(private val function: (PdfLoadEvent) -> Unit): Func_void_PdfLoadEvent {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(event: PdfLoadEvent): Unit {
78
+ return this.function(event)
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_PdfPageEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfsdk
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(event: struct) => 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_PdfPageEvent: (PdfPageEvent) -> 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(event: PdfPageEvent): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(event: struct) => 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_PdfPageEvent_cxx: Func_void_PdfPageEvent {
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(event: PdfPageEvent): Unit
60
+ = invoke_cxx(event)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(event: PdfPageEvent): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(event: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(PdfPageEvent) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_PdfPageEvent_java(private val function: (PdfPageEvent) -> Unit): Func_void_PdfPageEvent {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(event: PdfPageEvent): Unit {
78
+ return this.function(event)
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_PdfTapEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfsdk
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(event: struct) => 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_PdfTapEvent: (PdfTapEvent) -> 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(event: PdfTapEvent): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(event: struct) => 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_PdfTapEvent_cxx: Func_void_PdfTapEvent {
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(event: PdfTapEvent): Unit
60
+ = invoke_cxx(event)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(event: PdfTapEvent): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(event: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(PdfTapEvent) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_PdfTapEvent_java(private val function: (PdfTapEvent) -> Unit): Func_void_PdfTapEvent {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(event: PdfTapEvent): Unit {
78
+ return this.function(event)
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_PdfZoomEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfsdk
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(event: struct) => 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_PdfZoomEvent: (PdfZoomEvent) -> 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(event: PdfZoomEvent): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(event: struct) => 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_PdfZoomEvent_cxx: Func_void_PdfZoomEvent {
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(event: PdfZoomEvent): Unit
60
+ = invoke_cxx(event)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(event: PdfZoomEvent): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(event: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(PdfZoomEvent) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_PdfZoomEvent_java(private val function: (PdfZoomEvent) -> Unit): Func_void_PdfZoomEvent {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(event: PdfZoomEvent): Unit {
78
+ return this.function(event)
79
+ }
80
+ }