ffi-bindings 1.0.1 → 1.0.2

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.
@@ -1,4 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.UtdCause = exports.TrustRequirement = exports.SignatureState = exports.SecretsBundle = exports.QrCodeIntent = exports.LoginQrCodeDecodeError_Tags = exports.LoginQrCodeDecodeError = exports.LocalTrust = exports.IdentityState = exports.DecryptionSettings = exports.CrossSigningSecrets = exports.CollectStrategy = exports.BackupSecrets = void 0;
7
+ var wasmBundle = _interopRequireWildcard(require("./wasm-bindgen/index.js"));
8
+ var _uniffiBindgenReactNative = require("uniffi-bindgen-react-native");
1
9
  var _process;
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
2
11
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
12
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
4
13
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
@@ -12,19 +21,14 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
12
21
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
13
22
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
14
23
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
15
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
- // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
24
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
17
25
  // Trust me, you don't want to mess with it!
18
- /* tslint:disable */
19
- /* eslint-disable */
20
- // @ts-nocheck
21
- import * as wasmBundle from "./wasm-bindgen/index.js";
22
- import { AbstractFfiConverterByteArray, FfiConverterInt32, UniffiError, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
26
+ /* tslint:disable */ /* eslint-disable */ // @ts-nocheck
23
27
  // Get converters from the other files, if any.
24
28
  var nativeModule = function nativeModule() {
25
29
  return wasmBundle;
26
30
  };
27
- var uniffiCaller = new UniffiRustCaller(function () {
31
+ var uniffiCaller = new _uniffiBindgenReactNative.UniffiRustCaller(function () {
28
32
  return new wasmBundle.RustCallStatus();
29
33
  });
30
34
  var uniffiIsDebug =
@@ -32,30 +36,25 @@ var uniffiIsDebug =
32
36
  (typeof process === "undefined" ? "undefined" : _typeof(process)) !== "object" ||
33
37
  // @ts-ignore -- The process global might not be defined
34
38
  ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) !== "production" || false;
39
+ // Public interface members begin here.
40
+
41
+ /**
42
+ * Settings for decrypting messages
43
+ */
44
+
35
45
  /**
36
46
  * Generated factory for {@link DecryptionSettings} record objects.
37
47
  */
38
- export var DecryptionSettings = function () {
48
+ var DecryptionSettings = exports.DecryptionSettings = function () {
39
49
  var _defaults = function defaults() {
40
50
  return {};
41
51
  };
42
52
  var create = function () {
43
- return uniffiCreateRecord(_defaults);
53
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(_defaults);
44
54
  }();
45
55
  return Object.freeze({
46
- /**
47
- * Create a frozen instance of {@link DecryptionSettings}, with defaults specified
48
- * in Rust, in the {@link matrix_sdk_crypto} crate.
49
- */
50
56
  create: create,
51
- /**
52
- * Create a frozen instance of {@link DecryptionSettings}, with defaults specified
53
- * in Rust, in the {@link matrix_sdk_crypto} crate.
54
- */
55
57
  "new": create,
56
- /**
57
- * Defaults specified in the {@link matrix_sdk_crypto} crate.
58
- */
59
58
  defaults: function defaults() {
60
59
  return Object.freeze(_defaults());
61
60
  }
@@ -86,7 +85,7 @@ var FfiConverterTypeDecryptionSettings = function () {
86
85
  return FfiConverterTypeTrustRequirement.allocationSize(value.senderDeviceTrustRequirement);
87
86
  }
88
87
  }]);
89
- }(AbstractFfiConverterByteArray);
88
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
90
89
  ;
91
90
  return new FFIConverter();
92
91
  }();
@@ -105,15 +104,22 @@ var stringConverter = function () {
105
104
  }
106
105
  };
107
106
  }();
108
- var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
107
+ var FfiConverterString = (0, _uniffiBindgenReactNative.uniffiCreateFfiConverterString)(stringConverter);
108
+
109
109
  /**
110
110
  * Strategy to collect the devices that should receive room keys for the
111
111
  * current discussion.
112
112
  */
113
- export var CollectStrategy;
114
- (function (CollectStrategy) {
113
+ var CollectStrategy = exports.CollectStrategy = /*#__PURE__*/function (CollectStrategy) {
115
114
  /**
116
115
  * Share with all (unblacklisted) devices.
116
+ *
117
+ * Not recommended, per the guidance of [MSC4153].
118
+ *
119
+ * (Used by Element X and Element Web in the legacy, non-"exclude insecure
120
+ * devices" mode.)
121
+ *
122
+ * [MSC4153]: https://github.com/matrix-org/matrix-doc/pull/4153
117
123
  */
118
124
  CollectStrategy[CollectStrategy["AllDevices"] = 0] = "AllDevices";
119
125
  /**
@@ -131,12 +137,24 @@ export var CollectStrategy;
131
137
  *
132
138
  * Once the problematic devices are blacklisted or whitelisted the
133
139
  * caller can retry to share a second time.
140
+ *
141
+ * Not recommended, per the guidance of [MSC4153].
142
+ *
143
+ * [MSC4153]: https://github.com/matrix-org/matrix-doc/pull/4153
134
144
  */
135
145
  CollectStrategy[CollectStrategy["ErrorOnVerifiedUserProblem"] = 1] = "ErrorOnVerifiedUserProblem";
136
146
  /**
137
147
  * Share based on identity. Only distribute to devices signed by their
138
148
  * owner. If a user has no published identity he will not receive
139
149
  * any room keys.
150
+ *
151
+ * This is the recommended strategy: it is compliant with the guidance of
152
+ * [MSC4153].
153
+ *
154
+ * (Used by Element Web and Element X in the "exclude insecure devices"
155
+ * mode.)
156
+ *
157
+ * [MSC4153]: https://github.com/matrix-org/matrix-doc/pull/4153
140
158
  */
141
159
  CollectStrategy[CollectStrategy["IdentityBasedStrategy"] = 2] = "IdentityBasedStrategy";
142
160
  /**
@@ -147,11 +165,20 @@ export var CollectStrategy;
147
165
  * - It is signed by its owner identity, and this identity has been
148
166
  * trusted via interactive verification.
149
167
  * - It is the current own device of the user.
168
+ *
169
+ * This strategy is compliant with [MSC4153], but is probably too strict
170
+ * for normal use.
171
+ *
172
+ * (Used by Element Web when "only send messages to verified users" is
173
+ * enabled.)
174
+ *
175
+ * [MSC4153]: https://github.com/matrix-org/matrix-doc/pull/4153
150
176
  */
151
177
  CollectStrategy[CollectStrategy["OnlyTrustedDevices"] = 3] = "OnlyTrustedDevices";
152
- })(CollectStrategy || (CollectStrategy = {}));
178
+ return CollectStrategy;
179
+ }({});
153
180
  var FfiConverterTypeCollectStrategy = function () {
154
- var ordinalConverter = FfiConverterInt32;
181
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
155
182
  var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter2) {
156
183
  function FFIConverter() {
157
184
  _classCallCheck(this, FFIConverter);
@@ -171,7 +198,7 @@ var FfiConverterTypeCollectStrategy = function () {
171
198
  case 4:
172
199
  return CollectStrategy.OnlyTrustedDevices;
173
200
  default:
174
- throw new UniffiInternalError.UnexpectedEnumCase();
201
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
175
202
  }
176
203
  }
177
204
  }, {
@@ -194,14 +221,14 @@ var FfiConverterTypeCollectStrategy = function () {
194
221
  return ordinalConverter.allocationSize(0);
195
222
  }
196
223
  }]);
