@thatkid02/react-native-pdf-viewer 0.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.
Files changed (95) hide show
  1. package/LICENSE +20 -0
  2. package/PdfViewer.podspec +28 -0
  3. package/README.md +290 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +121 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  8. package/android/src/main/java/com/margelo/nitro/pdfviewer/HybridPdfViewer.kt +169 -0
  9. package/android/src/main/java/com/margelo/nitro/pdfviewer/PdfViewer.kt +996 -0
  10. package/android/src/main/java/com/margelo/nitro/pdfviewer/PdfViewerPackage.kt +26 -0
  11. package/ios/PdfViewer.swift +696 -0
  12. package/lib/module/PdfViewer.nitro.js +4 -0
  13. package/lib/module/PdfViewer.nitro.js.map +1 -0
  14. package/lib/module/index.js +13 -0
  15. package/lib/module/index.js.map +1 -0
  16. package/lib/module/package.json +1 -0
  17. package/lib/typescript/package.json +1 -0
  18. package/lib/typescript/src/PdfViewer.nitro.d.ts +67 -0
  19. package/lib/typescript/src/PdfViewer.nitro.d.ts.map +1 -0
  20. package/lib/typescript/src/index.d.ts +8 -0
  21. package/lib/typescript/src/index.d.ts.map +1 -0
  22. package/nitro.json +17 -0
  23. package/nitrogen/generated/android/c++/JErrorEvent.hpp +57 -0
  24. package/nitrogen/generated/android/c++/JFunc_void_ErrorEvent.hpp +77 -0
  25. package/nitrogen/generated/android/c++/JFunc_void_LoadCompleteEvent.hpp +76 -0
  26. package/nitrogen/generated/android/c++/JFunc_void_LoadingChangeEvent.hpp +76 -0
  27. package/nitrogen/generated/android/c++/JFunc_void_PageChangeEvent.hpp +76 -0
  28. package/nitrogen/generated/android/c++/JFunc_void_ScaleChangeEvent.hpp +76 -0
  29. package/nitrogen/generated/android/c++/JFunc_void_ThumbnailGeneratedEvent.hpp +77 -0
  30. package/nitrogen/generated/android/c++/JHybridPdfViewerSpec.cpp +273 -0
  31. package/nitrogen/generated/android/c++/JHybridPdfViewerSpec.hpp +94 -0
  32. package/nitrogen/generated/android/c++/JLoadCompleteEvent.hpp +61 -0
  33. package/nitrogen/generated/android/c++/JLoadingChangeEvent.hpp +53 -0
  34. package/nitrogen/generated/android/c++/JPageChangeEvent.hpp +57 -0
  35. package/nitrogen/generated/android/c++/JScaleChangeEvent.hpp +53 -0
  36. package/nitrogen/generated/android/c++/JThumbnailGeneratedEvent.hpp +57 -0
  37. package/nitrogen/generated/android/c++/views/JHybridPdfViewerStateUpdater.cpp +108 -0
  38. package/nitrogen/generated/android/c++/views/JHybridPdfViewerStateUpdater.hpp +49 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ErrorEvent.kt +32 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ErrorEvent.kt +81 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_LoadCompleteEvent.kt +81 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_LoadingChangeEvent.kt +81 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_PageChangeEvent.kt +81 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ScaleChangeEvent.kt +81 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/Func_void_ThumbnailGeneratedEvent.kt +81 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/HybridPdfViewerSpec.kt +195 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/LoadCompleteEvent.kt +35 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/LoadingChangeEvent.kt +29 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/PageChangeEvent.kt +32 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ScaleChangeEvent.kt +29 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/ThumbnailGeneratedEvent.kt +32 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/pdfviewerOnLoad.kt +35 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/views/HybridPdfViewerManager.kt +50 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfviewer/views/HybridPdfViewerStateUpdater.kt +23 -0
  55. package/nitrogen/generated/android/pdfviewer+autolinking.cmake +83 -0
  56. package/nitrogen/generated/android/pdfviewer+autolinking.gradle +27 -0
  57. package/nitrogen/generated/android/pdfviewerOnLoad.cpp +58 -0
  58. package/nitrogen/generated/android/pdfviewerOnLoad.hpp +25 -0
  59. package/nitrogen/generated/ios/PdfViewer+autolinking.rb +60 -0
  60. package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Bridge.cpp +80 -0
  61. package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Bridge.hpp +339 -0
  62. package/nitrogen/generated/ios/PdfViewer-Swift-Cxx-Umbrella.hpp +64 -0
  63. package/nitrogen/generated/ios/PdfViewerAutolinking.mm +33 -0
  64. package/nitrogen/generated/ios/PdfViewerAutolinking.swift +25 -0
  65. package/nitrogen/generated/ios/c++/HybridPdfViewerSpecSwift.cpp +11 -0
  66. package/nitrogen/generated/ios/c++/HybridPdfViewerSpecSwift.hpp +205 -0
  67. package/nitrogen/generated/ios/c++/views/HybridPdfViewerComponent.mm +161 -0
  68. package/nitrogen/generated/ios/swift/ErrorEvent.swift +46 -0
  69. package/nitrogen/generated/ios/swift/Func_void_ErrorEvent.swift +47 -0
  70. package/nitrogen/generated/ios/swift/Func_void_LoadCompleteEvent.swift +47 -0
  71. package/nitrogen/generated/ios/swift/Func_void_LoadingChangeEvent.swift +47 -0
  72. package/nitrogen/generated/ios/swift/Func_void_PageChangeEvent.swift +47 -0
  73. package/nitrogen/generated/ios/swift/Func_void_ScaleChangeEvent.swift +47 -0
  74. package/nitrogen/generated/ios/swift/Func_void_ThumbnailGeneratedEvent.swift +47 -0
  75. package/nitrogen/generated/ios/swift/HybridPdfViewerSpec.swift +65 -0
  76. package/nitrogen/generated/ios/swift/HybridPdfViewerSpec_cxx.swift +500 -0
  77. package/nitrogen/generated/ios/swift/LoadCompleteEvent.swift +57 -0
  78. package/nitrogen/generated/ios/swift/LoadingChangeEvent.swift +35 -0
  79. package/nitrogen/generated/ios/swift/PageChangeEvent.swift +46 -0
  80. package/nitrogen/generated/ios/swift/ScaleChangeEvent.swift +35 -0
  81. package/nitrogen/generated/ios/swift/ThumbnailGeneratedEvent.swift +46 -0
  82. package/nitrogen/generated/shared/c++/ErrorEvent.hpp +71 -0
  83. package/nitrogen/generated/shared/c++/HybridPdfViewerSpec.cpp +52 -0
  84. package/nitrogen/generated/shared/c++/HybridPdfViewerSpec.hpp +111 -0
  85. package/nitrogen/generated/shared/c++/LoadCompleteEvent.hpp +75 -0
  86. package/nitrogen/generated/shared/c++/LoadingChangeEvent.hpp +67 -0
  87. package/nitrogen/generated/shared/c++/PageChangeEvent.hpp +71 -0
  88. package/nitrogen/generated/shared/c++/ScaleChangeEvent.hpp +67 -0
  89. package/nitrogen/generated/shared/c++/ThumbnailGeneratedEvent.hpp +71 -0
  90. package/nitrogen/generated/shared/c++/views/HybridPdfViewerComponent.cpp +243 -0
  91. package/nitrogen/generated/shared/c++/views/HybridPdfViewerComponent.hpp +127 -0
  92. package/nitrogen/generated/shared/json/PdfViewerConfig.json +23 -0
  93. package/package.json +175 -0
  94. package/src/PdfViewer.nitro.ts +97 -0
  95. package/src/index.tsx +27 -0
