@minip2p/react-native 0.8.2 → 0.9.1
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/android/src/main/jniLibs/arm64-v8a/libminip2p_ffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libminip2p_ffi.so +0 -0
- package/build/Minip2pFfi.xcframework/ios-arm64/libminip2p_ffi.a +2 -2
- package/build/Minip2pFfi.xcframework/ios-arm64-simulator/libminip2p_ffi.a +2 -2
- package/cpp/generated/minip2p_ffi.cpp +8 -12
- package/lib/module/adapter.js +118 -33
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +16 -14
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/module/generated/minip2p_ffi_core.js +273 -8
- package/lib/module/generated/minip2p_ffi_core.js.map +1 -1
- package/lib/typescript/src/adapter.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts +4 -4
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +14 -10
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts +219 -20
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +121 -58
- package/src/generated/minip2p_ffi-ffi.ts +4 -4
- package/src/generated/minip2p_ffi.ts +19 -19
- package/src/generated/minip2p_ffi_core.ts +285 -42
|
@@ -298,7 +298,7 @@ export interface P2pEndpointLike {
|
|
|
298
298
|
/**
|
|
299
299
|
* Forgets a stream.
|
|
300
300
|
*/
|
|
301
|
-
abandonStream(
|
|
301
|
+
abandonStream(connId: bigint, streamId: bigint) /*throws*/: void;
|
|
302
302
|
/**
|
|
303
303
|
* Returns the active relay reservation.
|
|
304
304
|
*/
|
|
@@ -314,7 +314,7 @@ export interface P2pEndpointLike {
|
|
|
314
314
|
/**
|
|
315
315
|
* Half-closes a stream's write side.
|
|
316
316
|
*/
|
|
317
|
-
closeStreamWrite(
|
|
317
|
+
closeStreamWrite(connId: bigint, streamId: bigint) /*throws*/: void;
|
|
318
318
|
/**
|
|
319
319
|
* Starts one Connection attempt and returns its Connect ID.
|
|
320
320
|
*/
|
|
@@ -386,7 +386,7 @@ export interface P2pEndpointLike {
|
|
|
386
386
|
/**
|
|
387
387
|
* Resets a stream.
|
|
388
388
|
*/
|
|
389
|
-
resetStream(
|
|
389
|
+
resetStream(connId: bigint, streamId: bigint) /*throws*/: void;
|
|
390
390
|
/**
|
|
391
391
|
* Sends bytes on a stream, named by its connection and stream ids.
|
|
392
392
|
*
|
|
@@ -395,7 +395,7 @@ export interface P2pEndpointLike {
|
|
|
395
395
|
* write side ends first (`StreamWriteStopped`, `StreamClosed`, a reset,
|
|
396
396
|
* or the connection closing or being replaced), which drops the tail.
|
|
397
397
|
*/
|
|
398
|
-
sendStream(
|
|
398
|
+
sendStream(connId: bigint, streamId: bigint, data: ArrayBuffer) /*throws*/: boolean;
|
|
399
399
|
/**
|
|
400
400
|
* Accepted for compatibility; has no effect, since the driver sleeps until the endpoint's next deadline.
|
|
401
401
|
*/
|
|
@@ -410,7 +410,9 @@ export interface P2pEndpointLike {
|
|
|
410
410
|
stop(): void;
|
|
411
411
|
/**
|
|
412
412
|
* Acknowledges `bytes` of a stream's received data as consumed,
|
|
413
|
-
* letting its sender continue. Every registered protocol needs this
|
|
413
|
+
* letting its sender continue. Every registered protocol needs this,
|
|
414
|
+
* also after the stream's connection closed: unacknowledged bytes keep
|
|
415
|
+
* the ended connection's slot until they are acknowledged or abandoned.
|
|
414
416
|
*/
|
|
415
417
|
streamConsumed(connId: bigint, streamId: bigint, bytes: bigint) /*throws*/: void;
|
|
416
418
|
/**
|
|
@@ -466,11 +468,10 @@ export class P2pEndpoint extends UniffiAbstractObject implements P2pEndpointLike
|
|
|
466
468
|
/**
|
|
467
469
|
* Forgets a stream.
|
|
468
470
|
*/
|
|
469
|
-
abandonStream(
|
|
471
|
+
abandonStream(connId: bigint, streamId: bigint): void /*throws*/ {uniffiCaller.rustCallWithError(
|
|
470
472
|
/*liftError:*/ FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError),
|
|
471
473
|
/*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_abandon_stream(
|
|
472
474
|
uniffiTypeP2pEndpointObjectFactory.clonePointer(this),
|
|
473
|
-
FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc),
|
|
474
475
|
FfiConverterUInt64.lower(connId, nativeModule().rustbuffer_alloc),
|
|
475
476
|
FfiConverterUInt64.lower(streamId, nativeModule().rustbuffer_alloc),
|
|
476
477
|
callStatus);
|
|
@@ -530,11 +531,10 @@ export class P2pEndpoint extends UniffiAbstractObject implements P2pEndpointLike
|
|
|
530
531
|
/**
|
|
531
532
|
* Half-closes a stream's write side.
|
|
532
533
|
*/
|
|
533
|
-
closeStreamWrite(
|
|
534
|
+
closeStreamWrite(connId: bigint, streamId: bigint): void /*throws*/ {uniffiCaller.rustCallWithError(
|
|
534
535
|
/*liftError:*/ FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError),
|
|
535
536
|
/*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_close_stream_write(
|
|
536
537
|
uniffiTypeP2pEndpointObjectFactory.clonePointer(this),
|
|
537
|
-
FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc),
|
|
538
538
|
FfiConverterUInt64.lower(connId, nativeModule().rustbuffer_alloc),
|
|
539
539
|
FfiConverterUInt64.lower(streamId, nativeModule().rustbuffer_alloc),
|
|
540
540
|
callStatus);
|
|
@@ -858,11 +858,10 @@ export class P2pEndpoint extends UniffiAbstractObject implements P2pEndpointLike
|
|
|
858
858
|
/**
|
|
859
859
|
* Resets a stream.
|
|
860
860
|
*/
|
|
861
|
-
resetStream(
|
|
861
|
+
resetStream(connId: bigint, streamId: bigint): void /*throws*/ {uniffiCaller.rustCallWithError(
|
|
862
862
|
/*liftError:*/ FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError),
|
|
863
863
|
/*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_reset_stream(
|
|
864
864
|
uniffiTypeP2pEndpointObjectFactory.clonePointer(this),
|
|
865
|
-
FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc),
|
|
866
865
|
FfiConverterUInt64.lower(connId, nativeModule().rustbuffer_alloc),
|
|
867
866
|
FfiConverterUInt64.lower(streamId, nativeModule().rustbuffer_alloc),
|
|
868
867
|
callStatus);
|
|
@@ -879,13 +878,12 @@ export class P2pEndpoint extends UniffiAbstractObject implements P2pEndpointLike
|
|
|
879
878
|
* write side ends first (`StreamWriteStopped`, `StreamClosed`, a reset,
|
|
880
879
|
* or the connection closing or being replaced), which drops the tail.
|
|
881
880
|
*/
|
|
882
|
-
sendStream(
|
|
881
|
+
sendStream(connId: bigint, streamId: bigint, data: ArrayBuffer): boolean /*throws*/ {
|
|
883
882
|
return FfiConverterBool.lift(uniffiCaller.rustCallWithError(
|
|
884
883
|
/*liftError:*/ FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError),
|
|
885
884
|
/*caller:*/ (callStatus) => {
|
|
886
885
|
return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_send_stream(
|
|
887
886
|
uniffiTypeP2pEndpointObjectFactory.clonePointer(this),
|
|
888
|
-
FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc),
|
|
889
887
|
FfiConverterUInt64.lower(connId, nativeModule().rustbuffer_alloc),
|
|
890
888
|
FfiConverterUInt64.lower(streamId, nativeModule().rustbuffer_alloc),
|
|
891
889
|
FfiConverterArrayBuffer.lower(data, nativeModule().rustbuffer_alloc),
|
|
@@ -936,7 +934,9 @@ export class P2pEndpoint extends UniffiAbstractObject implements P2pEndpointLike
|
|
|
936
934
|
|
|
937
935
|
/**
|
|
938
936
|
* Acknowledges `bytes` of a stream's received data as consumed,
|
|
939
|
-
* letting its sender continue. Every registered protocol needs this
|
|
937
|
+
* letting its sender continue. Every registered protocol needs this,
|
|
938
|
+
* also after the stream's connection closed: unacknowledged bytes keep
|
|
939
|
+
* the ended connection's slot until they are acknowledged or abandoned.
|
|
940
940
|
*/
|
|
941
941
|
streamConsumed(connId: bigint, streamId: bigint, bytes: bigint): void /*throws*/ {uniffiCaller.rustCallWithError(
|
|
942
942
|
/*liftError:*/ FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError),
|
|
@@ -1123,7 +1123,7 @@ function uniffiEnsureInitialized() {
|
|
|
1123
1123
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new() !== 40346) {
|
|
1124
1124
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new");
|
|
1125
1125
|
}
|
|
1126
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream() !==
|
|
1126
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream() !== 3134) {
|
|
1127
1127
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream");
|
|
1128
1128
|
}
|
|
1129
1129
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_active_reservation() !== 7490) {
|
|
@@ -1135,7 +1135,7 @@ function uniffiEnsureInitialized() {
|
|
|
1135
1135
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_cancel_connect() !== 21146) {
|
|
1136
1136
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_cancel_connect");
|
|
1137
1137
|
}
|
|
1138
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write() !==
|
|
1138
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write() !== 63517) {
|
|
1139
1139
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write");
|
|
1140
1140
|
}
|
|
1141
1141
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect() !== 21790) {
|
|
@@ -1189,10 +1189,10 @@ function uniffiEnsureInitialized() {
|
|
|
1189
1189
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reachability() !== 4853) {
|
|
1190
1190
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_reachability");
|
|
1191
1191
|
}
|
|
1192
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream() !==
|
|
1192
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream() !== 8949) {
|
|
1193
1193
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream");
|
|
1194
1194
|
}
|
|
1195
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream() !==
|
|
1195
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream() !== 31876) {
|
|
1196
1196
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream");
|
|
1197
1197
|
}
|
|
1198
1198
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_set_active() !== 10522) {
|
|
@@ -1204,7 +1204,7 @@ function uniffiEnsureInitialized() {
|
|
|
1204
1204
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_stop() !== 11062) {
|
|
1205
1205
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_stop");
|
|
1206
1206
|
}
|
|
1207
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_stream_consumed() !==
|
|
1207
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_stream_consumed() !== 52358) {
|
|
1208
1208
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_stream_consumed");
|
|
1209
1209
|
}
|
|
1210
1210
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_subscribe() !== 41051) {
|