197
- }(AbstractFfiConverterByteArray);
224
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
198
225
  return new FFIConverter();
199
226
  }();
227
+
200
228
  /**
201
229
  * The state of an identity - verified, pinned etc.
202
230
  */
203
- export var IdentityState;
204
- (function (IdentityState) {
231
+ var IdentityState = exports.IdentityState = /*#__PURE__*/function (IdentityState) {
205
232
  /**
206
233
  * The user is verified with us
207
234
  */
@@ -227,9 +254,10 @@ export var IdentityState;
227
254
  * [`UserIdentity::withdraw_verification`] to make it pinned.
228
255
  */
229
256
  IdentityState[IdentityState["VerificationViolation"] = 3] = "VerificationViolation";
230
- })(IdentityState || (IdentityState = {}));
257
+ return IdentityState;
258
+ }({});
231
259
  var FfiConverterTypeIdentityState = function () {
232
- var ordinalConverter = FfiConverterInt32;
260
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
233
261
  var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter3) {
234
262
  function FFIConverter() {
235
263
  _classCallCheck(this, FFIConverter);
@@ -249,7 +277,7 @@ var FfiConverterTypeIdentityState = function () {
249
277
  case 4:
250
278
  return IdentityState.VerificationViolation;
251
279
  default:
252
- throw new UniffiInternalError.UnexpectedEnumCase();
280
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
253
281
  }
254
282
  }
255
283
  }, {
@@ -272,14 +300,14 @@ var FfiConverterTypeIdentityState = function () {
272
300
  return ordinalConverter.allocationSize(0);
273
301
  }
274
302
  }]);
275
- }(AbstractFfiConverterByteArray);
303
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
276
304
  return new FFIConverter();
277
305
  }();
306
+
278
307
  /**
279
308
  * The local trust state of a device.
280
309
  */
281
- export var LocalTrust;
282
- (function (LocalTrust) {
310
+ var LocalTrust = exports.LocalTrust = /*#__PURE__*/function (LocalTrust) {
283
311
  /**
284
312
  * The device has been verified and is trusted.
285
313
  */
@@ -296,9 +324,10 @@ export var LocalTrust;
296
324
  * The trust state is unset.
297
325
  */
298
326
  LocalTrust[LocalTrust["Unset"] = 3] = "Unset";
299
- })(LocalTrust || (LocalTrust = {}));
327
+ return LocalTrust;
328
+ }({});
300
329
  var FfiConverterTypeLocalTrust = function () {
301
- var ordinalConverter = FfiConverterInt32;
330
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
302
331
  var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter4) {
303
332
  function FFIConverter() {
304
333
  _classCallCheck(this, FFIConverter);
@@ -318,7 +347,7 @@ var FfiConverterTypeLocalTrust = function () {
318
347
  case 4:
319
348
  return LocalTrust.Unset;
320
349
  default:
321
- throw new UniffiInternalError.UnexpectedEnumCase();
350
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
322
351
  }
323
352
  }
324
353
  }, {
@@ -341,24 +370,25 @@ var FfiConverterTypeLocalTrust = function () {
341
370
  return ordinalConverter.allocationSize(0);
342
371
  }
343
372
  }]);
344
- }(AbstractFfiConverterByteArray);
373
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
345
374
  return new FFIConverter();
346
375
  }();
376
+
347
377
  // Flat error type: LoginQrCodeDecodeError
348
- export var LoginQrCodeDecodeError_Tags;
349
- (function (LoginQrCodeDecodeError_Tags) {
378
+ var LoginQrCodeDecodeError_Tags = exports.LoginQrCodeDecodeError_Tags = /*#__PURE__*/function (LoginQrCodeDecodeError_Tags) {
350
379
  LoginQrCodeDecodeError_Tags["NotEnoughData"] = "NotEnoughData";
351
380
  LoginQrCodeDecodeError_Tags["NotUtf8"] = "NotUtf8";
352
381
  LoginQrCodeDecodeError_Tags["UrlParse"] = "UrlParse";
353
- LoginQrCodeDecodeError_Tags["InvalidMode"] = "InvalidMode";
354
- LoginQrCodeDecodeError_Tags["InvalidVersion"] = "InvalidVersion";
382
+ LoginQrCodeDecodeError_Tags["InvalidIntent"] = "InvalidIntent";
383
+ LoginQrCodeDecodeError_Tags["InvalidType"] = "InvalidType";
355
384
  LoginQrCodeDecodeError_Tags["Base64"] = "Base64";
356
385
  LoginQrCodeDecodeError_Tags["InvalidPrefix"] = "InvalidPrefix";
357
- })(LoginQrCodeDecodeError_Tags || (LoginQrCodeDecodeError_Tags = {}));
386
+ return LoginQrCodeDecodeError_Tags;
387
+ }({});
358
388
  /**
359
389
  * Error type for the decoding of the [`QrCodeData`].
360
390
  */
