@succinctlabs/react-native-zcam1 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/Zcam1Sdk.podspec +157 -0
- package/app.plugin.js +11 -0
- package/cpp/generated/zcam1_c2pa_utils.cpp +4091 -0
- package/cpp/generated/zcam1_c2pa_utils.hpp +367 -0
- package/cpp/generated/zcam1_certs_utils.cpp +1799 -0
- package/cpp/generated/zcam1_certs_utils.hpp +72 -0
- package/cpp/generated/zcam1_verify_utils.cpp +1857 -0
- package/cpp/generated/zcam1_verify_utils.hpp +79 -0
- package/cpp/proving/generated/zcam1_proving_utils.cpp +3661 -0
- package/cpp/proving/generated/zcam1_proving_utils.hpp +275 -0
- package/cpp/proving/zcam1-proving.cpp +16 -0
- package/cpp/proving/zcam1-proving.h +15 -0
- package/cpp/zcam1-sdk.cpp +20 -0
- package/cpp/zcam1-sdk.h +15 -0
- package/ios/Zcam1Camera.swift +2945 -0
- package/ios/Zcam1CameraFilmStyle.swift +191 -0
- package/ios/Zcam1CameraViewManager.m +86 -0
- package/ios/Zcam1Capture.h +13 -0
- package/ios/Zcam1Capture.mm +500 -0
- package/ios/Zcam1DepthData.swift +417 -0
- package/ios/Zcam1Sdk.h +16 -0
- package/ios/Zcam1Sdk.mm +66 -0
- package/ios/proving/Zcam1Proving.h +16 -0
- package/ios/proving/Zcam1Proving.mm +66 -0
- package/lib/module/NativeZcam1Capture.js +12 -0
- package/lib/module/NativeZcam1Capture.js.map +1 -0
- package/lib/module/NativeZcam1Sdk.js +7 -0
- package/lib/module/NativeZcam1Sdk.js.map +1 -0
- package/lib/module/bindings.js +51 -0
- package/lib/module/bindings.js.map +1 -0
- package/lib/module/camera.js +522 -0
- package/lib/module/camera.js.map +1 -0
- package/lib/module/capture.js +120 -0
- package/lib/module/capture.js.map +1 -0
- package/lib/module/common.js +35 -0
- package/lib/module/common.js.map +1 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_c2pa_utils.js +1202 -0
- package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_certs_utils.js +399 -0
- package/lib/module/generated/zcam1_certs_utils.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils.js +515 -0
- package/lib/module/generated/zcam1_proving_utils.js.map +1 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_verify_utils.js +252 -0
- package/lib/module/generated/zcam1_verify_utils.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/picker.js +222 -0
- package/lib/module/picker.js.map +1 -0
- package/lib/module/proving/NativeZcam1Proving.js +7 -0
- package/lib/module/proving/NativeZcam1Proving.js.map +1 -0
- package/lib/module/proving/bindings.js +46 -0
- package/lib/module/proving/bindings.js.map +1 -0
- package/lib/module/proving/index.js +5 -0
- package/lib/module/proving/index.js.map +1 -0
- package/lib/module/proving/prove.js +346 -0
- package/lib/module/proving/prove.js.map +1 -0
- package/lib/module/utils.js +27 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/verify.js +82 -0
- package/lib/module/verify.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeZcam1Capture.d.ts +280 -0
- package/lib/typescript/src/NativeZcam1Capture.d.ts.map +1 -0
- package/lib/typescript/src/NativeZcam1Sdk.d.ts +8 -0
- package/lib/typescript/src/NativeZcam1Sdk.d.ts.map +1 -0
- package/lib/typescript/src/bindings.d.ts +14 -0
- package/lib/typescript/src/bindings.d.ts.map +1 -0
- package/lib/typescript/src/camera.d.ts +300 -0
- package/lib/typescript/src/camera.d.ts.map +1 -0
- package/lib/typescript/src/capture.d.ts +59 -0
- package/lib/typescript/src/capture.d.ts.map +1 -0
- package/lib/typescript/src/common.d.ts +10 -0
- package/lib/typescript/src/common.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +175 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +811 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +82 -0
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts +413 -0
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +153 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +321 -0
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +84 -0
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +286 -0
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +29 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/picker.d.ts +103 -0
- package/lib/typescript/src/picker.d.ts.map +1 -0
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +8 -0
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts.map +1 -0
- package/lib/typescript/src/proving/bindings.d.ts +8 -0
- package/lib/typescript/src/proving/bindings.d.ts.map +1 -0
- package/lib/typescript/src/proving/index.d.ts +3 -0
- package/lib/typescript/src/proving/index.d.ts.map +1 -0
- package/lib/typescript/src/proving/prove.d.ts +74 -0
- package/lib/typescript/src/proving/prove.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/verify.d.ts +45 -0
- package/lib/typescript/src/verify.d.ts.map +1 -0
- package/package.json +118 -0
- package/src/NativeZcam1Capture.ts +335 -0
- package/src/NativeZcam1Sdk.ts +10 -0
- package/src/bindings.tsx +49 -0
- package/src/camera.tsx +705 -0
- package/src/capture.tsx +165 -0
- package/src/common.tsx +46 -0
- package/src/generated/zcam1_c2pa_utils-ffi.ts +456 -0
- package/src/generated/zcam1_c2pa_utils.ts +1866 -0
- package/src/generated/zcam1_certs_utils-ffi.ts +187 -0
- package/src/generated/zcam1_certs_utils.ts +549 -0
- package/src/generated/zcam1_proving_utils-ffi.ts +374 -0
- package/src/generated/zcam1_proving_utils.ts +804 -0
- package/src/generated/zcam1_verify_utils-ffi.ts +196 -0
- package/src/generated/zcam1_verify_utils.ts +372 -0
- package/src/index.ts +73 -0
- package/src/picker.tsx +342 -0
- package/src/proving/NativeZcam1Proving.ts +10 -0
- package/src/proving/bindings.tsx +50 -0
- package/src/proving/index.ts +8 -0
- package/src/proving/prove.tsx +492 -0
- package/src/utils.ts +38 -0
- package/src/verify.tsx +119 -0
- package/turbo.json +27 -0
|
@@ -0,0 +1,1202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
4
|
+
// Trust me, you don't want to mess with it!
|
|
5
|
+
import nativeModule from "./zcam1_c2pa_utils-ffi.js";
|
|
6
|
+
import { AbstractFfiConverterByteArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterInt32, FfiConverterObject, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
|
|
7
|
+
|
|
8
|
+
// Get converters from the other files, if any.
|
|
9
|
+
const uniffiCaller = new UniffiRustCaller(() => ({
|
|
10
|
+
code: 0
|
|
11
|
+
}));
|
|
12
|
+
const uniffiIsDebug =
|
|
13
|
+
// @ts-ignore -- The process global might not be defined
|
|
14
|
+
typeof process !== "object" ||
|
|
15
|
+
// @ts-ignore -- The process global might not be defined
|
|
16
|
+
process?.env?.NODE_ENV !== "production" || false;
|
|
17
|
+
// Public interface members begin here.
|
|
18
|
+
|
|
19
|
+
export async function authenticityStatus(path, asyncOpts_) {
|
|
20
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
21
|
+
try {
|
|
22
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
23
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_func_authenticity_status(FfiConverterString.lower(path));
|
|
24
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeAuthenticityStatus.lift.bind(FfiConverterTypeAuthenticityStatus), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
|
|
25
|
+
} catch (__error) {
|
|
26
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
27
|
+
__error.stack = __stack;
|
|
28
|
+
}
|
|
29
|
+
throw __error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compute the hash for a file.
|
|
34
|
+
*
|
|
35
|
+
* Note: the file should **not** have a C2PA manifest embedded.
|
|
36
|
+
*/
|
|
37
|
+
export function computeHash(path) /*throws*/{
|
|
38
|
+
return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
39
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_func_compute_hash(FfiConverterString.lower(path), callStatus);
|
|
40
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
41
|
+
}
|
|
42
|
+
export function computeHashFromBuffer(buffer, format) /*throws*/{
|
|
43
|
+
return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
44
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_func_compute_hash_from_buffer(FfiConverterArrayBuffer.lower(buffer), FfiConverterString.lower(format), callStatus);
|
|
45
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
46
|
+
}
|
|
47
|
+
export function extractManifest(path) /*throws*/{
|
|
48
|
+
return FfiConverterTypeManifestStore.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
49
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_func_extract_manifest(FfiConverterString.lower(path), callStatus);
|
|
50
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Return a MIME type given a file path.
|
|
54
|
+
*
|
|
55
|
+
* This function will use the file extension to determine the MIME type.
|
|
56
|
+
*/
|
|
57
|
+
export function formatFromPath(path) {
|
|
58
|
+
return FfiConverterOptionalString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
59
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_func_format_from_path(FfiConverterString.lower(path), callStatus);
|
|
60
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generated factory for {@link AuthenticityData} record objects.
|
|
64
|
+
*/
|
|
65
|
+
export const AuthenticityData = (() => {
|
|
66
|
+
const defaults = () => ({});
|
|
67
|
+
const create = (() => {
|
|
68
|
+
return uniffiCreateRecord(defaults);
|
|
69
|
+
})();
|
|
70
|
+
return Object.freeze({
|
|
71
|
+
/**
|
|
72
|
+
* Create a frozen instance of {@link AuthenticityData}, with defaults specified
|
|
73
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
74
|
+
*/
|
|
75
|
+
create,
|
|
76
|
+
/**
|
|
77
|
+
* Create a frozen instance of {@link AuthenticityData}, with defaults specified
|
|
78
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
79
|
+
*/
|
|
80
|
+
new: create,
|
|
81
|
+
/**
|
|
82
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
83
|
+
*/
|
|
84
|
+
defaults: () => Object.freeze(defaults())
|
|
85
|
+
});
|
|
86
|
+
})();
|
|
87
|
+
const FfiConverterTypeAuthenticityData = (() => {
|
|
88
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
89
|
+
read(from) {
|
|
90
|
+
return {
|
|
91
|
+
isJailBroken: FfiConverterBool.read(from),
|
|
92
|
+
isLocationSpoofingAvailable: FfiConverterBool.read(from)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
write(value, into) {
|
|
96
|
+
FfiConverterBool.write(value.isJailBroken, into);
|
|
97
|
+
FfiConverterBool.write(value.isLocationSpoofingAvailable, into);
|
|
98
|
+
}
|
|
99
|
+
allocationSize(value) {
|
|
100
|
+
return FfiConverterBool.allocationSize(value.isJailBroken) + FfiConverterBool.allocationSize(value.isLocationSpoofingAvailable);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return new FFIConverter();
|
|
104
|
+
})();
|
|
105
|
+
/**
|
|
106
|
+
* Generated factory for {@link Claim} record objects.
|
|
107
|
+
*/
|
|
108
|
+
export const Claim = (() => {
|
|
109
|
+
const defaults = () => ({});
|
|
110
|
+
const create = (() => {
|
|
111
|
+
return uniffiCreateRecord(defaults);
|
|
112
|
+
})();
|
|
113
|
+
return Object.freeze({
|
|
114
|
+
/**
|
|
115
|
+
* Create a frozen instance of {@link Claim}, with defaults specified
|
|
116
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
117
|
+
*/
|
|
118
|
+
create,
|
|
119
|
+
/**
|
|
120
|
+
* Create a frozen instance of {@link Claim}, with defaults specified
|
|
121
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
122
|
+
*/
|
|
123
|
+
new: create,
|
|
124
|
+
/**
|
|
125
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
126
|
+
*/
|
|
127
|
+
defaults: () => Object.freeze(defaults())
|
|
128
|
+
});
|
|
129
|
+
})();
|
|
130
|
+
const FfiConverterTypeClaim = (() => {
|
|
131
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
132
|
+
read(from) {
|
|
133
|
+
return {
|
|
134
|
+
signature: FfiConverterString.read(from)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
write(value, into) {
|
|
138
|
+
FfiConverterString.write(value.signature, into);
|
|
139
|
+
}
|
|
140
|
+
allocationSize(value) {
|
|
141
|
+
return FfiConverterString.allocationSize(value.signature);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return new FFIConverter();
|
|
145
|
+
})();
|
|
146
|
+
/**
|
|
147
|
+
* Generated factory for {@link DepthData} record objects.
|
|
148
|
+
*/
|
|
149
|
+
export const DepthData = (() => {
|
|
150
|
+
const defaults = () => ({});
|
|
151
|
+
const create = (() => {
|
|
152
|
+
return uniffiCreateRecord(defaults);
|
|
153
|
+
})();
|
|
154
|
+
return Object.freeze({
|
|
155
|
+
/**
|
|
156
|
+
* Create a frozen instance of {@link DepthData}, with defaults specified
|
|
157
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
158
|
+
*/
|
|
159
|
+
create,
|
|
160
|
+
/**
|
|
161
|
+
* Create a frozen instance of {@link DepthData}, with defaults specified
|
|
162
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
163
|
+
*/
|
|
164
|
+
new: create,
|
|
165
|
+
/**
|
|
166
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
167
|
+
*/
|
|
168
|
+
defaults: () => Object.freeze(defaults())
|
|
169
|
+
});
|
|
170
|
+
})();
|
|
171
|
+
const FfiConverterTypeDepthData = (() => {
|
|
172
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
173
|
+
read(from) {
|
|
174
|
+
return {
|
|
175
|
+
width: FfiConverterUInt32.read(from),
|
|
176
|
+
height: FfiConverterUInt32.read(from),
|
|
177
|
+
pixelFormat: FfiConverterString.read(from),
|
|
178
|
+
statistics: FfiConverterTypeDepthDataStatistics.read(from),
|
|
179
|
+
accuracy: FfiConverterString.read(from)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
write(value, into) {
|
|
183
|
+
FfiConverterUInt32.write(value.width, into);
|
|
184
|
+
FfiConverterUInt32.write(value.height, into);
|
|
185
|
+
FfiConverterString.write(value.pixelFormat, into);
|
|
186
|
+
FfiConverterTypeDepthDataStatistics.write(value.statistics, into);
|
|
187
|
+
FfiConverterString.write(value.accuracy, into);
|
|
188
|
+
}
|
|
189
|
+
allocationSize(value) {
|
|
190
|
+
return FfiConverterUInt32.allocationSize(value.width) + FfiConverterUInt32.allocationSize(value.height) + FfiConverterString.allocationSize(value.pixelFormat) + FfiConverterTypeDepthDataStatistics.allocationSize(value.statistics) + FfiConverterString.allocationSize(value.accuracy);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return new FFIConverter();
|
|
194
|
+
})();
|
|
195
|
+
/**
|
|
196
|
+
* Generated factory for {@link DepthDataStatistics} record objects.
|
|
197
|
+
*/
|
|
198
|
+
export const DepthDataStatistics = (() => {
|
|
199
|
+
const defaults = () => ({});
|
|
200
|
+
const create = (() => {
|
|
201
|
+
return uniffiCreateRecord(defaults);
|
|
202
|
+
})();
|
|
203
|
+
return Object.freeze({
|
|
204
|
+
/**
|
|
205
|
+
* Create a frozen instance of {@link DepthDataStatistics}, with defaults specified
|
|
206
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
207
|
+
*/
|
|
208
|
+
create,
|
|
209
|
+
/**
|
|
210
|
+
* Create a frozen instance of {@link DepthDataStatistics}, with defaults specified
|
|
211
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
212
|
+
*/
|
|
213
|
+
new: create,
|
|
214
|
+
/**
|
|
215
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
216
|
+
*/
|
|
217
|
+
defaults: () => Object.freeze(defaults())
|
|
218
|
+
});
|
|
219
|
+
})();
|
|
220
|
+
const FfiConverterTypeDepthDataStatistics = (() => {
|
|
221
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
222
|
+
read(from) {
|
|
223
|
+
return {
|
|
224
|
+
min: FfiConverterString.read(from),
|
|
225
|
+
max: FfiConverterString.read(from),
|
|
226
|
+
mean: FfiConverterString.read(from),
|
|
227
|
+
stdDev: FfiConverterString.read(from),
|
|
228
|
+
validPixelCount: FfiConverterUInt32.read(from),
|
|
229
|
+
sampleStride: FfiConverterUInt32.read(from)
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
write(value, into) {
|
|
233
|
+
FfiConverterString.write(value.min, into);
|
|
234
|
+
FfiConverterString.write(value.max, into);
|
|
235
|
+
FfiConverterString.write(value.mean, into);
|
|
236
|
+
FfiConverterString.write(value.stdDev, into);
|
|
237
|
+
FfiConverterUInt32.write(value.validPixelCount, into);
|
|
238
|
+
FfiConverterUInt32.write(value.sampleStride, into);
|
|
239
|
+
}
|
|
240
|
+
allocationSize(value) {
|
|
241
|
+
return FfiConverterString.allocationSize(value.min) + FfiConverterString.allocationSize(value.max) + FfiConverterString.allocationSize(value.mean) + FfiConverterString.allocationSize(value.stdDev) + FfiConverterUInt32.allocationSize(value.validPixelCount) + FfiConverterUInt32.allocationSize(value.sampleStride);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return new FFIConverter();
|
|
245
|
+
})();
|
|
246
|
+
/**
|
|
247
|
+
* Generated factory for {@link DeviceBindings} record objects.
|
|
248
|
+
*/
|
|
249
|
+
export const DeviceBindings = (() => {
|
|
250
|
+
const defaults = () => ({});
|
|
251
|
+
const create = (() => {
|
|
252
|
+
return uniffiCreateRecord(defaults);
|
|
253
|
+
})();
|
|
254
|
+
return Object.freeze({
|
|
255
|
+
/**
|
|
256
|
+
* Create a frozen instance of {@link DeviceBindings}, with defaults specified
|
|
257
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
258
|
+
*/
|
|
259
|
+
create,
|
|
260
|
+
/**
|
|
261
|
+
* Create a frozen instance of {@link DeviceBindings}, with defaults specified
|
|
262
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
263
|
+
*/
|
|
264
|
+
new: create,
|
|
265
|
+
/**
|
|
266
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
267
|
+
*/
|
|
268
|
+
defaults: () => Object.freeze(defaults())
|
|
269
|
+
});
|
|
270
|
+
})();
|
|
271
|
+
const FfiConverterTypeDeviceBindings = (() => {
|
|
272
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
273
|
+
read(from) {
|
|
274
|
+
return {
|
|
275
|
+
appId: FfiConverterString.read(from),
|
|
276
|
+
deviceKeyId: FfiConverterString.read(from),
|
|
277
|
+
attestation: FfiConverterString.read(from),
|
|
278
|
+
assertion: FfiConverterString.read(from)
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
write(value, into) {
|
|
282
|
+
FfiConverterString.write(value.appId, into);
|
|
283
|
+
FfiConverterString.write(value.deviceKeyId, into);
|
|
284
|
+
FfiConverterString.write(value.attestation, into);
|
|
285
|
+
FfiConverterString.write(value.assertion, into);
|
|
286
|
+
}
|
|
287
|
+
allocationSize(value) {
|
|
288
|
+
return FfiConverterString.allocationSize(value.appId) + FfiConverterString.allocationSize(value.deviceKeyId) + FfiConverterString.allocationSize(value.attestation) + FfiConverterString.allocationSize(value.assertion);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return new FFIConverter();
|
|
292
|
+
})();
|
|
293
|
+
/**
|
|
294
|
+
* Generated factory for {@link Exclusion} record objects.
|
|
295
|
+
*/
|
|
296
|
+
export const Exclusion = (() => {
|
|
297
|
+
const defaults = () => ({});
|
|
298
|
+
const create = (() => {
|
|
299
|
+
return uniffiCreateRecord(defaults);
|
|
300
|
+
})();
|
|
301
|
+
return Object.freeze({
|
|
302
|
+
/**
|
|
303
|
+
* Create a frozen instance of {@link Exclusion}, with defaults specified
|
|
304
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
305
|
+
*/
|
|
306
|
+
create,
|
|
307
|
+
/**
|
|
308
|
+
* Create a frozen instance of {@link Exclusion}, with defaults specified
|
|
309
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
310
|
+
*/
|
|
311
|
+
new: create,
|
|
312
|
+
/**
|
|
313
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
314
|
+
*/
|
|
315
|
+
defaults: () => Object.freeze(defaults())
|
|
316
|
+
});
|
|
317
|
+
})();
|
|
318
|
+
const FfiConverterTypeExclusion = (() => {
|
|
319
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
320
|
+
read(from) {
|
|
321
|
+
return {
|
|
322
|
+
start: FfiConverterUInt64.read(from),
|
|
323
|
+
length: FfiConverterUInt64.read(from)
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
write(value, into) {
|
|
327
|
+
FfiConverterUInt64.write(value.start, into);
|
|
328
|
+
FfiConverterUInt64.write(value.length, into);
|
|
329
|
+
}
|
|
330
|
+
allocationSize(value) {
|
|
331
|
+
return FfiConverterUInt64.allocationSize(value.start) + FfiConverterUInt64.allocationSize(value.length);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return new FFIConverter();
|
|
335
|
+
})();
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Film style (filter) information captured at the time of photo/video creation.
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Generated factory for {@link FilmStyleInfo} record objects.
|
|
343
|
+
*/
|
|
344
|
+
export const FilmStyleInfo = (() => {
|
|
345
|
+
const defaults = () => ({});
|
|
346
|
+
const create = (() => {
|
|
347
|
+
return uniffiCreateRecord(defaults);
|
|
348
|
+
})();
|
|
349
|
+
return Object.freeze({
|
|
350
|
+
/**
|
|
351
|
+
* Create a frozen instance of {@link FilmStyleInfo}, with defaults specified
|
|
352
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
353
|
+
*/
|
|
354
|
+
create,
|
|
355
|
+
/**
|
|
356
|
+
* Create a frozen instance of {@link FilmStyleInfo}, with defaults specified
|
|
357
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
358
|
+
*/
|
|
359
|
+
new: create,
|
|
360
|
+
/**
|
|
361
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
362
|
+
*/
|
|
363
|
+
defaults: () => Object.freeze(defaults())
|
|
364
|
+
});
|
|
365
|
+
})();
|
|
366
|
+
const FfiConverterTypeFilmStyleInfo = (() => {
|
|
367
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
368
|
+
read(from) {
|
|
369
|
+
return {
|
|
370
|
+
name: FfiConverterString.read(from),
|
|
371
|
+
source: FfiConverterString.read(from),
|
|
372
|
+
recipe: FfiConverterString.read(from)
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
write(value, into) {
|
|
376
|
+
FfiConverterString.write(value.name, into);
|
|
377
|
+
FfiConverterString.write(value.source, into);
|
|
378
|
+
FfiConverterString.write(value.recipe, into);
|
|
379
|
+
}
|
|
380
|
+
allocationSize(value) {
|
|
381
|
+
return FfiConverterString.allocationSize(value.name) + FfiConverterString.allocationSize(value.source) + FfiConverterString.allocationSize(value.recipe);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return new FFIConverter();
|
|
385
|
+
})();
|
|
386
|
+
/**
|
|
387
|
+
* Generated factory for {@link PhotoMetadataInfo} record objects.
|
|
388
|
+
*/
|
|
389
|
+
export const PhotoMetadataInfo = (() => {
|
|
390
|
+
const defaults = () => ({});
|
|
391
|
+
const create = (() => {
|
|
392
|
+
return uniffiCreateRecord(defaults);
|
|
393
|
+
})();
|
|
394
|
+
return Object.freeze({
|
|
395
|
+
/**
|
|
396
|
+
* Create a frozen instance of {@link PhotoMetadataInfo}, with defaults specified
|
|
397
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
398
|
+
*/
|
|
399
|
+
create,
|
|
400
|
+
/**
|
|
401
|
+
* Create a frozen instance of {@link PhotoMetadataInfo}, with defaults specified
|
|
402
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
403
|
+
*/
|
|
404
|
+
new: create,
|
|
405
|
+
/**
|
|
406
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
407
|
+
*/
|
|
408
|
+
defaults: () => Object.freeze(defaults())
|
|
409
|
+
});
|
|
410
|
+
})();
|
|
411
|
+
const FfiConverterTypePhotoMetadataInfo = (() => {
|
|
412
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
413
|
+
read(from) {
|
|
414
|
+
return {
|
|
415
|
+
deviceMake: FfiConverterString.read(from),
|
|
416
|
+
deviceModel: FfiConverterString.read(from),
|
|
417
|
+
softwareVersion: FfiConverterString.read(from),
|
|
418
|
+
xResolution: FfiConverterUInt32.read(from),
|
|
419
|
+
yResolution: FfiConverterUInt32.read(from),
|
|
420
|
+
orientation: FfiConverterUInt32.read(from),
|
|
421
|
+
iso: FfiConverterString.read(from),
|
|
422
|
+
exposureTime: FfiConverterUInt32.read(from),
|
|
423
|
+
depthOfField: FfiConverterUInt32.read(from),
|
|
424
|
+
focalLength: FfiConverterUInt32.read(from),
|
|
425
|
+
authenticityData: FfiConverterTypeAuthenticityData.read(from),
|
|
426
|
+
depthData: FfiConverterOptionalTypeDepthData.read(from),
|
|
427
|
+
filmStyle: FfiConverterOptionalTypeFilmStyleInfo.read(from)
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
write(value, into) {
|
|
431
|
+
FfiConverterString.write(value.deviceMake, into);
|
|
432
|
+
FfiConverterString.write(value.deviceModel, into);
|
|
433
|
+
FfiConverterString.write(value.softwareVersion, into);
|
|
434
|
+
FfiConverterUInt32.write(value.xResolution, into);
|
|
435
|
+
FfiConverterUInt32.write(value.yResolution, into);
|
|
436
|
+
FfiConverterUInt32.write(value.orientation, into);
|
|
437
|
+
FfiConverterString.write(value.iso, into);
|
|
438
|
+
FfiConverterUInt32.write(value.exposureTime, into);
|
|
439
|
+
FfiConverterUInt32.write(value.depthOfField, into);
|
|
440
|
+
FfiConverterUInt32.write(value.focalLength, into);
|
|
441
|
+
FfiConverterTypeAuthenticityData.write(value.authenticityData, into);
|
|
442
|
+
FfiConverterOptionalTypeDepthData.write(value.depthData, into);
|
|
443
|
+
FfiConverterOptionalTypeFilmStyleInfo.write(value.filmStyle, into);
|
|
444
|
+
}
|
|
445
|
+
allocationSize(value) {
|
|
446
|
+
return FfiConverterString.allocationSize(value.deviceMake) + FfiConverterString.allocationSize(value.deviceModel) + FfiConverterString.allocationSize(value.softwareVersion) + FfiConverterUInt32.allocationSize(value.xResolution) + FfiConverterUInt32.allocationSize(value.yResolution) + FfiConverterUInt32.allocationSize(value.orientation) + FfiConverterString.allocationSize(value.iso) + FfiConverterUInt32.allocationSize(value.exposureTime) + FfiConverterUInt32.allocationSize(value.depthOfField) + FfiConverterUInt32.allocationSize(value.focalLength) + FfiConverterTypeAuthenticityData.allocationSize(value.authenticityData) + FfiConverterOptionalTypeDepthData.allocationSize(value.depthData) + FfiConverterOptionalTypeFilmStyleInfo.allocationSize(value.filmStyle);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return new FFIConverter();
|
|
450
|
+
})();
|
|
451
|
+
/**
|
|
452
|
+
* Generated factory for {@link Proof} record objects.
|
|
453
|
+
*/
|
|
454
|
+
export const Proof = (() => {
|
|
455
|
+
const defaults = () => ({});
|
|
456
|
+
const create = (() => {
|
|
457
|
+
return uniffiCreateRecord(defaults);
|
|
458
|
+
})();
|
|
459
|
+
return Object.freeze({
|
|
460
|
+
/**
|
|
461
|
+
* Create a frozen instance of {@link Proof}, with defaults specified
|
|
462
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
463
|
+
*/
|
|
464
|
+
create,
|
|
465
|
+
/**
|
|
466
|
+
* Create a frozen instance of {@link Proof}, with defaults specified
|
|
467
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
468
|
+
*/
|
|
469
|
+
new: create,
|
|
470
|
+
/**
|
|
471
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
472
|
+
*/
|
|
473
|
+
defaults: () => Object.freeze(defaults())
|
|
474
|
+
});
|
|
475
|
+
})();
|
|
476
|
+
const FfiConverterTypeProof = (() => {
|
|
477
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
478
|
+
read(from) {
|
|
479
|
+
return {
|
|
480
|
+
data: FfiConverterString.read(from),
|
|
481
|
+
vkHash: FfiConverterString.read(from)
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
write(value, into) {
|
|
485
|
+
FfiConverterString.write(value.data, into);
|
|
486
|
+
FfiConverterString.write(value.vkHash, into);
|
|
487
|
+
}
|
|
488
|
+
allocationSize(value) {
|
|
489
|
+
return FfiConverterString.allocationSize(value.data) + FfiConverterString.allocationSize(value.vkHash);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return new FFIConverter();
|
|
493
|
+
})();
|
|
494
|
+
/**
|
|
495
|
+
* Generated factory for {@link VideoMetadataInfo} record objects.
|
|
496
|
+
*/
|
|
497
|
+
export const VideoMetadataInfo = (() => {
|
|
498
|
+
const defaults = () => ({});
|
|
499
|
+
const create = (() => {
|
|
500
|
+
return uniffiCreateRecord(defaults);
|
|
501
|
+
})();
|
|
502
|
+
return Object.freeze({
|
|
503
|
+
/**
|
|
504
|
+
* Create a frozen instance of {@link VideoMetadataInfo}, with defaults specified
|
|
505
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
506
|
+
*/
|
|
507
|
+
create,
|
|
508
|
+
/**
|
|
509
|
+
* Create a frozen instance of {@link VideoMetadataInfo}, with defaults specified
|
|
510
|
+
* in Rust, in the {@link zcam1_c2pa_utils} crate.
|
|
511
|
+
*/
|
|
512
|
+
new: create,
|
|
513
|
+
/**
|
|
514
|
+
* Defaults specified in the {@link zcam1_c2pa_utils} crate.
|
|
515
|
+
*/
|
|
516
|
+
defaults: () => Object.freeze(defaults())
|
|
517
|
+
});
|
|
518
|
+
})();
|
|
519
|
+
const FfiConverterTypeVideoMetadataInfo = (() => {
|
|
520
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
521
|
+
read(from) {
|
|
522
|
+
return {
|
|
523
|
+
deviceMake: FfiConverterString.read(from),
|
|
524
|
+
deviceModel: FfiConverterString.read(from),
|
|
525
|
+
softwareVersion: FfiConverterString.read(from),
|
|
526
|
+
format: FfiConverterString.read(from),
|
|
527
|
+
hasAudio: FfiConverterBool.read(from),
|
|
528
|
+
durationSeconds: FfiConverterUInt32.read(from),
|
|
529
|
+
fileSizeBytes: FfiConverterUInt32.read(from),
|
|
530
|
+
width: FfiConverterUInt32.read(from),
|
|
531
|
+
height: FfiConverterUInt32.read(from),
|
|
532
|
+
rotationDegrees: FfiConverterUInt32.read(from),
|
|
533
|
+
frameRate: FfiConverterUInt32.read(from),
|
|
534
|
+
videoCodec: FfiConverterOptionalString.read(from),
|
|
535
|
+
audioCodec: FfiConverterOptionalString.read(from),
|
|
536
|
+
audioSampleRate: FfiConverterOptionalUInt32.read(from),
|
|
537
|
+
audioChannels: FfiConverterOptionalUInt32.read(from),
|
|
538
|
+
authenticityData: FfiConverterTypeAuthenticityData.read(from),
|
|
539
|
+
filmStyle: FfiConverterOptionalTypeFilmStyleInfo.read(from)
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
write(value, into) {
|
|
543
|
+
FfiConverterString.write(value.deviceMake, into);
|
|
544
|
+
FfiConverterString.write(value.deviceModel, into);
|
|
545
|
+
FfiConverterString.write(value.softwareVersion, into);
|
|
546
|
+
FfiConverterString.write(value.format, into);
|
|
547
|
+
FfiConverterBool.write(value.hasAudio, into);
|
|
548
|
+
FfiConverterUInt32.write(value.durationSeconds, into);
|
|
549
|
+
FfiConverterUInt32.write(value.fileSizeBytes, into);
|
|
550
|
+
FfiConverterUInt32.write(value.width, into);
|
|
551
|
+
FfiConverterUInt32.write(value.height, into);
|
|
552
|
+
FfiConverterUInt32.write(value.rotationDegrees, into);
|
|
553
|
+
FfiConverterUInt32.write(value.frameRate, into);
|
|
554
|
+
FfiConverterOptionalString.write(value.videoCodec, into);
|
|
555
|
+
FfiConverterOptionalString.write(value.audioCodec, into);
|
|
556
|
+
FfiConverterOptionalUInt32.write(value.audioSampleRate, into);
|
|
557
|
+
FfiConverterOptionalUInt32.write(value.audioChannels, into);
|
|
558
|
+
FfiConverterTypeAuthenticityData.write(value.authenticityData, into);
|
|
559
|
+
FfiConverterOptionalTypeFilmStyleInfo.write(value.filmStyle, into);
|
|
560
|
+
}
|
|
561
|
+
allocationSize(value) {
|
|
562
|
+
return FfiConverterString.allocationSize(value.deviceMake) + FfiConverterString.allocationSize(value.deviceModel) + FfiConverterString.allocationSize(value.softwareVersion) + FfiConverterString.allocationSize(value.format) + FfiConverterBool.allocationSize(value.hasAudio) + FfiConverterUInt32.allocationSize(value.durationSeconds) + FfiConverterUInt32.allocationSize(value.fileSizeBytes) + FfiConverterUInt32.allocationSize(value.width) + FfiConverterUInt32.allocationSize(value.height) + FfiConverterUInt32.allocationSize(value.rotationDegrees) + FfiConverterUInt32.allocationSize(value.frameRate) + FfiConverterOptionalString.allocationSize(value.videoCodec) + FfiConverterOptionalString.allocationSize(value.audioCodec) + FfiConverterOptionalUInt32.allocationSize(value.audioSampleRate) + FfiConverterOptionalUInt32.allocationSize(value.audioChannels) + FfiConverterTypeAuthenticityData.allocationSize(value.authenticityData) + FfiConverterOptionalTypeFilmStyleInfo.allocationSize(value.filmStyle);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return new FFIConverter();
|
|
566
|
+
})();
|
|
567
|
+
const stringConverter = {
|
|
568
|
+
stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
|
|
569
|
+
bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
|
|
570
|
+
stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
|
|
571
|
+
};
|
|
572
|
+
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
573
|
+
export let AuthenticityStatus = /*#__PURE__*/function (AuthenticityStatus) {
|
|
574
|
+
AuthenticityStatus[AuthenticityStatus["Unknown"] = 0] = "Unknown";
|
|
575
|
+
AuthenticityStatus[AuthenticityStatus["NoManifest"] = 1] = "NoManifest";
|
|
576
|
+
AuthenticityStatus[AuthenticityStatus["InvalidManifest"] = 2] = "InvalidManifest";
|
|
577
|
+
AuthenticityStatus[AuthenticityStatus["Bindings"] = 3] = "Bindings";
|
|
578
|
+
AuthenticityStatus[AuthenticityStatus["Proof"] = 4] = "Proof";
|
|
579
|
+
return AuthenticityStatus;
|
|
580
|
+
}({});
|
|
581
|
+
const FfiConverterTypeAuthenticityStatus = (() => {
|
|
582
|
+
const ordinalConverter = FfiConverterInt32;
|
|
583
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
584
|
+
read(from) {
|
|
585
|
+
switch (ordinalConverter.read(from)) {
|
|
586
|
+
case 1:
|
|
587
|
+
return AuthenticityStatus.Unknown;
|
|
588
|
+
case 2:
|
|
589
|
+
return AuthenticityStatus.NoManifest;
|
|
590
|
+
case 3:
|
|
591
|
+
return AuthenticityStatus.InvalidManifest;
|
|
592
|
+
case 4:
|
|
593
|
+
return AuthenticityStatus.Bindings;
|
|
594
|
+
case 5:
|
|
595
|
+
return AuthenticityStatus.Proof;
|
|
596
|
+
default:
|
|
597
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
write(value, into) {
|
|
601
|
+
switch (value) {
|
|
602
|
+
case AuthenticityStatus.Unknown:
|
|
603
|
+
return ordinalConverter.write(1, into);
|
|
604
|
+
case AuthenticityStatus.NoManifest:
|
|
605
|
+
return ordinalConverter.write(2, into);
|
|
606
|
+
case AuthenticityStatus.InvalidManifest:
|
|
607
|
+
return ordinalConverter.write(3, into);
|
|
608
|
+
case AuthenticityStatus.Bindings:
|
|
609
|
+
return ordinalConverter.write(4, into);
|
|
610
|
+
case AuthenticityStatus.Proof:
|
|
611
|
+
return ordinalConverter.write(5, into);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
allocationSize(value) {
|
|
615
|
+
return ordinalConverter.allocationSize(0);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return new FFIConverter();
|
|
619
|
+
})();
|
|
620
|
+
|
|
621
|
+
// Flat error type: C2paError
|
|
622
|
+
export let C2paError_Tags = /*#__PURE__*/function (C2paError_Tags) {
|
|
623
|
+
C2paError_Tags["C2pa"] = "C2pa";
|
|
624
|
+
C2paError_Tags["Json"] = "Json";
|
|
625
|
+
C2paError_Tags["Io"] = "Io";
|
|
626
|
+
C2paError_Tags["Base64"] = "Base64";
|
|
627
|
+
C2paError_Tags["NoActiveManifest"] = "NoActiveManifest";
|
|
628
|
+
C2paError_Tags["NoHash"] = "NoHash";
|
|
629
|
+
C2paError_Tags["FormatNotSupported"] = "FormatNotSupported";
|
|
630
|
+
C2paError_Tags["Poisoned"] = "Poisoned";
|
|
631
|
+
return C2paError_Tags;
|
|
632
|
+
}({});
|
|
633
|
+
export const C2paError = (() => {
|
|
634
|
+
class C2pa extends UniffiError {
|
|
635
|
+
/**
|
|
636
|
+
* @private
|
|
637
|
+
* This field is private and should not be used.
|
|
638
|
+
*/
|
|
639
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
640
|
+
/**
|
|
641
|
+
* @private
|
|
642
|
+
* This field is private and should not be used.
|
|
643
|
+
*/
|
|
644
|
+
[variantOrdinalSymbol] = 1;
|
|
645
|
+
tag = C2paError_Tags.C2pa;
|
|
646
|
+
constructor(message) {
|
|
647
|
+
super("C2paError", "C2pa", message);
|
|
648
|
+
}
|
|
649
|
+
static instanceOf(e) {
|
|
650
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 1;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
class Json extends UniffiError {
|
|
654
|
+
/**
|
|
655
|
+
* @private
|
|
656
|
+
* This field is private and should not be used.
|
|
657
|
+
*/
|
|
658
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
659
|
+
/**
|
|
660
|
+
* @private
|
|
661
|
+
* This field is private and should not be used.
|
|
662
|
+
*/
|
|
663
|
+
[variantOrdinalSymbol] = 2;
|
|
664
|
+
tag = C2paError_Tags.Json;
|
|
665
|
+
constructor(message) {
|
|
666
|
+
super("C2paError", "Json", message);
|
|
667
|
+
}
|
|
668
|
+
static instanceOf(e) {
|
|
669
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 2;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
class Io extends UniffiError {
|
|
673
|
+
/**
|
|
674
|
+
* @private
|
|
675
|
+
* This field is private and should not be used.
|
|
676
|
+
*/
|
|
677
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
678
|
+
/**
|
|
679
|
+
* @private
|
|
680
|
+
* This field is private and should not be used.
|
|
681
|
+
*/
|
|
682
|
+
[variantOrdinalSymbol] = 3;
|
|
683
|
+
tag = C2paError_Tags.Io;
|
|
684
|
+
constructor(message) {
|
|
685
|
+
super("C2paError", "Io", message);
|
|
686
|
+
}
|
|
687
|
+
static instanceOf(e) {
|
|
688
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 3;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
class Base64 extends UniffiError {
|
|
692
|
+
/**
|
|
693
|
+
* @private
|
|
694
|
+
* This field is private and should not be used.
|
|
695
|
+
*/
|
|
696
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
697
|
+
/**
|
|
698
|
+
* @private
|
|
699
|
+
* This field is private and should not be used.
|
|
700
|
+
*/
|
|
701
|
+
[variantOrdinalSymbol] = 4;
|
|
702
|
+
tag = C2paError_Tags.Base64;
|
|
703
|
+
constructor(message) {
|
|
704
|
+
super("C2paError", "Base64", message);
|
|
705
|
+
}
|
|
706
|
+
static instanceOf(e) {
|
|
707
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 4;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
class NoActiveManifest extends UniffiError {
|
|
711
|
+
/**
|
|
712
|
+
* @private
|
|
713
|
+
* This field is private and should not be used.
|
|
714
|
+
*/
|
|
715
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
716
|
+
/**
|
|
717
|
+
* @private
|
|
718
|
+
* This field is private and should not be used.
|
|
719
|
+
*/
|
|
720
|
+
[variantOrdinalSymbol] = 5;
|
|
721
|
+
tag = C2paError_Tags.NoActiveManifest;
|
|
722
|
+
constructor(message) {
|
|
723
|
+
super("C2paError", "NoActiveManifest", message);
|
|
724
|
+
}
|
|
725
|
+
static instanceOf(e) {
|
|
726
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 5;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
class NoHash extends UniffiError {
|
|
730
|
+
/**
|
|
731
|
+
* @private
|
|
732
|
+
* This field is private and should not be used.
|
|
733
|
+
*/
|
|
734
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
735
|
+
/**
|
|
736
|
+
* @private
|
|
737
|
+
* This field is private and should not be used.
|
|
738
|
+
*/
|
|
739
|
+
[variantOrdinalSymbol] = 6;
|
|
740
|
+
tag = C2paError_Tags.NoHash;
|
|
741
|
+
constructor(message) {
|
|
742
|
+
super("C2paError", "NoHash", message);
|
|
743
|
+
}
|
|
744
|
+
static instanceOf(e) {
|
|
745
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 6;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
class FormatNotSupported extends UniffiError {
|
|
749
|
+
/**
|
|
750
|
+
* @private
|
|
751
|
+
* This field is private and should not be used.
|
|
752
|
+
*/
|
|
753
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
754
|
+
/**
|
|
755
|
+
* @private
|
|
756
|
+
* This field is private and should not be used.
|
|
757
|
+
*/
|
|
758
|
+
[variantOrdinalSymbol] = 7;
|
|
759
|
+
tag = C2paError_Tags.FormatNotSupported;
|
|
760
|
+
constructor(message) {
|
|
761
|
+
super("C2paError", "FormatNotSupported", message);
|
|
762
|
+
}
|
|
763
|
+
static instanceOf(e) {
|
|
764
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 7;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
class Poisoned extends UniffiError {
|
|
768
|
+
/**
|
|
769
|
+
* @private
|
|
770
|
+
* This field is private and should not be used.
|
|
771
|
+
*/
|
|
772
|
+
[uniffiTypeNameSymbol] = "C2paError";
|
|
773
|
+
/**
|
|
774
|
+
* @private
|
|
775
|
+
* This field is private and should not be used.
|
|
776
|
+
*/
|
|
777
|
+
[variantOrdinalSymbol] = 8;
|
|
778
|
+
tag = C2paError_Tags.Poisoned;
|
|
779
|
+
constructor(message) {
|
|
780
|
+
super("C2paError", "Poisoned", message);
|
|
781
|
+
}
|
|
782
|
+
static instanceOf(e) {
|
|
783
|
+
return instanceOf(e) && e[variantOrdinalSymbol] === 8;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// Utility function which does not rely on instanceof.
|
|
788
|
+
function instanceOf(e) {
|
|
789
|
+
return e[uniffiTypeNameSymbol] === "C2paError";
|
|
790
|
+
}
|
|
791
|
+
return {
|
|
792
|
+
C2pa,
|
|
793
|
+
Json,
|
|
794
|
+
Io,
|
|
795
|
+
Base64,
|
|
796
|
+
NoActiveManifest,
|
|
797
|
+
NoHash,
|
|
798
|
+
FormatNotSupported,
|
|
799
|
+
Poisoned,
|
|
800
|
+
instanceOf
|
|
801
|
+
};
|
|
802
|
+
})();
|
|
803
|
+
|
|
804
|
+
// Union type for C2paError error type.
|
|
805
|
+
|
|
806
|
+
const FfiConverterTypeC2paError = (() => {
|
|
807
|
+
const intConverter = FfiConverterInt32;
|
|
808
|
+
class FfiConverter extends AbstractFfiConverterByteArray {
|
|
809
|
+
read(from) {
|
|
810
|
+
switch (intConverter.read(from)) {
|
|
811
|
+
case 1:
|
|
812
|
+
return new C2paError.C2pa(FfiConverterString.read(from));
|
|
813
|
+
case 2:
|
|
814
|
+
return new C2paError.Json(FfiConverterString.read(from));
|
|
815
|
+
case 3:
|
|
816
|
+
return new C2paError.Io(FfiConverterString.read(from));
|
|
817
|
+
case 4:
|
|
818
|
+
return new C2paError.Base64(FfiConverterString.read(from));
|
|
819
|
+
case 5:
|
|
820
|
+
return new C2paError.NoActiveManifest(FfiConverterString.read(from));
|
|
821
|
+
case 6:
|
|
822
|
+
return new C2paError.NoHash(FfiConverterString.read(from));
|
|
823
|
+
case 7:
|
|
824
|
+
return new C2paError.FormatNotSupported(FfiConverterString.read(from));
|
|
825
|
+
case 8:
|
|
826
|
+
return new C2paError.Poisoned(FfiConverterString.read(from));
|
|
827
|
+
default:
|
|
828
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
write(value, into) {
|
|
832
|
+
const obj = value;
|
|
833
|
+
const index = obj[variantOrdinalSymbol];
|
|
834
|
+
intConverter.write(index, into);
|
|
835
|
+
}
|
|
836
|
+
allocationSize(value) {
|
|
837
|
+
return intConverter.allocationSize(0);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return new FfiConverter();
|
|
841
|
+
})();
|
|
842
|
+
export class Manifest extends UniffiAbstractObject {
|
|
843
|
+
[uniffiTypeNameSymbol] = "Manifest";
|
|
844
|
+
// No primary constructor declared for this class.
|
|
845
|
+
constructor(pointer) {
|
|
846
|
+
super();
|
|
847
|
+
this[pointerLiteralSymbol] = pointer;
|
|
848
|
+
this[destructorGuardSymbol] = uniffiTypeManifestObjectFactory.bless(pointer);
|
|
849
|
+
}
|
|
850
|
+
bindings() {
|
|
851
|
+
return FfiConverterOptionalTypeDeviceBindings.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
852
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifest_bindings(uniffiTypeManifestObjectFactory.clonePointer(this), callStatus);
|
|
853
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
854
|
+
}
|
|
855
|
+
captureMetadataAction() /*throws*/{
|
|
856
|
+
return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
857
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifest_capture_metadata_action(uniffiTypeManifestObjectFactory.clonePointer(this), callStatus);
|
|
858
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
859
|
+
}
|
|
860
|
+
proof() {
|
|
861
|
+
return FfiConverterOptionalTypeProof.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
862
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifest_proof(uniffiTypeManifestObjectFactory.clonePointer(this), callStatus);
|
|
863
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
868
|
+
*/
|
|
869
|
+
uniffiDestroy() {
|
|
870
|
+
const ptr = this[destructorGuardSymbol];
|
|
871
|
+
if (ptr !== undefined) {
|
|
872
|
+
const pointer = uniffiTypeManifestObjectFactory.pointer(this);
|
|
873
|
+
uniffiTypeManifestObjectFactory.freePointer(pointer);
|
|
874
|
+
uniffiTypeManifestObjectFactory.unbless(ptr);
|
|
875
|
+
delete this[destructorGuardSymbol];
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
static instanceOf(obj) {
|
|
879
|
+
return uniffiTypeManifestObjectFactory.isConcreteType(obj);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
const uniffiTypeManifestObjectFactory = (() => {
|
|
883
|
+
return {
|
|
884
|
+
create(pointer) {
|
|
885
|
+
const instance = Object.create(Manifest.prototype);
|
|
886
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
887
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
888
|
+
instance[uniffiTypeNameSymbol] = "Manifest";
|
|
889
|
+
return instance;
|
|
890
|
+
},
|
|
891
|
+
bless(p) {
|
|
892
|
+
return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_manifest_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
893
|
+
},
|
|
894
|
+
unbless(ptr) {
|
|
895
|
+
ptr.markDestroyed();
|
|
896
|
+
},
|
|
897
|
+
pointer(obj) {
|
|
898
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
899
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
900
|
+
}
|
|
901
|
+
return obj[pointerLiteralSymbol];
|
|
902
|
+
},
|
|
903
|
+
clonePointer(obj) {
|
|
904
|
+
const pointer = this.pointer(obj);
|
|
905
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_clone_manifest(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
906
|
+
},
|
|
907
|
+
freePointer(pointer) {
|
|
908
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_free_manifest(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
909
|
+
},
|
|
910
|
+
isConcreteType(obj) {
|
|
911
|
+
return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Manifest";
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
})();
|
|
915
|
+
// FfiConverter for ManifestInterface
|
|
916
|
+
const FfiConverterTypeManifest = new FfiConverterObject(uniffiTypeManifestObjectFactory);
|
|
917
|
+
export class ManifestEditor extends UniffiAbstractObject {
|
|
918
|
+
[uniffiTypeNameSymbol] = "ManifestEditor";
|
|
919
|
+
constructor(path, keyTag, certs) {
|
|
920
|
+
super();
|
|
921
|
+
const pointer = uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
922
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_constructor_manifesteditor_new(FfiConverterString.lower(path), FfiConverterArrayBuffer.lower(keyTag), FfiConverterString.lower(certs), callStatus);
|
|
923
|
+
}, /*liftString:*/FfiConverterString.lift);
|
|
924
|
+
this[pointerLiteralSymbol] = pointer;
|
|
925
|
+
this[destructorGuardSymbol] = uniffiTypeManifestEditorObjectFactory.bless(pointer);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Creates a builder from a file that is expected to contain an existing C2PA manifest.
|
|
930
|
+
*
|
|
931
|
+
* The metadata included in the manifest are kept.
|
|
932
|
+
*/
|
|
933
|
+
static fromManifest(path, keyTag, certs) /*throws*/{
|
|
934
|
+
return FfiConverterTypeManifestEditor.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
935
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_constructor_manifesteditor_from_manifest(FfiConverterString.lower(path), FfiConverterArrayBuffer.lower(keyTag), FfiConverterString.lower(certs), callStatus);
|
|
936
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
937
|
+
}
|
|
938
|
+
addAssertion(label, data) /*throws*/{
|
|
939
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
940
|
+
nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_add_assertion(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterString.lower(label), FfiConverterString.lower(data), callStatus);
|
|
941
|
+
}, /*liftString:*/FfiConverterString.lift);
|
|
942
|
+
}
|
|
943
|
+
addPhotoMetadataAction(parameters, when) /*throws*/{
|
|
944
|
+
return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
945
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_add_photo_metadata_action(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterTypePhotoMetadataInfo.lower(parameters), FfiConverterString.lower(when), callStatus);
|
|
946
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
947
|
+
}
|
|
948
|
+
addTitle(title) /*throws*/{
|
|
949
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
950
|
+
nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_add_title(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterString.lower(title), callStatus);
|
|
951
|
+
}, /*liftString:*/FfiConverterString.lift);
|
|
952
|
+
}
|
|
953
|
+
addVideoMetadataAction(parameters, when) /*throws*/{
|
|
954
|
+
return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
955
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_add_video_metadata_action(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterTypeVideoMetadataInfo.lower(parameters), FfiConverterString.lower(when), callStatus);
|
|
956
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
957
|
+
}
|
|
958
|
+
async embedManifestToFile(destination, format, asyncOpts_) /*throws*/{
|
|
959
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
960
|
+
try {
|
|
961
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
962
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_embed_manifest_to_file(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterString.lower(destination), FfiConverterString.lower(format));
|
|
963
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_zcam1_c2pa_utils_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError));
|
|
964
|
+
} catch (__error) {
|
|
965
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
966
|
+
__error.stack = __stack;
|
|
967
|
+
}
|
|
968
|
+
throw __error;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
removeAssertion(label) /*throws*/{
|
|
972
|
+
return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
973
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifesteditor_remove_assertion(uniffiTypeManifestEditorObjectFactory.clonePointer(this), FfiConverterString.lower(label), callStatus);
|
|
974
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
979
|
+
*/
|
|
980
|
+
uniffiDestroy() {
|
|
981
|
+
const ptr = this[destructorGuardSymbol];
|
|
982
|
+
if (ptr !== undefined) {
|
|
983
|
+
const pointer = uniffiTypeManifestEditorObjectFactory.pointer(this);
|
|
984
|
+
uniffiTypeManifestEditorObjectFactory.freePointer(pointer);
|
|
985
|
+
uniffiTypeManifestEditorObjectFactory.unbless(ptr);
|
|
986
|
+
delete this[destructorGuardSymbol];
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
static instanceOf(obj) {
|
|
990
|
+
return uniffiTypeManifestEditorObjectFactory.isConcreteType(obj);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
const uniffiTypeManifestEditorObjectFactory = (() => {
|
|
994
|
+
return {
|
|
995
|
+
create(pointer) {
|
|
996
|
+
const instance = Object.create(ManifestEditor.prototype);
|
|
997
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
998
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
999
|
+
instance[uniffiTypeNameSymbol] = "ManifestEditor";
|
|
1000
|
+
return instance;
|
|
1001
|
+
},
|
|
1002
|
+
bless(p) {
|
|
1003
|
+
return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_manifesteditor_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
1004
|
+
},
|
|
1005
|
+
unbless(ptr) {
|
|
1006
|
+
ptr.markDestroyed();
|
|
1007
|
+
},
|
|
1008
|
+
pointer(obj) {
|
|
1009
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
1010
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
1011
|
+
}
|
|
1012
|
+
return obj[pointerLiteralSymbol];
|
|
1013
|
+
},
|
|
1014
|
+
clonePointer(obj) {
|
|
1015
|
+
const pointer = this.pointer(obj);
|
|
1016
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_clone_manifesteditor(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
1017
|
+
},
|
|
1018
|
+
freePointer(pointer) {
|
|
1019
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_free_manifesteditor(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
1020
|
+
},
|
|
1021
|
+
isConcreteType(obj) {
|
|
1022
|
+
return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "ManifestEditor";
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
})();
|
|
1026
|
+
// FfiConverter for ManifestEditorInterface
|
|
1027
|
+
const FfiConverterTypeManifestEditor = new FfiConverterObject(uniffiTypeManifestEditorObjectFactory);
|
|
1028
|
+
export class ManifestStore extends UniffiAbstractObject {
|
|
1029
|
+
[uniffiTypeNameSymbol] = "ManifestStore";
|
|
1030
|
+
// No primary constructor declared for this class.
|
|
1031
|
+
constructor(pointer) {
|
|
1032
|
+
super();
|
|
1033
|
+
this[pointerLiteralSymbol] = pointer;
|
|
1034
|
+
this[destructorGuardSymbol] = uniffiTypeManifestStoreObjectFactory.bless(pointer);
|
|
1035
|
+
}
|
|
1036
|
+
activeManifest() /*throws*/{
|
|
1037
|
+
return FfiConverterTypeManifest.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeC2paError.lift.bind(FfiConverterTypeC2paError), /*caller:*/callStatus => {
|
|
1038
|
+
return nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_method_manifeststore_active_manifest(uniffiTypeManifestStoreObjectFactory.clonePointer(this), callStatus);
|
|
1039
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
1044
|
+
*/
|
|
1045
|
+
uniffiDestroy() {
|
|
1046
|
+
const ptr = this[destructorGuardSymbol];
|
|
1047
|
+
if (ptr !== undefined) {
|
|
1048
|
+
const pointer = uniffiTypeManifestStoreObjectFactory.pointer(this);
|
|
1049
|
+
uniffiTypeManifestStoreObjectFactory.freePointer(pointer);
|
|
1050
|
+
uniffiTypeManifestStoreObjectFactory.unbless(ptr);
|
|
1051
|
+
delete this[destructorGuardSymbol];
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
static instanceOf(obj) {
|
|
1055
|
+
return uniffiTypeManifestStoreObjectFactory.isConcreteType(obj);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
const uniffiTypeManifestStoreObjectFactory = (() => {
|
|
1059
|
+
return {
|
|
1060
|
+
create(pointer) {
|
|
1061
|
+
const instance = Object.create(ManifestStore.prototype);
|
|
1062
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
1063
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
1064
|
+
instance[uniffiTypeNameSymbol] = "ManifestStore";
|
|
1065
|
+
return instance;
|
|
1066
|
+
},
|
|
1067
|
+
bless(p) {
|
|
1068
|
+
return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_manifeststore_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
1069
|
+
},
|
|
1070
|
+
unbless(ptr) {
|
|
1071
|
+
ptr.markDestroyed();
|
|
1072
|
+
},
|
|
1073
|
+
pointer(obj) {
|
|
1074
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
1075
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
1076
|
+
}
|
|
1077
|
+
return obj[pointerLiteralSymbol];
|
|
1078
|
+
},
|
|
1079
|
+
clonePointer(obj) {
|
|
1080
|
+
const pointer = this.pointer(obj);
|
|
1081
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_clone_manifeststore(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
1082
|
+
},
|
|
1083
|
+
freePointer(pointer) {
|
|
1084
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_zcam1_c2pa_utils_fn_free_manifeststore(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
1085
|
+
},
|
|
1086
|
+
isConcreteType(obj) {
|
|
1087
|
+
return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "ManifestStore";
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
})();
|
|
1091
|
+
// FfiConverter for ManifestStoreInterface
|
|
1092
|
+
const FfiConverterTypeManifestStore = new FfiConverterObject(uniffiTypeManifestStoreObjectFactory);
|
|
1093
|
+
|
|
1094
|
+
// FfiConverter for DepthData | undefined
|
|
1095
|
+
const FfiConverterOptionalTypeDepthData = new FfiConverterOptional(FfiConverterTypeDepthData);
|
|
1096
|
+
|
|
1097
|
+
// FfiConverter for DeviceBindings | undefined
|
|
1098
|
+
const FfiConverterOptionalTypeDeviceBindings = new FfiConverterOptional(FfiConverterTypeDeviceBindings);
|
|
1099
|
+
|
|
1100
|
+
// FfiConverter for FilmStyleInfo | undefined
|
|
1101
|
+
const FfiConverterOptionalTypeFilmStyleInfo = new FfiConverterOptional(FfiConverterTypeFilmStyleInfo);
|
|
1102
|
+
|
|
1103
|
+
// FfiConverter for Proof | undefined
|
|
1104
|
+
const FfiConverterOptionalTypeProof = new FfiConverterOptional(FfiConverterTypeProof);
|
|
1105
|
+
|
|
1106
|
+
// FfiConverter for string | undefined
|
|
1107
|
+
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
1108
|
+
|
|
1109
|
+
// FfiConverter for /*u32*/number | undefined
|
|
1110
|
+
const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* This should be called before anything else.
|
|
1114
|
+
*
|
|
1115
|
+
* It is likely that this is being done for you by the library's `index.ts`.
|
|
1116
|
+
*
|
|
1117
|
+
* It checks versions of uniffi between when the Rust scaffolding was generated
|
|
1118
|
+
* and when the bindings were generated.
|
|
1119
|
+
*
|
|
1120
|
+
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
1121
|
+
*/
|
|
1122
|
+
function uniffiEnsureInitialized() {
|
|
1123
|
+
// Get the bindings contract version from our ComponentInterface
|
|
1124
|
+
const bindingsContractVersion = 29;
|
|
1125
|
+
// Get the scaffolding contract version by calling the into the dylib
|
|
1126
|
+
const scaffoldingContractVersion = nativeModule().ubrn_ffi_zcam1_c2pa_utils_uniffi_contract_version();
|
|
1127
|
+
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
1128
|
+
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
1129
|
+
}
|
|
1130
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_func_authenticity_status() !== 16408) {
|
|
1131
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_func_authenticity_status");
|
|
1132
|
+
}
|
|
1133
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_func_compute_hash() !== 19539) {
|
|
1134
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_func_compute_hash");
|
|
1135
|
+
}
|
|
1136
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_func_compute_hash_from_buffer() !== 10723) {
|
|
1137
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_func_compute_hash_from_buffer");
|
|
1138
|
+
}
|
|
1139
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_func_extract_manifest() !== 13636) {
|
|
1140
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_func_extract_manifest");
|
|
1141
|
+
}
|
|
1142
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_func_format_from_path() !== 30877) {
|
|
1143
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_func_format_from_path");
|
|
1144
|
+
}
|
|
1145
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifest_bindings() !== 48636) {
|
|
1146
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifest_bindings");
|
|
1147
|
+
}
|
|
1148
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifest_capture_metadata_action() !== 58322) {
|
|
1149
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifest_capture_metadata_action");
|
|
1150
|
+
}
|
|
1151
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifest_proof() !== 61561) {
|
|
1152
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifest_proof");
|
|
1153
|
+
}
|
|
1154
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_assertion() !== 1861) {
|
|
1155
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_assertion");
|
|
1156
|
+
}
|
|
1157
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_photo_metadata_action() !== 29229) {
|
|
1158
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_photo_metadata_action");
|
|
1159
|
+
}
|
|
1160
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_title() !== 41603) {
|
|
1161
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_title");
|
|
1162
|
+
}
|
|
1163
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_video_metadata_action() !== 1551) {
|
|
1164
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_add_video_metadata_action");
|
|
1165
|
+
}
|
|
1166
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_embed_manifest_to_file() !== 51702) {
|
|
1167
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_embed_manifest_to_file");
|
|
1168
|
+
}
|
|
1169
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_remove_assertion() !== 9530) {
|
|
1170
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifesteditor_remove_assertion");
|
|
1171
|
+
}
|
|
1172
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_method_manifeststore_active_manifest() !== 39667) {
|
|
1173
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_method_manifeststore_active_manifest");
|
|
1174
|
+
}
|
|
1175
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_constructor_manifesteditor_from_manifest() !== 16267) {
|
|
1176
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_constructor_manifesteditor_from_manifest");
|
|
1177
|
+
}
|
|
1178
|
+
if (nativeModule().ubrn_uniffi_zcam1_c2pa_utils_checksum_constructor_manifesteditor_new() !== 9414) {
|
|
1179
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zcam1_c2pa_utils_checksum_constructor_manifesteditor_new");
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
export default Object.freeze({
|
|
1183
|
+
initialize: uniffiEnsureInitialized,
|
|
1184
|
+
converters: {
|
|
1185
|
+
FfiConverterTypeAuthenticityData,
|
|
1186
|
+
FfiConverterTypeAuthenticityStatus,
|
|
1187
|
+
FfiConverterTypeC2paError,
|
|
1188
|
+
FfiConverterTypeClaim,
|
|
1189
|
+
FfiConverterTypeDepthData,
|
|
1190
|
+
FfiConverterTypeDepthDataStatistics,
|
|
1191
|
+
FfiConverterTypeDeviceBindings,
|
|
1192
|
+
FfiConverterTypeExclusion,
|
|
1193
|
+
FfiConverterTypeFilmStyleInfo,
|
|
1194
|
+
FfiConverterTypeManifest,
|
|
1195
|
+
FfiConverterTypeManifestEditor,
|
|
1196
|
+
FfiConverterTypeManifestStore,
|
|
1197
|
+
FfiConverterTypePhotoMetadataInfo,
|
|
1198
|
+
FfiConverterTypeProof,
|
|
1199
|
+
FfiConverterTypeVideoMetadataInfo
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
//# sourceMappingURL=zcam1_c2pa_utils.js.map
|