@minip2p/react-native 0.9.1 → 0.10.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.
- 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/Info.plist +4 -4
- 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 +3 -2
- package/lib/module/adapter.js +32 -10
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +11 -8
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/module/generated/minip2p_ffi_core.js +639 -264
- 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 +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +14 -8
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts +424 -130
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts.map +1 -1
- package/lib/typescript/src/hook-lifecycle.d.ts +2 -2
- package/lib/typescript/src/hook-lifecycle.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +45 -7
- package/src/generated/minip2p_ffi-ffi.ts +1 -1
- package/src/generated/minip2p_ffi.ts +18 -11
- package/src/generated/minip2p_ffi_core.ts +701 -267
- package/src/hook-lifecycle.ts +2 -2
|
@@ -1,21 +1,137 @@
|
|
|
1
1
|
import { type UniffiByteArray, Cursor, uniffiTypeNameSymbol } from "@ubjs/core";
|
|
2
|
+
export declare enum PathKind_Tags {
|
|
3
|
+
Direct = "Direct",
|
|
4
|
+
Punched = "Punched",
|
|
5
|
+
Relayed = "Relayed"
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
8
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PathKind: Readonly<{
|
|
11
|
+
instanceOf: (obj: any) => obj is PathKind;
|
|
12
|
+
Direct: {
|
|
13
|
+
new (): {
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
* This field is private and should not be used, use `tag` instead.
|
|
17
|
+
*/
|
|
18
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
19
|
+
readonly tag: PathKind_Tags.Direct;
|
|
20
|
+
};
|
|
21
|
+
"new"(): {
|
|
22
|
+
/**
|
|
23
|
+
* @private
|
|
24
|
+
* This field is private and should not be used, use `tag` instead.
|
|
25
|
+
*/
|
|
26
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
27
|
+
readonly tag: PathKind_Tags.Direct;
|
|
28
|
+
};
|
|
29
|
+
instanceOf(obj: any): obj is {
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
* This field is private and should not be used, use `tag` instead.
|
|
33
|
+
*/
|
|
34
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
35
|
+
readonly tag: PathKind_Tags.Direct;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
Punched: {
|
|
39
|
+
new (): {
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
* This field is private and should not be used, use `tag` instead.
|
|
43
|
+
*/
|
|
44
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
45
|
+
readonly tag: PathKind_Tags.Punched;
|
|
46
|
+
};
|
|
47
|
+
"new"(): {
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
* This field is private and should not be used, use `tag` instead.
|
|
51
|
+
*/
|
|
52
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
53
|
+
readonly tag: PathKind_Tags.Punched;
|
|
54
|
+
};
|
|
55
|
+
instanceOf(obj: any): obj is {
|
|
56
|
+
/**
|
|
57
|
+
* @private
|
|
58
|
+
* This field is private and should not be used, use `tag` instead.
|
|
59
|
+
*/
|
|
60
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
61
|
+
readonly tag: PathKind_Tags.Punched;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
Relayed: {
|
|
65
|
+
new (inner: {
|
|
66
|
+
relayPeerId: string;
|
|
67
|
+
}): {
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
* This field is private and should not be used, use `tag` instead.
|
|
71
|
+
*/
|
|
72
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
73
|
+
readonly tag: PathKind_Tags.Relayed;
|
|
74
|
+
readonly inner: Readonly<{
|
|
75
|
+
relayPeerId: string;
|
|
76
|
+
}>;
|
|
77
|
+
};
|
|
78
|
+
"new"(inner: {
|
|
79
|
+
relayPeerId: string;
|
|
80
|
+
}): {
|
|
81
|
+
/**
|
|
82
|
+
* @private
|
|
83
|
+
* This field is private and should not be used, use `tag` instead.
|
|
84
|
+
*/
|
|
85
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
86
|
+
readonly tag: PathKind_Tags.Relayed;
|
|
87
|
+
readonly inner: Readonly<{
|
|
88
|
+
relayPeerId: string;
|
|
89
|
+
}>;
|
|
90
|
+
};
|
|
91
|
+
instanceOf(obj: any): obj is {
|
|
92
|
+
/**
|
|
93
|
+
* @private
|
|
94
|
+
* This field is private and should not be used, use `tag` instead.
|
|
95
|
+
*/
|
|
96
|
+
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
97
|
+
readonly tag: PathKind_Tags.Relayed;
|
|
98
|
+
readonly inner: Readonly<{
|
|
99
|
+
relayPeerId: string;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
106
|
+
*/
|
|
107
|
+
export type PathKind = InstanceType<typeof PathKind['Direct' | 'Punched' | 'Relayed']>;
|
|
108
|
+
/**
|
|
109
|
+
* State snapshot of a peer's established connection; see
|
|
110
|
+
* `minip2p::ConnectionInfo`.
|
|
4
111
|
*/
|
|
5
112
|
export type ConnectionInfo = {
|
|
113
|
+
/**
|
|
114
|
+
* The peer on the other end.
|
|
115
|
+
*/
|
|
116
|
+
peerId: string;
|
|
6
117
|
/**
|
|
7
118
|
* Endpoint-local transport connection id.
|
|
8
119
|
*/
|
|
9
120
|
connId: bigint;
|
|
10
121
|
/**
|
|
11
|
-
* Remote transport address
|
|
122
|
+
* Remote transport address the transport reported; a circuit reports
|
|
123
|
+
* `/p2p/<relay>/p2p-circuit`.
|
|
12
124
|
*/
|
|
13
|
-
remoteAddr
|
|
125
|
+
remoteAddr: string;
|
|
126
|
+
/**
|
|
127
|
+
* How the connection was made.
|
|
128
|
+
*/
|
|
129
|
+
path: PathKind;
|
|
14
130
|
/**
|
|
15
131
|
* Protocols this connection advertised through Identify, once it is
|
|
16
|
-
* ready (`PeerReady` for this `conn_id`); `None` until then
|
|
17
|
-
* connection and protocols come from one
|
|
18
|
-
* trust them together.
|
|
132
|
+
* ready (`PeerReady` for this `conn_id`); `None` until then, distinct
|
|
133
|
+
* from an empty list. Readiness, connection and protocols come from one
|
|
134
|
+
* snapshot, so a ready wait can trust them together.
|
|
19
135
|
*/
|
|
20
136
|
readyProtocols?: Array<string>;
|
|
21
137
|
};
|
|
@@ -23,8 +139,8 @@ export type ConnectionInfo = {
|
|
|
23
139
|
* Generated factory for {@link ConnectionInfo} record objects.
|
|
24
140
|
*/
|
|
25
141
|
export declare const ConnectionInfo: Readonly<{
|
|
26
|
-
create: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "readyProtocols"
|
|
27
|
-
new: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "readyProtocols"
|
|
142
|
+
create: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "readyProtocols">>) => ConnectionInfo;
|
|
143
|
+
new: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "readyProtocols">>) => ConnectionInfo;
|
|
28
144
|
defaults: () => Partial<ConnectionInfo>;
|
|
29
145
|
}>;
|
|
30
146
|
/**
|
|
@@ -270,6 +386,46 @@ export declare const RelayReservationInfo: Readonly<{
|
|
|
270
386
|
new: (partial: Partial<RelayReservationInfo> & Required<Omit<RelayReservationInfo, "expiresUnixSecs">>) => RelayReservationInfo;
|
|
271
387
|
defaults: () => Partial<RelayReservationInfo>;
|
|
272
388
|
}>;
|
|
389
|
+
/**
|
|
390
|
+
* A connection still tracked when the closing drain ended.
|
|
391
|
+
*/
|
|
392
|
+
export type UnfinishedConnection = {
|
|
393
|
+
/**
|
|
394
|
+
* Endpoint-local transport connection id.
|
|
395
|
+
*/
|
|
396
|
+
connId: bigint;
|
|
397
|
+
/**
|
|
398
|
+
* Remote peer; `None` for an inbound handshake that had not identified
|
|
399
|
+
* one yet.
|
|
400
|
+
*/
|
|
401
|
+
peerId?: string;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Generated factory for {@link UnfinishedConnection} record objects.
|
|
405
|
+
*/
|
|
406
|
+
export declare const UnfinishedConnection: Readonly<{
|
|
407
|
+
create: (partial: Partial<UnfinishedConnection> & Required<Omit<UnfinishedConnection, "peerId">>) => UnfinishedConnection;
|
|
408
|
+
new: (partial: Partial<UnfinishedConnection> & Required<Omit<UnfinishedConnection, "peerId">>) => UnfinishedConnection;
|
|
409
|
+
defaults: () => Partial<UnfinishedConnection>;
|
|
410
|
+
}>;
|
|
411
|
+
/**
|
|
412
|
+
* How the driver's closing drain ended; see [`P2pEvent::EndpointClosed`].
|
|
413
|
+
*/
|
|
414
|
+
export declare enum CloseOutcome {
|
|
415
|
+
/**
|
|
416
|
+
* Every tracked connection finished its teardown in time.
|
|
417
|
+
*/
|
|
418
|
+
Drained = 0,
|
|
419
|
+
/**
|
|
420
|
+
* The stop deadline passed with connections still tracked.
|
|
421
|
+
*/
|
|
422
|
+
DeadlineExpired = 1,
|
|
423
|
+
/**
|
|
424
|
+
* Driving the transports failed and ended the drain early, or the
|
|
425
|
+
* driver panicked and dropped the endpoint without a drain.
|
|
426
|
+
*/
|
|
427
|
+
Failed = 2
|
|
428
|
+
}
|
|
273
429
|
/**
|
|
274
430
|
* The part of an endpoint's configuration an [`FfiError::InvalidConfig`]
|
|
275
431
|
* names.
|
|
@@ -399,6 +555,179 @@ export declare const ConnectTarget: Readonly<{
|
|
|
399
555
|
* adapt the shape to their toolchain.
|
|
400
556
|
*/
|
|
401
557
|
export type ConnectTarget = InstanceType<typeof ConnectTarget['Peer' | 'Addresses']>;
|
|
558
|
+
export declare enum ConnectionCloseReason_Tags {
|
|
559
|
+
Local = "Local",
|
|
560
|
+
Remote = "Remote",
|
|
561
|
+
TimedOut = "TimedOut",
|
|
562
|
+
Stalled = "Stalled",
|
|
563
|
+
Error = "Error"
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
567
|
+
*/
|
|
568
|
+
export declare const ConnectionCloseReason: Readonly<{
|
|
569
|
+
instanceOf: (obj: any) => obj is ConnectionCloseReason;
|
|
570
|
+
Local: {
|
|
571
|
+
new (): {
|
|
572
|
+
/**
|
|
573
|
+
* @private
|
|
574
|
+
* This field is private and should not be used, use `tag` instead.
|
|
575
|
+
*/
|
|
576
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
577
|
+
readonly tag: ConnectionCloseReason_Tags.Local;
|
|
578
|
+
};
|
|
579
|
+
"new"(): {
|
|
580
|
+
/**
|
|
581
|
+
* @private
|
|
582
|
+
* This field is private and should not be used, use `tag` instead.
|
|
583
|
+
*/
|
|
584
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
585
|
+
readonly tag: ConnectionCloseReason_Tags.Local;
|
|
586
|
+
};
|
|
587
|
+
instanceOf(obj: any): obj is {
|
|
588
|
+
/**
|
|
589
|
+
* @private
|
|
590
|
+
* This field is private and should not be used, use `tag` instead.
|
|
591
|
+
*/
|
|
592
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
593
|
+
readonly tag: ConnectionCloseReason_Tags.Local;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
Remote: {
|
|
597
|
+
new (inner: {
|
|
598
|
+
code: bigint;
|
|
599
|
+
}): {
|
|
600
|
+
/**
|
|
601
|
+
* @private
|
|
602
|
+
* This field is private and should not be used, use `tag` instead.
|
|
603
|
+
*/
|
|
604
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
605
|
+
readonly tag: ConnectionCloseReason_Tags.Remote;
|
|
606
|
+
readonly inner: Readonly<{
|
|
607
|
+
code: bigint;
|
|
608
|
+
}>;
|
|
609
|
+
};
|
|
610
|
+
"new"(inner: {
|
|
611
|
+
code: bigint;
|
|
612
|
+
}): {
|
|
613
|
+
/**
|
|
614
|
+
* @private
|
|
615
|
+
* This field is private and should not be used, use `tag` instead.
|
|
616
|
+
*/
|
|
617
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
618
|
+
readonly tag: ConnectionCloseReason_Tags.Remote;
|
|
619
|
+
readonly inner: Readonly<{
|
|
620
|
+
code: bigint;
|
|
621
|
+
}>;
|
|
622
|
+
};
|
|
623
|
+
instanceOf(obj: any): obj is {
|
|
624
|
+
/**
|
|
625
|
+
* @private
|
|
626
|
+
* This field is private and should not be used, use `tag` instead.
|
|
627
|
+
*/
|
|
628
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
629
|
+
readonly tag: ConnectionCloseReason_Tags.Remote;
|
|
630
|
+
readonly inner: Readonly<{
|
|
631
|
+
code: bigint;
|
|
632
|
+
}>;
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
TimedOut: {
|
|
636
|
+
new (): {
|
|
637
|
+
/**
|
|
638
|
+
* @private
|
|
639
|
+
* This field is private and should not be used, use `tag` instead.
|
|
640
|
+
*/
|
|
641
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
642
|
+
readonly tag: ConnectionCloseReason_Tags.TimedOut;
|
|
643
|
+
};
|
|
644
|
+
"new"(): {
|
|
645
|
+
/**
|
|
646
|
+
* @private
|
|
647
|
+
* This field is private and should not be used, use `tag` instead.
|
|
648
|
+
*/
|
|
649
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
650
|
+
readonly tag: ConnectionCloseReason_Tags.TimedOut;
|
|
651
|
+
};
|
|
652
|
+
instanceOf(obj: any): obj is {
|
|
653
|
+
/**
|
|
654
|
+
* @private
|
|
655
|
+
* This field is private and should not be used, use `tag` instead.
|
|
656
|
+
*/
|
|
657
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
658
|
+
readonly tag: ConnectionCloseReason_Tags.TimedOut;
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
Stalled: {
|
|
662
|
+
new (): {
|
|
663
|
+
/**
|
|
664
|
+
* @private
|
|
665
|
+
* This field is private and should not be used, use `tag` instead.
|
|
666
|
+
*/
|
|
667
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
668
|
+
readonly tag: ConnectionCloseReason_Tags.Stalled;
|
|
669
|
+
};
|
|
670
|
+
"new"(): {
|
|
671
|
+
/**
|
|
672
|
+
* @private
|
|
673
|
+
* This field is private and should not be used, use `tag` instead.
|
|
674
|
+
*/
|
|
675
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
676
|
+
readonly tag: ConnectionCloseReason_Tags.Stalled;
|
|
677
|
+
};
|
|
678
|
+
instanceOf(obj: any): obj is {
|
|
679
|
+
/**
|
|
680
|
+
* @private
|
|
681
|
+
* This field is private and should not be used, use `tag` instead.
|
|
682
|
+
*/
|
|
683
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
684
|
+
readonly tag: ConnectionCloseReason_Tags.Stalled;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
Error: {
|
|
688
|
+
new (inner: {
|
|
689
|
+
message: string;
|
|
690
|
+
}): {
|
|
691
|
+
/**
|
|
692
|
+
* @private
|
|
693
|
+
* This field is private and should not be used, use `tag` instead.
|
|
694
|
+
*/
|
|
695
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
696
|
+
readonly tag: ConnectionCloseReason_Tags.Error;
|
|
697
|
+
readonly inner: Readonly<{
|
|
698
|
+
message: string;
|
|
699
|
+
}>;
|
|
700
|
+
};
|
|
701
|
+
"new"(inner: {
|
|
702
|
+
message: string;
|
|
703
|
+
}): {
|
|
704
|
+
/**
|
|
705
|
+
* @private
|
|
706
|
+
* This field is private and should not be used, use `tag` instead.
|
|
707
|
+
*/
|
|
708
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
709
|
+
readonly tag: ConnectionCloseReason_Tags.Error;
|
|
710
|
+
readonly inner: Readonly<{
|
|
711
|
+
message: string;
|
|
712
|
+
}>;
|
|
713
|
+
};
|
|
714
|
+
instanceOf(obj: any): obj is {
|
|
715
|
+
/**
|
|
716
|
+
* @private
|
|
717
|
+
* This field is private and should not be used, use `tag` instead.
|
|
718
|
+
*/
|
|
719
|
+
readonly [uniffiTypeNameSymbol]: "ConnectionCloseReason";
|
|
720
|
+
readonly tag: ConnectionCloseReason_Tags.Error;
|
|
721
|
+
readonly inner: Readonly<{
|
|
722
|
+
message: string;
|
|
723
|
+
}>;
|
|
724
|
+
};
|
|
725
|
+
};
|
|
726
|
+
}>;
|
|
727
|
+
/**
|
|
728
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
729
|
+
*/
|
|
730
|
+
export type ConnectionCloseReason = InstanceType<typeof ConnectionCloseReason['Local' | 'Remote' | 'TimedOut' | 'Stalled' | 'Error']>;
|
|
402
731
|
/**
|
|
403
732
|
* Source that contributed a discovery observation.
|
|
404
733
|
*/
|
|
@@ -940,9 +1269,6 @@ export declare const FfiError: Readonly<{
|
|
|
940
1269
|
new (inner: {
|
|
941
1270
|
detail: string;
|
|
942
1271
|
}): {
|
|
943
|
-
name: string;
|
|
944
|
-
message: string;
|
|
945
|
-
stack?: string;
|
|
946
1272
|
/**
|
|
947
1273
|
* @private
|
|
948
1274
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -952,14 +1278,14 @@ export declare const FfiError: Readonly<{
|
|
|
952
1278
|
readonly inner: Readonly<{
|
|
953
1279
|
detail: string;
|
|
954
1280
|
}>;
|
|
1281
|
+
name: string;
|
|
1282
|
+
message: string;
|
|
1283
|
+
stack?: string;
|
|
955
1284
|
cause?: unknown;
|
|
956
1285
|
};
|
|
957
1286
|
"new"(inner: {
|
|
958
1287
|
detail: string;
|
|
959
1288
|
}): {
|
|
960
|
-
name: string;
|
|
961
|
-
message: string;
|
|
962
|
-
stack?: string;
|
|
963
1289
|
/**
|
|
964
1290
|
* @private
|
|
965
1291
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -969,12 +1295,12 @@ export declare const FfiError: Readonly<{
|
|
|
969
1295
|
readonly inner: Readonly<{
|
|
970
1296
|
detail: string;
|
|
971
1297
|
}>;
|
|
972
|
-
cause?: unknown;
|
|
973
|
-
};
|
|
974
|
-
instanceOf(obj: any): obj is {
|
|
975
1298
|
name: string;
|
|
976
1299
|
message: string;
|
|
977
1300
|
stack?: string;
|
|
1301
|
+
cause?: unknown;
|
|
1302
|
+
};
|
|
1303
|
+
instanceOf(obj: any): obj is {
|
|
978
1304
|
/**
|
|
979
1305
|
* @private
|
|
980
1306
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -984,12 +1310,12 @@ export declare const FfiError: Readonly<{
|
|
|
984
1310
|
readonly inner: Readonly<{
|
|
985
1311
|
detail: string;
|
|
986
1312
|
}>;
|
|
987
|
-
cause?: unknown;
|
|
988
|
-
};
|
|
989
|
-
hasInner(obj: any): obj is {
|
|
990
1313
|
name: string;
|
|
991
1314
|
message: string;
|
|
992
1315
|
stack?: string;
|
|
1316
|
+
cause?: unknown;
|
|
1317
|
+
};
|
|
1318
|
+
hasInner(obj: any): obj is {
|
|
993
1319
|
/**
|
|
994
1320
|
* @private
|
|
995
1321
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -999,12 +1325,12 @@ export declare const FfiError: Readonly<{
|
|
|
999
1325
|
readonly inner: Readonly<{
|
|
1000
1326
|
detail: string;
|
|
1001
1327
|
}>;
|
|
1002
|
-
cause?: unknown;
|
|
1003
|
-
};
|
|
1004
|
-
getInner(obj: {
|
|
1005
1328
|
name: string;
|
|
1006
1329
|
message: string;
|
|
1007
1330
|
stack?: string;
|
|
1331
|
+
cause?: unknown;
|
|
1332
|
+
};
|
|
1333
|
+
getInner(obj: {
|
|
1008
1334
|
/**
|
|
1009
1335
|
* @private
|
|
1010
1336
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1014,6 +1340,9 @@ export declare const FfiError: Readonly<{
|
|
|
1014
1340
|
readonly inner: Readonly<{
|
|
1015
1341
|
detail: string;
|
|
1016
1342
|
}>;
|
|
1343
|
+
name: string;
|
|
1344
|
+
message: string;
|
|
1345
|
+
stack?: string;
|
|
1017
1346
|
cause?: unknown;
|
|
1018
1347
|
}): Readonly<{
|
|
1019
1348
|
detail: string;
|
|
@@ -1539,115 +1868,10 @@ export declare enum Reachability {
|
|
|
1539
1868
|
*/
|
|
1540
1869
|
Private = 2
|
|
1541
1870
|
}
|
|
1542
|
-
export declare enum PathKind_Tags {
|
|
1543
|
-
DirectDialed = "DirectDialed",
|
|
1544
|
-
DirectPunched = "DirectPunched",
|
|
1545
|
-
Relayed = "Relayed"
|
|
1546
|
-
}
|
|
1547
|
-
/**
|
|
1548
|
-
* Kind of usable connection path.
|
|
1549
|
-
*/
|
|
1550
|
-
export declare const PathKind: Readonly<{
|
|
1551
|
-
instanceOf: (obj: any) => obj is PathKind;
|
|
1552
|
-
DirectDialed: {
|
|
1553
|
-
new (): {
|
|
1554
|
-
/**
|
|
1555
|
-
* @private
|
|
1556
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1557
|
-
*/
|
|
1558
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1559
|
-
readonly tag: PathKind_Tags.DirectDialed;
|
|
1560
|
-
};
|
|
1561
|
-
"new"(): {
|
|
1562
|
-
/**
|
|
1563
|
-
* @private
|
|
1564
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1565
|
-
*/
|
|
1566
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1567
|
-
readonly tag: PathKind_Tags.DirectDialed;
|
|
1568
|
-
};
|
|
1569
|
-
instanceOf(obj: any): obj is {
|
|
1570
|
-
/**
|
|
1571
|
-
* @private
|
|
1572
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1573
|
-
*/
|
|
1574
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1575
|
-
readonly tag: PathKind_Tags.DirectDialed;
|
|
1576
|
-
};
|
|
1577
|
-
};
|
|
1578
|
-
DirectPunched: {
|
|
1579
|
-
new (): {
|
|
1580
|
-
/**
|
|
1581
|
-
* @private
|
|
1582
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1583
|
-
*/
|
|
1584
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1585
|
-
readonly tag: PathKind_Tags.DirectPunched;
|
|
1586
|
-
};
|
|
1587
|
-
"new"(): {
|
|
1588
|
-
/**
|
|
1589
|
-
* @private
|
|
1590
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1591
|
-
*/
|
|
1592
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1593
|
-
readonly tag: PathKind_Tags.DirectPunched;
|
|
1594
|
-
};
|
|
1595
|
-
instanceOf(obj: any): obj is {
|
|
1596
|
-
/**
|
|
1597
|
-
* @private
|
|
1598
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1599
|
-
*/
|
|
1600
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1601
|
-
readonly tag: PathKind_Tags.DirectPunched;
|
|
1602
|
-
};
|
|
1603
|
-
};
|
|
1604
|
-
Relayed: {
|
|
1605
|
-
new (inner: {
|
|
1606
|
-
relayPeerId: string;
|
|
1607
|
-
}): {
|
|
1608
|
-
/**
|
|
1609
|
-
* @private
|
|
1610
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1611
|
-
*/
|
|
1612
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1613
|
-
readonly tag: PathKind_Tags.Relayed;
|
|
1614
|
-
readonly inner: Readonly<{
|
|
1615
|
-
relayPeerId: string;
|
|
1616
|
-
}>;
|
|
1617
|
-
};
|
|
1618
|
-
"new"(inner: {
|
|
1619
|
-
relayPeerId: string;
|
|
1620
|
-
}): {
|
|
1621
|
-
/**
|
|
1622
|
-
* @private
|
|
1623
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1624
|
-
*/
|
|
1625
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1626
|
-
readonly tag: PathKind_Tags.Relayed;
|
|
1627
|
-
readonly inner: Readonly<{
|
|
1628
|
-
relayPeerId: string;
|
|
1629
|
-
}>;
|
|
1630
|
-
};
|
|
1631
|
-
instanceOf(obj: any): obj is {
|
|
1632
|
-
/**
|
|
1633
|
-
* @private
|
|
1634
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1635
|
-
*/
|
|
1636
|
-
readonly [uniffiTypeNameSymbol]: "PathKind";
|
|
1637
|
-
readonly tag: PathKind_Tags.Relayed;
|
|
1638
|
-
readonly inner: Readonly<{
|
|
1639
|
-
relayPeerId: string;
|
|
1640
|
-
}>;
|
|
1641
|
-
};
|
|
1642
|
-
};
|
|
1643
|
-
}>;
|
|
1644
|
-
/**
|
|
1645
|
-
* Kind of usable connection path.
|
|
1646
|
-
*/
|
|
1647
|
-
export type PathKind = InstanceType<typeof PathKind['DirectDialed' | 'DirectPunched' | 'Relayed']>;
|
|
1648
1871
|
export declare enum P2pEvent_Tags {
|
|
1649
1872
|
EventsDropped = "EventsDropped",
|
|
1650
1873
|
DriverFailed = "DriverFailed",
|
|
1874
|
+
EndpointClosed = "EndpointClosed",
|
|
1651
1875
|
ConnectionEstablished = "ConnectionEstablished",
|
|
1652
1876
|
ConnectionClosed = "ConnectionClosed",
|
|
1653
1877
|
ConnectionReplaced = "ConnectionReplaced",
|
|
@@ -1784,6 +2008,50 @@ export declare const P2pEvent: Readonly<{
|
|
|
1784
2008
|
}>;
|
|
1785
2009
|
};
|
|
1786
2010
|
};
|
|
2011
|
+
EndpointClosed: {
|
|
2012
|
+
new (inner: {
|
|
2013
|
+
outcome: CloseOutcome;
|
|
2014
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2015
|
+
}): {
|
|
2016
|
+
/**
|
|
2017
|
+
* @private
|
|
2018
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2019
|
+
*/
|
|
2020
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2021
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2022
|
+
readonly inner: Readonly<{
|
|
2023
|
+
outcome: CloseOutcome;
|
|
2024
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2025
|
+
}>;
|
|
2026
|
+
};
|
|
2027
|
+
"new"(inner: {
|
|
2028
|
+
outcome: CloseOutcome;
|
|
2029
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2030
|
+
}): {
|
|
2031
|
+
/**
|
|
2032
|
+
* @private
|
|
2033
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2034
|
+
*/
|
|
2035
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2036
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2037
|
+
readonly inner: Readonly<{
|
|
2038
|
+
outcome: CloseOutcome;
|
|
2039
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2040
|
+
}>;
|
|
2041
|
+
};
|
|
2042
|
+
instanceOf(obj: any): obj is {
|
|
2043
|
+
/**
|
|
2044
|
+
* @private
|
|
2045
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2046
|
+
*/
|
|
2047
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2048
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2049
|
+
readonly inner: Readonly<{
|
|
2050
|
+
outcome: CloseOutcome;
|
|
2051
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2052
|
+
}>;
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
1787
2055
|
ConnectionEstablished: {
|
|
1788
2056
|
new (inner: {
|
|
1789
2057
|
peerId: string;
|
|
@@ -1832,6 +2100,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1832
2100
|
new (inner: {
|
|
1833
2101
|
peerId: string;
|
|
1834
2102
|
connId: bigint;
|
|
2103
|
+
reason: ConnectionCloseReason;
|
|
1835
2104
|
}): {
|
|
1836
2105
|
/**
|
|
1837
2106
|
* @private
|
|
@@ -1842,11 +2111,13 @@ export declare const P2pEvent: Readonly<{
|
|
|
1842
2111
|
readonly inner: Readonly<{
|
|
1843
2112
|
peerId: string;
|
|
1844
2113
|
connId: bigint;
|
|
2114
|
+
reason: ConnectionCloseReason;
|
|
1845
2115
|
}>;
|
|
1846
2116
|
};
|
|
1847
2117
|
"new"(inner: {
|
|
1848
2118
|
peerId: string;
|
|
1849
2119
|
connId: bigint;
|
|
2120
|
+
reason: ConnectionCloseReason;
|
|
1850
2121
|
}): {
|
|
1851
2122
|
/**
|
|
1852
2123
|
* @private
|
|
@@ -1857,6 +2128,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1857
2128
|
readonly inner: Readonly<{
|
|
1858
2129
|
peerId: string;
|
|
1859
2130
|
connId: bigint;
|
|
2131
|
+
reason: ConnectionCloseReason;
|
|
1860
2132
|
}>;
|
|
1861
2133
|
};
|
|
1862
2134
|
instanceOf(obj: any): obj is {
|
|
@@ -1869,6 +2141,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1869
2141
|
readonly inner: Readonly<{
|
|
1870
2142
|
peerId: string;
|
|
1871
2143
|
connId: bigint;
|
|
2144
|
+
reason: ConnectionCloseReason;
|
|
1872
2145
|
}>;
|
|
1873
2146
|
};
|
|
1874
2147
|
};
|
|
@@ -3563,7 +3836,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
3563
3836
|
/**
|
|
3564
3837
|
* Event delivered by the native endpoint driver.
|
|
3565
3838
|
*/
|
|
3566
|
-
export type P2pEvent = InstanceType<typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'ConnectionReplaced' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamWriteAccepted' | 'StreamWriteStopped' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'MdnsFailed' | 'MdnsRecovered' | 'DiscoveryProtocolViolation']>;
|
|
3839
|
+
export type P2pEvent = InstanceType<typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'EndpointClosed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'ConnectionReplaced' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamWriteAccepted' | 'StreamWriteStopped' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'MdnsFailed' | 'MdnsRecovered' | 'DiscoveryProtocolViolation']>;
|
|
3567
3840
|
/**
|
|
3568
3841
|
* This should be called before anything else.
|
|
3569
3842
|
*
|
|
@@ -3578,6 +3851,13 @@ declare function uniffiEnsureInitialized(): void;
|
|
|
3578
3851
|
declare const _default: Readonly<{
|
|
3579
3852
|
initialize: typeof uniffiEnsureInitialized;
|
|
3580
3853
|
converters: {
|
|
3854
|
+
FfiConverterTypeCloseOutcome: {
|
|
3855
|
+
readFromCursor(c: Cursor): CloseOutcome;
|
|
3856
|
+
writeIntoCursor(value: CloseOutcome, c: Cursor): void;
|
|
3857
|
+
allocationSize(value: CloseOutcome): number;
|
|
3858
|
+
lift(value: UniffiByteArray): CloseOutcome;
|
|
3859
|
+
lower(value: CloseOutcome, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3860
|
+
};
|
|
3581
3861
|
FfiConverterTypeConfigCapability: {
|
|
3582
3862
|
readFromCursor(c: Cursor): ConfigCapability;
|
|
3583
3863
|
writeIntoCursor(value: ConfigCapability, c: Cursor): void;
|
|
@@ -3592,6 +3872,13 @@ declare const _default: Readonly<{
|
|
|
3592
3872
|
lift(value: UniffiByteArray): ConnectTarget;
|
|
3593
3873
|
lower(value: ConnectTarget, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3594
3874
|
};
|
|
3875
|
+
FfiConverterTypeConnectionCloseReason: {
|
|
3876
|
+
readFromCursor(c: Cursor): ConnectionCloseReason;
|
|
3877
|
+
writeIntoCursor(value: ConnectionCloseReason, c: Cursor): void;
|
|
3878
|
+
allocationSize(value: ConnectionCloseReason): number;
|
|
3879
|
+
lift(value: UniffiByteArray): ConnectionCloseReason;
|
|
3880
|
+
lower(value: ConnectionCloseReason, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3881
|
+
};
|
|
3595
3882
|
FfiConverterTypeConnectionInfo: {
|
|
3596
3883
|
readFromCursor(c: Cursor): ConnectionInfo;
|
|
3597
3884
|
writeIntoCursor(value: ConnectionInfo, c: Cursor): void;
|
|
@@ -3711,6 +3998,13 @@ declare const _default: Readonly<{
|
|
|
3711
3998
|
lift(value: UniffiByteArray): RelayReservationInfo;
|
|
3712
3999
|
lower(value: RelayReservationInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3713
4000
|
};
|
|
4001
|
+
FfiConverterTypeUnfinishedConnection: {
|
|
4002
|
+
readFromCursor(c: Cursor): UnfinishedConnection;
|
|
4003
|
+
writeIntoCursor(value: UnfinishedConnection, c: Cursor): void;
|
|
4004
|
+
allocationSize(value: UnfinishedConnection): number;
|
|
4005
|
+
lift(value: UniffiByteArray): UnfinishedConnection;
|
|
4006
|
+
lower(value: UnfinishedConnection, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
4007
|
+
};
|
|
3714
4008
|
};
|
|
3715
4009
|
}>;
|
|
3716
4010
|
export default _default;
|