@minip2p/react-native 0.9.1 → 0.10.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 +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 +662 -243
- 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 +464 -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 +864 -378
- 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
|
+
}
|
|
7
|
+
/**
|
|
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
|
+
}>;
|
|
2
104
|
/**
|
|
3
|
-
*
|
|
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`.
|
|
124
|
+
*/
|
|
125
|
+
remoteAddr: string;
|
|
126
|
+
/**
|
|
127
|
+
* How the connection was made.
|
|
12
128
|
*/
|
|
13
|
-
|
|
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",
|
|
@@ -1663,6 +1887,7 @@ export declare enum P2pEvent_Tags {
|
|
|
1663
1887
|
StreamClosed = "StreamClosed",
|
|
1664
1888
|
EndpointError = "EndpointError",
|
|
1665
1889
|
ReachabilityChanged = "ReachabilityChanged",
|
|
1890
|
+
ListenAddressesChanged = "ListenAddressesChanged",
|
|
1666
1891
|
PublicAddressesChanged = "PublicAddressesChanged",
|
|
1667
1892
|
RelayReserved = "RelayReserved",
|
|
1668
1893
|
RelayReservationLost = "RelayReservationLost",
|
|
@@ -1784,6 +2009,50 @@ export declare const P2pEvent: Readonly<{
|
|
|
1784
2009
|
}>;
|
|
1785
2010
|
};
|
|
1786
2011
|
};
|
|
2012
|
+
EndpointClosed: {
|
|
2013
|
+
new (inner: {
|
|
2014
|
+
outcome: CloseOutcome;
|
|
2015
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2016
|
+
}): {
|
|
2017
|
+
/**
|
|
2018
|
+
* @private
|
|
2019
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2020
|
+
*/
|
|
2021
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2022
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2023
|
+
readonly inner: Readonly<{
|
|
2024
|
+
outcome: CloseOutcome;
|
|
2025
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2026
|
+
}>;
|
|
2027
|
+
};
|
|
2028
|
+
"new"(inner: {
|
|
2029
|
+
outcome: CloseOutcome;
|
|
2030
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2031
|
+
}): {
|
|
2032
|
+
/**
|
|
2033
|
+
* @private
|
|
2034
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2035
|
+
*/
|
|
2036
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2037
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2038
|
+
readonly inner: Readonly<{
|
|
2039
|
+
outcome: CloseOutcome;
|
|
2040
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2041
|
+
}>;
|
|
2042
|
+
};
|
|
2043
|
+
instanceOf(obj: any): obj is {
|
|
2044
|
+
/**
|
|
2045
|
+
* @private
|
|
2046
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2047
|
+
*/
|
|
2048
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2049
|
+
readonly tag: P2pEvent_Tags.EndpointClosed;
|
|
2050
|
+
readonly inner: Readonly<{
|
|
2051
|
+
outcome: CloseOutcome;
|
|
2052
|
+
unfinished: Array<UnfinishedConnection>;
|
|
2053
|
+
}>;
|
|
2054
|
+
};
|
|
2055
|
+
};
|
|
1787
2056
|
ConnectionEstablished: {
|
|
1788
2057
|
new (inner: {
|
|
1789
2058
|
peerId: string;
|
|
@@ -1832,6 +2101,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1832
2101
|
new (inner: {
|
|
1833
2102
|
peerId: string;
|
|
1834
2103
|
connId: bigint;
|
|
2104
|
+
reason: ConnectionCloseReason;
|
|
1835
2105
|
}): {
|
|
1836
2106
|
/**
|
|
1837
2107
|
* @private
|
|
@@ -1842,11 +2112,13 @@ export declare const P2pEvent: Readonly<{
|
|
|
1842
2112
|
readonly inner: Readonly<{
|
|
1843
2113
|
peerId: string;
|
|
1844
2114
|
connId: bigint;
|
|
2115
|
+
reason: ConnectionCloseReason;
|
|
1845
2116
|
}>;
|
|
1846
2117
|
};
|
|
1847
2118
|
"new"(inner: {
|
|
1848
2119
|
peerId: string;
|
|
1849
2120
|
connId: bigint;
|
|
2121
|
+
reason: ConnectionCloseReason;
|
|
1850
2122
|
}): {
|
|
1851
2123
|
/**
|
|
1852
2124
|
* @private
|
|
@@ -1857,6 +2129,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1857
2129
|
readonly inner: Readonly<{
|
|
1858
2130
|
peerId: string;
|
|
1859
2131
|
connId: bigint;
|
|
2132
|
+
reason: ConnectionCloseReason;
|
|
1860
2133
|
}>;
|
|
1861
2134
|
};
|
|
1862
2135
|
instanceOf(obj: any): obj is {
|
|
@@ -1869,6 +2142,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1869
2142
|
readonly inner: Readonly<{
|
|
1870
2143
|
peerId: string;
|
|
1871
2144
|
connId: bigint;
|
|
2145
|
+
reason: ConnectionCloseReason;
|
|
1872
2146
|
}>;
|
|
1873
2147
|
};
|
|
1874
2148
|
};
|
|
@@ -2534,6 +2808,45 @@ export declare const P2pEvent: Readonly<{
|
|
|
2534
2808
|
}>;
|
|
2535
2809
|
};
|
|
2536
2810
|
};
|
|
2811
|
+
ListenAddressesChanged: {
|
|
2812
|
+
new (inner: {
|
|
2813
|
+
addrs: Array<string>;
|
|
2814
|
+
}): {
|
|
2815
|
+
/**
|
|
2816
|
+
* @private
|
|
2817
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2818
|
+
*/
|
|
2819
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2820
|
+
readonly tag: P2pEvent_Tags.ListenAddressesChanged;
|
|
2821
|
+
readonly inner: Readonly<{
|
|
2822
|
+
addrs: Array<string>;
|
|
2823
|
+
}>;
|
|
2824
|
+
};
|
|
2825
|
+
"new"(inner: {
|
|
2826
|
+
addrs: Array<string>;
|
|
2827
|
+
}): {
|
|
2828
|
+
/**
|
|
2829
|
+
* @private
|
|
2830
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2831
|
+
*/
|
|
2832
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2833
|
+
readonly tag: P2pEvent_Tags.ListenAddressesChanged;
|
|
2834
|
+
readonly inner: Readonly<{
|
|
2835
|
+
addrs: Array<string>;
|
|
2836
|
+
}>;
|
|
2837
|
+
};
|
|
2838
|
+
instanceOf(obj: any): obj is {
|
|
2839
|
+
/**
|
|
2840
|
+
* @private
|
|
2841
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2842
|
+
*/
|
|
2843
|
+
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2844
|
+
readonly tag: P2pEvent_Tags.ListenAddressesChanged;
|
|
2845
|
+
readonly inner: Readonly<{
|
|
2846
|
+
addrs: Array<string>;
|
|
2847
|
+
}>;
|
|
2848
|
+
};
|
|
2849
|
+
};
|
|
2537
2850
|
PublicAddressesChanged: {
|
|
2538
2851
|
new (inner: {
|
|
2539
2852
|
addrs: Array<string>;
|
|
@@ -3563,7 +3876,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
3563
3876
|
/**
|
|
3564
3877
|
* Event delivered by the native endpoint driver.
|
|
3565
3878
|
*/
|
|
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']>;
|
|
3879
|
+
export type P2pEvent = InstanceType<typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'EndpointClosed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'ConnectionReplaced' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamWriteAccepted' | 'StreamWriteStopped' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'ListenAddressesChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'MdnsFailed' | 'MdnsRecovered' | 'DiscoveryProtocolViolation']>;
|
|
3567
3880
|
/**
|
|
3568
3881
|
* This should be called before anything else.
|
|
3569
3882
|
*
|
|
@@ -3578,6 +3891,13 @@ declare function uniffiEnsureInitialized(): void;
|
|
|
3578
3891
|
declare const _default: Readonly<{
|
|
3579
3892
|
initialize: typeof uniffiEnsureInitialized;
|
|
3580
3893
|
converters: {
|
|
3894
|
+
FfiConverterTypeCloseOutcome: {
|
|
3895
|
+
readFromCursor(c: Cursor): CloseOutcome;
|
|
3896
|
+
writeIntoCursor(value: CloseOutcome, c: Cursor): void;
|
|
3897
|
+
allocationSize(value: CloseOutcome): number;
|
|
3898
|
+
lift(value: UniffiByteArray): CloseOutcome;
|
|
3899
|
+
lower(value: CloseOutcome, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3900
|
+
};
|
|
3581
3901
|
FfiConverterTypeConfigCapability: {
|
|
3582
3902
|
readFromCursor(c: Cursor): ConfigCapability;
|
|
3583
3903
|
writeIntoCursor(value: ConfigCapability, c: Cursor): void;
|
|
@@ -3592,6 +3912,13 @@ declare const _default: Readonly<{
|
|
|
3592
3912
|
lift(value: UniffiByteArray): ConnectTarget;
|
|
3593
3913
|
lower(value: ConnectTarget, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3594
3914
|
};
|
|
3915
|
+
FfiConverterTypeConnectionCloseReason: {
|
|
3916
|
+
readFromCursor(c: Cursor): ConnectionCloseReason;
|
|
3917
|
+
writeIntoCursor(value: ConnectionCloseReason, c: Cursor): void;
|
|
3918
|
+
allocationSize(value: ConnectionCloseReason): number;
|
|
3919
|
+
lift(value: UniffiByteArray): ConnectionCloseReason;
|
|
3920
|
+
lower(value: ConnectionCloseReason, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3921
|
+
};
|
|
3595
3922
|
FfiConverterTypeConnectionInfo: {
|
|
3596
3923
|
readFromCursor(c: Cursor): ConnectionInfo;
|
|
3597
3924
|
writeIntoCursor(value: ConnectionInfo, c: Cursor): void;
|
|
@@ -3711,6 +4038,13 @@ declare const _default: Readonly<{
|
|
|
3711
4038
|
lift(value: UniffiByteArray): RelayReservationInfo;
|
|
3712
4039
|
lower(value: RelayReservationInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3713
4040
|
};
|
|
4041
|
+
FfiConverterTypeUnfinishedConnection: {
|
|
4042
|
+
readFromCursor(c: Cursor): UnfinishedConnection;
|
|
4043
|
+
writeIntoCursor(value: UnfinishedConnection, c: Cursor): void;
|
|
4044
|
+
allocationSize(value: UnfinishedConnection): number;
|
|
4045
|
+
lift(value: UniffiByteArray): UnfinishedConnection;
|
|
4046
|
+
lower(value: UnfinishedConnection, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
4047
|
+
};
|
|
3714
4048
|
};
|
|
3715
4049
|
}>;
|
|
3716
4050
|
export default _default;
|