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,2 @@
1
+ // This provides the URL string that the Matrix SDK expects
2
+ export default "./generated-compat/wasm-bindgen/index_bg.wasm";
@@ -0,0 +1,40 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ // Export the generated bindings to the app.
3
+ export * from './generated-compat/matrix_sdk';
4
+ export * from './generated-compat/matrix_sdk_base';
5
+ export * from './generated-compat/matrix_sdk_common';
6
+ export * from './generated-compat/matrix_sdk_crypto';
7
+ export * from './generated-compat/matrix_sdk_ffi';
8
+ export * from './generated-compat/matrix_sdk_ui';
9
+ // Now import the bindings so we can:
10
+ // - intialize them
11
+ // - export them as namespaced objects as the default export.
12
+ import * as matrix_sdk from './generated-compat/matrix_sdk';
13
+ import * as matrix_sdk_base from './generated-compat/matrix_sdk_base';
14
+ import * as matrix_sdk_common from './generated-compat/matrix_sdk_common';
15
+ import * as matrix_sdk_crypto from './generated-compat/matrix_sdk_crypto';
16
+ import * as matrix_sdk_ffi from './generated-compat/matrix_sdk_ffi';
17
+ import * as matrix_sdk_ui from './generated-compat/matrix_sdk_ui';
18
+ import initAsync from './generated-compat/wasm-bindgen/index.js';
19
+ import wasmpath from './generated-compat/wasm-bindgen/index_bg';
20
+ export async function uniffiInitAsync() {
21
+ await initAsync({ module_or_path: wasmpath });
22
+ // Initialize the generated bindings: mostly checksums, but also callbacks.
23
+ // - the boolean flag ensures this loads exactly once, even if the JS code
24
+ // is reloaded (e.g. during development with metro).
25
+ matrix_sdk.default.initialize();
26
+ matrix_sdk_base.default.initialize();
27
+ matrix_sdk_common.default.initialize();
28
+ matrix_sdk_crypto.default.initialize();
29
+ matrix_sdk_ffi.default.initialize();
30
+ matrix_sdk_ui.default.initialize();
31
+ }
32
+ // Export the crates as individually namespaced objects.
33
+ export default {
34
+ matrix_sdk,
35
+ matrix_sdk_base,
36
+ matrix_sdk_common,
37
+ matrix_sdk_crypto,
38
+ matrix_sdk_ffi,
39
+ matrix_sdk_ui,
40
+ };