ffi-bindings 1.0.0

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.
@@ -0,0 +1,1698 @@
1
+ var _process;
2
+ 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
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
4
+ 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); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
10
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
13
+ 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
+ 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.
17
+ // 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, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterInt64, FfiConverterObject, FfiConverterOptional, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
23
+ // Get converters from the other files, if any.
24
+ var nativeModule = function nativeModule() {
25
+ return wasmBundle;
26
+ };
27
+ var uniffiCaller = new UniffiRustCaller(function () {
28
+ return new wasmBundle.RustCallStatus();
29
+ });
30
+ var uniffiIsDebug =
31
+ // @ts-ignore -- The process global might not be defined
32
+ (typeof process === "undefined" ? "undefined" : _typeof(process)) !== "object" ||
33
+ // @ts-ignore -- The process global might not be defined
34
+ ((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) !== "production" || false;
35
+ /**
36
+ * Generated factory for {@link RoomPowerLevelChanges} record objects.
37
+ */
38
+ export var RoomPowerLevelChanges = function () {
39
+ var _defaults = function defaults() {
40
+ return {
41
+ ban: undefined,
42
+ invite: undefined,
43
+ kick: undefined,
44
+ redact: undefined,
45
+ eventsDefault: undefined,
46
+ stateDefault: undefined,
47
+ usersDefault: undefined,
48
+ roomName: undefined,
49
+ roomAvatar: undefined,
50
+ roomTopic: undefined,
51
+ spaceChild: undefined
52
+ };
53
+ };
54
+ var create = function () {
55
+ return uniffiCreateRecord(_defaults);
56
+ }();
57
+ return Object.freeze({
58
+ /**
59
+ * Create a frozen instance of {@link RoomPowerLevelChanges}, with defaults specified
60
+ * in Rust, in the {@link matrix_sdk} crate.
61
+ */
62
+ create: create,
63
+ /**
64
+ * Create a frozen instance of {@link RoomPowerLevelChanges}, with defaults specified
65
+ * in Rust, in the {@link matrix_sdk} crate.
66
+ */
67
+ "new": create,
68
+ /**
69
+ * Defaults specified in the {@link matrix_sdk} crate.
70
+ */
71
+ defaults: function defaults() {
72
+ return Object.freeze(_defaults());
73
+ }
74
+ });
75
+ }();
76
+ var FfiConverterTypeRoomPowerLevelChanges = function () {
77
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter) {
78
+ function FFIConverter() {
79
+ _classCallCheck(this, FFIConverter);
80
+ return _callSuper(this, FFIConverter, arguments);
81
+ }
82
+ _inherits(FFIConverter, _AbstractFfiConverter);
83
+ return _createClass(FFIConverter, [{
84
+ key: "read",
85
+ value: function read(from) {
86
+ return {
87
+ ban: FfiConverterOptionalInt64.read(from),
88
+ invite: FfiConverterOptionalInt64.read(from),
89
+ kick: FfiConverterOptionalInt64.read(from),
90
+ redact: FfiConverterOptionalInt64.read(from),
91
+ eventsDefault: FfiConverterOptionalInt64.read(from),
92
+ stateDefault: FfiConverterOptionalInt64.read(from),
93
+ usersDefault: FfiConverterOptionalInt64.read(from),
94
+ roomName: FfiConverterOptionalInt64.read(from),
95
+ roomAvatar: FfiConverterOptionalInt64.read(from),
96
+ roomTopic: FfiConverterOptionalInt64.read(from),
97
+ spaceChild: FfiConverterOptionalInt64.read(from)
98
+ };
99
+ }
100
+ }, {
101
+ key: "write",
102
+ value: function write(value, into) {
103
+ FfiConverterOptionalInt64.write(value.ban, into);
104
+ FfiConverterOptionalInt64.write(value.invite, into);
105
+ FfiConverterOptionalInt64.write(value.kick, into);
106
+ FfiConverterOptionalInt64.write(value.redact, into);
107
+ FfiConverterOptionalInt64.write(value.eventsDefault, into);
108
+ FfiConverterOptionalInt64.write(value.stateDefault, into);
109
+ FfiConverterOptionalInt64.write(value.usersDefault, into);
110
+ FfiConverterOptionalInt64.write(value.roomName, into);
111
+ FfiConverterOptionalInt64.write(value.roomAvatar, into);
112
+ FfiConverterOptionalInt64.write(value.roomTopic, into);
113
+ FfiConverterOptionalInt64.write(value.spaceChild, into);
114
+ }
115
+ }, {
116
+ key: "allocationSize",
117
+ value: function allocationSize(value) {
118
+ return FfiConverterOptionalInt64.allocationSize(value.ban) + FfiConverterOptionalInt64.allocationSize(value.invite) + FfiConverterOptionalInt64.allocationSize(value.kick) + FfiConverterOptionalInt64.allocationSize(value.redact) + FfiConverterOptionalInt64.allocationSize(value.eventsDefault) + FfiConverterOptionalInt64.allocationSize(value.stateDefault) + FfiConverterOptionalInt64.allocationSize(value.usersDefault) + FfiConverterOptionalInt64.allocationSize(value.roomName) + FfiConverterOptionalInt64.allocationSize(value.roomAvatar) + FfiConverterOptionalInt64.allocationSize(value.roomTopic) + FfiConverterOptionalInt64.allocationSize(value.spaceChild);
119
+ }
120
+ }]);
121
+ }(AbstractFfiConverterByteArray);
122
+ ;
123
+ return new FFIConverter();
124
+ }();
125
+ /**
126
+ * Generated factory for {@link ServerVendorInfo} record objects.
127
+ */
128
+ export var ServerVendorInfo = function () {
129
+ var _defaults2 = function defaults() {
130
+ return {};
131
+ };
132
+ var create = function () {
133
+ return uniffiCreateRecord(_defaults2);
134
+ }();
135
+ return Object.freeze({
136
+ /**
137
+ * Create a frozen instance of {@link ServerVendorInfo}, with defaults specified
138
+ * in Rust, in the {@link matrix_sdk} crate.
139
+ */
140
+ create: create,
141
+ /**
142
+ * Create a frozen instance of {@link ServerVendorInfo}, with defaults specified
143
+ * in Rust, in the {@link matrix_sdk} crate.
144
+ */
145
+ "new": create,
146
+ /**
147
+ * Defaults specified in the {@link matrix_sdk} crate.
148
+ */
149
+ defaults: function defaults() {
150
+ return Object.freeze(_defaults2());
151
+ }
152
+ });
153
+ }();
154
+ var FfiConverterTypeServerVendorInfo = function () {
155
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter2) {
156
+ function FFIConverter() {
157
+ _classCallCheck(this, FFIConverter);
158
+ return _callSuper(this, FFIConverter, arguments);
159
+ }
160
+ _inherits(FFIConverter, _AbstractFfiConverter2);
161
+ return _createClass(FFIConverter, [{
162
+ key: "read",
163
+ value: function read(from) {
164
+ return {
165
+ serverName: FfiConverterString.read(from),
166
+ version: FfiConverterString.read(from)
167
+ };
168
+ }
169
+ }, {
170
+ key: "write",
171
+ value: function write(value, into) {
172
+ FfiConverterString.write(value.serverName, into);
173
+ FfiConverterString.write(value.version, into);
174
+ }
175
+ }, {
176
+ key: "allocationSize",
177
+ value: function allocationSize(value) {
178
+ return FfiConverterString.allocationSize(value.serverName) + FfiConverterString.allocationSize(value.version);
179
+ }
180
+ }]);
181
+ }(AbstractFfiConverterByteArray);
182
+ ;
183
+ return new FFIConverter();
184
+ }();
185
+ /**
186
+ * Generated factory for {@link VirtualElementCallWidgetConfig} record objects.
187
+ */
188
+ export var VirtualElementCallWidgetConfig = function () {
189
+ var _defaults3 = function defaults() {
190
+ return {
191
+ skipLobby: undefined,
192
+ header: undefined,
193
+ hideHeader: undefined,
194
+ preload: undefined,
195
+ appPrompt: undefined,
196
+ confineToRoom: undefined,
197
+ hideScreensharing: undefined,
198
+ controlledAudioDevices: undefined,
199
+ sendNotificationType: undefined
200
+ };
201
+ };
202
+ var create = function () {
203
+ return uniffiCreateRecord(_defaults3);
204
+ }();
205
+ return Object.freeze({
206
+ /**
207
+ * Create a frozen instance of {@link VirtualElementCallWidgetConfig}, with defaults specified
208
+ * in Rust, in the {@link matrix_sdk} crate.
209
+ */
210
+ create: create,
211
+ /**
212
+ * Create a frozen instance of {@link VirtualElementCallWidgetConfig}, with defaults specified
213
+ * in Rust, in the {@link matrix_sdk} crate.
214
+ */
215
+ "new": create,
216
+ /**
217
+ * Defaults specified in the {@link matrix_sdk} crate.
218
+ */
219
+ defaults: function defaults() {
220
+ return Object.freeze(_defaults3());
221
+ }
222
+ });
223
+ }();
224
+ var FfiConverterTypeVirtualElementCallWidgetConfig = function () {
225
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter3) {
226
+ function FFIConverter() {
227
+ _classCallCheck(this, FFIConverter);
228
+ return _callSuper(this, FFIConverter, arguments);
229
+ }
230
+ _inherits(FFIConverter, _AbstractFfiConverter3);
231
+ return _createClass(FFIConverter, [{
232
+ key: "read",
233
+ value: function read(from) {
234
+ return {
235
+ intent: FfiConverterOptionalTypeIntent.read(from),
236
+ skipLobby: FfiConverterOptionalBool.read(from),
237
+ header: FfiConverterOptionalTypeHeaderStyle.read(from),
238
+ hideHeader: FfiConverterOptionalBool.read(from),
239
+ preload: FfiConverterOptionalBool.read(from),
240
+ appPrompt: FfiConverterOptionalBool.read(from),
241
+ confineToRoom: FfiConverterOptionalBool.read(from),
242
+ hideScreensharing: FfiConverterOptionalBool.read(from),
243
+ controlledAudioDevices: FfiConverterOptionalBool.read(from),
244
+ sendNotificationType: FfiConverterOptionalTypeNotificationType.read(from)
245
+ };
246
+ }
247
+ }, {
248
+ key: "write",
249
+ value: function write(value, into) {
250
+ FfiConverterOptionalTypeIntent.write(value.intent, into);
251
+ FfiConverterOptionalBool.write(value.skipLobby, into);
252
+ FfiConverterOptionalTypeHeaderStyle.write(value.header, into);
253
+ FfiConverterOptionalBool.write(value.hideHeader, into);
254
+ FfiConverterOptionalBool.write(value.preload, into);
255
+ FfiConverterOptionalBool.write(value.appPrompt, into);
256
+ FfiConverterOptionalBool.write(value.confineToRoom, into);
257
+ FfiConverterOptionalBool.write(value.hideScreensharing, into);
258
+ FfiConverterOptionalBool.write(value.controlledAudioDevices, into);
259
+ FfiConverterOptionalTypeNotificationType.write(value.sendNotificationType, into);
260
+ }
261
+ }, {
262
+ key: "allocationSize",
263
+ value: function allocationSize(value) {
264
+ return FfiConverterOptionalTypeIntent.allocationSize(value.intent) + FfiConverterOptionalBool.allocationSize(value.skipLobby) + FfiConverterOptionalTypeHeaderStyle.allocationSize(value.header) + FfiConverterOptionalBool.allocationSize(value.hideHeader) + FfiConverterOptionalBool.allocationSize(value.preload) + FfiConverterOptionalBool.allocationSize(value.appPrompt) + FfiConverterOptionalBool.allocationSize(value.confineToRoom) + FfiConverterOptionalBool.allocationSize(value.hideScreensharing) + FfiConverterOptionalBool.allocationSize(value.controlledAudioDevices) + FfiConverterOptionalTypeNotificationType.allocationSize(value.sendNotificationType);
265
+ }
266
+ }]);
267
+ }(AbstractFfiConverterByteArray);
268
+ ;
269
+ return new FFIConverter();
270
+ }();
271
+ /**
272
+ * Generated factory for {@link VirtualElementCallWidgetProperties} record objects.
273
+ */
274
+ export var VirtualElementCallWidgetProperties = function () {
275
+ var _defaults4 = function defaults() {
276
+ return {
277
+ parentUrl: undefined,
278
+ fontScale: undefined,
279
+ font: undefined,
280
+ posthogUserId: undefined,
281
+ posthogApiHost: undefined,
282
+ posthogApiKey: undefined,
283
+ rageshakeSubmitUrl: undefined,
284
+ sentryDsn: undefined,
285
+ sentryEnvironment: undefined
286
+ };
287
+ };
288
+ var create = function () {
289
+ return uniffiCreateRecord(_defaults4);
290
+ }();
291
+ return Object.freeze({
292
+ /**
293
+ * Create a frozen instance of {@link VirtualElementCallWidgetProperties}, with defaults specified
294
+ * in Rust, in the {@link matrix_sdk} crate.
295
+ */
296
+ create: create,
297
+ /**
298
+ * Create a frozen instance of {@link VirtualElementCallWidgetProperties}, with defaults specified
299
+ * in Rust, in the {@link matrix_sdk} crate.
300
+ */
301
+ "new": create,
302
+ /**
303
+ * Defaults specified in the {@link matrix_sdk} crate.
304
+ */
305
+ defaults: function defaults() {
306
+ return Object.freeze(_defaults4());
307
+ }
308
+ });
309
+ }();
310
+ var FfiConverterTypeVirtualElementCallWidgetProperties = function () {
311
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter4) {
312
+ function FFIConverter() {
313
+ _classCallCheck(this, FFIConverter);
314
+ return _callSuper(this, FFIConverter, arguments);
315
+ }
316
+ _inherits(FFIConverter, _AbstractFfiConverter4);
317
+ return _createClass(FFIConverter, [{
318
+ key: "read",
319
+ value: function read(from) {
320
+ return {
321
+ elementCallUrl: FfiConverterString.read(from),
322
+ widgetId: FfiConverterString.read(from),
323
+ parentUrl: FfiConverterOptionalString.read(from),
324
+ fontScale: FfiConverterOptionalFloat64.read(from),
325
+ font: FfiConverterOptionalString.read(from),
326
+ encryption: FfiConverterTypeEncryptionSystem.read(from),
327
+ posthogUserId: FfiConverterOptionalString.read(from),
328
+ posthogApiHost: FfiConverterOptionalString.read(from),
329
+ posthogApiKey: FfiConverterOptionalString.read(from),
330
+ rageshakeSubmitUrl: FfiConverterOptionalString.read(from),
331
+ sentryDsn: FfiConverterOptionalString.read(from),
332
+ sentryEnvironment: FfiConverterOptionalString.read(from)
333
+ };
334
+ }
335
+ }, {
336
+ key: "write",
337
+ value: function write(value, into) {
338
+ FfiConverterString.write(value.elementCallUrl, into);
339
+ FfiConverterString.write(value.widgetId, into);
340
+ FfiConverterOptionalString.write(value.parentUrl, into);
341
+ FfiConverterOptionalFloat64.write(value.fontScale, into);
342
+ FfiConverterOptionalString.write(value.font, into);
343
+ FfiConverterTypeEncryptionSystem.write(value.encryption, into);
344
+ FfiConverterOptionalString.write(value.posthogUserId, into);
345
+ FfiConverterOptionalString.write(value.posthogApiHost, into);
346
+ FfiConverterOptionalString.write(value.posthogApiKey, into);
347
+ FfiConverterOptionalString.write(value.rageshakeSubmitUrl, into);
348
+ FfiConverterOptionalString.write(value.sentryDsn, into);
349
+ FfiConverterOptionalString.write(value.sentryEnvironment, into);
350
+ }
351
+ }, {
352
+ key: "allocationSize",
353
+ value: function allocationSize(value) {
354
+ return FfiConverterString.allocationSize(value.elementCallUrl) + FfiConverterString.allocationSize(value.widgetId) + FfiConverterOptionalString.allocationSize(value.parentUrl) + FfiConverterOptionalFloat64.allocationSize(value.fontScale) + FfiConverterOptionalString.allocationSize(value.font) + FfiConverterTypeEncryptionSystem.allocationSize(value.encryption) + FfiConverterOptionalString.allocationSize(value.posthogUserId) + FfiConverterOptionalString.allocationSize(value.posthogApiHost) + FfiConverterOptionalString.allocationSize(value.posthogApiKey) + FfiConverterOptionalString.allocationSize(value.rageshakeSubmitUrl) + FfiConverterOptionalString.allocationSize(value.sentryDsn) + FfiConverterOptionalString.allocationSize(value.sentryEnvironment);
355
+ }
356
+ }]);
357
+ }(AbstractFfiConverterByteArray);
358
+ ;
359
+ return new FFIConverter();
360
+ }();
361
+ var stringConverter = function () {
362
+ var encoder = new TextEncoder();
363
+ var decoder = new TextDecoder();
364
+ return {
365
+ stringToBytes: function stringToBytes(s) {
366
+ return encoder.encode(s);
367
+ },
368
+ bytesToString: function bytesToString(ab) {
369
+ return decoder.decode(ab);
370
+ },
371
+ stringByteLength: function stringByteLength(s) {
372
+ return encoder.encode(s).byteLength;
373
+ }
374
+ };
375
+ }();
376
+ var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
377
+ /**
378
+ * Settings for end-to-end encryption features.
379
+ */
380
+ export var BackupDownloadStrategy;
381
+ (function (BackupDownloadStrategy) {
382
+ /**
383
+ * Automatically download all room keys from the backup when the backup
384
+ * recovery key has been received. The backup recovery key can be received
385
+ * in two ways:
386
+ *
387
+ * 1. Received as a `m.secret.send` to-device event, after a successful
388
+ * interactive verification.
389
+ * 2. Imported from secret storage (4S) using the
390
+ * [`SecretStore::import_secrets()`] method.
391
+ *
392
+ * [`SecretStore::import_secrets()`]: crate::encryption::secret_storage::SecretStore::import_secrets
393
+ */
394
+ BackupDownloadStrategy[BackupDownloadStrategy["OneShot"] = 0] = "OneShot";
395
+ /**
396
+ * Attempt to download a single room key if an event fails to be decrypted.
397
+ */
398
+ BackupDownloadStrategy[BackupDownloadStrategy["AfterDecryptionFailure"] = 1] = "AfterDecryptionFailure";
399
+ /**
400
+ * Don't download any room keys automatically. The user can manually
401
+ * download room keys using the [`Backups::download_room_key()`] methods.
402
+ *
403
+ * This is the default option.
404
+ */
405
+ BackupDownloadStrategy[BackupDownloadStrategy["Manual"] = 2] = "Manual";
406
+ })(BackupDownloadStrategy || (BackupDownloadStrategy = {}));
407
+ var FfiConverterTypeBackupDownloadStrategy = function () {
408
+ var ordinalConverter = FfiConverterInt32;
409
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter5) {
410
+ function FFIConverter() {
411
+ _classCallCheck(this, FFIConverter);
412
+ return _callSuper(this, FFIConverter, arguments);
413
+ }
414
+ _inherits(FFIConverter, _AbstractFfiConverter5);
415
+ return _createClass(FFIConverter, [{
416
+ key: "read",
417
+ value: function read(from) {
418
+ switch (ordinalConverter.read(from)) {
419
+ case 1:
420
+ return BackupDownloadStrategy.OneShot;
421
+ case 2:
422
+ return BackupDownloadStrategy.AfterDecryptionFailure;
423
+ case 3:
424
+ return BackupDownloadStrategy.Manual;
425
+ default:
426
+ throw new UniffiInternalError.UnexpectedEnumCase();
427
+ }
428
+ }
429
+ }, {
430
+ key: "write",
431
+ value: function write(value, into) {
432
+ switch (value) {
433
+ case BackupDownloadStrategy.OneShot:
434
+ return ordinalConverter.write(1, into);
435
+ case BackupDownloadStrategy.AfterDecryptionFailure:
436
+ return ordinalConverter.write(2, into);
437
+ case BackupDownloadStrategy.Manual:
438
+ return ordinalConverter.write(3, into);
439
+ }
440
+ }
441
+ }, {
442
+ key: "allocationSize",
443
+ value: function allocationSize(value) {
444
+ return ordinalConverter.allocationSize(0);
445
+ }
446
+ }]);
447
+ }(AbstractFfiConverterByteArray);
448
+ return new FFIConverter();
449
+ }();
450
+ // Enum: EncryptionSystem
451
+ export var EncryptionSystem_Tags;
452
+ (function (EncryptionSystem_Tags) {
453
+ EncryptionSystem_Tags["Unencrypted"] = "Unencrypted";
454
+ EncryptionSystem_Tags["PerParticipantKeys"] = "PerParticipantKeys";
455
+ EncryptionSystem_Tags["SharedSecret"] = "SharedSecret";
456
+ })(EncryptionSystem_Tags || (EncryptionSystem_Tags = {}));
457
+ /**
458
+ * Defines if a call is encrypted and which encryption system should be used.
459
+ *
460
+ * This controls the url parameters: `perParticipantE2EE`, `password`.
461
+ */
462
+ export var EncryptionSystem = function () {
463
+ /**
464
+ * Equivalent to the element call url parameter: `perParticipantE2EE=false`
465
+ * and no password.
466
+ */
467
+ var Unencrypted_ = /*#__PURE__*/function (_UniffiEnum) {
468
+ function Unencrypted_() {
469
+ var _this;
470
+ _classCallCheck(this, Unencrypted_);
471
+ _this = _callSuper(this, Unencrypted_, ["EncryptionSystem", "Unencrypted"]);
472
+ /**
473
+ * @private
474
+ * This field is private and should not be used, use `tag` instead.
475
+ */
476
+ _defineProperty(_this, uniffiTypeNameSymbol, "EncryptionSystem");
477
+ _defineProperty(_this, "tag", EncryptionSystem_Tags.Unencrypted);
478
+ return _this;
479
+ }
480
+ _inherits(Unencrypted_, _UniffiEnum);
481
+ return _createClass(Unencrypted_, null, [{
482
+ key: "new",
483
+ value: function _new() {
484
+ return new Unencrypted_();
485
+ }
486
+ }, {
487
+ key: "instanceOf",
488
+ value: function instanceOf(obj) {
489
+ return obj.tag === EncryptionSystem_Tags.Unencrypted;
490
+ }
491
+ }]);
492
+ }(UniffiEnum);
493
+ /**
494
+ * Equivalent to the element call url parameters:
495
+ * `perParticipantE2EE=true`
496
+ */
497
+ var PerParticipantKeys_ = /*#__PURE__*/function (_UniffiEnum2) {
498
+ function PerParticipantKeys_() {
499
+ var _this2;
500
+ _classCallCheck(this, PerParticipantKeys_);
501
+ _this2 = _callSuper(this, PerParticipantKeys_, ["EncryptionSystem", "PerParticipantKeys"]);
502
+ /**
503
+ * @private
504
+ * This field is private and should not be used, use `tag` instead.
505
+ */
506
+ _defineProperty(_this2, uniffiTypeNameSymbol, "EncryptionSystem");
507
+ _defineProperty(_this2, "tag", EncryptionSystem_Tags.PerParticipantKeys);
508
+ return _this2;
509
+ }
510
+ _inherits(PerParticipantKeys_, _UniffiEnum2);
511
+ return _createClass(PerParticipantKeys_, null, [{
512
+ key: "new",
513
+ value: function _new() {
514
+ return new PerParticipantKeys_();
515
+ }
516
+ }, {
517
+ key: "instanceOf",
518
+ value: function instanceOf(obj) {
519
+ return obj.tag === EncryptionSystem_Tags.PerParticipantKeys;
520
+ }
521
+ }]);
522
+ }(UniffiEnum);
523
+ /**
524
+ * Equivalent to the element call url parameters:
525
+ * `password={secret}`
526
+ */
527
+ var SharedSecret_ = /*#__PURE__*/function (_UniffiEnum3) {
528
+ function SharedSecret_(inner) {
529
+ var _this3;
530
+ _classCallCheck(this, SharedSecret_);
531
+ _this3 = _callSuper(this, SharedSecret_, ["EncryptionSystem", "SharedSecret"]);
532
+ /**
533
+ * @private
534
+ * This field is private and should not be used, use `tag` instead.
535
+ */
536
+ _defineProperty(_this3, uniffiTypeNameSymbol, "EncryptionSystem");
537
+ _defineProperty(_this3, "tag", EncryptionSystem_Tags.SharedSecret);
538
+ _defineProperty(_this3, "inner", void 0);
539
+ _this3.inner = Object.freeze(inner);
540
+ return _this3;
541
+ }
542
+ _inherits(SharedSecret_, _UniffiEnum3);
543
+ return _createClass(SharedSecret_, null, [{
544
+ key: "new",
545
+ value: function _new(inner) {
546
+ return new SharedSecret_(inner);
547
+ }
548
+ }, {
549
+ key: "instanceOf",
550
+ value: function instanceOf(obj) {
551
+ return obj.tag === EncryptionSystem_Tags.SharedSecret;
552
+ }
553
+ }]);
554
+ }(UniffiEnum);
555
+ function instanceOf(obj) {
556
+ return obj[uniffiTypeNameSymbol] === "EncryptionSystem";
557
+ }
558
+ return Object.freeze({
559
+ instanceOf: instanceOf,
560
+ Unencrypted: Unencrypted_,
561
+ PerParticipantKeys: PerParticipantKeys_,
562
+ SharedSecret: SharedSecret_
563
+ });
564
+ }();
565
+ // FfiConverter for enum EncryptionSystem
566
+ var FfiConverterTypeEncryptionSystem = function () {
567
+ var ordinalConverter = FfiConverterInt32;
568
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter6) {
569
+ function FFIConverter() {
570
+ _classCallCheck(this, FFIConverter);
571
+ return _callSuper(this, FFIConverter, arguments);
572
+ }
573
+ _inherits(FFIConverter, _AbstractFfiConverter6);
574
+ return _createClass(FFIConverter, [{
575
+ key: "read",
576
+ value: function read(from) {
577
+ switch (ordinalConverter.read(from)) {
578
+ case 1:
579
+ return new EncryptionSystem.Unencrypted();
580
+ case 2:
581
+ return new EncryptionSystem.PerParticipantKeys();
582
+ case 3:
583
+ return new EncryptionSystem.SharedSecret({
584
+ secret: FfiConverterString.read(from)
585
+ });
586
+ default:
587
+ throw new UniffiInternalError.UnexpectedEnumCase();
588
+ }
589
+ }
590
+ }, {
591
+ key: "write",
592
+ value: function write(value, into) {
593
+ switch (value.tag) {
594
+ case EncryptionSystem_Tags.Unencrypted:
595
+ {
596
+ ordinalConverter.write(1, into);
597
+ return;
598
+ }
599
+ case EncryptionSystem_Tags.PerParticipantKeys:
600
+ {
601
+ ordinalConverter.write(2, into);
602
+ return;
603
+ }
604
+ case EncryptionSystem_Tags.SharedSecret:
605
+ {
606
+ ordinalConverter.write(3, into);
607
+ var inner = value.inner;
608
+ FfiConverterString.write(inner.secret, into);
609
+ return;
610
+ }
611
+ default:
612
+ // Throwing from here means that EncryptionSystem_Tags hasn't matched an ordinal.
613
+ throw new UniffiInternalError.UnexpectedEnumCase();
614
+ }
615
+ }
616
+ }, {
617
+ key: "allocationSize",
618
+ value: function allocationSize(value) {
619
+ switch (value.tag) {
620
+ case EncryptionSystem_Tags.Unencrypted:
621
+ {
622
+ return ordinalConverter.allocationSize(1);
623
+ }
624
+ case EncryptionSystem_Tags.PerParticipantKeys:
625
+ {
626
+ return ordinalConverter.allocationSize(2);
627
+ }
628
+ case EncryptionSystem_Tags.SharedSecret:
629
+ {
630
+ var inner = value.inner;
631
+ var size = ordinalConverter.allocationSize(3);
632
+ size += FfiConverterString.allocationSize(inner.secret);
633
+ return size;
634
+ }
635
+ default:
636
+ throw new UniffiInternalError.UnexpectedEnumCase();
637
+ }
638
+ }
639
+ }]);
640
+ }(AbstractFfiConverterByteArray);
641
+ return new FFIConverter();
642
+ }();
643
+ /**
644
+ * Defines how (if) element-call renders a header.
645
+ */
646
+ export var HeaderStyle;
647
+ (function (HeaderStyle) {
648
+ /**
649
+ * The normal header with branding.
650
+ */
651
+ HeaderStyle[HeaderStyle["Standard"] = 0] = "Standard";
652
+ /**
653
+ * Render a header with a back button (useful on mobile platforms).
654
+ */
655
+ HeaderStyle[HeaderStyle["AppBar"] = 1] = "AppBar";
656
+ /**
657
+ * No Header (useful for webapps).
658
+ */
659
+ HeaderStyle[HeaderStyle["None"] = 2] = "None";
660
+ })(HeaderStyle || (HeaderStyle = {}));
661
+ var FfiConverterTypeHeaderStyle = function () {
662
+ var ordinalConverter = FfiConverterInt32;
663
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter7) {
664
+ function FFIConverter() {
665
+ _classCallCheck(this, FFIConverter);
666
+ return _callSuper(this, FFIConverter, arguments);
667
+ }
668
+ _inherits(FFIConverter, _AbstractFfiConverter7);
669
+ return _createClass(FFIConverter, [{
670
+ key: "read",
671
+ value: function read(from) {
672
+ switch (ordinalConverter.read(from)) {
673
+ case 1:
674
+ return HeaderStyle.Standard;
675
+ case 2:
676
+ return HeaderStyle.AppBar;
677
+ case 3:
678
+ return HeaderStyle.None;
679
+ default:
680
+ throw new UniffiInternalError.UnexpectedEnumCase();
681
+ }
682
+ }
683
+ }, {
684
+ key: "write",
685
+ value: function write(value, into) {
686
+ switch (value) {
687
+ case HeaderStyle.Standard:
688
+ return ordinalConverter.write(1, into);
689
+ case HeaderStyle.AppBar:
690
+ return ordinalConverter.write(2, into);
691
+ case HeaderStyle.None:
692
+ return ordinalConverter.write(3, into);
693
+ }
694
+ }
695
+ }, {
696
+ key: "allocationSize",
697
+ value: function allocationSize(value) {
698
+ return ordinalConverter.allocationSize(0);
699
+ }
700
+ }]);
701
+ }(AbstractFfiConverterByteArray);
702
+ return new FFIConverter();
703
+ }();
704
+ /**
705
+ * Defines the intent of showing the call.
706
+ *
707
+ * This controls whether to show or skip the lobby.
708
+ */
709
+ export var Intent;
710
+ (function (Intent) {
711
+ /**
712
+ * The user wants to start a call.
713
+ */
714
+ Intent[Intent["StartCall"] = 0] = "StartCall";
715
+ /**
716
+ * The user wants to join an existing call.
717
+ */
718
+ Intent[Intent["JoinExisting"] = 1] = "JoinExisting";
719
+ /**
720
+ * The user wants to join an existing call that is a "Direct Message" (DM)
721
+ * room.
722
+ */
723
+ Intent[Intent["JoinExistingDm"] = 2] = "JoinExistingDm";
724
+ /**
725
+ * The user wants to start a call in a "Direct Message" (DM) room.
726
+ */
727
+ Intent[Intent["StartCallDm"] = 3] = "StartCallDm";
728
+ })(Intent || (Intent = {}));
729
+ var FfiConverterTypeIntent = function () {
730
+ var ordinalConverter = FfiConverterInt32;
731
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter8) {
732
+ function FFIConverter() {
733
+ _classCallCheck(this, FFIConverter);
734
+ return _callSuper(this, FFIConverter, arguments);
735
+ }
736
+ _inherits(FFIConverter, _AbstractFfiConverter8);
737
+ return _createClass(FFIConverter, [{
738
+ key: "read",
739
+ value: function read(from) {
740
+ switch (ordinalConverter.read(from)) {
741
+ case 1:
742
+ return Intent.StartCall;
743
+ case 2:
744
+ return Intent.JoinExisting;
745
+ case 3:
746
+ return Intent.JoinExistingDm;
747
+ case 4:
748
+ return Intent.StartCallDm;
749
+ default:
750
+ throw new UniffiInternalError.UnexpectedEnumCase();
751
+ }
752
+ }
753
+ }, {
754
+ key: "write",
755
+ value: function write(value, into) {
756
+ switch (value) {
757
+ case Intent.StartCall:
758
+ return ordinalConverter.write(1, into);
759
+ case Intent.JoinExisting:
760
+ return ordinalConverter.write(2, into);
761
+ case Intent.JoinExistingDm:
762
+ return ordinalConverter.write(3, into);
763
+ case Intent.StartCallDm:
764
+ return ordinalConverter.write(4, into);
765
+ }
766
+ }
767
+ }, {
768
+ key: "allocationSize",
769
+ value: function allocationSize(value) {
770
+ return ordinalConverter.allocationSize(0);
771
+ }
772
+ }]);
773
+ }(AbstractFfiConverterByteArray);
774
+ return new FFIConverter();
775
+ }();
776
+ /**
777
+ * Types of call notifications.
778
+ */
779
+ export var NotificationType;
780
+ (function (NotificationType) {
781
+ /**
782
+ * The receiving client should display a visual notification.
783
+ */
784
+ NotificationType[NotificationType["Notification"] = 0] = "Notification";
785
+ /**
786
+ * The receiving client should ring with an audible sound.
787
+ */
788
+ NotificationType[NotificationType["Ring"] = 1] = "Ring";
789
+ })(NotificationType || (NotificationType = {}));
790
+ var FfiConverterTypeNotificationType = function () {
791
+ var ordinalConverter = FfiConverterInt32;
792
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter9) {
793
+ function FFIConverter() {
794
+ _classCallCheck(this, FFIConverter);
795
+ return _callSuper(this, FFIConverter, arguments);
796
+ }
797
+ _inherits(FFIConverter, _AbstractFfiConverter9);
798
+ return _createClass(FFIConverter, [{
799
+ key: "read",
800
+ value: function read(from) {
801
+ switch (ordinalConverter.read(from)) {
802
+ case 1:
803
+ return NotificationType.Notification;
804
+ case 2:
805
+ return NotificationType.Ring;
806
+ default:
807
+ throw new UniffiInternalError.UnexpectedEnumCase();
808
+ }
809
+ }
810
+ }, {
811
+ key: "write",
812
+ value: function write(value, into) {
813
+ switch (value) {
814
+ case NotificationType.Notification:
815
+ return ordinalConverter.write(1, into);
816
+ case NotificationType.Ring:
817
+ return ordinalConverter.write(2, into);
818
+ }
819
+ }
820
+ }, {
821
+ key: "allocationSize",
822
+ value: function allocationSize(value) {
823
+ return ordinalConverter.allocationSize(0);
824
+ }
825
+ }]);
826
+ }(AbstractFfiConverterByteArray);
827
+ return new FFIConverter();
828
+ }();
829
+ /**
830
+ * Current state of a [`Paginator`].
831
+ */
832
+ export var PaginatorState;
833
+ (function (PaginatorState) {
834
+ /**
835
+ * The initial state of the paginator.
836
+ */
837
+ PaginatorState[PaginatorState["Initial"] = 0] = "Initial";
838
+ /**
839
+ * The paginator is fetching the target initial event.
840
+ */
841
+ PaginatorState[PaginatorState["FetchingTargetEvent"] = 1] = "FetchingTargetEvent";
842
+ /**
843
+ * The target initial event could be found, zero or more paginations have
844
+ * happened since then, and the paginator is at rest now.
845
+ */
846
+ PaginatorState[PaginatorState["Idle"] = 2] = "Idle";
847
+ /**
848
+ * The paginator is… paginating one direction or another.
849
+ */
850
+ PaginatorState[PaginatorState["Paginating"] = 3] = "Paginating";
851
+ })(PaginatorState || (PaginatorState = {}));
852
+ var FfiConverterTypePaginatorState = function () {
853
+ var ordinalConverter = FfiConverterInt32;
854
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter0) {
855
+ function FFIConverter() {
856
+ _classCallCheck(this, FFIConverter);
857
+ return _callSuper(this, FFIConverter, arguments);
858
+ }
859
+ _inherits(FFIConverter, _AbstractFfiConverter0);
860
+ return _createClass(FFIConverter, [{
861
+ key: "read",
862
+ value: function read(from) {
863
+ switch (ordinalConverter.read(from)) {
864
+ case 1:
865
+ return PaginatorState.Initial;
866
+ case 2:
867
+ return PaginatorState.FetchingTargetEvent;
868
+ case 3:
869
+ return PaginatorState.Idle;
870
+ case 4:
871
+ return PaginatorState.Paginating;
872
+ default:
873
+ throw new UniffiInternalError.UnexpectedEnumCase();
874
+ }
875
+ }
876
+ }, {
877
+ key: "write",
878
+ value: function write(value, into) {
879
+ switch (value) {
880
+ case PaginatorState.Initial:
881
+ return ordinalConverter.write(1, into);
882
+ case PaginatorState.FetchingTargetEvent:
883
+ return ordinalConverter.write(2, into);
884
+ case PaginatorState.Idle:
885
+ return ordinalConverter.write(3, into);
886
+ case PaginatorState.Paginating:
887
+ return ordinalConverter.write(4, into);
888
+ }
889
+ }
890
+ }, {
891
+ key: "allocationSize",
892
+ value: function allocationSize(value) {
893
+ return ordinalConverter.allocationSize(0);
894
+ }
895
+ }]);
896
+ }(AbstractFfiConverterByteArray);
897
+ return new FFIConverter();
898
+ }();
899
+ // Flat error type: QrCodeLoginError
900
+ export var QrCodeLoginError_Tags;
901
+ (function (QrCodeLoginError_Tags) {
902
+ QrCodeLoginError_Tags["OAuth"] = "OAuth";
903
+ QrCodeLoginError_Tags["LoginFailure"] = "LoginFailure";
904
+ QrCodeLoginError_Tags["UnexpectedMessage"] = "UnexpectedMessage";
905
+ QrCodeLoginError_Tags["SecureChannel"] = "SecureChannel";
906
+ QrCodeLoginError_Tags["NotFound"] = "NotFound";
907
+ QrCodeLoginError_Tags["CrossProcessRefreshLock"] = "CrossProcessRefreshLock";
908
+ QrCodeLoginError_Tags["UserIdDiscovery"] = "UserIdDiscovery";
909
+ QrCodeLoginError_Tags["SessionTokens"] = "SessionTokens";
910
+ QrCodeLoginError_Tags["DeviceKeyUpload"] = "DeviceKeyUpload";
911
+ QrCodeLoginError_Tags["SecretImport"] = "SecretImport";
912
+ QrCodeLoginError_Tags["ServerReset"] = "ServerReset";
913
+ })(QrCodeLoginError_Tags || (QrCodeLoginError_Tags = {}));
914
+ /**
915
+ * The error type for failures while trying to log in a new device using a QR
916
+ * code.
917
+ */
918
+ export var QrCodeLoginError = function () {
919
+ /**
920
+ * An error happened while we were communicating with the OAuth 2.0
921
+ * authorization server.
922
+ */
923
+ var OAuth = /*#__PURE__*/function (_UniffiError) {
924
+ function OAuth(message) {
925
+ var _this4;
926
+ _classCallCheck(this, OAuth);
927
+ _this4 = _callSuper(this, OAuth, ["QrCodeLoginError", "OAuth", message]);
928
+ /**
929
+ * @private
930
+ * This field is private and should not be used.
931
+ */
932
+ _defineProperty(_this4, uniffiTypeNameSymbol, "QrCodeLoginError");
933
+ /**
934
+ * @private
935
+ * This field is private and should not be used.
936
+ */
937
+ _defineProperty(_this4, variantOrdinalSymbol, 1);
938
+ _defineProperty(_this4, "tag", QrCodeLoginError_Tags.OAuth);
939
+ return _this4;
940
+ }
941
+ _inherits(OAuth, _UniffiError);
942
+ return _createClass(OAuth, null, [{
943
+ key: "instanceOf",
944
+ value: function instanceOf(e) {
945
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 1;
946
+ }
947
+ }]);
948
+ }(UniffiError);
949
+ /**
950
+ * The other device has signaled to us that the login has failed.
951
+ */
952
+ var LoginFailure = /*#__PURE__*/function (_UniffiError2) {
953
+ function LoginFailure(message) {
954
+ var _this5;
955
+ _classCallCheck(this, LoginFailure);
956
+ _this5 = _callSuper(this, LoginFailure, ["QrCodeLoginError", "LoginFailure", message]);
957
+ /**
958
+ * @private
959
+ * This field is private and should not be used.
960
+ */
961
+ _defineProperty(_this5, uniffiTypeNameSymbol, "QrCodeLoginError");
962
+ /**
963
+ * @private
964
+ * This field is private and should not be used.
965
+ */
966
+ _defineProperty(_this5, variantOrdinalSymbol, 2);
967
+ _defineProperty(_this5, "tag", QrCodeLoginError_Tags.LoginFailure);
968
+ return _this5;
969
+ }
970
+ _inherits(LoginFailure, _UniffiError2);
971
+ return _createClass(LoginFailure, null, [{
972
+ key: "instanceOf",
973
+ value: function instanceOf(e) {
974
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 2;
975
+ }
976
+ }]);
977
+ }(UniffiError);
978
+ /**
979
+ * An unexpected message was received from the other device.
980
+ */
981
+ var UnexpectedMessage = /*#__PURE__*/function (_UniffiError3) {
982
+ function UnexpectedMessage(message) {
983
+ var _this6;
984
+ _classCallCheck(this, UnexpectedMessage);
985
+ _this6 = _callSuper(this, UnexpectedMessage, ["QrCodeLoginError", "UnexpectedMessage", message]);
986
+ /**
987
+ * @private
988
+ * This field is private and should not be used.
989
+ */
990
+ _defineProperty(_this6, uniffiTypeNameSymbol, "QrCodeLoginError");
991
+ /**
992
+ * @private
993
+ * This field is private and should not be used.
994
+ */
995
+ _defineProperty(_this6, variantOrdinalSymbol, 3);
996
+ _defineProperty(_this6, "tag", QrCodeLoginError_Tags.UnexpectedMessage);
997
+ return _this6;
998
+ }
999
+ _inherits(UnexpectedMessage, _UniffiError3);
1000
+ return _createClass(UnexpectedMessage, null, [{
1001
+ key: "instanceOf",
1002
+ value: function instanceOf(e) {
1003
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 3;
1004
+ }
1005
+ }]);
1006
+ }(UniffiError);
1007
+ /**
1008
+ * An error happened while exchanging messages with the other device.
1009
+ */
1010
+ var SecureChannel = /*#__PURE__*/function (_UniffiError4) {
1011
+ function SecureChannel(message) {
1012
+ var _this7;
1013
+ _classCallCheck(this, SecureChannel);
1014
+ _this7 = _callSuper(this, SecureChannel, ["QrCodeLoginError", "SecureChannel", message]);
1015
+ /**
1016
+ * @private
1017
+ * This field is private and should not be used.
1018
+ */
1019
+ _defineProperty(_this7, uniffiTypeNameSymbol, "QrCodeLoginError");
1020
+ /**
1021
+ * @private
1022
+ * This field is private and should not be used.
1023
+ */
1024
+ _defineProperty(_this7, variantOrdinalSymbol, 4);
1025
+ _defineProperty(_this7, "tag", QrCodeLoginError_Tags.SecureChannel);
1026
+ return _this7;
1027
+ }
1028
+ _inherits(SecureChannel, _UniffiError4);
1029
+ return _createClass(SecureChannel, null, [{
1030
+ key: "instanceOf",
1031
+ value: function instanceOf(e) {
1032
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 4;
1033
+ }
1034
+ }]);
1035
+ }(UniffiError);
1036
+ /**
1037
+ * The rendezvous session was not found and might have expired.
1038
+ */
1039
+ var NotFound = /*#__PURE__*/function (_UniffiError5) {
1040
+ function NotFound(message) {
1041
+ var _this8;
1042
+ _classCallCheck(this, NotFound);
1043
+ _this8 = _callSuper(this, NotFound, ["QrCodeLoginError", "NotFound", message]);
1044
+ /**
1045
+ * @private
1046
+ * This field is private and should not be used.
1047
+ */
1048
+ _defineProperty(_this8, uniffiTypeNameSymbol, "QrCodeLoginError");
1049
+ /**
1050
+ * @private
1051
+ * This field is private and should not be used.
1052
+ */
1053
+ _defineProperty(_this8, variantOrdinalSymbol, 5);
1054
+ _defineProperty(_this8, "tag", QrCodeLoginError_Tags.NotFound);
1055
+ return _this8;
1056
+ }
1057
+ _inherits(NotFound, _UniffiError5);
1058
+ return _createClass(NotFound, null, [{
1059
+ key: "instanceOf",
1060
+ value: function instanceOf(e) {
1061
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 5;
1062
+ }
1063
+ }]);
1064
+ }(UniffiError);
1065
+ /**
1066
+ * The cross-process refresh lock failed to be initialized.
1067
+ */
1068
+ var CrossProcessRefreshLock = /*#__PURE__*/function (_UniffiError6) {
1069
+ function CrossProcessRefreshLock(message) {
1070
+ var _this9;
1071
+ _classCallCheck(this, CrossProcessRefreshLock);
1072
+ _this9 = _callSuper(this, CrossProcessRefreshLock, ["QrCodeLoginError", "CrossProcessRefreshLock", message]);
1073
+ /**
1074
+ * @private
1075
+ * This field is private and should not be used.
1076
+ */
1077
+ _defineProperty(_this9, uniffiTypeNameSymbol, "QrCodeLoginError");
1078
+ /**
1079
+ * @private
1080
+ * This field is private and should not be used.
1081
+ */
1082
+ _defineProperty(_this9, variantOrdinalSymbol, 6);
1083
+ _defineProperty(_this9, "tag", QrCodeLoginError_Tags.CrossProcessRefreshLock);
1084
+ return _this9;
1085
+ }
1086
+ _inherits(CrossProcessRefreshLock, _UniffiError6);
1087
+ return _createClass(CrossProcessRefreshLock, null, [{
1088
+ key: "instanceOf",
1089
+ value: function instanceOf(e) {
1090
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 6;
1091
+ }
1092
+ }]);
1093
+ }(UniffiError);
1094
+ /**
1095
+ * An error happened while we were trying to discover our user and device
1096
+ * ID, after we have acquired an access token from the OAuth 2.0
1097
+ * authorization server.
1098
+ */
1099
+ var UserIdDiscovery = /*#__PURE__*/function (_UniffiError7) {
1100
+ function UserIdDiscovery(message) {
1101
+ var _this0;
1102
+ _classCallCheck(this, UserIdDiscovery);
1103
+ _this0 = _callSuper(this, UserIdDiscovery, ["QrCodeLoginError", "UserIdDiscovery", message]);
1104
+ /**
1105
+ * @private
1106
+ * This field is private and should not be used.
1107
+ */
1108
+ _defineProperty(_this0, uniffiTypeNameSymbol, "QrCodeLoginError");
1109
+ /**
1110
+ * @private
1111
+ * This field is private and should not be used.
1112
+ */
1113
+ _defineProperty(_this0, variantOrdinalSymbol, 7);
1114
+ _defineProperty(_this0, "tag", QrCodeLoginError_Tags.UserIdDiscovery);
1115
+ return _this0;
1116
+ }
1117
+ _inherits(UserIdDiscovery, _UniffiError7);
1118
+ return _createClass(UserIdDiscovery, null, [{
1119
+ key: "instanceOf",
1120
+ value: function instanceOf(e) {
1121
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 7;
1122
+ }
1123
+ }]);
1124
+ }(UniffiError);
1125
+ /**
1126
+ * We failed to set the session tokens after we figured out our device and
1127
+ * user IDs.
1128
+ */
1129
+ var SessionTokens = /*#__PURE__*/function (_UniffiError8) {
1130
+ function SessionTokens(message) {
1131
+ var _this1;
1132
+ _classCallCheck(this, SessionTokens);
1133
+ _this1 = _callSuper(this, SessionTokens, ["QrCodeLoginError", "SessionTokens", message]);
1134
+ /**
1135
+ * @private
1136
+ * This field is private and should not be used.
1137
+ */
1138
+ _defineProperty(_this1, uniffiTypeNameSymbol, "QrCodeLoginError");
1139
+ /**
1140
+ * @private
1141
+ * This field is private and should not be used.
1142
+ */
1143
+ _defineProperty(_this1, variantOrdinalSymbol, 8);
1144
+ _defineProperty(_this1, "tag", QrCodeLoginError_Tags.SessionTokens);
1145
+ return _this1;
1146
+ }
1147
+ _inherits(SessionTokens, _UniffiError8);
1148
+ return _createClass(SessionTokens, null, [{
1149
+ key: "instanceOf",
1150
+ value: function instanceOf(e) {
1151
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 8;
1152
+ }
1153
+ }]);
1154
+ }(UniffiError);
1155
+ /**
1156
+ * The device keys failed to be uploaded after we successfully logged in.
1157
+ */
1158
+ var DeviceKeyUpload = /*#__PURE__*/function (_UniffiError9) {
1159
+ function DeviceKeyUpload(message) {
1160
+ var _this10;
1161
+ _classCallCheck(this, DeviceKeyUpload);
1162
+ _this10 = _callSuper(this, DeviceKeyUpload, ["QrCodeLoginError", "DeviceKeyUpload", message]);
1163
+ /**
1164
+ * @private
1165
+ * This field is private and should not be used.
1166
+ */
1167
+ _defineProperty(_this10, uniffiTypeNameSymbol, "QrCodeLoginError");
1168
+ /**
1169
+ * @private
1170
+ * This field is private and should not be used.
1171
+ */
1172
+ _defineProperty(_this10, variantOrdinalSymbol, 9);
1173
+ _defineProperty(_this10, "tag", QrCodeLoginError_Tags.DeviceKeyUpload);
1174
+ return _this10;
1175
+ }
1176
+ _inherits(DeviceKeyUpload, _UniffiError9);
1177
+ return _createClass(DeviceKeyUpload, null, [{
1178
+ key: "instanceOf",
1179
+ value: function instanceOf(e) {
1180
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 9;
1181
+ }
1182
+ }]);
1183
+ }(UniffiError);
1184
+ /**
1185
+ * The secrets bundle we received from the existing device failed to be
1186
+ * imported.
1187
+ */
1188
+ var SecretImport = /*#__PURE__*/function (_UniffiError0) {
1189
+ function SecretImport(message) {
1190
+ var _this11;
1191
+ _classCallCheck(this, SecretImport);
1192
+ _this11 = _callSuper(this, SecretImport, ["QrCodeLoginError", "SecretImport", message]);
1193
+ /**
1194
+ * @private
1195
+ * This field is private and should not be used.
1196
+ */
1197
+ _defineProperty(_this11, uniffiTypeNameSymbol, "QrCodeLoginError");
1198
+ /**
1199
+ * @private
1200
+ * This field is private and should not be used.
1201
+ */
1202
+ _defineProperty(_this11, variantOrdinalSymbol, 10);
1203
+ _defineProperty(_this11, "tag", QrCodeLoginError_Tags.SecretImport);
1204
+ return _this11;
1205
+ }
1206
+ _inherits(SecretImport, _UniffiError0);
1207
+ return _createClass(SecretImport, null, [{
1208
+ key: "instanceOf",
1209
+ value: function instanceOf(e) {
1210
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 10;
1211
+ }
1212
+ }]);
1213
+ }(UniffiError);
1214
+ /**
1215
+ * The other party told us to use a different homeserver but we failed to
1216
+ * reset the server URL.
1217
+ */
1218
+ var ServerReset = /*#__PURE__*/function (_UniffiError1) {
1219
+ function ServerReset(message) {
1220
+ var _this12;
1221
+ _classCallCheck(this, ServerReset);
1222
+ _this12 = _callSuper(this, ServerReset, ["QrCodeLoginError", "ServerReset", message]);
1223
+ /**
1224
+ * @private
1225
+ * This field is private and should not be used.
1226
+ */
1227
+ _defineProperty(_this12, uniffiTypeNameSymbol, "QrCodeLoginError");
1228
+ /**
1229
+ * @private
1230
+ * This field is private and should not be used.
1231
+ */
1232
+ _defineProperty(_this12, variantOrdinalSymbol, 11);
1233
+ _defineProperty(_this12, "tag", QrCodeLoginError_Tags.ServerReset);
1234
+ return _this12;
1235
+ }
1236
+ _inherits(ServerReset, _UniffiError1);
1237
+ return _createClass(ServerReset, null, [{
1238
+ key: "instanceOf",
1239
+ value: function instanceOf(e) {
1240
+ return _instanceOf(e) && e[variantOrdinalSymbol] === 11;
1241
+ }
1242
+ }]);
1243
+ }(UniffiError); // Utility function which does not rely on instanceof.
1244
+ function _instanceOf(e) {
1245
+ return e[uniffiTypeNameSymbol] === "QrCodeLoginError";
1246
+ }
1247
+ return {
1248
+ OAuth: OAuth,
1249
+ LoginFailure: LoginFailure,
1250
+ UnexpectedMessage: UnexpectedMessage,
1251
+ SecureChannel: SecureChannel,
1252
+ NotFound: NotFound,
1253
+ CrossProcessRefreshLock: CrossProcessRefreshLock,
1254
+ UserIdDiscovery: UserIdDiscovery,
1255
+ SessionTokens: SessionTokens,
1256
+ DeviceKeyUpload: DeviceKeyUpload,
1257
+ SecretImport: SecretImport,
1258
+ ServerReset: ServerReset,
1259
+ instanceOf: _instanceOf
1260
+ };
1261
+ }();
1262
+ var FfiConverterTypeQRCodeLoginError = function () {
1263
+ var intConverter = FfiConverterInt32;
1264
+ var FfiConverter = /*#__PURE__*/function (_AbstractFfiConverter1) {
1265
+ function FfiConverter() {
1266
+ _classCallCheck(this, FfiConverter);
1267
+ return _callSuper(this, FfiConverter, arguments);
1268
+ }
1269
+ _inherits(FfiConverter, _AbstractFfiConverter1);
1270
+ return _createClass(FfiConverter, [{
1271
+ key: "read",
1272
+ value: function read(from) {
1273
+ switch (intConverter.read(from)) {
1274
+ case 1:
1275
+ return new QrCodeLoginError.OAuth(FfiConverterString.read(from));
1276
+ case 2:
1277
+ return new QrCodeLoginError.LoginFailure(FfiConverterString.read(from));
1278
+ case 3:
1279
+ return new QrCodeLoginError.UnexpectedMessage(FfiConverterString.read(from));
1280
+ case 4:
1281
+ return new QrCodeLoginError.SecureChannel(FfiConverterString.read(from));
1282
+ case 5:
1283
+ return new QrCodeLoginError.NotFound(FfiConverterString.read(from));
1284
+ case 6:
1285
+ return new QrCodeLoginError.CrossProcessRefreshLock(FfiConverterString.read(from));
1286
+ case 7:
1287
+ return new QrCodeLoginError.UserIdDiscovery(FfiConverterString.read(from));
1288
+ case 8:
1289
+ return new QrCodeLoginError.SessionTokens(FfiConverterString.read(from));
1290
+ case 9:
1291
+ return new QrCodeLoginError.DeviceKeyUpload(FfiConverterString.read(from));
1292
+ case 10:
1293
+ return new QrCodeLoginError.SecretImport(FfiConverterString.read(from));
1294
+ case 11:
1295
+ return new QrCodeLoginError.ServerReset(FfiConverterString.read(from));
1296
+ default:
1297
+ throw new UniffiInternalError.UnexpectedEnumCase();
1298
+ }
1299
+ }
1300
+ }, {
1301
+ key: "write",
1302
+ value: function write(value, into) {
1303
+ var obj = value;
1304
+ var index = obj[variantOrdinalSymbol];
1305
+ intConverter.write(index, into);
1306
+ }
1307
+ }, {
1308
+ key: "allocationSize",
1309
+ value: function allocationSize(value) {
1310
+ return intConverter.allocationSize(0);
1311
+ }
1312
+ }]);
1313
+ }(AbstractFfiConverterByteArray);
1314
+ return new FfiConverter();
1315
+ }();
1316
+ /**
1317
+ * The role of a member in a room.
1318
+ */
1319
+ export var RoomMemberRole;
1320
+ (function (RoomMemberRole) {
1321
+ /**
1322
+ * The member is a creator.
1323
+ *
1324
+ * A creator has an infinite power level and cannot be demoted, so this
1325
+ * role is immutable. A room can have several creators.
1326
+ *
1327
+ * It is available in room versions where
1328
+ * `explicitly_privilege_room_creators` in [`AuthorizationRules`] is set to
1329
+ * `true`.
1330
+ *
1331
+ * [`AuthorizationRules`]: ruma::room_version_rules::AuthorizationRules
1332
+ */
1333
+ RoomMemberRole[RoomMemberRole["Creator"] = 0] = "Creator";
1334
+ /**
1335
+ * The member is an administrator.
1336
+ */
1337
+ RoomMemberRole[RoomMemberRole["Administrator"] = 1] = "Administrator";
1338
+ /**
1339
+ * The member is a moderator.
1340
+ */
1341
+ RoomMemberRole[RoomMemberRole["Moderator"] = 2] = "Moderator";
1342
+ /**
1343
+ * The member is a regular user.
1344
+ */
1345
+ RoomMemberRole[RoomMemberRole["User"] = 3] = "User";
1346
+ })(RoomMemberRole || (RoomMemberRole = {}));
1347
+ var FfiConverterTypeRoomMemberRole = function () {
1348
+ var ordinalConverter = FfiConverterInt32;
1349
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter10) {
1350
+ function FFIConverter() {
1351
+ _classCallCheck(this, FFIConverter);
1352
+ return _callSuper(this, FFIConverter, arguments);
1353
+ }
1354
+ _inherits(FFIConverter, _AbstractFfiConverter10);
1355
+ return _createClass(FFIConverter, [{
1356
+ key: "read",
1357
+ value: function read(from) {
1358
+ switch (ordinalConverter.read(from)) {
1359
+ case 1:
1360
+ return RoomMemberRole.Creator;
1361
+ case 2:
1362
+ return RoomMemberRole.Administrator;
1363
+ case 3:
1364
+ return RoomMemberRole.Moderator;
1365
+ case 4:
1366
+ return RoomMemberRole.User;
1367
+ default:
1368
+ throw new UniffiInternalError.UnexpectedEnumCase();
1369
+ }
1370
+ }
1371
+ }, {
1372
+ key: "write",
1373
+ value: function write(value, into) {
1374
+ switch (value) {
1375
+ case RoomMemberRole.Creator:
1376
+ return ordinalConverter.write(1, into);
1377
+ case RoomMemberRole.Administrator:
1378
+ return ordinalConverter.write(2, into);
1379
+ case RoomMemberRole.Moderator:
1380
+ return ordinalConverter.write(3, into);
1381
+ case RoomMemberRole.User:
1382
+ return ordinalConverter.write(4, into);
1383
+ }
1384
+ }
1385
+ }, {
1386
+ key: "allocationSize",
1387
+ value: function allocationSize(value) {
1388
+ return ordinalConverter.allocationSize(0);
1389
+ }
1390
+ }]);
1391
+ }(AbstractFfiConverterByteArray);
1392
+ return new FFIConverter();
1393
+ }();
1394
+ // Enum: RoomPaginationStatus
1395
+ export var RoomPaginationStatus_Tags;
1396
+ (function (RoomPaginationStatus_Tags) {
1397
+ RoomPaginationStatus_Tags["Idle"] = "Idle";
1398
+ RoomPaginationStatus_Tags["Paginating"] = "Paginating";
1399
+ })(RoomPaginationStatus_Tags || (RoomPaginationStatus_Tags = {}));
1400
+ /**
1401
+ * Status for the back-pagination on a room event cache.
1402
+ */
1403
+ export var RoomPaginationStatus = function () {
1404
+ /**
1405
+ * No back-pagination is happening right now.
1406
+ */
1407
+ var Idle_ = /*#__PURE__*/function (_UniffiEnum4) {
1408
+ function Idle_(inner) {
1409
+ var _this13;
1410
+ _classCallCheck(this, Idle_);
1411
+ _this13 = _callSuper(this, Idle_, ["RoomPaginationStatus", "Idle"]);
1412
+ /**
1413
+ * @private
1414
+ * This field is private and should not be used, use `tag` instead.
1415
+ */
1416
+ _defineProperty(_this13, uniffiTypeNameSymbol, "RoomPaginationStatus");
1417
+ _defineProperty(_this13, "tag", RoomPaginationStatus_Tags.Idle);
1418
+ _defineProperty(_this13, "inner", void 0);
1419
+ _this13.inner = Object.freeze(inner);
1420
+ return _this13;
1421
+ }
1422
+ _inherits(Idle_, _UniffiEnum4);
1423
+ return _createClass(Idle_, null, [{
1424
+ key: "new",
1425
+ value: function _new(inner) {
1426
+ return new Idle_(inner);
1427
+ }
1428
+ }, {
1429
+ key: "instanceOf",
1430
+ value: function instanceOf(obj) {
1431
+ return obj.tag === RoomPaginationStatus_Tags.Idle;
1432
+ }
1433
+ }]);
1434
+ }(UniffiEnum);
1435
+ /**
1436
+ * Back-pagination is already running in the background.
1437
+ */
1438
+ var Paginating_ = /*#__PURE__*/function (_UniffiEnum5) {
1439
+ function Paginating_() {
1440
+ var _this14;
1441
+ _classCallCheck(this, Paginating_);
1442
+ _this14 = _callSuper(this, Paginating_, ["RoomPaginationStatus", "Paginating"]);
1443
+ /**
1444
+ * @private
1445
+ * This field is private and should not be used, use `tag` instead.
1446
+ */
1447
+ _defineProperty(_this14, uniffiTypeNameSymbol, "RoomPaginationStatus");
1448
+ _defineProperty(_this14, "tag", RoomPaginationStatus_Tags.Paginating);
1449
+ return _this14;
1450
+ }
1451
+ _inherits(Paginating_, _UniffiEnum5);
1452
+ return _createClass(Paginating_, null, [{
1453
+ key: "new",
1454
+ value: function _new() {
1455
+ return new Paginating_();
1456
+ }
1457
+ }, {
1458
+ key: "instanceOf",
1459
+ value: function instanceOf(obj) {
1460
+ return obj.tag === RoomPaginationStatus_Tags.Paginating;
1461
+ }
1462
+ }]);
1463
+ }(UniffiEnum);
1464
+ function instanceOf(obj) {
1465
+ return obj[uniffiTypeNameSymbol] === "RoomPaginationStatus";
1466
+ }
1467
+ return Object.freeze({
1468
+ instanceOf: instanceOf,
1469
+ Idle: Idle_,
1470
+ Paginating: Paginating_
1471
+ });
1472
+ }();
1473
+ // FfiConverter for enum RoomPaginationStatus
1474
+ var FfiConverterTypeRoomPaginationStatus = function () {
1475
+ var ordinalConverter = FfiConverterInt32;
1476
+ var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter11) {
1477
+ function FFIConverter() {
1478
+ _classCallCheck(this, FFIConverter);
1479
+ return _callSuper(this, FFIConverter, arguments);
1480
+ }
1481
+ _inherits(FFIConverter, _AbstractFfiConverter11);
1482
+ return _createClass(FFIConverter, [{
1483
+ key: "read",
1484
+ value: function read(from) {
1485
+ switch (ordinalConverter.read(from)) {
1486
+ case 1:
1487
+ return new RoomPaginationStatus.Idle({
1488
+ hitTimelineStart: FfiConverterBool.read(from)
1489
+ });
1490
+ case 2:
1491
+ return new RoomPaginationStatus.Paginating();
1492
+ default:
1493
+ throw new UniffiInternalError.UnexpectedEnumCase();
1494
+ }
1495
+ }
1496
+ }, {
1497
+ key: "write",
1498
+ value: function write(value, into) {
1499
+ switch (value.tag) {
1500
+ case RoomPaginationStatus_Tags.Idle:
1501
+ {
1502
+ ordinalConverter.write(1, into);
1503
+ var inner = value.inner;
1504
+ FfiConverterBool.write(inner.hitTimelineStart, into);
1505
+ return;
1506
+ }
1507
+ case RoomPaginationStatus_Tags.Paginating:
1508
+ {
1509
+ ordinalConverter.write(2, into);
1510
+ return;
1511
+ }
1512
+ default:
1513
+ // Throwing from here means that RoomPaginationStatus_Tags hasn't matched an ordinal.
1514
+ throw new UniffiInternalError.UnexpectedEnumCase();
1515
+ }
1516
+ }
1517
+ }, {
1518
+ key: "allocationSize",
1519
+ value: function allocationSize(value) {
1520
+ switch (value.tag) {
1521
+ case RoomPaginationStatus_Tags.Idle:
1522
+ {
1523
+ var inner = value.inner;
1524
+ var size = ordinalConverter.allocationSize(1);
1525
+ size += FfiConverterBool.allocationSize(inner.hitTimelineStart);
1526
+ return size;
1527
+ }
1528
+ case RoomPaginationStatus_Tags.Paginating:
1529
+ {
1530
+ return ordinalConverter.allocationSize(2);
1531
+ }
1532
+ default:
1533
+ throw new UniffiInternalError.UnexpectedEnumCase();
1534
+ }
1535
+ }
1536
+ }]);
1537
+ }(AbstractFfiConverterByteArray);
1538
+ return new FFIConverter();
1539
+ }();
1540
+ /**
1541
+ * The data needed to perform authorization using OAuth 2.0.
1542
+ */
1543
+ export var OAuthAuthorizationData = /*#__PURE__*/function (_UniffiAbstractObject) {
1544
+ // No primary constructor declared for this class.
1545
+ function OAuthAuthorizationData(pointer) {
1546
+ var _this15;
1547
+ _classCallCheck(this, OAuthAuthorizationData);
1548
+ _this15 = _callSuper(this, OAuthAuthorizationData);
1549
+ _defineProperty(_this15, uniffiTypeNameSymbol, "OAuthAuthorizationData");
1550
+ _defineProperty(_this15, destructorGuardSymbol, void 0);
1551
+ _defineProperty(_this15, pointerLiteralSymbol, void 0);
1552
+ _this15[pointerLiteralSymbol] = pointer;
1553
+ _this15[destructorGuardSymbol] = uniffiTypeOAuthAuthorizationDataObjectFactory.bless(pointer);
1554
+ return _this15;
1555
+ }
1556
+ /**
1557
+ * The login URL to use for authorization.
1558
+ */
1559
+ _inherits(OAuthAuthorizationData, _UniffiAbstractObject);
1560
+ return _createClass(OAuthAuthorizationData, [{
1561
+ key: "loginUrl",
1562
+ value: function loginUrl() {
1563
+ var _this16 = this;
1564
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1565
+ return nativeModule().ubrn_uniffi_matrix_sdk_fn_method_oauthauthorizationdata_login_url(uniffiTypeOAuthAuthorizationDataObjectFactory.clonePointer(_this16), callStatus);
1566
+ }, /*liftString:*/FfiConverterString.lift));
1567
+ }
1568
+ /**
1569
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1570
+ */
1571
+ }, {
1572
+ key: "uniffiDestroy",
1573
+ value: function uniffiDestroy() {
1574
+ var ptr = this[destructorGuardSymbol];
1575
+ if (ptr !== undefined) {
1576
+ var pointer = uniffiTypeOAuthAuthorizationDataObjectFactory.pointer(this);
1577
+ uniffiTypeOAuthAuthorizationDataObjectFactory.freePointer(pointer);
1578
+ uniffiTypeOAuthAuthorizationDataObjectFactory.unbless(ptr);
1579
+ delete this[destructorGuardSymbol];
1580
+ }
1581
+ }
1582
+ }], [{
1583
+ key: "instanceOf",
1584
+ value: function instanceOf(obj) {
1585
+ return uniffiTypeOAuthAuthorizationDataObjectFactory.isConcreteType(obj);
1586
+ }
1587
+ }]);
1588
+ }(UniffiAbstractObject);
1589
+ var uniffiTypeOAuthAuthorizationDataObjectFactory = function () {
1590
+ /// <reference lib="es2021" />
1591
+ var registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry(function (heldValue) {
1592
+ uniffiTypeOAuthAuthorizationDataObjectFactory.freePointer(heldValue);
1593
+ }) : null;
1594
+ return {
1595
+ create: function create(pointer) {
1596
+ var instance = Object.create(OAuthAuthorizationData.prototype);
1597
+ instance[pointerLiteralSymbol] = pointer;
1598
+ instance[destructorGuardSymbol] = this.bless(pointer);
1599
+ instance[uniffiTypeNameSymbol] = "OAuthAuthorizationData";
1600
+ return instance;
1601
+ },
1602
+ bless: function bless(p) {
1603
+ var ptr = {
1604
+ p: p,
1605
+ // make sure this object doesn't get optimized away.
1606
+ markDestroyed: function markDestroyed() {
1607
+ return undefined;
1608
+ }
1609
+ };
1610
+ if (registry) {
1611
+ registry.register(ptr, p, ptr);
1612
+ }
1613
+ return ptr;
1614
+ },
1615
+ unbless: function unbless(ptr) {
1616
+ if (registry) {
1617
+ registry.unregister(ptr);
1618
+ }
1619
+ },
1620
+ pointer: function pointer(obj) {
1621
+ if (obj[destructorGuardSymbol] === undefined) {
1622
+ throw new UniffiInternalError.UnexpectedNullPointer();
1623
+ }
1624
+ return obj[pointerLiteralSymbol];
1625
+ },
1626
+ clonePointer: function clonePointer(obj) {
1627
+ var pointer = this.pointer(obj);
1628
+ return uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1629
+ return nativeModule().ubrn_uniffi_matrix_sdk_fn_clone_oauthauthorizationdata(pointer, callStatus);
1630
+ }, /*liftString:*/FfiConverterString.lift);
1631
+ },
1632
+ freePointer: function freePointer(pointer) {
1633
+ uniffiCaller.rustCall(/*caller:*/function (callStatus) {
1634
+ return nativeModule().ubrn_uniffi_matrix_sdk_fn_free_oauthauthorizationdata(pointer, callStatus);
1635
+ }, /*liftString:*/FfiConverterString.lift);
1636
+ },
1637
+ isConcreteType: function isConcreteType(obj) {
1638
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "OAuthAuthorizationData";
1639
+ }
1640
+ };
1641
+ }();
1642
+ // FfiConverter for OAuthAuthorizationDataInterface
1643
+ var FfiConverterTypeOAuthAuthorizationData = new FfiConverterObject(uniffiTypeOAuthAuthorizationDataObjectFactory);
1644
+ // FfiConverter for boolean | undefined
1645
+ var FfiConverterOptionalBool = new FfiConverterOptional(FfiConverterBool);
1646
+ // FfiConverter for /*f64*/number | undefined
1647
+ var FfiConverterOptionalFloat64 = new FfiConverterOptional(FfiConverterFloat64);
1648
+ // FfiConverter for /*i64*/bigint | undefined
1649
+ var FfiConverterOptionalInt64 = new FfiConverterOptional(FfiConverterInt64);
1650
+ // FfiConverter for string | undefined
1651
+ var FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
1652
+ // FfiConverter for HeaderStyle | undefined
1653
+ var FfiConverterOptionalTypeHeaderStyle = new FfiConverterOptional(FfiConverterTypeHeaderStyle);
1654
+ // FfiConverter for Intent | undefined
1655
+ var FfiConverterOptionalTypeIntent = new FfiConverterOptional(FfiConverterTypeIntent);
1656
+ // FfiConverter for NotificationType | undefined
1657
+ var FfiConverterOptionalTypeNotificationType = new FfiConverterOptional(FfiConverterTypeNotificationType);
1658
+ /**
1659
+ * This should be called before anything else.
1660
+ *
1661
+ * It is likely that this is being done for you by the library's `index.ts`.
1662
+ *
1663
+ * It checks versions of uniffi between when the Rust scaffolding was generated
1664
+ * and when the bindings were generated.
1665
+ *
1666
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
1667
+ */
1668
+ function uniffiEnsureInitialized() {
1669
+ // Get the bindings contract version from our ComponentInterface
1670
+ var bindingsContractVersion = 29;
1671
+ // Get the scaffolding contract version by calling the into the dylib
1672
+ var scaffoldingContractVersion = nativeModule().ubrn_ffi_matrix_sdk_uniffi_contract_version();
1673
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
1674
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1675
+ }
1676
+ if (nativeModule().ubrn_uniffi_matrix_sdk_checksum_method_oauthauthorizationdata_login_url() !== 25566) {
1677
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_matrix_sdk_checksum_method_oauthauthorizationdata_login_url");
1678
+ }
1679
+ }
1680
+ export default Object.freeze({
1681
+ initialize: uniffiEnsureInitialized,
1682
+ converters: {
1683
+ FfiConverterTypeBackupDownloadStrategy: FfiConverterTypeBackupDownloadStrategy,
1684
+ FfiConverterTypeEncryptionSystem: FfiConverterTypeEncryptionSystem,
1685
+ FfiConverterTypeHeaderStyle: FfiConverterTypeHeaderStyle,
1686
+ FfiConverterTypeIntent: FfiConverterTypeIntent,
1687
+ FfiConverterTypeNotificationType: FfiConverterTypeNotificationType,
1688
+ FfiConverterTypeOAuthAuthorizationData: FfiConverterTypeOAuthAuthorizationData,
1689
+ FfiConverterTypePaginatorState: FfiConverterTypePaginatorState,
1690
+ FfiConverterTypeQRCodeLoginError: FfiConverterTypeQRCodeLoginError,
1691
+ FfiConverterTypeRoomMemberRole: FfiConverterTypeRoomMemberRole,
1692
+ FfiConverterTypeRoomPaginationStatus: FfiConverterTypeRoomPaginationStatus,
1693
+ FfiConverterTypeRoomPowerLevelChanges: FfiConverterTypeRoomPowerLevelChanges,
1694
+ FfiConverterTypeServerVendorInfo: FfiConverterTypeServerVendorInfo,
1695
+ FfiConverterTypeVirtualElementCallWidgetConfig: FfiConverterTypeVirtualElementCallWidgetConfig,
1696
+ FfiConverterTypeVirtualElementCallWidgetProperties: FfiConverterTypeVirtualElementCallWidgetProperties
1697
+ }
1698
+ });