@@ -0,0 +1,108 @@
1
+ ///
2
+ /// JHybridPdfViewerStateUpdater.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "JHybridPdfViewerStateUpdater.hpp"
9
+ #include "views/HybridPdfViewerComponent.hpp"
10
+ #include <NitroModules/NitroDefines.hpp>
11
+
12
+ namespace margelo::nitro::pdfviewer::views {
13
+
14
+ using namespace facebook;
15
+ using ConcreteStateData = react::ConcreteState<HybridPdfViewerState>;
16
+
17
+ void JHybridPdfViewerStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
18
+ jni::alias_ref<JHybridPdfViewerSpec::javaobject> javaView,
19
+ jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
20
+ JHybridPdfViewerSpec* view = javaView->cthis();
21
+
22
+ // Get concrete StateWrapperImpl from passed StateWrapper interface object
23
+ jobject rawStateWrapper = stateWrapperInterface.get();
24
+ if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
25
+ throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
26
+ }
27
+ auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
28
+ static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
29
+
30
+ std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
31
+ auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
32
+ const HybridPdfViewerState& data = concreteState->getData();
33
+ const std::optional<HybridPdfViewerProps>& maybeProps = data.getProps();
34
+ if (!maybeProps.has_value()) {
35
+ // Props aren't set yet!
36
+ throw std::runtime_error("HybridPdfViewerState's data doesn't contain any props!");
37
+ }
38
+ const HybridPdfViewerProps& props = maybeProps.value();
39
+ if (props.source.isDirty) {
40
+ view->setSource(props.source.value);
41
+ // TODO: Set isDirty = false
42
+ }
43
+ if (props.horizontal.isDirty) {
44
+ view->setHorizontal(props.horizontal.value);
45
+ // TODO: Set isDirty = false
46
+ }
47
+ if (props.enablePaging.isDirty) {
48
+ view->setEnablePaging(props.enablePaging.value);
49
+ // TODO: Set isDirty = false
50
+ }
51
+ if (props.spacing.isDirty) {
52
+ view->setSpacing(props.spacing.value);
53
+ // TODO: Set isDirty = false
54
+ }
55
+ if (props.enableZoom.isDirty) {
56
+ view->setEnableZoom(props.enableZoom.value);
57
+ // TODO: Set isDirty = false
58
+ }
59
+ if (props.minScale.isDirty) {
60
+ view->setMinScale(props.minScale.value);
61
+ // TODO: Set isDirty = false
62
+ }
63
+ if (props.maxScale.isDirty) {
64
+ view->setMaxScale(props.maxScale.value);
65
+ // TODO: Set isDirty = false
66
+ }
67
+ if (props.showsActivityIndicator.isDirty) {
68
+ view->setShowsActivityIndicator(props.showsActivityIndicator.value);
69
+ // TODO: Set isDirty = false
70
+ }
71
+ if (props.onLoadComplete.isDirty) {
72
+ view->setOnLoadComplete(props.onLoadComplete.value);
73
+ // TODO: Set isDirty = false
74
+ }
75
+ if (props.onPageChange.isDirty) {
76
+ view->setOnPageChange(props.onPageChange.value);
77
+ // TODO: Set isDirty = false
78
+ }
79
+ if (props.onScaleChange.isDirty) {
80
+ view->setOnScaleChange(props.onScaleChange.value);
81
+ // TODO: Set isDirty = false
82
+ }
83
+ if (props.onError.isDirty) {
84
+ view->setOnError(props.onError.value);
85
+ // TODO: Set isDirty = false
86
+ }
87
+ if (props.onThumbnailGenerated.isDirty) {
88
+ view->setOnThumbnailGenerated(props.onThumbnailGenerated.value);
89
+ // TODO: Set isDirty = false
90
+ }
91
+ if (props.onLoadingChange.isDirty) {
92
+ view->setOnLoadingChange(props.onLoadingChange.value);
93
+ // TODO: Set isDirty = false
94
+ }
95
+
96
+ // Update hybridRef if it changed
97
+ if (props.hybridRef.isDirty) {
98
+ // hybridRef changed - call it with new this
99
+ const auto& maybeFunc = props.hybridRef.value;
100
+ if (maybeFunc.has_value()) {
101
+ std::shared_ptr<JHybridPdfViewerSpec> shared = javaView->cthis()->shared_cast<JHybridPdfViewerSpec>();
102
+ maybeFunc.value()(shared);
103
+ }
104
+ // TODO: Set isDirty = false
105
+ }
106
+ }
107
+
108
+ } // namespace margelo::nitro::pdfviewer::views
@@ -0,0 +1,49 @@
1
+ ///
2
+ /// JHybridPdfViewerStateUpdater.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #ifndef RN_SERIALIZABLE_STATE
11
+ #error pdfviewer 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/StateWrapperImpl.h>
16
+ #include <react/fabric/CoreComponentsRegistry.h>
17
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
18
+ #include <NitroModules/NitroDefines.hpp>
19
+ #include <NitroModules/JStateWrapper.hpp>
20
+ #include "JHybridPdfViewerSpec.hpp"
21
+ #include "views/HybridPdfViewerComponent.hpp"
22
+
23
+ namespace margelo::nitro::pdfviewer::views {
24
+
25
+ using namespace facebook;
26
+
27
+ class JHybridPdfViewerStateUpdater: public jni::JavaClass<JHybridPdfViewerStateUpdater> {
28
+ public:
29
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/views/HybridPdfViewerStateUpdater;";
30
+
31
+ public:
32
+ static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
33
+ jni::alias_ref<JHybridPdfViewerSpec::javaobject> 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", JHybridPdfViewerStateUpdater::updateViewProps),
41
+ });
42
+ // Register React Native view component descriptor
43
+ auto provider = react::concreteComponentDescriptorProvider<HybridPdfViewerComponentDescriptor>();
44
+ auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
45
+ providerRegistry->add(provider);
46
+ }
47
+ };
48
+
49
+ } // namespace margelo::nitro::pdfviewer::views
@@ -0,0 +1,32 @@
1
+ ///
2
+ /// ErrorEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import com.margelo.nitro.core.*
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "ErrorEvent".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class ErrorEvent
21
+ @DoNotStrip
22
+ @Keep
23
+ constructor(
24
+ @DoNotStrip
25
+ @Keep
26
+ val message: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val code: String
30
+ ) {
31
+ /* main constructor */
32
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_ErrorEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_ErrorEvent: (ErrorEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: ErrorEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_ErrorEvent_cxx: Func_void_ErrorEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: ErrorEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: ErrorEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(ErrorEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_ErrorEvent_java(private val function: (ErrorEvent) -> Unit): Func_void_ErrorEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: ErrorEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_LoadCompleteEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_LoadCompleteEvent: (LoadCompleteEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: LoadCompleteEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_LoadCompleteEvent_cxx: Func_void_LoadCompleteEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: LoadCompleteEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: LoadCompleteEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(LoadCompleteEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_LoadCompleteEvent_java(private val function: (LoadCompleteEvent) -> Unit): Func_void_LoadCompleteEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: LoadCompleteEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_LoadingChangeEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_LoadingChangeEvent: (LoadingChangeEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: LoadingChangeEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_LoadingChangeEvent_cxx: Func_void_LoadingChangeEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: LoadingChangeEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: LoadingChangeEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(LoadingChangeEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_LoadingChangeEvent_java(private val function: (LoadingChangeEvent) -> Unit): Func_void_LoadingChangeEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: LoadingChangeEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_PageChangeEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_PageChangeEvent: (PageChangeEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: PageChangeEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_PageChangeEvent_cxx: Func_void_PageChangeEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: PageChangeEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: PageChangeEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(PageChangeEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_PageChangeEvent_java(private val function: (PageChangeEvent) -> Unit): Func_void_PageChangeEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: PageChangeEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_ScaleChangeEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_ScaleChangeEvent: (ScaleChangeEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: ScaleChangeEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_ScaleChangeEvent_cxx: Func_void_ScaleChangeEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: ScaleChangeEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: ScaleChangeEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(ScaleChangeEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_ScaleChangeEvent_java(private val function: (ScaleChangeEvent) -> Unit): Func_void_ScaleChangeEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: ScaleChangeEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// Func_void_ThumbnailGeneratedEvent.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.pdfviewer
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
+ /**
18
+ * Represents the JavaScript callback `(event: struct) => void`.
19
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
+ * or in Kotlin/Java (in which case it is a native callback).
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress("ClassName", "RedundantUnitReturnType")
25
+ fun interface Func_void_ThumbnailGeneratedEvent: (ThumbnailGeneratedEvent) -> Unit {
26
+ /**
27
+ * Call the given JS callback.
28
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
+ */
30
+ @DoNotStrip
31
+ @Keep
32
+ override fun invoke(event: ThumbnailGeneratedEvent): Unit
33
+ }
34
+
35
+ /**
36
+ * Represents the JavaScript callback `(event: struct) => void`.
37
+ * This is implemented in C++, via a `std::function<...>`.
38
+ * The callback might be coming from JS.
39
+ */
40
+ @DoNotStrip
41
+ @Keep
42
+ @Suppress(
43
+ "KotlinJniMissingFunction", "unused",
44
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
+ )
47
+ class Func_void_ThumbnailGeneratedEvent_cxx: Func_void_ThumbnailGeneratedEvent {
48
+ @DoNotStrip
49
+ @Keep
50
+ private val mHybridData: HybridData
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ private constructor(hybridData: HybridData) {
55
+ mHybridData = hybridData
56
+ }
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ override fun invoke(event: ThumbnailGeneratedEvent): Unit
61
+ = invoke_cxx(event)
62
+
63
+ @FastNative
64
+ private external fun invoke_cxx(event: ThumbnailGeneratedEvent): Unit
65
+ }
66
+
67
+ /**
68
+ * Represents the JavaScript callback `(event: struct) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(ThumbnailGeneratedEvent) -> Unit`.
70
+ * The callback is always coming from native.
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
+ class Func_void_ThumbnailGeneratedEvent_java(private val function: (ThumbnailGeneratedEvent) -> Unit): Func_void_ThumbnailGeneratedEvent {
76
+ @DoNotStrip
77
+ @Keep
78
+ override fun invoke(event: ThumbnailGeneratedEvent): Unit {
79
+ return this.function(event)
80
+ }
81
+ }