jazz-rn 2.0.0-alpha.6

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.
Files changed (37) hide show
  1. package/JazzRn.podspec +44 -0
  2. package/README.md +47 -0
  3. package/android/CMakeLists.txt +76 -0
  4. package/android/build.gradle +144 -0
  5. package/android/cpp-adapter.cpp +43 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +5 -0
  8. package/android/src/main/java/com/jazzrn/JazzRnModule.kt +43 -0
  9. package/android/src/main/java/com/jazzrn/JazzRnPackage.kt +34 -0
  10. package/cpp/jazz-rn.cpp +16 -0
  11. package/cpp/jazz-rn.h +15 -0
  12. package/ios/JazzRn.h +16 -0
  13. package/ios/JazzRn.mm +66 -0
  14. package/lib/module/NativeJazzRn.js +7 -0
  15. package/lib/module/NativeJazzRn.js.map +1 -0
  16. package/lib/module/generated/jazz_rn-ffi.js +43 -0
  17. package/lib/module/generated/jazz_rn-ffi.js.map +1 -0
  18. package/lib/module/generated/jazz_rn.js +714 -0
  19. package/lib/module/generated/jazz_rn.js.map +1 -0
  20. package/lib/module/index.js +43 -0
  21. package/lib/module/index.js.map +1 -0
  22. package/lib/module/package.json +1 -0
  23. package/lib/typescript/package.json +1 -0
  24. package/lib/typescript/src/NativeJazzRn.d.ts +8 -0
  25. package/lib/typescript/src/NativeJazzRn.d.ts.map +1 -0
  26. package/lib/typescript/src/generated/jazz_rn-ffi.d.ts +147 -0
  27. package/lib/typescript/src/generated/jazz_rn-ffi.d.ts.map +1 -0
  28. package/lib/typescript/src/generated/jazz_rn.d.ts +644 -0
  29. package/lib/typescript/src/generated/jazz_rn.d.ts.map +1 -0
  30. package/lib/typescript/src/index.d.ts +8 -0
  31. package/lib/typescript/src/index.d.ts.map +1 -0
  32. package/package.json +170 -0
  33. package/react-native.config.js +11 -0
  34. package/src/NativeJazzRn.ts +10 -0
  35. package/src/generated/jazz_rn-ffi.ts +360 -0
  36. package/src/generated/jazz_rn.ts +1391 -0
  37. package/src/index.tsx +41 -0