361
- export var LoginQrCodeDecodeError = function () {
391
+ var LoginQrCodeDecodeError = exports.LoginQrCodeDecodeError = function () {
362
392
  /**
363
393
  * The QR code data is no long enough, it's missing some fields.
364
394
  */
@@ -371,12 +401,12 @@ export var LoginQrCodeDecodeError = function () {
371
401
  * @private
372
402
  * This field is private and should not be used.
373
403
  */
374
- _defineProperty(_this, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
404
+ _defineProperty(_this, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
375
405
  /**
376
406
  * @private
377
407
  * This field is private and should not be used.
378
408
  */
379
- _defineProperty(_this, variantOrdinalSymbol, 1);
409
+ _defineProperty(_this, _uniffiBindgenReactNative.variantOrdinalSymbol, 1);
380
410
  _defineProperty(_this, "tag", LoginQrCodeDecodeError_Tags.NotEnoughData);
381
411
  return _this;
382
412
  }
@@ -384,10 +414,10 @@ export var LoginQrCodeDecodeError = function () {
384
414
  return _createClass(NotEnoughData, null, [{
385
415
  key: "instanceOf",
386
416
  value: function instanceOf(e) {
387
- return _instanceOf(e) && e[variantOrdinalSymbol] === 1;
417
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 1;
388
418
  }
389
419
  }]);
390
- }(UniffiError);
420
+ }(_uniffiBindgenReactNative.UniffiError);
391
421
  /**
392
422
  * One of the URLs in the QR code data is not a valid UTF-8 encoded string.
393
423
  */
@@ -400,12 +430,12 @@ export var LoginQrCodeDecodeError = function () {
400
430
  * @private
401
431
  * This field is private and should not be used.
402
432
  */
403
- _defineProperty(_this2, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
433
+ _defineProperty(_this2, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
404
434
  /**
405
435
  * @private
406
436
  * This field is private and should not be used.
407
437
  */
408
- _defineProperty(_this2, variantOrdinalSymbol, 2);
438
+ _defineProperty(_this2, _uniffiBindgenReactNative.variantOrdinalSymbol, 2);
409
439
  _defineProperty(_this2, "tag", LoginQrCodeDecodeError_Tags.NotUtf8);
410
440
  return _this2;
411
441
  }
@@ -413,10 +443,10 @@ export var LoginQrCodeDecodeError = function () {
413
443
  return _createClass(NotUtf8, null, [{
414
444
  key: "instanceOf",
415
445
  value: function instanceOf(e) {
416
- return _instanceOf(e) && e[variantOrdinalSymbol] === 2;
446
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 2;
417
447
  }
418
448
  }]);
419
- }(UniffiError);
449
+ }(_uniffiBindgenReactNative.UniffiError);
420
450
  /**
421
451
  * One of the URLs in the QR code data could not be parsed.
422
452
  */
@@ -429,12 +459,12 @@ export var LoginQrCodeDecodeError = function () {
429
459
  * @private
430
460
  * This field is private and should not be used.
431
461
  */
432
- _defineProperty(_this3, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
462
+ _defineProperty(_this3, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
433
463
  /**
434
464
  * @private
435
465
  * This field is private and should not be used.
436
466
  */
437
- _defineProperty(_this3, variantOrdinalSymbol, 3);
467
+ _defineProperty(_this3, _uniffiBindgenReactNative.variantOrdinalSymbol, 3);
438
468
  _defineProperty(_this3, "tag", LoginQrCodeDecodeError_Tags.UrlParse);
439
469
  return _this3;
440
470
  }
@@ -442,69 +472,69 @@ export var LoginQrCodeDecodeError = function () {
442
472
  return _createClass(UrlParse, null, [{
443
473
  key: "instanceOf",
444
474
  value: function instanceOf(e) {
445
- return _instanceOf(e) && e[variantOrdinalSymbol] === 3;
475
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 3;
446
476
  }
447
477
  }]);
448
- }(UniffiError);
478
+ }(_uniffiBindgenReactNative.UniffiError);
449
479
  /**
450
- * The QR code data contains an invalid mode, we expect the login (0x03)
451
- * mode or the reciprocate mode (0x04).
480
+ * The QR code data contains an invalid intent, we expect the login
481
+ * intent or the reciprocate intent.
452
482
  */
453
- var InvalidMode = /*#__PURE__*/function (_UniffiError4) {
454
- function InvalidMode(message) {
483
+ var InvalidIntent = /*#__PURE__*/function (_UniffiError4) {
484
+ function InvalidIntent(message) {
455
485
  var _this4;
456
- _classCallCheck(this, InvalidMode);
457
- _this4 = _callSuper(this, InvalidMode, ["LoginQrCodeDecodeError", "InvalidMode", message]);
486
+ _classCallCheck(this, InvalidIntent);
487
+ _this4 = _callSuper(this, InvalidIntent, ["LoginQrCodeDecodeError", "InvalidIntent", message]);
458
488
  /**
459
489
  * @private
460
490
  * This field is private and should not be used.
461
491
  */
462
- _defineProperty(_this4, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
492
+ _defineProperty(_this4, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
463
493
  /**
464
494
  * @private
465
495
  * This field is private and should not be used.
466
496
  */
467
- _defineProperty(_this4, variantOrdinalSymbol, 4);
468
- _defineProperty(_this4, "tag", LoginQrCodeDecodeError_Tags.InvalidMode);
497
+ _defineProperty(_this4, _uniffiBindgenReactNative.variantOrdinalSymbol, 4);
498
+ _defineProperty(_this4, "tag", LoginQrCodeDecodeError_Tags.InvalidIntent);
469
499
  return _this4;
470
500
  }
471
- _inherits(InvalidMode, _UniffiError4);
472
- return _createClass(InvalidMode, null, [{
501
+ _inherits(InvalidIntent, _UniffiError4);
502
+ return _createClass(InvalidIntent, null, [{
473
503
  key: "instanceOf",
474
504
  value: function instanceOf(e) {
475
- return _instanceOf(e) && e[variantOrdinalSymbol] === 4;
505
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 4;
476
506
  }
477
507
  }]);
478
- }(UniffiError);
508
+ }(_uniffiBindgenReactNative.UniffiError);
479
509
  /**
480
- * The QR code data contains an unsupported version.
510
+ * The QR code data contains an unsupported type.
481
511
  */
482
- var InvalidVersion = /*#__PURE__*/function (_UniffiError5) {
483
- function InvalidVersion(message) {
512
+ var InvalidType = /*#__PURE__*/function (_UniffiError5) {
513
+ function InvalidType(message) {
484
514
  var _this5;
485
- _classCallCheck(this, InvalidVersion);
486
- _this5 = _callSuper(this, InvalidVersion, ["LoginQrCodeDecodeError", "InvalidVersion", message]);
515
+ _classCallCheck(this, InvalidType);
516
+ _this5 = _callSuper(this, InvalidType, ["LoginQrCodeDecodeError", "InvalidType", message]);
487
517
  /**
488
518
  * @private
489
519
  * This field is private and should not be used.
490
520
  */
491
- _defineProperty(_this5, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
521
+ _defineProperty(_this5, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
492
522
  /**
493
523
  * @private
494
524
  * This field is private and should not be used.
495
525
  */
496
- _defineProperty(_this5, variantOrdinalSymbol, 5);
497
- _defineProperty(_this5, "tag", LoginQrCodeDecodeError_Tags.InvalidVersion);
526
+ _defineProperty(_this5, _uniffiBindgenReactNative.variantOrdinalSymbol, 5);
527
+ _defineProperty(_this5, "tag", LoginQrCodeDecodeError_Tags.InvalidType);
498
528
  return _this5;
499
529
  }
500
- _inherits(InvalidVersion, _UniffiError5);
501
- return _createClass(InvalidVersion, null, [{
530
+ _inherits(InvalidType, _UniffiError5);
531
+ return _createClass(InvalidType, null, [{
502
532
  key: "instanceOf",
503
533
  value: function instanceOf(e) {
504
- return _instanceOf(e) && e[variantOrdinalSymbol] === 5;
534
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 5;
505
535
  }
506
536
  }]);
507
- }(UniffiError);
537
+ }(_uniffiBindgenReactNative.UniffiError);
508
538
  /**
509
539
  * The base64 encoded variant of the QR code data is not a valid base64
510
540
  * string.
@@ -518,12 +548,12 @@ export var LoginQrCodeDecodeError = function () {
518
548
  * @private
519
549
  * This field is private and should not be used.
520
550
  */
521
- _defineProperty(_this6, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
551
+ _defineProperty(_this6, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
522
552
  /**
523
553
  * @private
524
554
  * This field is private and should not be used.
525
555
  */
526
- _defineProperty(_this6, variantOrdinalSymbol, 6);
556
+ _defineProperty(_this6, _uniffiBindgenReactNative.variantOrdinalSymbol, 6);
527
557
  _defineProperty(_this6, "tag", LoginQrCodeDecodeError_Tags.Base64);
528
558
  return _this6;
529
559
  }
@@ -531,10 +561,10 @@ export var LoginQrCodeDecodeError = function () {
531
561
  return _createClass(Base64, null, [{
532
562
  key: "instanceOf",
533
563
  value: function instanceOf(e) {
534
- return _instanceOf(e) && e[variantOrdinalSymbol] === 6;
564
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 6;
535
565
  }
536
566
  }]);
537
- }(UniffiError);
567
+ }(_uniffiBindgenReactNative.UniffiError);
538
568
  /**
539
569
  * The QR code data doesn't contain the expected `MATRIX` prefix.
540
570
  */
@@ -547,12 +577,12 @@ export var LoginQrCodeDecodeError = function () {
547
577
  * @private
548
578
  * This field is private and should not be used.
549
579
  */
550
- _defineProperty(_this7, uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
580
+ _defineProperty(_this7, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "LoginQrCodeDecodeError");
551
581
  /**
552
582
  * @private
553
583
  * This field is private and should not be used.
554
584
  */
555
- _defineProperty(_this7, variantOrdinalSymbol, 7);
585
+ _defineProperty(_this7, _uniffiBindgenReactNative.variantOrdinalSymbol, 7);
556
586
  _defineProperty(_this7, "tag", LoginQrCodeDecodeError_Tags.InvalidPrefix);
557
587
  return _this7;
558
588
  }
@@ -560,26 +590,33 @@ export var LoginQrCodeDecodeError = function () {
560
590
  return _createClass(InvalidPrefix, null, [{
561
591
  key: "instanceOf",
562
592
  value: function instanceOf(e) {
563
- return _instanceOf(e) && e[variantOrdinalSymbol] === 7;
593
+ return _instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 7;
564
594
  }
565
595
  }]);
566
- }(UniffiError); // Utility function which does not rely on instanceof.
596
+ }(_uniffiBindgenReactNative.UniffiError); // Utility function which does not rely on instanceof.
567
597
  function _instanceOf(e) {
568
- return e[uniffiTypeNameSymbol] === "LoginQrCodeDecodeError";
598
+ return e[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "LoginQrCodeDecodeError";
569
599
  }
570
600
  return {
571
601
  NotEnoughData: NotEnoughData,
572
602
  NotUtf8: NotUtf8,
573
603
  UrlParse: UrlParse,
574
- InvalidMode: InvalidMode,
575
- InvalidVersion: InvalidVersion,
604
+ InvalidIntent: InvalidIntent,
605
+ InvalidType: InvalidType,
576
606
  Base64: Base64,
577
607
  InvalidPrefix: InvalidPrefix,
578
608
  instanceOf: _instanceOf
579
609
  };
580
610
  }();
611
+
612
+ // Union type for LoginQrCodeDecodeError error type.
613
+
614
+ /**
615
+ * Error type for the decoding of the [`QrCodeData`].
616
+ */
617
+
581
618
  var FfiConverterTypeLoginQrCodeDecodeError = function () {
582
- var intConverter = FfiConverterInt32;
619
+ var intConverter = _uniffiBindgenReactNative.FfiConverterInt32;
583
620
  var FfiConverter = /*#__PURE__*/function (_AbstractFfiConverter5) {
584
621
  function FfiConverter() {
585
622
  _classCallCheck(this, FfiConverter);
@@ -597,22 +634,22 @@ var FfiConverterTypeLoginQrCodeDecodeError = function () {
597
634
  case 3:
598
635
  return new LoginQrCodeDecodeError.UrlParse(FfiConverterString.read(from));
599
636
  case 4:
600
- return new LoginQrCodeDecodeError.InvalidMode(FfiConverterString.read(from));
637
+ return new LoginQrCodeDecodeError.InvalidIntent(FfiConverterString.read(from));
601
638
  case 5:
602
- return new LoginQrCodeDecodeError.InvalidVersion(FfiConverterString.read(from));
639
+ return new LoginQrCodeDecodeError.InvalidType(FfiConverterString.read(from));
603
640
  case 6:
604
641
  return new LoginQrCodeDecodeError.Base64(FfiConverterString.read(from));
605
642
  case 7:
606
643
  return new LoginQrCodeDecodeError.InvalidPrefix(FfiConverterString.read(from));
607
644
  default:
608
- throw new UniffiInternalError.UnexpectedEnumCase();
645
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
609
646
  }
610
647
  }
611
648
  }, {
612
649
  key: "write",
613
650
  value: function write(value, into) {
614
651
  var obj = value;
615
- var index = obj[variantOrdinalSymbol];
652
+ var index = obj[_uniffiBindgenReactNative.variantOrdinalSymbol];
616
653
  intConverter.write(index, into);
617
654
  }
618
655
  }, {
@@ -621,14 +658,76 @@ var FfiConverterTypeLoginQrCodeDecodeError = function () {
621
658
  return intConverter.allocationSize(0);
622
659
  }
623
660
  }]);
624
- }(AbstractFfiConverterByteArray);
661
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
625
662
  return new FfiConverter();
626
663
  }();
664
+
665
+ /**
666
+ * The intent of the device that generated/displayed the QR code.
667
+ *
668
+ * The QR code login mechanism supports both, the new device, as well as the
669
+ * existing device to display the QR code.
670
+ *
671
+ * The different intents have an explicit one-byte identifier which gets added
672
+ * to the QR code data.
673
+ */
674
+ var QrCodeIntent = exports.QrCodeIntent = /*#__PURE__*/function (QrCodeIntent) {
675
+ /**
676
+ * Enum variant for the case where the new device is displaying the QR
677
+ * code.
678
+ */
679
+ QrCodeIntent[QrCodeIntent["Login"] = 0] = "Login";
680
+ /**
681
+ * Enum variant for the case where the existing device is displaying the QR
682
+ * code.
683
+ */
684
+ QrCodeIntent[QrCodeIntent["Reciprocate"] = 1] = "Reciprocate";
685
+ return QrCodeIntent;
686
+ }({});
687
+ var FfiConverterTypeQrCodeIntent = function () {
688
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
689
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter6) {
690
+ function FFIConverter() {
691
+ _classCallCheck(this, FFIConverter);
692
+ return _callSuper(this, FFIConverter, arguments);
693
+ }
694
+ _inherits(FFIConverter, _AbstractFfiConverter6);
695
+ return _createClass(FFIConverter, [{
696
+ key: "read",
697
+ value: function read(from) {
698
+ switch (ordinalConverter.read(from)) {
699
+ case 1:
700
+ return QrCodeIntent.Login;
701
+ case 2:
702
+ return QrCodeIntent.Reciprocate;
703
+ default:
704
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
705
+ }
706
+ }
707
+ }, {
708
+ key: "write",
709
+ value: function write(value, into) {
710
+ switch (value) {
711
+ case QrCodeIntent.Login:
712
+ return ordinalConverter.write(1, into);
713
+ case QrCodeIntent.Reciprocate:
714
+ return ordinalConverter.write(2, into);
715
+ }
716
+ }
717
+ }, {
718
+ key: "allocationSize",
719
+ value: function allocationSize(value) {
720
+ return ordinalConverter.allocationSize(0);
721
+ }
722
+ }]);
723
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
724
+ return new FFIConverter();
725
+ }();
726
+
627
727
  /**
628
728
  * The result of a signature check.
629
729
  */
630
- export var SignatureState;
631
- (function (SignatureState) {
730
+ var SignatureState = exports.SignatureState = /*#__PURE__*/function (SignatureState) {
632
731
  /**
633
732
  * The signature is missing.
634
733
  */
@@ -647,15 +746,16 @@ export var SignatureState;
647
746
  * signature is trusted.
648
747
  */
649
748
  SignatureState[SignatureState["ValidAndTrusted"] = 3] = "ValidAndTrusted";
650
- })(SignatureState || (SignatureState = {}));
749
+ return SignatureState;
750
+ }({});
651
751
  var FfiConverterTypeSignatureState = function () {
652
- var ordinalConverter = FfiConverterInt32;
653
- var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter6) {
752
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
753
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter7) {
654
754
  function FFIConverter() {
655
755
  _classCallCheck(this, FFIConverter);
656
756
  return _callSuper(this, FFIConverter, arguments);
657
757
  }
658
- _inherits(FFIConverter, _AbstractFfiConverter6);
758
+ _inherits(FFIConverter, _AbstractFfiConverter7);
659
759
  return _createClass(FFIConverter, [{
660
760
  key: "read",
661
761
  value: function read(from) {
@@ -669,7 +769,7 @@ var FfiConverterTypeSignatureState = function () {
669
769
  case 4:
670
770
  return SignatureState.ValidAndTrusted;
671
771
  default:
672
- throw new UniffiInternalError.UnexpectedEnumCase();
772
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
673
773
  }
674
774
  }
675
775
  }, {
@@ -692,17 +792,21 @@ var FfiConverterTypeSignatureState = function () {
692
792
  return ordinalConverter.allocationSize(0);
693
793
  }
694
794
  }]);
695
- }(AbstractFfiConverterByteArray);
795
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
696
796
  return new FFIConverter();
697
797
  }();
798
+
698
799
  /**
699
800
  * The trust level in the sender's device that is required to decrypt an
700
801
  * event.
701
802
  */
702
- export var TrustRequirement;
703
- (function (TrustRequirement) {
803
+ var TrustRequirement = exports.TrustRequirement = /*#__PURE__*/function (TrustRequirement) {
704
804
  /**
705
805
  * Decrypt events from everyone regardless of trust.
806
+ *
807
+ * Not recommended, per the guidance of [MSC4153].
808
+ *
809
+ * [MSC4153]: https://github.com/matrix-org/matrix-doc/pull/4153
706
810
  */
707
811
  TrustRequirement[TrustRequirement["Untrusted"] = 0] = "Untrusted";
708
812
  /**
@@ -714,15 +818,16 @@ export var TrustRequirement;
714
818
  * Only decrypt events from cross-signed devices.
715
819
  */
716
820
  TrustRequirement[TrustRequirement["CrossSigned"] = 2] = "CrossSigned";
717
- })(TrustRequirement || (TrustRequirement = {}));
821
+ return TrustRequirement;
822
+ }({});
718
823
  var FfiConverterTypeTrustRequirement = function () {
719
- var ordinalConverter = FfiConverterInt32;
720
- var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter7) {
824
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
825
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter8) {
721
826
  function FFIConverter() {
722
827
  _classCallCheck(this, FFIConverter);
723
828
  return _callSuper(this, FFIConverter, arguments);
724
829
  }
725
- _inherits(FFIConverter, _AbstractFfiConverter7);
830
+ _inherits(FFIConverter, _AbstractFfiConverter8);
726
831
  return _createClass(FFIConverter, [{
727
832
  key: "read",
728
833
  value: function read(from) {
@@ -734,7 +839,7 @@ var FfiConverterTypeTrustRequirement = function () {
734
839
  case 3:
735
840
  return TrustRequirement.CrossSigned;
736
841
  default:
737
- throw new UniffiInternalError.UnexpectedEnumCase();
842
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
738
843
  }
739
844
  }
740
845
  }, {
@@ -755,14 +860,14 @@ var FfiConverterTypeTrustRequirement = function () {
755
860
  return ordinalConverter.allocationSize(0);
756
861
  }
757
862
  }]);
758
- }(AbstractFfiConverterByteArray);
863
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
759
864
  return new FFIConverter();
760
865
  }();
866
+
761
867
  /**
762
868
  * Our best guess at the reason why an event can't be decrypted.
763
869
  */
764
- export var UtdCause;
765
- (function (UtdCause) {
870
+ var UtdCause = exports.UtdCause = /*#__PURE__*/function (UtdCause) {
766
871
  /**
767
872
  * We don't have an explanation for why this UTD happened - it is probably
768
873
  * a bug, or a network split between the two homeservers.
@@ -845,15 +950,16 @@ export var UtdCause;
845
950
  * Expected message to user: "You need to verify this device".
846
951
  */
847
952
  UtdCause[UtdCause["HistoricalMessageAndDeviceIsUnverified"] = 8] = "HistoricalMessageAndDeviceIsUnverified";
848
- })(UtdCause || (UtdCause = {}));
953
+ return UtdCause;
954
+ }({});
849
955
  var FfiConverterTypeUtdCause = function () {
850
- var ordinalConverter = FfiConverterInt32;
851
- var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter8) {
956
+ var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
957
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter9) {
852
958
  function FFIConverter() {
853
959
  _classCallCheck(this, FFIConverter);
854
960
  return _callSuper(this, FFIConverter, arguments);
855
961
  }
856
- _inherits(FFIConverter, _AbstractFfiConverter8);
962
+ _inherits(FFIConverter, _AbstractFfiConverter9);
857
963
  return _createClass(FFIConverter, [{
858
964
  key: "read",
859
965
  value: function read(from) {
@@ -877,7 +983,7 @@ var FfiConverterTypeUtdCause = function () {
877
983
  case 9:
878
984
  return UtdCause.HistoricalMessageAndDeviceIsUnverified;
879
985
  default:
880
- throw new UniffiInternalError.UnexpectedEnumCase();
986
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
881
987
  }
882
988
  }
883
989
  }, {
@@ -910,9 +1016,318 @@ var FfiConverterTypeUtdCause = function () {
910
1016
  return ordinalConverter.allocationSize(0);
911
1017
  }
912
1018
  }]);
913
- }(AbstractFfiConverterByteArray);
1019
+ }(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
914
1020
  return new FFIConverter();
915
1021
  }();
1022
+
1023
+ /**
1024
+ * Enum for the algorithm-specific secrets for the room key backup.
1025
+ */
1026
+
1027
+ /**
1028
+ * @deprecated Use `BackupSecretsLike` instead.
1029
+ */
1030
+ /**
1031
+ * Enum for the algorithm-specific secrets for the room key backup.
1032
+ */
1033
+ var BackupSecrets = exports.BackupSecrets = /*#__PURE__*/function (_UniffiAbstractObject) {
1034
+ // No primary constructor declared for this class.
1035
+ function BackupSecrets(pointer) {
1036
+ var _this8;
1037
+ _classCallCheck(this, BackupSecrets);
1038
+ _this8 = _callSuper(this, BackupSecrets);
1039
+ _defineProperty(_this8, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "BackupSecrets");
1040
+ _defineProperty(_this8, _uniffiBindgenReactNative.destructorGuardSymbol, void 0);
1041
+ _defineProperty(_this8, _uniffiBindgenReactNative.pointerLiteralSymbol, void 0);
1042
+ _this8[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1043
+ _this8[_uniffiBindgenReactNative.destructorGuardSymbol] = uniffiTypeBackupSecretsObjectFactory.bless(pointer);
1044
+ return _this8;
1045
+ }
1046
+
1047
+ /**
1048
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1049
+ */
1050
+ _inherits(BackupSecrets, _UniffiAbstractObject);
1051
+ return _createClass(BackupSecrets, [{
1052
+ key: "uniffiDestroy",
1053
+ value: function uniffiDestroy() {
1054
+ var ptr = this[_uniffiBindgenReactNative.destructorGuardSymbol];
1055
+ if (ptr !== undefined) {
1056
+ var pointer = uniffiTypeBackupSecretsObjectFactory.pointer(this);
1057
+ uniffiTypeBackupSecretsObjectFactory.freePointer(pointer);
1058
+ uniffiTypeBackupSecretsObjectFactory.unbless(ptr);
1059
+ delete this[_uniffiBindgenReactNative.destructorGuardSymbol];
1060
+ }
1061
+ }
1062
+ }], [{
1063
+ key: "instanceOf",
1064
+ value: function instanceOf(obj) {
1065
+ return uniffiTypeBackupSecretsObjectFactory.isConcreteType(obj);
1066
+ }
1067
+ }]);
1068
+ }(_uniffiBindgenReactNative.UniffiAbstractObject);
1069
+ var uniffiTypeBackupSecretsObjectFactory = function () {
1070
+ /// <reference lib="es2021" />
1071
+ var registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry(function (heldValue) {
1072
+ uniffiTypeBackupSecretsObjectFactory.freePointer(heldValue);
1073
+ }) : null;
1074
+ return {
1075
+ create: function create(pointer) {
1076
+ var instance = Object.create(BackupSecrets.prototype);
1077
+ instance[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1078
+ instance[_uniffiBindgenReactNative.destructorGuardSymbol] = this.bless(pointer);
1079
+ instance[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "BackupSecrets";
1080
+ return instance;
1081
+ },
1082
+ bless: function bless(p) {
1083
+ var ptr = {
1084
+ p: p,
1085
+ // make sure this object doesn't get optimized away.
1086
+ markDestroyed: function markDestroyed() {
1087
+ return undefined;
1088
+ }
1089
+ };
1090
+ if (registry) {
1091
+ registry.register(ptr, p, ptr);
1092
+ }
1093
+ return ptr;
1094
+ },
1095
+ unbless: function unbless(ptr) {
1096
+ if (registry) {
1097
+ registry.unregister(ptr);
1098
+ }
1099
+ },
1100
+ pointer: function pointer(obj) {
1101
+ if (obj[_uniffiBindgenReactNative.destructorGuardSymbol] === undefined) {
1102
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedNullPointer();
1103
+ }
1104
+ return obj[_uniffiBindgenReactNative.pointerLiteralSymbol];
1105
+ },
1106
+ clonePointer: function clonePointer(obj) {
1107
+ var pointer = this.pointer(obj);
1108
+ return uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1109
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_clone_backupsecrets(pointer, callStatus);
1110
+ }, /*liftString:*/FfiConverterString.lift);
1111
+ },
1112
+ freePointer: function freePointer(pointer) {
1113
+ uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1114
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_free_backupsecrets(pointer, callStatus);
1115
+ }, /*liftString:*/FfiConverterString.lift);
1116
+ },
1117
+ isConcreteType: function isConcreteType(obj) {
1118
+ return obj[_uniffiBindgenReactNative.destructorGuardSymbol] && obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "BackupSecrets";
1119
+ }
1120
+ };
1121
+ }();
1122
+ // FfiConverter for BackupSecretsLike
1123
+ var FfiConverterTypeBackupSecrets = new _uniffiBindgenReactNative.FfiConverterObject(uniffiTypeBackupSecretsObjectFactory);
1124
+
1125
+ /**
1126
+ * Data for the secrets bundle containing the cross-signing keys.
1127
+ */
1128
+
1129
+ /**
1130
+ * @deprecated Use `CrossSigningSecretsLike` instead.
1131
+ */
1132
+ /**
1133
+ * Data for the secrets bundle containing the cross-signing keys.
1134
+ */
1135
+ var CrossSigningSecrets = exports.CrossSigningSecrets = /*#__PURE__*/function (_UniffiAbstractObject2) {
1136
+ // No primary constructor declared for this class.
1137
+ function CrossSigningSecrets(pointer) {
1138
+ var _this9;
1139
+ _classCallCheck(this, CrossSigningSecrets);
1140
+ _this9 = _callSuper(this, CrossSigningSecrets);
1141
+ _defineProperty(_this9, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "CrossSigningSecrets");
1142
+ _defineProperty(_this9, _uniffiBindgenReactNative.destructorGuardSymbol, void 0);
1143
+ _defineProperty(_this9, _uniffiBindgenReactNative.pointerLiteralSymbol, void 0);
1144
+ _this9[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1145
+ _this9[_uniffiBindgenReactNative.destructorGuardSymbol] = uniffiTypeCrossSigningSecretsObjectFactory.bless(pointer);
1146
+ return _this9;
1147
+ }
1148
+
1149
+ /**
1150
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1151
+ */
1152
+ _inherits(CrossSigningSecrets, _UniffiAbstractObject2);
1153
+ return _createClass(CrossSigningSecrets, [{
1154
+ key: "uniffiDestroy",
1155
+ value: function uniffiDestroy() {
1156
+ var ptr = this[_uniffiBindgenReactNative.destructorGuardSymbol];
1157
+ if (ptr !== undefined) {
1158
+ var pointer = uniffiTypeCrossSigningSecretsObjectFactory.pointer(this);
1159
+ uniffiTypeCrossSigningSecretsObjectFactory.freePointer(pointer);
1160
+ uniffiTypeCrossSigningSecretsObjectFactory.unbless(ptr);
1161
+ delete this[_uniffiBindgenReactNative.destructorGuardSymbol];
1162
+ }
1163
+ }
1164
+ }], [{
1165
+ key: "instanceOf",
1166
+ value: function instanceOf(obj) {
1167
+ return uniffiTypeCrossSigningSecretsObjectFactory.isConcreteType(obj);
1168
+ }
1169
+ }]);
1170
+ }(_uniffiBindgenReactNative.UniffiAbstractObject);
1171
+ var uniffiTypeCrossSigningSecretsObjectFactory = function () {
1172
+ /// <reference lib="es2021" />
1173
+ var registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry(function (heldValue) {
1174
+ uniffiTypeCrossSigningSecretsObjectFactory.freePointer(heldValue);
1175
+ }) : null;
1176
+ return {
1177
+ create: function create(pointer) {
1178
+ var instance = Object.create(CrossSigningSecrets.prototype);
1179
+ instance[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1180
+ instance[_uniffiBindgenReactNative.destructorGuardSymbol] = this.bless(pointer);
1181
+ instance[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "CrossSigningSecrets";
1182
+ return instance;
1183
+ },
1184
+ bless: function bless(p) {
1185
+ var ptr = {
1186
+ p: p,
1187
+ // make sure this object doesn't get optimized away.
1188
+ markDestroyed: function markDestroyed() {
1189
+ return undefined;
1190
+ }
1191
+ };
1192
+ if (registry) {
1193
+ registry.register(ptr, p, ptr);
1194
+ }
1195
+ return ptr;
1196
+ },
1197
+ unbless: function unbless(ptr) {
1198
+ if (registry) {
1199
+ registry.unregister(ptr);
1200
+ }
1201
+ },
1202
+ pointer: function pointer(obj) {
1203
+ if (obj[_uniffiBindgenReactNative.destructorGuardSymbol] === undefined) {
1204
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedNullPointer();
1205
+ }
1206
+ return obj[_uniffiBindgenReactNative.pointerLiteralSymbol];
1207
+ },
1208
+ clonePointer: function clonePointer(obj) {
1209
+ var pointer = this.pointer(obj);
1210
+ return uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1211
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_clone_crosssigningsecrets(pointer, callStatus);
1212
+ }, /*liftString:*/FfiConverterString.lift);
1213
+ },
1214
+ freePointer: function freePointer(pointer) {
1215
+ uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1216
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_free_crosssigningsecrets(pointer, callStatus);
1217
+ }, /*liftString:*/FfiConverterString.lift);
1218
+ },
1219
+ isConcreteType: function isConcreteType(obj) {
1220
+ return obj[_uniffiBindgenReactNative.destructorGuardSymbol] && obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "CrossSigningSecrets";
1221
+ }
1222
+ };
1223
+ }();
1224
+ // FfiConverter for CrossSigningSecretsLike
1225
+ var FfiConverterTypeCrossSigningSecrets = new _uniffiBindgenReactNative.FfiConverterObject(uniffiTypeCrossSigningSecretsObjectFactory);
1226
+
1227
+ /**
1228
+ * Struct containing the bundle of secrets to fully activate a new devices for
1229
+ * end-to-end encryption.
1230
+ */
1231
+
1232
+ /**
1233
+ * @deprecated Use `SecretsBundleLike` instead.
1234
+ */
1235
+ /**
1236
+ * Struct containing the bundle of secrets to fully activate a new devices for
1237
+ * end-to-end encryption.
1238
+ */
1239
+ var SecretsBundle = exports.SecretsBundle = /*#__PURE__*/function (_UniffiAbstractObject3) {
1240
+ // No primary constructor declared for this class.
1241
+ function SecretsBundle(pointer) {
1242
+ var _this0;
1243
+ _classCallCheck(this, SecretsBundle);
1244
+ _this0 = _callSuper(this, SecretsBundle);
1245
+ _defineProperty(_this0, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "SecretsBundle");
1246
+ _defineProperty(_this0, _uniffiBindgenReactNative.destructorGuardSymbol, void 0);
1247
+ _defineProperty(_this0, _uniffiBindgenReactNative.pointerLiteralSymbol, void 0);
1248
+ _this0[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1249
+ _this0[_uniffiBindgenReactNative.destructorGuardSymbol] = uniffiTypeSecretsBundleObjectFactory.bless(pointer);
1250
+ return _this0;
1251
+ }
1252
+
1253
+ /**
1254
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1255
+ */
1256
+ _inherits(SecretsBundle, _UniffiAbstractObject3);
1257
+ return _createClass(SecretsBundle, [{
1258
+ key: "uniffiDestroy",
1259
+ value: function uniffiDestroy() {
1260
+ var ptr = this[_uniffiBindgenReactNative.destructorGuardSymbol];
1261
+ if (ptr !== undefined) {
1262
+ var pointer = uniffiTypeSecretsBundleObjectFactory.pointer(this);
1263
+ uniffiTypeSecretsBundleObjectFactory.freePointer(pointer);
1264
+ uniffiTypeSecretsBundleObjectFactory.unbless(ptr);
1265
+ delete this[_uniffiBindgenReactNative.destructorGuardSymbol];
1266
+ }
1267
+ }
1268
+ }], [{
1269
+ key: "instanceOf",
1270
+ value: function instanceOf(obj) {
1271
+ return uniffiTypeSecretsBundleObjectFactory.isConcreteType(obj);
1272
+ }
1273
+ }]);
1274
+ }(_uniffiBindgenReactNative.UniffiAbstractObject);
1275
+ var uniffiTypeSecretsBundleObjectFactory = function () {
1276
+ /// <reference lib="es2021" />
1277
+ var registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry(function (heldValue) {
1278
+ uniffiTypeSecretsBundleObjectFactory.freePointer(heldValue);
1279
+ }) : null;
1280
+ return {
1281
+ create: function create(pointer) {
1282
+ var instance = Object.create(SecretsBundle.prototype);
1283
+ instance[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
1284
+ instance[_uniffiBindgenReactNative.destructorGuardSymbol] = this.bless(pointer);
1285
+ instance[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "SecretsBundle";
1286
+ return instance;
1287
+ },
1288
+ bless: function bless(p) {
1289
+ var ptr = {
1290
+ p: p,
1291
+ // make sure this object doesn't get optimized away.
1292
+ markDestroyed: function markDestroyed() {
1293
+ return undefined;
1294
+ }
1295
+ };
1296
+ if (registry) {
1297
+ registry.register(ptr, p, ptr);
1298
+ }
1299
+ return ptr;
1300
+ },
1301
+ unbless: function unbless(ptr) {
1302
+ if (registry) {
1303
+ registry.unregister(ptr);
1304
+ }
1305
+ },
1306
+ pointer: function pointer(obj) {
1307
+ if (obj[_uniffiBindgenReactNative.destructorGuardSymbol] === undefined) {
1308
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedNullPointer();
1309
+ }
1310
+ return obj[_uniffiBindgenReactNative.pointerLiteralSymbol];
1311
+ },
1312
+ clonePointer: function clonePointer(obj) {
1313
+ var pointer = this.pointer(obj);
1314
+ return uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1315
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_clone_secretsbundle(pointer, callStatus);
1316
+ }, /*liftString:*/FfiConverterString.lift);
1317
+ },
1318
+ freePointer: function freePointer(pointer) {
1319
+ uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1320
+ return nativeModule().ubrn_uniffi_matrix_sdk_crypto_fn_free_secretsbundle(pointer, callStatus);
1321
+ }, /*liftString:*/FfiConverterString.lift);
1322
+ },
1323
+ isConcreteType: function isConcreteType(obj) {
1324
+ return obj[_uniffiBindgenReactNative.destructorGuardSymbol] && obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "SecretsBundle";
1325
+ }
1326
+ };
1327
+ }();
1328
+ // FfiConverter for SecretsBundleLike
1329
+ var FfiConverterTypeSecretsBundle = new _uniffiBindgenReactNative.FfiConverterObject(uniffiTypeSecretsBundleObjectFactory);
1330
+
916
1331
  /**
917
1332
  * This should be called before anything else.
918
1333
  *
@@ -925,21 +1340,25 @@ var FfiConverterTypeUtdCause = function () {
925
1340
  */
926
1341
  function uniffiEnsureInitialized() {
927
1342
  // Get the bindings contract version from our ComponentInterface
928
- var bindingsContractVersion = 29;
1343
+ var bindingsContractVersion = 30;
929
1344
  // Get the scaffolding contract version by calling the into the dylib
930
1345
  var scaffoldingContractVersion = nativeModule().ubrn_ffi_matrix_sdk_crypto_uniffi_contract_version();
931
1346
  if (bindingsContractVersion !== scaffoldingContractVersion) {
932
- throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1347
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
933
1348
  }
934
1349
  }
935
- export default Object.freeze({
1350
+ var _default = exports["default"] = Object.freeze({
936
1351
  initialize: uniffiEnsureInitialized,
937
1352
  converters: {
1353
+ FfiConverterTypeBackupSecrets: FfiConverterTypeBackupSecrets,
938
1354
  FfiConverterTypeCollectStrategy: FfiConverterTypeCollectStrategy,
1355
+ FfiConverterTypeCrossSigningSecrets: FfiConverterTypeCrossSigningSecrets,
939
1356
  FfiConverterTypeDecryptionSettings: FfiConverterTypeDecryptionSettings,
940
1357
  FfiConverterTypeIdentityState: FfiConverterTypeIdentityState,
941
1358
  FfiConverterTypeLocalTrust: FfiConverterTypeLocalTrust,
942
1359
  FfiConverterTypeLoginQrCodeDecodeError: FfiConverterTypeLoginQrCodeDecodeError,
1360
+ FfiConverterTypeQrCodeIntent: FfiConverterTypeQrCodeIntent,
1361
+ FfiConverterTypeSecretsBundle: FfiConverterTypeSecretsBundle,
943
1362
  FfiConverterTypeSignatureState: FfiConverterTypeSignatureState,
944
1363
  FfiConverterTypeTrustRequirement: FfiConverterTypeTrustRequirement,
945
1364
  FfiConverterTypeUtdCause: FfiConverterTypeUtdCause