@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 @@
1
+ {"version":3,"names":["getHostComponent","callback","PdfViewerConfig","require","PdfViewerView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,4BAA4B;AAEvE,MAAMC,eAAe,GAAGC,OAAO,CAAC,wDAAwD,CAAC;AAGzF,OAAO,MAAMC,aAAa,GAAGJ,gBAAgB,CAC3C,WAAW,EACX,MAAME,eACR,CAAC;;AAED;;AAGA;;AAYA;AACA,SAASD,QAAQ","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,67 @@
1
+ import type { HybridView, HybridViewMethods, HybridViewProps } from 'react-native-nitro-modules';
2
+ export interface LoadCompleteEvent {
3
+ pageCount: number;
4
+ pageWidth: number;
5
+ pageHeight: number;
6
+ }
7
+ export interface PageChangeEvent {
8
+ page: number;
9
+ pageCount: number;
10
+ }
11
+ export interface ScaleChangeEvent {
12
+ scale: number;
13
+ }
14
+ export interface ErrorEvent {
15
+ message: string;
16
+ code: string;
17
+ }
18
+ export interface ThumbnailGeneratedEvent {
19
+ page: number;
20
+ uri: string;
21
+ }
22
+ export interface LoadingChangeEvent {
23
+ isLoading: boolean;
24
+ }
25
+ export interface IOSPdfViewerProps {
26
+ horizontal?: boolean;
27
+ enablePaging?: boolean;
28
+ }
29
+ export interface PdfViewerProps extends HybridViewProps {
30
+ /**
31
+ * PDF source URI
32
+ * @supported file://, http://, https://
33
+ * @security For production apps, prefer https:// URLs to ensure secure content delivery
34
+ * @example "https://example.com/document.pdf"
35
+ * @example "file:///path/to/local/document.pdf"
36
+ */
37
+ source?: string;
38
+ /**
39
+ * Horizontal scroll direction (iOS only)
40
+ * @platform ios
41
+ */
42
+ horizontal?: boolean;
43
+ /**
44
+ * Enable paging mode (iOS only)
45
+ * @platform ios
46
+ */
47
+ enablePaging?: boolean;
48
+ spacing?: number;
49
+ enableZoom?: boolean;
50
+ minScale?: number;
51
+ maxScale?: number;
52
+ showsActivityIndicator?: boolean;
53
+ onLoadComplete?: (event: LoadCompleteEvent) => void;
54
+ onPageChange?: (event: PageChangeEvent) => void;
55
+ onScaleChange?: (event: ScaleChangeEvent) => void;
56
+ onError?: (event: ErrorEvent) => void;
57
+ onThumbnailGenerated?: (event: ThumbnailGeneratedEvent) => void;
58
+ onLoadingChange?: (event: LoadingChangeEvent) => void;
59
+ }
60
+ export interface PdfViewerMethods extends HybridViewMethods {
61
+ goToPage(page: number): void;
62
+ setScale(scale: number): void;
63
+ generateThumbnail(page: number): void;
64
+ generateAllThumbnails(): void;
65
+ }
66
+ export type PdfViewer = HybridView<PdfViewerProps, PdfViewerMethods>;
67
+ //# sourceMappingURL=PdfViewer.nitro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewer.nitro.d.ts","sourceRoot":"","sources":["../../../src/PdfViewer.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;CACpB;AAGD,MAAM,WAAW,iBAAiB;IAEhC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAGjC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAChD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IAEzD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtC,qBAAqB,IAAI,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { callback } from 'react-native-nitro-modules';
2
+ import type { HybridRef } from 'react-native-nitro-modules';
3
+ import type { PdfViewerMethods, PdfViewerProps } from './PdfViewer.nitro';
4
+ export declare const PdfViewerView: import("react-native-nitro-modules").ReactNativeView<PdfViewerProps, PdfViewerMethods>;
5
+ export type PdfViewerRef = HybridRef<PdfViewerProps, PdfViewerMethods>;
6
+ export type { LoadCompleteEvent, PageChangeEvent, ScaleChangeEvent, ErrorEvent, ThumbnailGeneratedEvent, LoadingChangeEvent, PdfViewerProps, PdfViewerMethods, } from './PdfViewer.nitro';
7
+ export { callback };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E,eAAO,MAAM,aAAa,wFAGzB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAGvE,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/nitro.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "cxxNamespace": ["pdfviewer"],
3
+ "ios": {
4
+ "iosModuleName": "PdfViewer"
5
+ },
6
+ "android": {
7
+ "androidNamespace": ["pdfviewer"],
8
+ "androidCxxLibName": "pdfviewer"
9
+ },
10
+ "autolinking": {
11
+ "PdfViewer": {
12
+ "swift": "HybridPdfViewer",
13
+ "kotlin": "HybridPdfViewer"
14
+ }
15
+ },
16
+ "ignorePaths": ["node_modules"]
17
+ }
@@ -0,0 +1,57 @@
1
+ ///
2
+ /// JErrorEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include "ErrorEvent.hpp"
12
+
13
+ #include <string>
14
+
15
+ namespace margelo::nitro::pdfviewer {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "ErrorEvent" and the the Kotlin data class "ErrorEvent".
21
+ */
22
+ struct JErrorEvent final: public jni::JavaClass<JErrorEvent> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/ErrorEvent;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct ErrorEvent by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ ErrorEvent toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldMessage = clazz->getField<jni::JString>("message");
35
+ jni::local_ref<jni::JString> message = this->getFieldValue(fieldMessage);
36
+ static const auto fieldCode = clazz->getField<jni::JString>("code");
37
+ jni::local_ref<jni::JString> code = this->getFieldValue(fieldCode);
38
+ return ErrorEvent(
39
+ message->toStdString(),
40
+ code->toStdString()
41
+ );
42
+ }
43
+
44
+ public:
45
+ /**
46
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
47
+ */
48
+ [[maybe_unused]]
49
+ static jni::local_ref<JErrorEvent::javaobject> fromCpp(const ErrorEvent& value) {
50
+ return newInstance(
51
+ jni::make_jstring(value.message),
52
+ jni::make_jstring(value.code)
53
+ );
54
+ }
55
+ };
56
+
57
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// JFunc_void_ErrorEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "ErrorEvent.hpp"
14
+ #include <functional>
15
+ #include "JErrorEvent.hpp"
16
+ #include <string>
17
+
18
+ namespace margelo::nitro::pdfviewer {
19
+
20
+ using namespace facebook;
21
+
22
+ /**
23
+ * Represents the Java/Kotlin callback `(event: ErrorEvent) -> Unit`.
24
+ * This can be passed around between C++ and Java/Kotlin.
25
+ */
26
+ struct JFunc_void_ErrorEvent: public jni::JavaClass<JFunc_void_ErrorEvent> {
27
+ public:
28
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ErrorEvent;";
29
+
30
+ public:
31
+ /**
32
+ * Invokes the function this `JFunc_void_ErrorEvent` instance holds through JNI.
33
+ */
34
+ void invoke(const ErrorEvent& event) const {
35
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JErrorEvent> /* event */)>("invoke");
36
+ method(self(), JErrorEvent::fromCpp(event));
37
+ }
38
+ };
39
+
40
+ /**
41
+ * An implementation of Func_void_ErrorEvent that is backed by a C++ implementation (using `std::function<...>`)
42
+ */
43
+ struct JFunc_void_ErrorEvent_cxx final: public jni::HybridClass<JFunc_void_ErrorEvent_cxx, JFunc_void_ErrorEvent> {
44
+ public:
45
+ static jni::local_ref<JFunc_void_ErrorEvent::javaobject> fromCpp(const std::function<void(const ErrorEvent& /* event */)>& func) {
46
+ return JFunc_void_ErrorEvent_cxx::newObjectCxxArgs(func);
47
+ }
48
+
49
+ public:
50
+ /**
51
+ * Invokes the C++ `std::function<...>` this `JFunc_void_ErrorEvent_cxx` instance holds.
52
+ */
53
+ void invoke_cxx(jni::alias_ref<JErrorEvent> event) {
54
+ _func(event->toCpp());
55
+ }
56
+
57
+ public:
58
+ [[nodiscard]]
59
+ inline const std::function<void(const ErrorEvent& /* event */)>& getFunction() const {
60
+ return _func;
61
+ }
62
+
63
+ public:
64
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ErrorEvent_cxx;";
65
+ static void registerNatives() {
66
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ErrorEvent_cxx::invoke_cxx)});
67
+ }
68
+
69
+ private:
70
+ explicit JFunc_void_ErrorEvent_cxx(const std::function<void(const ErrorEvent& /* event */)>& func): _func(func) { }
71
+
72
+ private:
73
+ friend HybridBase;
74
+ std::function<void(const ErrorEvent& /* event */)> _func;
75
+ };
76
+
77
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// JFunc_void_LoadCompleteEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "LoadCompleteEvent.hpp"
14
+ #include <functional>
15
+ #include "JLoadCompleteEvent.hpp"
16
+
17
+ namespace margelo::nitro::pdfviewer {
18
+
19
+ using namespace facebook;
20
+
21
+ /**
22
+ * Represents the Java/Kotlin callback `(event: LoadCompleteEvent) -> Unit`.
23
+ * This can be passed around between C++ and Java/Kotlin.
24
+ */
25
+ struct JFunc_void_LoadCompleteEvent: public jni::JavaClass<JFunc_void_LoadCompleteEvent> {
26
+ public:
27
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_LoadCompleteEvent;";
28
+
29
+ public:
30
+ /**
31
+ * Invokes the function this `JFunc_void_LoadCompleteEvent` instance holds through JNI.
32
+ */
33
+ void invoke(const LoadCompleteEvent& event) const {
34
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JLoadCompleteEvent> /* event */)>("invoke");
35
+ method(self(), JLoadCompleteEvent::fromCpp(event));
36
+ }
37
+ };
38
+
39
+ /**
40
+ * An implementation of Func_void_LoadCompleteEvent that is backed by a C++ implementation (using `std::function<...>`)
41
+ */
42
+ struct JFunc_void_LoadCompleteEvent_cxx final: public jni::HybridClass<JFunc_void_LoadCompleteEvent_cxx, JFunc_void_LoadCompleteEvent> {
43
+ public:
44
+ static jni::local_ref<JFunc_void_LoadCompleteEvent::javaobject> fromCpp(const std::function<void(const LoadCompleteEvent& /* event */)>& func) {
45
+ return JFunc_void_LoadCompleteEvent_cxx::newObjectCxxArgs(func);
46
+ }
47
+
48
+ public:
49
+ /**
50
+ * Invokes the C++ `std::function<...>` this `JFunc_void_LoadCompleteEvent_cxx` instance holds.
51
+ */
52
+ void invoke_cxx(jni::alias_ref<JLoadCompleteEvent> event) {
53
+ _func(event->toCpp());
54
+ }
55
+
56
+ public:
57
+ [[nodiscard]]
58
+ inline const std::function<void(const LoadCompleteEvent& /* event */)>& getFunction() const {
59
+ return _func;
60
+ }
61
+
62
+ public:
63
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_LoadCompleteEvent_cxx;";
64
+ static void registerNatives() {
65
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_LoadCompleteEvent_cxx::invoke_cxx)});
66
+ }
67
+
68
+ private:
69
+ explicit JFunc_void_LoadCompleteEvent_cxx(const std::function<void(const LoadCompleteEvent& /* event */)>& func): _func(func) { }
70
+
71
+ private:
72
+ friend HybridBase;
73
+ std::function<void(const LoadCompleteEvent& /* event */)> _func;
74
+ };
75
+
76
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// JFunc_void_LoadingChangeEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "LoadingChangeEvent.hpp"
14
+ #include <functional>
15
+ #include "JLoadingChangeEvent.hpp"
16
+
17
+ namespace margelo::nitro::pdfviewer {
18
+
19
+ using namespace facebook;
20
+
21
+ /**
22
+ * Represents the Java/Kotlin callback `(event: LoadingChangeEvent) -> Unit`.
23
+ * This can be passed around between C++ and Java/Kotlin.
24
+ */
25
+ struct JFunc_void_LoadingChangeEvent: public jni::JavaClass<JFunc_void_LoadingChangeEvent> {
26
+ public:
27
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_LoadingChangeEvent;";
28
+
29
+ public:
30
+ /**
31
+ * Invokes the function this `JFunc_void_LoadingChangeEvent` instance holds through JNI.
32
+ */
33
+ void invoke(const LoadingChangeEvent& event) const {
34
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JLoadingChangeEvent> /* event */)>("invoke");
35
+ method(self(), JLoadingChangeEvent::fromCpp(event));
36
+ }
37
+ };
38
+
39
+ /**
40
+ * An implementation of Func_void_LoadingChangeEvent that is backed by a C++ implementation (using `std::function<...>`)
41
+ */
42
+ struct JFunc_void_LoadingChangeEvent_cxx final: public jni::HybridClass<JFunc_void_LoadingChangeEvent_cxx, JFunc_void_LoadingChangeEvent> {
43
+ public:
44
+ static jni::local_ref<JFunc_void_LoadingChangeEvent::javaobject> fromCpp(const std::function<void(const LoadingChangeEvent& /* event */)>& func) {
45
+ return JFunc_void_LoadingChangeEvent_cxx::newObjectCxxArgs(func);
46
+ }
47
+
48
+ public:
49
+ /**
50
+ * Invokes the C++ `std::function<...>` this `JFunc_void_LoadingChangeEvent_cxx` instance holds.
51
+ */
52
+ void invoke_cxx(jni::alias_ref<JLoadingChangeEvent> event) {
53
+ _func(event->toCpp());
54
+ }
55
+
56
+ public:
57
+ [[nodiscard]]
58
+ inline const std::function<void(const LoadingChangeEvent& /* event */)>& getFunction() const {
59
+ return _func;
60
+ }
61
+
62
+ public:
63
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_LoadingChangeEvent_cxx;";
64
+ static void registerNatives() {
65
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_LoadingChangeEvent_cxx::invoke_cxx)});
66
+ }
67
+
68
+ private:
69
+ explicit JFunc_void_LoadingChangeEvent_cxx(const std::function<void(const LoadingChangeEvent& /* event */)>& func): _func(func) { }
70
+
71
+ private:
72
+ friend HybridBase;
73
+ std::function<void(const LoadingChangeEvent& /* event */)> _func;
74
+ };
75
+
76
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// JFunc_void_PageChangeEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "PageChangeEvent.hpp"
14
+ #include <functional>
15
+ #include "JPageChangeEvent.hpp"
16
+
17
+ namespace margelo::nitro::pdfviewer {
18
+
19
+ using namespace facebook;
20
+
21
+ /**
22
+ * Represents the Java/Kotlin callback `(event: PageChangeEvent) -> Unit`.
23
+ * This can be passed around between C++ and Java/Kotlin.
24
+ */
25
+ struct JFunc_void_PageChangeEvent: public jni::JavaClass<JFunc_void_PageChangeEvent> {
26
+ public:
27
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_PageChangeEvent;";
28
+
29
+ public:
30
+ /**
31
+ * Invokes the function this `JFunc_void_PageChangeEvent` instance holds through JNI.
32
+ */
33
+ void invoke(const PageChangeEvent& event) const {
34
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JPageChangeEvent> /* event */)>("invoke");
35
+ method(self(), JPageChangeEvent::fromCpp(event));
36
+ }
37
+ };
38
+
39
+ /**
40
+ * An implementation of Func_void_PageChangeEvent that is backed by a C++ implementation (using `std::function<...>`)
41
+ */
42
+ struct JFunc_void_PageChangeEvent_cxx final: public jni::HybridClass<JFunc_void_PageChangeEvent_cxx, JFunc_void_PageChangeEvent> {
43
+ public:
44
+ static jni::local_ref<JFunc_void_PageChangeEvent::javaobject> fromCpp(const std::function<void(const PageChangeEvent& /* event */)>& func) {
45
+ return JFunc_void_PageChangeEvent_cxx::newObjectCxxArgs(func);
46
+ }
47
+
48
+ public:
49
+ /**
50
+ * Invokes the C++ `std::function<...>` this `JFunc_void_PageChangeEvent_cxx` instance holds.
51
+ */
52
+ void invoke_cxx(jni::alias_ref<JPageChangeEvent> event) {
53
+ _func(event->toCpp());
54
+ }
55
+
56
+ public:
57
+ [[nodiscard]]
58
+ inline const std::function<void(const PageChangeEvent& /* event */)>& getFunction() const {
59
+ return _func;
60
+ }
61
+
62
+ public:
63
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_PageChangeEvent_cxx;";
64
+ static void registerNatives() {
65
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_PageChangeEvent_cxx::invoke_cxx)});
66
+ }
67
+
68
+ private:
69
+ explicit JFunc_void_PageChangeEvent_cxx(const std::function<void(const PageChangeEvent& /* event */)>& func): _func(func) { }
70
+
71
+ private:
72
+ friend HybridBase;
73
+ std::function<void(const PageChangeEvent& /* event */)> _func;
74
+ };
75
+
76
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// JFunc_void_ScaleChangeEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "ScaleChangeEvent.hpp"
14
+ #include <functional>
15
+ #include "JScaleChangeEvent.hpp"
16
+
17
+ namespace margelo::nitro::pdfviewer {
18
+
19
+ using namespace facebook;
20
+
21
+ /**
22
+ * Represents the Java/Kotlin callback `(event: ScaleChangeEvent) -> Unit`.
23
+ * This can be passed around between C++ and Java/Kotlin.
24
+ */
25
+ struct JFunc_void_ScaleChangeEvent: public jni::JavaClass<JFunc_void_ScaleChangeEvent> {
26
+ public:
27
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ScaleChangeEvent;";
28
+
29
+ public:
30
+ /**
31
+ * Invokes the function this `JFunc_void_ScaleChangeEvent` instance holds through JNI.
32
+ */
33
+ void invoke(const ScaleChangeEvent& event) const {
34
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JScaleChangeEvent> /* event */)>("invoke");
35
+ method(self(), JScaleChangeEvent::fromCpp(event));
36
+ }
37
+ };
38
+
39
+ /**
40
+ * An implementation of Func_void_ScaleChangeEvent that is backed by a C++ implementation (using `std::function<...>`)
41
+ */
42
+ struct JFunc_void_ScaleChangeEvent_cxx final: public jni::HybridClass<JFunc_void_ScaleChangeEvent_cxx, JFunc_void_ScaleChangeEvent> {
43
+ public:
44
+ static jni::local_ref<JFunc_void_ScaleChangeEvent::javaobject> fromCpp(const std::function<void(const ScaleChangeEvent& /* event */)>& func) {
45
+ return JFunc_void_ScaleChangeEvent_cxx::newObjectCxxArgs(func);
46
+ }
47
+
48
+ public:
49
+ /**
50
+ * Invokes the C++ `std::function<...>` this `JFunc_void_ScaleChangeEvent_cxx` instance holds.
51
+ */
52
+ void invoke_cxx(jni::alias_ref<JScaleChangeEvent> event) {
53
+ _func(event->toCpp());
54
+ }
55
+
56
+ public:
57
+ [[nodiscard]]
58
+ inline const std::function<void(const ScaleChangeEvent& /* event */)>& getFunction() const {
59
+ return _func;
60
+ }
61
+
62
+ public:
63
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ScaleChangeEvent_cxx;";
64
+ static void registerNatives() {
65
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ScaleChangeEvent_cxx::invoke_cxx)});
66
+ }
67
+
68
+ private:
69
+ explicit JFunc_void_ScaleChangeEvent_cxx(const std::function<void(const ScaleChangeEvent& /* event */)>& func): _func(func) { }
70
+
71
+ private:
72
+ friend HybridBase;
73
+ std::function<void(const ScaleChangeEvent& /* event */)> _func;
74
+ };
75
+
76
+ } // namespace margelo::nitro::pdfviewer
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// JFunc_void_ThumbnailGeneratedEvent.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
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "ThumbnailGeneratedEvent.hpp"
14
+ #include <functional>
15
+ #include "JThumbnailGeneratedEvent.hpp"
16
+ #include <string>
17
+
18
+ namespace margelo::nitro::pdfviewer {
19
+
20
+ using namespace facebook;
21
+
22
+ /**
23
+ * Represents the Java/Kotlin callback `(event: ThumbnailGeneratedEvent) -> Unit`.
24
+ * This can be passed around between C++ and Java/Kotlin.
25
+ */
26
+ struct JFunc_void_ThumbnailGeneratedEvent: public jni::JavaClass<JFunc_void_ThumbnailGeneratedEvent> {
27
+ public:
28
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ThumbnailGeneratedEvent;";
29
+
30
+ public:
31
+ /**
32
+ * Invokes the function this `JFunc_void_ThumbnailGeneratedEvent` instance holds through JNI.
33
+ */
34
+ void invoke(const ThumbnailGeneratedEvent& event) const {
35
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JThumbnailGeneratedEvent> /* event */)>("invoke");
36
+ method(self(), JThumbnailGeneratedEvent::fromCpp(event));
37
+ }
38
+ };
39
+
40
+ /**
41
+ * An implementation of Func_void_ThumbnailGeneratedEvent that is backed by a C++ implementation (using `std::function<...>`)
42
+ */
43
+ struct JFunc_void_ThumbnailGeneratedEvent_cxx final: public jni::HybridClass<JFunc_void_ThumbnailGeneratedEvent_cxx, JFunc_void_ThumbnailGeneratedEvent> {
44
+ public:
45
+ static jni::local_ref<JFunc_void_ThumbnailGeneratedEvent::javaobject> fromCpp(const std::function<void(const ThumbnailGeneratedEvent& /* event */)>& func) {
46
+ return JFunc_void_ThumbnailGeneratedEvent_cxx::newObjectCxxArgs(func);
47
+ }
48
+
49
+ public:
50
+ /**
51
+ * Invokes the C++ `std::function<...>` this `JFunc_void_ThumbnailGeneratedEvent_cxx` instance holds.
52
+ */
53
+ void invoke_cxx(jni::alias_ref<JThumbnailGeneratedEvent> event) {
54
+ _func(event->toCpp());
55
+ }
56
+
57
+ public:
58
+ [[nodiscard]]
59
+ inline const std::function<void(const ThumbnailGeneratedEvent& /* event */)>& getFunction() const {
60
+ return _func;
61
+ }
62
+
63
+ public:
64
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pdfviewer/Func_void_ThumbnailGeneratedEvent_cxx;";
65
+ static void registerNatives() {
66
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ThumbnailGeneratedEvent_cxx::invoke_cxx)});
67
+ }
68
+
69
+ private:
70
+ explicit JFunc_void_ThumbnailGeneratedEvent_cxx(const std::function<void(const ThumbnailGeneratedEvent& /* event */)>& func): _func(func) { }
71
+
72
+ private:
73
+ friend HybridBase;
74
+ std::function<void(const ThumbnailGeneratedEvent& /* event */)> _func;
75
+ };
76
+
77
+ } // namespace margelo::nitro::pdfviewer