package/package.json ADDED
@@ -0,0 +1,170 @@
1
+ {
2
+ "name": "jazz-rn",
3
+ "version": "2.0.0-alpha.6",
4
+ "description": "cojson core for react native",
5
+ "keywords": [
6
+ "android",
7
+ "ios",
8
+ "react-native"
9
+ ],
10
+ "homepage": "https://github.com/antoniomuso/jazz-rn#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/antoniomuso/jazz-rn/issues"
13
+ },
14
+ "license": "MIT",
15
+ "author": "Antonio Musolino <antoniomusolino007@gmail.com> (https://github.com/antoniomuso)",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://https://github.com/garden-co/jazz.git"
19
+ },
20
+ "files": [
21
+ "src",
22
+ "lib",
23
+ "android",
24
+ "ios",
25
+ "cpp",
26
+ "JazzRnFramework.xcframework",
27
+ "*.podspec",
28
+ "react-native.config.js",
29
+ "!ios/build",
30
+ "!android/build",
31
+ "!android/gradle",
32
+ "!android/gradlew",
33
+ "!android/gradlew.bat",
34
+ "!android/local.properties",
35
+ "!**/__tests__",
36
+ "!**/__fixtures__",
37
+ "!**/__mocks__",
38
+ "!**/.*"
39
+ ],
40
+ "main": "./lib/module/index.js",
41
+ "types": "./lib/typescript/src/index.d.ts",
42
+ "exports": {
43
+ ".": {
44
+ "types": "./lib/typescript/src/index.d.ts",
45
+ "source": "./src/index.tsx",
46
+ "default": "./lib/module/index.js"
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "publishConfig": {
51
+ "registry": "https://registry.npmjs.org/",
52
+ "access": "public",
53
+ "tag": "alpha"
54
+ },
55
+ "dependencies": {
56
+ "uniffi-bindgen-react-native": "0.29.3-1"
57
+ },
58
+ "devDependencies": {
59
+ "@commitlint/config-conventional": "^19.8.1",
60
+ "@eslint/compat": "^1.3.2",
61
+ "@eslint/eslintrc": "^3.3.1",
62
+ "@eslint/js": "^9.35.0",
63
+ "@evilmartians/lefthook": "^1.12.3",
64
+ "@react-native-community/cli": "20.0.1",
65
+ "@react-native/babel-preset": "^0.81.5",
66
+ "@react-native/eslint-config": "^0.81.5",
67
+ "@release-it/conventional-changelog": "^10.0.1",
68
+ "@types/jest": "^29.5.14",
69
+ "@types/react": "^19.1.0",
70
+ "commitlint": "^19.8.1",
71
+ "del-cli": "^6.0.0",
72
+ "eslint": "^9.35.0",
73
+ "eslint-config-prettier": "^10.1.8",
74
+ "eslint-plugin-prettier": "^5.5.4",
75
+ "jest": "^29.7.0",
76
+ "prettier": "^3.6.2",
77
+ "react": "19.2.4",
78
+ "react-native": "0.81.5",
79
+ "react-native-builder-bob": "^0.40.14",
80
+ "release-it": "^19.0.4",
81
+ "turbo": "^2.5.6",
82
+ "typescript": "^5.9.2"
83
+ },
84
+ "peerDependencies": {
85
+ "react": "*",
86
+ "react-native": "*"
87
+ },
88
+ "commitlint": {
89
+ "extends": [
90
+ "@commitlint/config-conventional"
91
+ ]
92
+ },
93
+ "prettier": {
94
+ "quoteProps": "consistent",
95
+ "singleQuote": true,
96
+ "tabWidth": 2,
97
+ "trailingComma": "es5",
98
+ "useTabs": false
99
+ },
100
+ "jest": {
101
+ "modulePathIgnorePatterns": [
102
+ "<rootDir>/example/node_modules",
103
+ "<rootDir>/lib/"
104
+ ],
105
+ "preset": "react-native"
106
+ },
107
+ "codegenConfig": {
108
+ "name": "JazzRnSpec",
109
+ "type": "modules",
110
+ "jsSrcsDir": "src",
111
+ "android": {
112
+ "javaPackageName": "com.jazzrn"
113
+ }
114
+ },
115
+ "create-react-native-library": {
116
+ "languages": "kotlin-objc",
117
+ "type": "turbo-module",
118
+ "version": "0.54.8"
119
+ },
120
+ "react-native-builder-bob": {
121
+ "source": "src",
122
+ "output": "lib",
123
+ "targets": [
124
+ [
125
+ "module",
126
+ {
127
+ "esm": true
128
+ }
129
+ ],
130
+ [
131
+ "typescript",
132
+ {
133
+ "project": "tsconfig.build.json"
134
+ }
135
+ ]
136
+ ]
137
+ },
138
+ "release-it": {
139
+ "git": {
140
+ "commitMessage": "chore: release ${version}",
141
+ "tagName": "v${version}"
142
+ },
143
+ "npm": {
144
+ "publish": true
145
+ },
146
+ "github": {
147
+ "release": true
148
+ },
149
+ "plugins": {
150
+ "@release-it/conventional-changelog": {
151
+ "preset": {
152
+ "name": "angular"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "scripts": {
158
+ "ubrn:ios": "ubrn build ios --and-generate --release",
159
+ "ubrn:android": "ubrn build android --and-generate --release",
160
+ "ubrn:checkout": "ubrn checkout",
161
+ "ubrn:clean": "rm -rfv cpp/ android/CMakeLists.txt android/src/main/java android/*.cpp ios/ src/Native* src/index.*ts* src/generated/",
162
+ "build:rn": "pnpm ubrn:ios && pnpm ubrn:android",
163
+ "build": "pnpm build:rn",
164
+ "build:rn:android": "pnpm ubrn:android",
165
+ "build:rn:ios": "pnpm ubrn:ios",
166
+ "test": "jest",
167
+ "typecheck": "tsc",
168
+ "lint": "eslint \"**/*.{js,ts,tsx}\""
169
+ }
170
+ }
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ dependency: {
3
+ platforms: {
4
+ android: {
5
+ packageName: "com.jazzrn",
6
+ packageImportPath: "import com.jazzrn.JazzRnPackage;",
7
+ packageInstance: "new JazzRnPackage()",
8
+ },
9
+ },
10
+ },
11
+ };
@@ -0,0 +1,10 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ import type { TurboModule } from 'react-native';
3
+ import { TurboModuleRegistry } from 'react-native';
4
+
5
+ export interface Spec extends TurboModule {
6
+ installRustCrate(): boolean;
7
+ cleanupRustCrate(): boolean;
8
+ }
9
+
10
+ export default TurboModuleRegistry.getEnforcing<Spec>('JazzRn');
@@ -0,0 +1,360 @@
1
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
+ // Trust me, you don't want to mess with it!
3
+
4
+ import {
5
+ type StructuralEquality as UniffiStructuralEquality,
6
+ type UniffiForeignFuture as RuntimeUniffiForeignFuture,
7
+ type UniffiRustCallStatus,
8
+ type UniffiRustArcPtr,
9
+ type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback,
10
+ type UniffiResult,
11
+ } from 'uniffi-bindgen-react-native';
12
+
13
+ interface NativeModuleInterface {
14
+ ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
15
+ string: string,
16
+ uniffi_out_err: UniffiRustCallStatus
17
+ ): number;
18
+ ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
19
+ string: string,
20
+ uniffi_out_err: UniffiRustCallStatus
21
+ ): Uint8Array;
22
+ ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
23
+ buffer: Uint8Array,
24
+ uniffi_out_err: UniffiRustCallStatus
25
+ ): string;
26
+ ubrn_uniffi_jazz_rn_fn_clone_rnruntime(
27
+ ptr: bigint,
28
+ uniffi_out_err: UniffiRustCallStatus
29
+ ): bigint;
30
+ ubrn_uniffi_jazz_rn_fn_free_rnruntime(
31
+ ptr: bigint,
32
+ uniffi_out_err: UniffiRustCallStatus
33
+ ): void;
34
+ ubrn_uniffi_jazz_rn_fn_constructor_rnruntime_new(
35
+ schemaJson: Uint8Array,
36
+ appId: Uint8Array,
37
+ jazzEnv: Uint8Array,
38
+ userBranch: Uint8Array,
39
+ tier: Uint8Array,
40
+ dataPath: Uint8Array,
41
+ uniffi_out_err: UniffiRustCallStatus
42
+ ): bigint;
43
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_add_client(
44
+ ptr: bigint,
45
+ uniffi_out_err: UniffiRustCallStatus
46
+ ): Uint8Array;
47
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_add_server(
48
+ ptr: bigint,
49
+ uniffi_out_err: UniffiRustCallStatus
50
+ ): void;
51
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_batched_tick(
52
+ ptr: bigint,
53
+ uniffi_out_err: UniffiRustCallStatus
54
+ ): void;
55
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_close(
56
+ ptr: bigint,
57
+ uniffi_out_err: UniffiRustCallStatus
58
+ ): void;
59
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_delete(
60
+ ptr: bigint,
61
+ objectId: Uint8Array,
62
+ uniffi_out_err: UniffiRustCallStatus
63
+ ): void;
64
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_flush(
65
+ ptr: bigint,
66
+ uniffi_out_err: UniffiRustCallStatus
67
+ ): void;
68
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_get_schema_hash(
69
+ ptr: bigint,
70
+ uniffi_out_err: UniffiRustCallStatus
71
+ ): Uint8Array;
72
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_insert(
73
+ ptr: bigint,
74
+ table: Uint8Array,
75
+ valuesJson: Uint8Array,
76
+ uniffi_out_err: UniffiRustCallStatus
77
+ ): Uint8Array;
78
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_on_batched_tick_needed(
79
+ ptr: bigint,
80
+ callback: Uint8Array,
81
+ uniffi_out_err: UniffiRustCallStatus
82
+ ): void;
83
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_on_sync_message_received(
84
+ ptr: bigint,
85
+ messageJson: Uint8Array,
86
+ uniffi_out_err: UniffiRustCallStatus
87
+ ): void;
88
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_on_sync_message_received_from_client(
89
+ ptr: bigint,
90
+ clientId: Uint8Array,
91
+ messageJson: Uint8Array,
92
+ uniffi_out_err: UniffiRustCallStatus
93
+ ): void;
94
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_on_sync_message_to_send(
95
+ ptr: bigint,
96
+ callback: Uint8Array,
97
+ uniffi_out_err: UniffiRustCallStatus
98
+ ): void;
99
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_query(
100
+ ptr: bigint,
101
+ queryJson: Uint8Array,
102
+ sessionJson: Uint8Array,
103
+ settledTier: Uint8Array,
104
+ uniffi_out_err: UniffiRustCallStatus
105
+ ): Uint8Array;
106
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_remove_server(
107
+ ptr: bigint,
108
+ uniffi_out_err: UniffiRustCallStatus
109
+ ): void;
110
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_set_client_role(
111
+ ptr: bigint,
112
+ clientId: Uint8Array,
113
+ role: Uint8Array,
114
+ uniffi_out_err: UniffiRustCallStatus
115
+ ): void;
116
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_subscribe(
117
+ ptr: bigint,
118
+ queryJson: Uint8Array,
119
+ callback: bigint,
120
+ sessionJson: Uint8Array,
121
+ settledTier: Uint8Array,
122
+ uniffi_out_err: UniffiRustCallStatus
123
+ ): bigint;
124
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_unsubscribe(
125
+ ptr: bigint,
126
+ handle: bigint,
127
+ uniffi_out_err: UniffiRustCallStatus
128
+ ): void;
129
+ ubrn_uniffi_jazz_rn_fn_method_rnruntime_update(
130
+ ptr: bigint,
131
+ objectId: Uint8Array,
132
+ valuesJson: Uint8Array,
133
+ uniffi_out_err: UniffiRustCallStatus
134
+ ): void;
135
+ ubrn_uniffi_jazz_rn_fn_init_callback_vtable_batchedtickcallback(
136
+ vtable: UniffiVTableCallbackInterfaceBatchedTickCallback
137
+ ): void;
138
+ ubrn_uniffi_jazz_rn_fn_init_callback_vtable_subscriptioncallback(
139
+ vtable: UniffiVTableCallbackInterfaceSubscriptionCallback
140
+ ): void;
141
+ ubrn_uniffi_jazz_rn_fn_init_callback_vtable_syncmessagecallback(
142
+ vtable: UniffiVTableCallbackInterfaceSyncMessageCallback
143
+ ): void;
144
+ ubrn_uniffi_jazz_rn_fn_func_current_timestamp_ms(
145
+ uniffi_out_err: UniffiRustCallStatus
146
+ ): bigint;
147
+ ubrn_uniffi_jazz_rn_fn_func_generate_id(
148
+ uniffi_out_err: UniffiRustCallStatus
149
+ ): Uint8Array;
150
+ ubrn_uniffi_jazz_rn_checksum_func_current_timestamp_ms(): number;
151
+ ubrn_uniffi_jazz_rn_checksum_func_generate_id(): number;
152
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_add_client(): number;
153
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_add_server(): number;
154
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_batched_tick(): number;
155
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_close(): number;
156
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_delete(): number;
157
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_flush(): number;
158
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_get_schema_hash(): number;
159
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_insert(): number;
160
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_on_batched_tick_needed(): number;
161
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_on_sync_message_received(): number;
162
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_on_sync_message_received_from_client(): number;
163
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_on_sync_message_to_send(): number;
164
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_query(): number;
165
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_remove_server(): number;
166
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_set_client_role(): number;
167
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_subscribe(): number;
168
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_unsubscribe(): number;
169
+ ubrn_uniffi_jazz_rn_checksum_method_rnruntime_update(): number;
170
+ ubrn_uniffi_jazz_rn_checksum_constructor_rnruntime_new(): number;
171
+ ubrn_uniffi_jazz_rn_checksum_method_batchedtickcallback_request_batched_tick(): number;
172
+ ubrn_uniffi_jazz_rn_checksum_method_subscriptioncallback_on_update(): number;
173
+ ubrn_uniffi_jazz_rn_checksum_method_syncmessagecallback_on_sync_message(): number;
174
+ ubrn_ffi_jazz_rn_uniffi_contract_version(): number;
175
+ ubrn_uniffi_internal_fn_method_rnruntime_ffi__bless_pointer(
176
+ pointer: bigint,
177
+ uniffi_out_err: UniffiRustCallStatus
178
+ ): UniffiRustArcPtr;
179
+ }
180
+
181
+ // Casting globalThis to any allows us to look for `NativeJazzRn`
182
+ // if it was added via JSI.
183
+ //
184
+ // We use a getter here rather than simply `globalThis.NativeJazzRn` so that
185
+ // if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
186
+ const getter: () => NativeModuleInterface = () =>
187
+ (globalThis as any).NativeJazzRn;
188
+ export default getter;
189
+
190
+ // Structs and function types for calling back into Typescript from Rust.
191
+ export type UniffiRustFutureContinuationCallback = (
192
+ data: bigint,
193
+ pollResult: number
194
+ ) => void;
195
+ type UniffiForeignFutureFree = (handle: bigint) => void;
196
+ type UniffiCallbackInterfaceFree = (handle: bigint) => void;
197
+ export type UniffiForeignFuture = {
198
+ handle: bigint;
199
+ free: UniffiForeignFutureFree;
200
+ };
201
+ export type UniffiForeignFutureStructU8 = {
202
+ returnValue: number;
203
+ callStatus: UniffiRustCallStatus;
204
+ };
205
+ export type UniffiForeignFutureCompleteU8 = (
206
+ callbackData: bigint,
207
+ result: UniffiForeignFutureStructU8
208
+ ) => void;
209
+ export type UniffiForeignFutureStructI8 = {
210
+ returnValue: number;
211
+ callStatus: UniffiRustCallStatus;
212
+ };
213
+ export type UniffiForeignFutureCompleteI8 = (
214
+ callbackData: bigint,
215
+ result: UniffiForeignFutureStructI8
216
+ ) => void;
217
+ export type UniffiForeignFutureStructU16 = {
218
+ returnValue: number;
219
+ callStatus: UniffiRustCallStatus;
220
+ };
221
+ export type UniffiForeignFutureCompleteU16 = (
222
+ callbackData: bigint,
223
+ result: UniffiForeignFutureStructU16
224
+ ) => void;
225
+ export type UniffiForeignFutureStructI16 = {
226
+ returnValue: number;
227
+ callStatus: UniffiRustCallStatus;
228
+ };
229
+ export type UniffiForeignFutureCompleteI16 = (
230
+ callbackData: bigint,
231
+ result: UniffiForeignFutureStructI16
232
+ ) => void;
233
+ export type UniffiForeignFutureStructU32 = {
234
+ returnValue: number;
235
+ callStatus: UniffiRustCallStatus;
236
+ };
237
+ export type UniffiForeignFutureCompleteU32 = (
238
+ callbackData: bigint,
239
+ result: UniffiForeignFutureStructU32
240
+ ) => void;
241
+ export type UniffiForeignFutureStructI32 = {
242
+ returnValue: number;
243
+ callStatus: UniffiRustCallStatus;
244
+ };
245
+ export type UniffiForeignFutureCompleteI32 = (
246
+ callbackData: bigint,
247
+ result: UniffiForeignFutureStructI32
248
+ ) => void;
249
+ export type UniffiForeignFutureStructU64 = {
250
+ returnValue: bigint;
251
+ callStatus: UniffiRustCallStatus;
252
+ };
253
+ export type UniffiForeignFutureCompleteU64 = (
254
+ callbackData: bigint,
255
+ result: UniffiForeignFutureStructU64
256
+ ) => void;
257
+ export type UniffiForeignFutureStructI64 = {
258
+ returnValue: bigint;
259
+ callStatus: UniffiRustCallStatus;
260
+ };
261
+ export type UniffiForeignFutureCompleteI64 = (
262
+ callbackData: bigint,
263
+ result: UniffiForeignFutureStructI64
264
+ ) => void;
265
+ export type UniffiForeignFutureStructF32 = {
266
+ returnValue: number;
267
+ callStatus: UniffiRustCallStatus;
268
+ };
269
+ export type UniffiForeignFutureCompleteF32 = (
270
+ callbackData: bigint,
271
+ result: UniffiForeignFutureStructF32
272
+ ) => void;
273
+ export type UniffiForeignFutureStructF64 = {
274
+ returnValue: number;
275
+ callStatus: UniffiRustCallStatus;
276
+ };
277
+ export type UniffiForeignFutureCompleteF64 = (
278
+ callbackData: bigint,
279
+ result: UniffiForeignFutureStructF64
280
+ ) => void;
281
+ export type UniffiForeignFutureStructPointer = {
282
+ returnValue: bigint;
283
+ callStatus: UniffiRustCallStatus;
284
+ };
285
+ export type UniffiForeignFutureCompletePointer = (
286
+ callbackData: bigint,
287
+ result: UniffiForeignFutureStructPointer
288
+ ) => void;
289
+ export type UniffiForeignFutureStructRustBuffer = {
290
+ returnValue: Uint8Array;
291
+ callStatus: UniffiRustCallStatus;
292
+ };
293
+ export type UniffiForeignFutureCompleteRustBuffer = (
294
+ callbackData: bigint,
295
+ result: UniffiForeignFutureStructRustBuffer
296
+ ) => void;
297
+ export type UniffiForeignFutureStructVoid = {
298
+ callStatus: UniffiRustCallStatus;
299
+ };
300
+ export type UniffiForeignFutureCompleteVoid = (
301
+ callbackData: bigint,
302
+ result: UniffiForeignFutureStructVoid
303
+ ) => void;
304
+ type UniffiCallbackInterfaceBatchedTickCallbackMethod0 = (
305
+ uniffiHandle: bigint
306
+ ) => UniffiResult<void>;
307
+ type UniffiCallbackInterfaceSubscriptionCallbackMethod0 = (
308
+ uniffiHandle: bigint,
309
+ deltaJson: Uint8Array
310
+ ) => UniffiResult<void>;
311
+ type UniffiCallbackInterfaceSyncMessageCallbackMethod0 = (
312
+ uniffiHandle: bigint,
313
+ messageJson: Uint8Array
314
+ ) => UniffiResult<void>;
315
+ export type UniffiVTableCallbackInterfaceBatchedTickCallback = {
316
+ requestBatchedTick: UniffiCallbackInterfaceBatchedTickCallbackMethod0;
317
+ uniffiFree: UniffiCallbackInterfaceFree;
318
+ };
319
+ export type UniffiVTableCallbackInterfaceSubscriptionCallback = {
320
+ onUpdate: UniffiCallbackInterfaceSubscriptionCallbackMethod0;
321
+ uniffiFree: UniffiCallbackInterfaceFree;
322
+ };
323
+ export type UniffiVTableCallbackInterfaceSyncMessageCallback = {
324
+ onSyncMessage: UniffiCallbackInterfaceSyncMessageCallbackMethod0;
325
+ uniffiFree: UniffiCallbackInterfaceFree;
326
+ };
327
+
328
+ // UniffiRustFutureContinuationCallback is generated as part of the component interface's
329
+ // ffi_definitions. However, we need it in the runtime.
330
+ // We could:
331
+ // (a) do some complicated template logic to ensure the declaration is not generated here (possible)
332
+ // (b) import the generated declaration into the runtime (m a y b e) or…
333
+ // (c) generate the declaration anyway, and use a different declaration in the runtime.
334
+ //
335
+ // We chose (c) here as the simplest. In addition, we perform a compile time check that
336
+ // the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
337
+ //
338
+ // If you see the error:
339
+ // ```
340
+ // Type 'true' is not assignable to type 'false'.(2322)
341
+ // ```
342
+ // Then a new version of uniffi has changed the signature of the callback. Most likely, code in
343
+ // `typescript/src/async-rust-call.ts` will need to be changed.
344
+ //
345
+ // If you see the error:
346
+ // ```
347
+ // Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
348
+ // ```
349
+ // then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
350
+ // You should not generate this if that is the case.
351
+ //
352
+ // ('You' being the bindings generator maintainer).
353
+ const isRustFutureContinuationCallbackTypeCompatible: UniffiStructuralEquality<
354
+ RuntimeUniffiRustFutureContinuationCallback,
355
+ UniffiRustFutureContinuationCallback
356
+ > = true;
357
+ const isUniffiForeignFutureTypeCompatible: UniffiStructuralEquality<
358
+ RuntimeUniffiForeignFuture,
359
+ UniffiForeignFuture
360
+ > = true;