ffi-bindings 1.0.0 → 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.
- package/package.json +23 -4
- package/src/generated/matrix_sdk.ts +1843 -0
- package/src/generated/matrix_sdk_base.ts +252 -0
- package/src/generated/matrix_sdk_common.ts +370 -0
- package/src/generated/matrix_sdk_crypto.ts +1280 -0
- package/src/generated/matrix_sdk_ffi.ts +65263 -0
- package/src/generated/matrix_sdk_ui.ts +816 -0
- package/src/generated/wasm-bindgen/index.d.ts +5455 -0
- package/src/generated/wasm-bindgen/index.js +14223 -0
- package/src/generated/wasm-bindgen/index_bg.wasm +0 -0
- package/src/generated/wasm-bindgen/index_bg.wasm.d.ts +2840 -0
- package/src/generated-compat/matrix_sdk.js +454 -395
- package/src/generated-compat/matrix_sdk_base.js +39 -34
- package/src/generated-compat/matrix_sdk_common.js +245 -35
- package/src/generated-compat/matrix_sdk_crypto.js +547 -128
- package/src/generated-compat/matrix_sdk_ffi.js +3057 -2696
- package/src/generated-compat/matrix_sdk_ui.js +580 -46
- package/src/generated-compat/wasm-bindgen/index.d.js +66 -0
- package/src/generated-compat/wasm-bindgen/index.d.ts +5455 -0
- package/src/generated-compat/wasm-bindgen/index.js +10572 -8359
- package/src/generated-compat/wasm-bindgen/index_bg.wasm +0 -0
- package/src/generated-compat/wasm-bindgen/index_bg.wasm.d.ts +2840 -0
- package/src/index.web.js +126 -34
- package/src/index.web.js.bak +132 -0
- package/src/index.web.ts +46 -0
- package/src/index.web.ts.bak +46 -0
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.MediaRetentionPolicy = exports.EncryptionState = 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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
12
|
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); } }
|
|
4
13
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -11,19 +20,14 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
20
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
21
|
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); }
|
|
13
22
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
-
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); }
|
|
15
|
-
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
23
|
+
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.
|
|
16
24
|
// Trust me, you don't want to mess with it!
|
|
17
|
-
/* tslint:disable */
|
|
18
|
-
/* eslint-disable */
|
|
19
|
-
// @ts-nocheck
|
|
20
|
-
import * as wasmBundle from "./wasm-bindgen/index.js";
|
|
21
|
-
import { AbstractFfiConverterByteArray, FfiConverterDuration, FfiConverterInt32, FfiConverterOptional, FfiConverterUInt64, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString, uniffiCreateRecord } from "uniffi-bindgen-react-native";
|
|
25
|
+
/* tslint:disable */ /* eslint-disable */ // @ts-nocheck
|
|
22
26
|
// Get converters from the other files, if any.
|
|
23
27
|
var nativeModule = function nativeModule() {
|
|
24
28
|
return wasmBundle;
|
|
25
29
|
};
|
|
26
|
-
var uniffiCaller = new UniffiRustCaller(function () {
|
|
30
|
+
var uniffiCaller = new _uniffiBindgenReactNative.UniffiRustCaller(function () {
|
|
27
31
|
return new wasmBundle.RustCallStatus();
|
|
28
32
|
});
|
|
29
33
|
var uniffiIsDebug =
|
|
@@ -31,30 +35,27 @@ var uniffiIsDebug =
|
|
|
31
35
|
(typeof process === "undefined" ? "undefined" : _typeof(process)) !== "object" ||
|
|
32
36
|
// @ts-ignore -- The process global might not be defined
|
|
33
37
|
((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) !== "production" || false;
|
|
38
|
+
// Public interface members begin here.
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The retention policy for media content used by the [`MediaStore`].
|
|
42
|
+
*
|
|
43
|
+
* [`EventCacheStore`]: crate::event_cache::store::EventCacheStore
|
|
44
|
+
*/
|
|
45
|
+
|
|
34
46
|
/**
|
|
35
47
|
* Generated factory for {@link MediaRetentionPolicy} record objects.
|
|
36
48
|
*/
|
|
37
|
-
|
|
49
|
+
var MediaRetentionPolicy = exports.MediaRetentionPolicy = function () {
|
|
38
50
|
var _defaults = function defaults() {
|
|
39
51
|
return {};
|
|
40
52
|
};
|
|
41
53
|
var create = function () {
|
|
42
|
-
return uniffiCreateRecord(_defaults);
|
|
54
|
+
return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(_defaults);
|
|
43
55
|
}();
|
|
44
56
|
return Object.freeze({
|
|
45
|
-
/**
|
|
46
|
-
* Create a frozen instance of {@link MediaRetentionPolicy}, with defaults specified
|
|
47
|
-
* in Rust, in the {@link matrix_sdk_base} crate.
|
|
48
|
-
*/
|
|
49
57
|
create: create,
|
|
50
|
-
/**
|
|
51
|
-
* Create a frozen instance of {@link MediaRetentionPolicy}, with defaults specified
|
|
52
|
-
* in Rust, in the {@link matrix_sdk_base} crate.
|
|
53
|
-
*/
|
|
54
58
|
"new": create,
|
|
55
|
-
/**
|
|
56
|
-
* Defaults specified in the {@link matrix_sdk_base} crate.
|
|
57
|
-
*/
|
|
58
59
|
defaults: function defaults() {
|
|
59
60
|
return Object.freeze(_defaults());
|
|
60
61
|
}
|
|
@@ -91,7 +92,7 @@ var FfiConverterTypeMediaRetentionPolicy = function () {
|
|
|
91
92
|
return FfiConverterOptionalUInt64.allocationSize(value.maxCacheSize) + FfiConverterOptionalUInt64.allocationSize(value.maxFileSize) + FfiConverterOptionalDuration.allocationSize(value.lastAccessExpiry) + FfiConverterOptionalDuration.allocationSize(value.cleanupFrequency);
|
|
92
93
|
}
|
|
93
94
|
}]);
|
|
94
|
-
}(AbstractFfiConverterByteArray);
|
|
95
|
+
}(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
|
|
95
96
|
;
|
|
96
97
|
return new FFIConverter();
|
|
97
98
|
}();
|
|
@@ -110,12 +111,12 @@ var stringConverter = function () {
|
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
}();
|
|
113
|
-
var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
114
|
+
var FfiConverterString = (0, _uniffiBindgenReactNative.uniffiCreateFfiConverterString)(stringConverter);
|
|
115
|
+
|
|
114
116
|
/**
|
|
115
117
|
* Represents the state of a room encryption.
|
|
116
118
|
*/
|
|
117
|
-
|
|
118
|
-
(function (EncryptionState) {
|
|
119
|
+
var EncryptionState = exports.EncryptionState = /*#__PURE__*/function (EncryptionState) {
|
|
119
120
|
/**
|
|
120
121
|
* The room is encrypted.
|
|
121
122
|
*/
|
|
@@ -129,9 +130,10 @@ export var EncryptionState;
|
|
|
129
130
|
* `/sync` did not provide all data needed to decide.
|
|
130
131
|
*/
|
|
131
132
|
EncryptionState[EncryptionState["Unknown"] = 2] = "Unknown";
|
|
132
|
-
|
|
133
|
+
return EncryptionState;
|
|
134
|
+
}({});
|
|
133
135
|
var FfiConverterTypeEncryptionState = function () {
|
|
134
|
-
var ordinalConverter = FfiConverterInt32;
|
|
136
|
+
var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
135
137
|
var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter2) {
|
|
136
138
|
function FFIConverter() {
|
|
137
139
|
_classCallCheck(this, FFIConverter);
|
|
@@ -149,7 +151,7 @@ var FfiConverterTypeEncryptionState = function () {
|
|
|
149
151
|
case 3:
|
|
150
152
|
return EncryptionState.Unknown;
|
|
151
153
|
default:
|
|
152
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
154
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
}, {
|
|
@@ -170,13 +172,16 @@ var FfiConverterTypeEncryptionState = function () {
|
|
|
170
172
|
return ordinalConverter.allocationSize(0);
|
|
171
173
|
}
|
|
172
174
|
}]);
|
|
173
|
-
}(AbstractFfiConverterByteArray);
|
|
175
|
+
}(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
|
|
174
176
|
return new FFIConverter();
|
|
175
177
|
}();
|
|
178
|
+
|
|
176
179
|
// FfiConverter for UniffiDuration | undefined
|
|
177
|
-
var FfiConverterOptionalDuration = new FfiConverterOptional(FfiConverterDuration);
|
|
180
|
+
var FfiConverterOptionalDuration = new _uniffiBindgenReactNative.FfiConverterOptional(_uniffiBindgenReactNative.FfiConverterDuration);
|
|
181
|
+
|
|
178
182
|
// FfiConverter for /*u64*/bigint | undefined
|
|
179
|
-
var FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
183
|
+
var FfiConverterOptionalUInt64 = new _uniffiBindgenReactNative.FfiConverterOptional(_uniffiBindgenReactNative.FfiConverterUInt64);
|
|
184
|
+
|
|
180
185
|
/**
|
|
181
186
|
* This should be called before anything else.
|
|
182
187
|
*
|
|
@@ -189,14 +194,14 @@ var FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
|
189
194
|
*/
|
|
190
195
|
function uniffiEnsureInitialized() {
|
|
191
196
|
// Get the bindings contract version from our ComponentInterface
|
|
192
|
-
var bindingsContractVersion =
|
|
197
|
+
var bindingsContractVersion = 30;
|
|
193
198
|
// Get the scaffolding contract version by calling the into the dylib
|
|
194
199
|
var scaffoldingContractVersion = nativeModule().ubrn_ffi_matrix_sdk_base_uniffi_contract_version();
|
|
195
200
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
196
|
-
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
201
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
197
202
|
}
|
|
198
203
|
}
|
|
199
|
-
|
|
204
|
+
var _default = exports["default"] = Object.freeze({
|
|
200
205
|
initialize: uniffiEnsureInitialized,
|
|
201
206
|
converters: {
|
|
202
207
|
FfiConverterTypeEncryptionState: FfiConverterTypeEncryptionState,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.ShieldStateCode = exports.BackgroundTaskFailureReason_Tags = exports.BackgroundTaskFailureReason = 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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
12
|
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); } }
|
|
4
13
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
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); }
|
|
7
14
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
15
|
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); }
|
|
9
16
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
@@ -11,19 +18,17 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
18
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
19
|
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); }
|
|
13
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
-
function
|
|
15
|
-
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
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.
|
|
16
25
|
// Trust me, you don't want to mess with it!
|
|
17
|
-
/* tslint:disable */
|
|
18
|
-
/* eslint-disable */
|
|
19
|
-
// @ts-nocheck
|
|
20
|
-
import * as wasmBundle from "./wasm-bindgen/index.js";
|
|
21
|
-
import { AbstractFfiConverterByteArray, FfiConverterInt32, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString } from "uniffi-bindgen-react-native";
|
|
26
|
+
/* tslint:disable */ /* eslint-disable */ // @ts-nocheck
|
|
22
27
|
// Get converters from the other files, if any.
|
|
23
28
|
var nativeModule = function nativeModule() {
|
|
24
29
|
return wasmBundle;
|
|
25
30
|
};
|
|
26
|
-
var uniffiCaller = new UniffiRustCaller(function () {
|
|
31
|
+
var uniffiCaller = new _uniffiBindgenReactNative.UniffiRustCaller(function () {
|
|
27
32
|
return new wasmBundle.RustCallStatus();
|
|
28
33
|
});
|
|
29
34
|
var uniffiIsDebug =
|
|
@@ -32,6 +37,7 @@ var uniffiIsDebug =
|
|
|
32
37
|
// @ts-ignore -- The process global might not be defined
|
|
33
38
|
((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) !== "production" || false;
|
|
34
39
|
// Public interface members begin here.
|
|
40
|
+
|
|
35
41
|
var stringConverter = function () {
|
|
36
42
|
var encoder = new TextEncoder();
|
|
37
43
|
var decoder = new TextDecoder();
|
|
@@ -47,12 +53,218 @@ var stringConverter = function () {
|
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
55
|
}();
|
|
50
|
-
var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
56
|
+
var FfiConverterString = (0, _uniffiBindgenReactNative.uniffiCreateFfiConverterString)(stringConverter);
|
|
57
|
+
|
|
58
|
+
// Enum: BackgroundTaskFailureReason
|
|
59
|
+
var BackgroundTaskFailureReason_Tags = exports.BackgroundTaskFailureReason_Tags = /*#__PURE__*/function (BackgroundTaskFailureReason_Tags) {
|
|
60
|
+
BackgroundTaskFailureReason_Tags["Panic"] = "Panic";
|
|
61
|
+
BackgroundTaskFailureReason_Tags["Error"] = "Error";
|
|
62
|
+
BackgroundTaskFailureReason_Tags["EarlyTermination"] = "EarlyTermination";
|
|
63
|
+
return BackgroundTaskFailureReason_Tags;
|
|
64
|
+
}({});
|
|
65
|
+
/**
|
|
66
|
+
* Reason why a background task failed.
|
|
67
|
+
*/
|
|
68
|
+
var BackgroundTaskFailureReason = exports.BackgroundTaskFailureReason = function () {
|
|
69
|
+
/**
|
|
70
|
+
* The task panicked.
|
|
71
|
+
*/
|
|
72
|
+
var Panic_ = /*#__PURE__*/function (_UniffiEnum) {
|
|
73
|
+
function Panic_(inner) {
|
|
74
|
+
var _this;
|
|
75
|
+
_classCallCheck(this, Panic_);
|
|
76
|
+
_this = _callSuper(this, Panic_, ["BackgroundTaskFailureReason", "Panic"]);
|
|
77
|
+
/**
|
|
78
|
+
* @private
|
|
79
|
+
* This field is private and should not be used, use `tag` instead.
|
|
80
|
+
*/
|
|
81
|
+
_defineProperty(_this, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "BackgroundTaskFailureReason");
|
|
82
|
+
_defineProperty(_this, "tag", BackgroundTaskFailureReason_Tags.Panic);
|
|
83
|
+
_defineProperty(_this, "inner", void 0);
|
|
84
|
+
_this.inner = Object.freeze(inner);
|
|
85
|
+
return _this;
|
|
86
|
+
}
|
|
87
|
+
_inherits(Panic_, _UniffiEnum);
|
|
88
|
+
return _createClass(Panic_, null, [{
|
|
89
|
+
key: "new",
|
|
90
|
+
value: function _new(inner) {
|
|
91
|
+
return new Panic_(inner);
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "instanceOf",
|
|
95
|
+
value: function instanceOf(obj) {
|
|
96
|
+
return obj.tag === BackgroundTaskFailureReason_Tags.Panic;
|
|
97
|
+
}
|
|
98
|
+
}]);
|
|
99
|
+
}(_uniffiBindgenReactNative.UniffiEnum);
|
|
100
|
+
/**
|
|
101
|
+
* The task returned an error.
|
|
102
|
+
*/
|
|
103
|
+
var Error_ = /*#__PURE__*/function (_UniffiEnum2) {
|
|
104
|
+
function Error_(inner) {
|
|
105
|
+
var _this2;
|
|
106
|
+
_classCallCheck(this, Error_);
|
|
107
|
+
_this2 = _callSuper(this, Error_, ["BackgroundTaskFailureReason", "Error"]);
|
|
108
|
+
/**
|
|
109
|
+
* @private
|
|
110
|
+
* This field is private and should not be used, use `tag` instead.
|
|
111
|
+
*/
|
|
112
|
+
_defineProperty(_this2, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "BackgroundTaskFailureReason");
|
|
113
|
+
_defineProperty(_this2, "tag", BackgroundTaskFailureReason_Tags.Error);
|
|
114
|
+
_defineProperty(_this2, "inner", void 0);
|
|
115
|
+
_this2.inner = Object.freeze(inner);
|
|
116
|
+
return _this2;
|
|
117
|
+
}
|
|
118
|
+
_inherits(Error_, _UniffiEnum2);
|
|
119
|
+
return _createClass(Error_, null, [{
|
|
120
|
+
key: "new",
|
|
121
|
+
value: function _new(inner) {
|
|
122
|
+
return new Error_(inner);
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "instanceOf",
|
|
126
|
+
value: function instanceOf(obj) {
|
|
127
|
+
return obj.tag === BackgroundTaskFailureReason_Tags.Error;
|
|
128
|
+
}
|
|
129
|
+
}]);
|
|
130
|
+
}(_uniffiBindgenReactNative.UniffiEnum);
|
|
131
|
+
/**
|
|
132
|
+
* The task ended unexpectedly (for tasks expected to run forever).
|
|
133
|
+
*/
|
|
134
|
+
var EarlyTermination_ = /*#__PURE__*/function (_UniffiEnum3) {
|
|
135
|
+
function EarlyTermination_() {
|
|
136
|
+
var _this3;
|
|
137
|
+
_classCallCheck(this, EarlyTermination_);
|
|
138
|
+
_this3 = _callSuper(this, EarlyTermination_, ["BackgroundTaskFailureReason", "EarlyTermination"]);
|
|
139
|
+
/**
|
|
140
|
+
* @private
|
|
141
|
+
* This field is private and should not be used, use `tag` instead.
|
|
142
|
+
*/
|
|
143
|
+
_defineProperty(_this3, _uniffiBindgenReactNative.uniffiTypeNameSymbol, "BackgroundTaskFailureReason");
|
|
144
|
+
_defineProperty(_this3, "tag", BackgroundTaskFailureReason_Tags.EarlyTermination);
|
|
145
|
+
return _this3;
|
|
146
|
+
}
|
|
147
|
+
_inherits(EarlyTermination_, _UniffiEnum3);
|
|
148
|
+
return _createClass(EarlyTermination_, null, [{
|
|
149
|
+
key: "new",
|
|
150
|
+
value: function _new() {
|
|
151
|
+
return new EarlyTermination_();
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "instanceOf",
|
|
155
|
+
value: function instanceOf(obj) {
|
|
156
|
+
return obj.tag === BackgroundTaskFailureReason_Tags.EarlyTermination;
|
|
157
|
+
}
|
|
158
|
+
}]);
|
|
159
|
+
}(_uniffiBindgenReactNative.UniffiEnum);
|
|
160
|
+
function instanceOf(obj) {
|
|
161
|
+
return obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "BackgroundTaskFailureReason";
|
|
162
|
+
}
|
|
163
|
+
return Object.freeze({
|
|
164
|
+
instanceOf: instanceOf,
|
|
165
|
+
Panic: Panic_,
|
|
166
|
+
Error: Error_,
|
|
167
|
+
EarlyTermination: EarlyTermination_
|
|
168
|
+
});
|
|
169
|
+
}();
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Reason why a background task failed.
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
// FfiConverter for enum BackgroundTaskFailureReason
|
|
176
|
+
var FfiConverterTypeBackgroundTaskFailureReason = function () {
|
|
177
|
+
var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
178
|
+
var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter) {
|
|
179
|
+
function FFIConverter() {
|
|
180
|
+
_classCallCheck(this, FFIConverter);
|
|
181
|
+
return _callSuper(this, FFIConverter, arguments);
|
|
182
|
+
}
|
|
183
|
+
_inherits(FFIConverter, _AbstractFfiConverter);
|
|
184
|
+
return _createClass(FFIConverter, [{
|
|
185
|
+
key: "read",
|
|
186
|
+
value: function read(from) {
|
|
187
|
+
switch (ordinalConverter.read(from)) {
|
|
188
|
+
case 1:
|
|
189
|
+
return new BackgroundTaskFailureReason.Panic({
|
|
190
|
+
message: FfiConverterOptionalString.read(from),
|
|
191
|
+
panicBacktrace: FfiConverterOptionalString.read(from)
|
|
192
|
+
});
|
|
193
|
+
case 2:
|
|
194
|
+
return new BackgroundTaskFailureReason.Error({
|
|
195
|
+
error: FfiConverterString.read(from)
|
|
196
|
+
});
|
|
197
|
+
case 3:
|
|
198
|
+
return new BackgroundTaskFailureReason.EarlyTermination();
|
|
199
|
+
default:
|
|
200
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: "write",
|
|
205
|
+
value: function write(value, into) {
|
|
206
|
+
switch (value.tag) {
|
|
207
|
+
case BackgroundTaskFailureReason_Tags.Panic:
|
|
208
|
+
{
|
|
209
|
+
ordinalConverter.write(1, into);
|
|
210
|
+
var inner = value.inner;
|
|
211
|
+
FfiConverterOptionalString.write(inner.message, into);
|
|
212
|
+
FfiConverterOptionalString.write(inner.panicBacktrace, into);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
case BackgroundTaskFailureReason_Tags.Error:
|
|
216
|
+
{
|
|
217
|
+
ordinalConverter.write(2, into);
|
|
218
|
+
var _inner = value.inner;
|
|
219
|
+
FfiConverterString.write(_inner.error, into);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
case BackgroundTaskFailureReason_Tags.EarlyTermination:
|
|
223
|
+
{
|
|
224
|
+
ordinalConverter.write(3, into);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
default:
|
|
228
|
+
// Throwing from here means that BackgroundTaskFailureReason_Tags hasn't matched an ordinal.
|
|
229
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
key: "allocationSize",
|
|
234
|
+
value: function allocationSize(value) {
|
|
235
|
+
switch (value.tag) {
|
|
236
|
+
case BackgroundTaskFailureReason_Tags.Panic:
|
|
237
|
+
{
|
|
238
|
+
var inner = value.inner;
|
|
239
|
+
var size = ordinalConverter.allocationSize(1);
|
|
240
|
+
size += FfiConverterOptionalString.allocationSize(inner.message);
|
|
241
|
+
size += FfiConverterOptionalString.allocationSize(inner.panicBacktrace);
|
|
242
|
+
return size;
|
|
243
|
+
}
|
|
244
|
+
case BackgroundTaskFailureReason_Tags.Error:
|
|
245
|
+
{
|
|
246
|
+
var _inner2 = value.inner;
|
|
247
|
+
var _size = ordinalConverter.allocationSize(2);
|
|
248
|
+
_size += FfiConverterString.allocationSize(_inner2.error);
|
|
249
|
+
return _size;
|
|
250
|
+
}
|
|
251
|
+
case BackgroundTaskFailureReason_Tags.EarlyTermination:
|
|
252
|
+
{
|
|
253
|
+
return ordinalConverter.allocationSize(3);
|
|
254
|
+
}
|
|
255
|
+
default:
|
|
256
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}]);
|
|
260
|
+
}(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
|
|
261
|
+
return new FFIConverter();
|
|
262
|
+
}();
|
|
263
|
+
|
|
51
264
|
/**
|
|
52
265
|
* A machine-readable representation of the authenticity for a `ShieldState`.
|
|
53
266
|
*/
|
|
54
|
-
|
|
55
|
-
(function (ShieldStateCode) {
|
|
267
|
+
var ShieldStateCode = exports.ShieldStateCode = /*#__PURE__*/function (ShieldStateCode) {
|
|
56
268
|
/**
|
|
57
269
|
* Not enough information available to check the authenticity.
|
|
58
270
|
*/
|
|
@@ -69,28 +281,25 @@ export var ShieldStateCode;
|
|
|
69
281
|
* The sender hasn't been verified by the Client's user.
|
|
70
282
|
*/
|
|
71
283
|
ShieldStateCode[ShieldStateCode["UnverifiedIdentity"] = 3] = "UnverifiedIdentity";
|
|
72
|
-
/**
|
|
73
|
-
* An unencrypted event in an encrypted room.
|
|
74
|
-
*/
|
|
75
|
-
ShieldStateCode[ShieldStateCode["SentInClear"] = 4] = "SentInClear";
|
|
76
284
|
/**
|
|
77
285
|
* The sender was previously verified but changed their identity.
|
|
78
286
|
*/
|
|
79
|
-
ShieldStateCode[ShieldStateCode["VerificationViolation"] =
|
|
287
|
+
ShieldStateCode[ShieldStateCode["VerificationViolation"] = 4] = "VerificationViolation";
|
|
80
288
|
/**
|
|
81
289
|
* The `sender` field on the event does not match the owner of the device
|
|
82
290
|
* that established the Megolm session.
|
|
83
291
|
*/
|
|
84
|
-
ShieldStateCode[ShieldStateCode["MismatchedSender"] =
|
|
85
|
-
|
|
292
|
+
ShieldStateCode[ShieldStateCode["MismatchedSender"] = 5] = "MismatchedSender";
|
|
293
|
+
return ShieldStateCode;
|
|
294
|
+
}({});
|
|
86
295
|
var FfiConverterTypeShieldStateCode = function () {
|
|
87
|
-
var ordinalConverter = FfiConverterInt32;
|
|
88
|
-
var FFIConverter = /*#__PURE__*/function (
|
|
296
|
+
var ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
297
|
+
var FFIConverter = /*#__PURE__*/function (_AbstractFfiConverter2) {
|
|
89
298
|
function FFIConverter() {
|
|
90
299
|
_classCallCheck(this, FFIConverter);
|
|
91
300
|
return _callSuper(this, FFIConverter, arguments);
|
|
92
301
|
}
|
|
93
|
-
_inherits(FFIConverter,
|
|
302
|
+
_inherits(FFIConverter, _AbstractFfiConverter2);
|
|
94
303
|
return _createClass(FFIConverter, [{
|
|
95
304
|
key: "read",
|
|
96
305
|
value: function read(from) {
|
|
@@ -104,13 +313,11 @@ var FfiConverterTypeShieldStateCode = function () {
|
|
|
104
313
|
case 4:
|
|
105
314
|
return ShieldStateCode.UnverifiedIdentity;
|
|
106
315
|
case 5:
|
|
107
|
-
return ShieldStateCode.SentInClear;
|
|
108
|
-
case 6:
|
|
109
316
|
return ShieldStateCode.VerificationViolation;
|
|
110
|
-
case
|
|
317
|
+
case 6:
|
|
111
318
|
return ShieldStateCode.MismatchedSender;
|
|
112
319
|
default:
|
|
113
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
320
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
114
321
|
}
|
|
115
322
|
}
|
|
116
323
|
}, {
|
|
@@ -125,12 +332,10 @@ var FfiConverterTypeShieldStateCode = function () {
|
|
|
125
332
|
return ordinalConverter.write(3, into);
|
|
126
333
|
case ShieldStateCode.UnverifiedIdentity:
|
|
127
334
|
return ordinalConverter.write(4, into);
|
|
128
|
-
case ShieldStateCode.SentInClear:
|
|
129
|
-
return ordinalConverter.write(5, into);
|
|
130
335
|
case ShieldStateCode.VerificationViolation:
|
|
131
|
-
return ordinalConverter.write(
|
|
336
|
+
return ordinalConverter.write(5, into);
|
|
132
337
|
case ShieldStateCode.MismatchedSender:
|
|
133
|
-
return ordinalConverter.write(
|
|
338
|
+
return ordinalConverter.write(6, into);
|
|
134
339
|
}
|
|
135
340
|
}
|
|
136
341
|
}, {
|
|
@@ -139,9 +344,13 @@ var FfiConverterTypeShieldStateCode = function () {
|
|
|
139
344
|
return ordinalConverter.allocationSize(0);
|
|
140
345
|
}
|
|
141
346
|
}]);
|
|
142
|
-
}(AbstractFfiConverterByteArray);
|
|
347
|
+
}(_uniffiBindgenReactNative.AbstractFfiConverterByteArray);
|
|
143
348
|
return new FFIConverter();
|
|
144
349
|
}();
|
|
350
|
+
|
|
351
|
+
// FfiConverter for string | undefined
|
|
352
|
+
var FfiConverterOptionalString = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterString);
|
|
353
|
+
|
|
145
354
|
/**
|
|
146
355
|
* This should be called before anything else.
|
|
147
356
|
*
|
|
@@ -154,16 +363,17 @@ var FfiConverterTypeShieldStateCode = function () {
|
|
|
154
363
|
*/
|
|
155
364
|
function uniffiEnsureInitialized() {
|
|
156
365
|
// Get the bindings contract version from our ComponentInterface
|
|
157
|
-
var bindingsContractVersion =
|
|
366
|
+
var bindingsContractVersion = 30;
|
|
158
367
|
// Get the scaffolding contract version by calling the into the dylib
|
|
159
368
|
var scaffoldingContractVersion = nativeModule().ubrn_ffi_matrix_sdk_common_uniffi_contract_version();
|
|
160
369
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
161
|
-
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
370
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
162
371
|
}
|
|
163
372
|
}
|
|
164
|
-
|
|
373
|
+
var _default = exports["default"] = Object.freeze({
|
|
165
374
|
initialize: uniffiEnsureInitialized,
|
|
166
375
|
converters: {
|
|
376
|
+
FfiConverterTypeBackgroundTaskFailureReason: FfiConverterTypeBackgroundTaskFailureReason,
|
|
167
377
|
FfiConverterTypeShieldStateCode: FfiConverterTypeShieldStateCode
|
|
168
378
|
}
|
|
169
379
|
});
|