@minip2p/react-native 0.10.1 → 0.10.3

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.
@@ -475,6 +475,666 @@ const FfiConverterTypeMdnsOptions = (() => {
475
475
  return new FFIConverter();
476
476
  })();
477
477
 
478
+
479
+ // Enum: WindowLimit
480
+ export enum WindowLimit_Tags {
481
+ Bounded = "Bounded",
482
+ Unlimited = "Unlimited"
483
+ }
484
+ /**
485
+ * A receive window that may be unbounded.
486
+ */
487
+ export const WindowLimit = (() => {
488
+
489
+ type Bounded__interface = {
490
+ tag: WindowLimit_Tags.Bounded;
491
+ inner:
492
+ Readonly<{bytes: bigint}>
493
+ };
494
+ /**
495
+ * At most `bytes`.
496
+ */
497
+ class Bounded_ extends UniffiEnum implements Bounded__interface {
498
+ /**
499
+ * @private
500
+ * This field is private and should not be used, use `tag` instead.
501
+ */
502
+ readonly [uniffiTypeNameSymbol] = "WindowLimit";
503
+ readonly tag = WindowLimit_Tags.Bounded;
504
+ readonly inner:
505
+ Readonly<{bytes: bigint}>;
506
+ constructor(
507
+ inner: {bytes: bigint }) {
508
+ super("WindowLimit", "Bounded");
509
+
510
+ this.inner = Object.freeze(inner);
511
+ }
512
+ static new(
513
+ inner: {bytes: bigint }): Bounded_ {
514
+ return new Bounded_(inner);
515
+ }
516
+
517
+ static instanceOf(obj: any): obj is Bounded_ {
518
+ return obj.tag === WindowLimit_Tags.Bounded;
519
+ }
520
+
521
+ }
522
+
523
+ type Unlimited__interface = {
524
+ tag: WindowLimit_Tags.Unlimited
525
+ };
526
+ /**
527
+ * No window.
528
+ */
529
+ class Unlimited_ extends UniffiEnum implements Unlimited__interface {
530
+ /**
531
+ * @private
532
+ * This field is private and should not be used, use `tag` instead.
533
+ */
534
+ readonly [uniffiTypeNameSymbol] = "WindowLimit";
535
+ readonly tag = WindowLimit_Tags.Unlimited;
536
+ constructor() {
537
+ super("WindowLimit", "Unlimited");
538
+ }
539
+
540
+ static new(): Unlimited_ {
541
+ return new Unlimited_();
542
+ }
543
+
544
+ static instanceOf(obj: any): obj is Unlimited_ {
545
+ return obj.tag === WindowLimit_Tags.Unlimited;
546
+ }
547
+
548
+ }
549
+
550
+ function instanceOf(obj: any): obj is WindowLimit {
551
+ return obj[uniffiTypeNameSymbol] === "WindowLimit";
552
+ }
553
+
554
+ return Object.freeze({
555
+ instanceOf,
556
+ Bounded: Bounded_,
557
+ Unlimited: Unlimited_
558
+ });
559
+
560
+ })();
561
+ /**
562
+ * A receive window that may be unbounded.
563
+ */
564
+ export type WindowLimit = InstanceType<
565
+ typeof WindowLimit['Bounded' | 'Unlimited']
566
+ >;
567
+
568
+ // FfiConverter for enum WindowLimit
569
+ const FfiConverterTypeWindowLimit = (() => {
570
+ type TypeName = WindowLimit;
571
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
572
+ readFromCursor(c: Cursor): TypeName {
573
+ switch (c.readI32()) {
574
+ case 1: return new WindowLimit.Bounded({bytes: FfiConverterUInt64.readFromCursor(c) });
575
+ case 2: return new WindowLimit.Unlimited();
576
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
577
+ }
578
+ }
579
+ writeIntoCursor(value: TypeName, c: Cursor): void {
580
+ switch (value.tag) {
581
+ case WindowLimit_Tags.Bounded: {
582
+ c.writeI32(1);
583
+ const inner = value.inner;
584
+ FfiConverterUInt64.writeIntoCursor(inner.bytes, c);
585
+ return;
586
+ }
587
+ case WindowLimit_Tags.Unlimited: {
588
+ c.writeI32(2);
589
+ return;
590
+ }
591
+ default:
592
+ // Throwing from here means that WindowLimit_Tags hasn't matched an ordinal.
593
+ throw new UniffiInternalError.UnexpectedEnumCase();
594
+ }
595
+ }
596
+ allocationSize(value: TypeName): number {
597
+ switch (value.tag) {
598
+ case WindowLimit_Tags.Bounded: {
599
+ const inner = value.inner;
600
+ let size = 4;
601
+ size += FfiConverterUInt64.allocationSize(inner.bytes);
602
+ return size;
603
+ }
604
+ case WindowLimit_Tags.Unlimited: {
605
+ return 4;
606
+ }
607
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
608
+ }
609
+ }
610
+ }
611
+ return new FFIConverter();
612
+ })();
613
+
614
+ /**
615
+ * QUIC overrides; each field mirrors `minip2p::QuicLimits`.
616
+ */
617
+ export type QuicLimitsOptions = {
618
+ /**
619
+ * Simultaneous connections, inbound and outbound.
620
+ */
621
+ maxConnections?: bigint,
622
+ /**
623
+ * Locally initiated bidirectional streams per connection.
624
+ */
625
+ maxStreamsPerConnection?: bigint,
626
+ /**
627
+ * Bytes queued per stream beyond what the engine accepts; non-zero.
628
+ */
629
+ maxPendingBytesPerStream?: bigint,
630
+ /**
631
+ * Bytes queued per connection beyond what the engine accepts; greater
632
+ * than `control_stream_reserve_bytes`.
633
+ */
634
+ maxPendingConnectionBytes?: bigint,
635
+ /**
636
+ * Part of the connection queue only control streams may fill.
637
+ */
638
+ controlStreamReserveBytes?: bigint,
639
+ /**
640
+ * UDP datagrams retained while the socket would block; non-zero.
641
+ */
642
+ maxPendingDatagrams?: bigint,
643
+ /**
644
+ * Idle timeout advertised to peers, in milliseconds; non-zero.
645
+ */
646
+ idleTimeoutMs?: bigint,
647
+ /**
648
+ * Whether inbound connections need a stateless Retry first.
649
+ */
650
+ requireAddressValidation?: boolean,
651
+ /**
652
+ * Per-stream receive window in bytes; non-zero.
653
+ */
654
+ streamReceiveWindow?: bigint,
655
+ /**
656
+ * Per-connection receive window (unlimited by default).
657
+ */
658
+ connectionReceiveWindow?: WindowLimit,
659
+ /**
660
+ * Bytes buffered per connection for sending; non-zero.
661
+ */
662
+ sendWindow?: bigint,
663
+ /**
664
+ * Time an `h3` connection has to complete Noise, in milliseconds;
665
+ * non-zero.
666
+ */
667
+ webtransportHandshakeTimeoutMs?: bigint
668
+ }
669
+
670
+ /**
671
+ * Generated factory for {@link QuicLimitsOptions} record objects.
672
+ */
673
+ export const QuicLimitsOptions = (() => {
674
+ const defaults = () => ({
675
+ maxConnections: undefined,
676
+ maxStreamsPerConnection: undefined,
677
+ maxPendingBytesPerStream: undefined,
678
+ maxPendingConnectionBytes: undefined,
679
+ controlStreamReserveBytes: undefined,
680
+ maxPendingDatagrams: undefined,
681
+ idleTimeoutMs: undefined,
682
+ requireAddressValidation: undefined,
683
+ streamReceiveWindow: undefined,
684
+ connectionReceiveWindow: undefined,
685
+ sendWindow: undefined,
686
+ webtransportHandshakeTimeoutMs: undefined
687
+ });
688
+ const create = (() => {
689
+ return uniffiCreateRecord<QuicLimitsOptions, ReturnType<typeof defaults>>(defaults);
690
+ })();
691
+ return Object.freeze({
692
+ create,
693
+ new: create,
694
+ defaults: () => Object.freeze(defaults()) as Partial<QuicLimitsOptions>,
695
+ });
696
+ })();
697
+
698
+ const FfiConverterTypeQuicLimitsOptions = (() => {
699
+ type TypeName = QuicLimitsOptions;
700
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
701
+ readFromCursor(c: Cursor): TypeName {
702
+ return {
703
+ maxConnections: FfiConverterOptionalUInt64.readFromCursor(c),
704
+ maxStreamsPerConnection: FfiConverterOptionalUInt64.readFromCursor(c),
705
+ maxPendingBytesPerStream: FfiConverterOptionalUInt64.readFromCursor(c),
706
+ maxPendingConnectionBytes: FfiConverterOptionalUInt64.readFromCursor(c),
707
+ controlStreamReserveBytes: FfiConverterOptionalUInt64.readFromCursor(c),
708
+ maxPendingDatagrams: FfiConverterOptionalUInt64.readFromCursor(c),
709
+ idleTimeoutMs: FfiConverterOptionalUInt64.readFromCursor(c),
710
+ requireAddressValidation: FfiConverterOptionalBoolean.readFromCursor(c),
711
+ streamReceiveWindow: FfiConverterOptionalUInt64.readFromCursor(c),
712
+ connectionReceiveWindow: FfiConverterOptionalTypeWindowLimit.readFromCursor(c),
713
+ sendWindow: FfiConverterOptionalUInt64.readFromCursor(c),
714
+ webtransportHandshakeTimeoutMs: FfiConverterOptionalUInt64.readFromCursor(c)
715
+ };
716
+ }
717
+ writeIntoCursor(value: TypeName, c: Cursor): void {
718
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxConnections, c);
719
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxStreamsPerConnection, c);
720
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingBytesPerStream, c);
721
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingConnectionBytes, c);
722
+ FfiConverterOptionalUInt64.writeIntoCursor(value.controlStreamReserveBytes, c);
723
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingDatagrams, c);
724
+ FfiConverterOptionalUInt64.writeIntoCursor(value.idleTimeoutMs, c);
725
+ FfiConverterOptionalBoolean.writeIntoCursor(value.requireAddressValidation, c);
726
+ FfiConverterOptionalUInt64.writeIntoCursor(value.streamReceiveWindow, c);
727
+ FfiConverterOptionalTypeWindowLimit.writeIntoCursor(value.connectionReceiveWindow, c);
728
+ FfiConverterOptionalUInt64.writeIntoCursor(value.sendWindow, c);
729
+ FfiConverterOptionalUInt64.writeIntoCursor(value.webtransportHandshakeTimeoutMs, c);
730
+ }
731
+ allocationSize(value: TypeName): number {
732
+ return FfiConverterOptionalUInt64.allocationSize(value.maxConnections) +
733
+ FfiConverterOptionalUInt64.allocationSize(value.maxStreamsPerConnection) +
734
+ FfiConverterOptionalUInt64.allocationSize(value.maxPendingBytesPerStream) +
735
+ FfiConverterOptionalUInt64.allocationSize(value.maxPendingConnectionBytes) +
736
+ FfiConverterOptionalUInt64.allocationSize(value.controlStreamReserveBytes) +
737
+ FfiConverterOptionalUInt64.allocationSize(value.maxPendingDatagrams) +
738
+ FfiConverterOptionalUInt64.allocationSize(value.idleTimeoutMs) +
739
+ FfiConverterOptionalBoolean.allocationSize(value.requireAddressValidation) +
740
+ FfiConverterOptionalUInt64.allocationSize(value.streamReceiveWindow) +
741
+ FfiConverterOptionalTypeWindowLimit.allocationSize(value.connectionReceiveWindow) +
742
+ FfiConverterOptionalUInt64.allocationSize(value.sendWindow) +
743
+ FfiConverterOptionalUInt64.allocationSize(value.webtransportHandshakeTimeoutMs);
744
+
745
+ }
746
+ };
747
+ return new FFIConverter();
748
+ })();
749
+
750
+
751
+ // Enum: TimeoutLimit
752
+ export enum TimeoutLimit_Tags {
753
+ AfterMs = "AfterMs",
754
+ Never = "Never"
755
+ }
756
+ /**
757
+ * A timeout that may be disabled.
758
+ */
759
+ export const TimeoutLimit = (() => {
760
+
761
+ type AfterMs__interface = {
762
+ tag: TimeoutLimit_Tags.AfterMs;
763
+ inner:
764
+ Readonly<{ms: bigint}>
765
+ };
766
+ /**
767
+ * Fires after `ms` milliseconds.
768
+ */
769
+ class AfterMs_ extends UniffiEnum implements AfterMs__interface {
770
+ /**
771
+ * @private
772
+ * This field is private and should not be used, use `tag` instead.
773
+ */
774
+ readonly [uniffiTypeNameSymbol] = "TimeoutLimit";
775
+ readonly tag = TimeoutLimit_Tags.AfterMs;
776
+ readonly inner:
777
+ Readonly<{ms: bigint}>;
778
+ constructor(
779
+ inner: {ms: bigint }) {
780
+ super("TimeoutLimit", "AfterMs");
781
+
782
+ this.inner = Object.freeze(inner);
783
+ }
784
+ static new(
785
+ inner: {ms: bigint }): AfterMs_ {
786
+ return new AfterMs_(inner);
787
+ }
788
+
789
+ static instanceOf(obj: any): obj is AfterMs_ {
790
+ return obj.tag === TimeoutLimit_Tags.AfterMs;
791
+ }
792
+
793
+ }
794
+
795
+ type Never__interface = {
796
+ tag: TimeoutLimit_Tags.Never
797
+ };
798
+ /**
799
+ * Waits indefinitely.
800
+ */
801
+ class Never_ extends UniffiEnum implements Never__interface {
802
+ /**
803
+ * @private
804
+ * This field is private and should not be used, use `tag` instead.
805
+ */
806
+ readonly [uniffiTypeNameSymbol] = "TimeoutLimit";
807
+ readonly tag = TimeoutLimit_Tags.Never;
808
+ constructor() {
809
+ super("TimeoutLimit", "Never");
810
+ }
811
+
812
+ static new(): Never_ {
813
+ return new Never_();
814
+ }
815
+
816
+ static instanceOf(obj: any): obj is Never_ {
817
+ return obj.tag === TimeoutLimit_Tags.Never;
818
+ }
819
+
820
+ }
821
+
822
+ function instanceOf(obj: any): obj is TimeoutLimit {
823
+ return obj[uniffiTypeNameSymbol] === "TimeoutLimit";
824
+ }
825
+
826
+ return Object.freeze({
827
+ instanceOf,
828
+ AfterMs: AfterMs_,
829
+ Never: Never_
830
+ });
831
+
832
+ })();
833
+ /**
834
+ * A timeout that may be disabled.
835
+ */
836
+ export type TimeoutLimit = InstanceType<
837
+ typeof TimeoutLimit['AfterMs' | 'Never']
838
+ >;
839
+
840
+ // FfiConverter for enum TimeoutLimit
841
+ const FfiConverterTypeTimeoutLimit = (() => {
842
+ type TypeName = TimeoutLimit;
843
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
844
+ readFromCursor(c: Cursor): TypeName {
845
+ switch (c.readI32()) {
846
+ case 1: return new TimeoutLimit.AfterMs({ms: FfiConverterUInt64.readFromCursor(c) });
847
+ case 2: return new TimeoutLimit.Never();
848
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
849
+ }
850
+ }
851
+ writeIntoCursor(value: TypeName, c: Cursor): void {
852
+ switch (value.tag) {
853
+ case TimeoutLimit_Tags.AfterMs: {
854
+ c.writeI32(1);
855
+ const inner = value.inner;
856
+ FfiConverterUInt64.writeIntoCursor(inner.ms, c);
857
+ return;
858
+ }
859
+ case TimeoutLimit_Tags.Never: {
860
+ c.writeI32(2);
861
+ return;
862
+ }
863
+ default:
864
+ // Throwing from here means that TimeoutLimit_Tags hasn't matched an ordinal.
865
+ throw new UniffiInternalError.UnexpectedEnumCase();
866
+ }
867
+ }
868
+ allocationSize(value: TypeName): number {
869
+ switch (value.tag) {
870
+ case TimeoutLimit_Tags.AfterMs: {
871
+ const inner = value.inner;
872
+ let size = 4;
873
+ size += FfiConverterUInt64.allocationSize(inner.ms);
874
+ return size;
875
+ }
876
+ case TimeoutLimit_Tags.Never: {
877
+ return 4;
878
+ }
879
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
880
+ }
881
+ }
882
+ }
883
+ return new FFIConverter();
884
+ })();
885
+
886
+ /**
887
+ * Yamux overrides; each field mirrors `minip2p::YamuxConfig`.
888
+ */
889
+ export type YamuxOptions = {
890
+ /**
891
+ * Per-stream receive window in bytes; at least 256 KiB.
892
+ */
893
+ receiveWindow?: number,
894
+ /**
895
+ * Largest data-frame payload sent; non-zero.
896
+ */
897
+ maxFrameLen?: number,
898
+ /**
899
+ * Streams tracked at once, counting unsettled closed ones.
900
+ */
901
+ maxStreams?: bigint,
902
+ /**
903
+ * Per-stream cap on accepted, unpulled send bytes; non-zero.
904
+ */
905
+ maxBufferedSend?: bigint,
906
+ /**
907
+ * Session-wide cap on accepted, unpulled send bytes; greater than
908
+ * `control_stream_reserve`.
909
+ */
910
+ maxTotalBufferedSend?: bigint,
911
+ /**
912
+ * Part of the session-wide cap only control streams may fill.
913
+ */
914
+ controlStreamReserve?: bigint,
915
+ /**
916
+ * Control frames that may wait to be pulled.
917
+ */
918
+ maxPendingControl?: bigint
919
+ }
920
+
921
+ /**
922
+ * Generated factory for {@link YamuxOptions} record objects.
923
+ */
924
+ export const YamuxOptions = (() => {
925
+ const defaults = () => ({
926
+ receiveWindow: undefined,
927
+ maxFrameLen: undefined,
928
+ maxStreams: undefined,
929
+ maxBufferedSend: undefined,
930
+ maxTotalBufferedSend: undefined,
931
+ controlStreamReserve: undefined,
932
+ maxPendingControl: undefined
933
+ });
934
+ const create = (() => {
935
+ return uniffiCreateRecord<YamuxOptions, ReturnType<typeof defaults>>(defaults);
936
+ })();
937
+ return Object.freeze({
938
+ create,
939
+ new: create,
940
+ defaults: () => Object.freeze(defaults()) as Partial<YamuxOptions>,
941
+ });
942
+ })();
943
+
944
+ const FfiConverterTypeYamuxOptions = (() => {
945
+ type TypeName = YamuxOptions;
946
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
947
+ readFromCursor(c: Cursor): TypeName {
948
+ return {
949
+ receiveWindow: FfiConverterOptionalUInt32.readFromCursor(c),
950
+ maxFrameLen: FfiConverterOptionalUInt32.readFromCursor(c),
951
+ maxStreams: FfiConverterOptionalUInt64.readFromCursor(c),
952
+ maxBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
953
+ maxTotalBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
954
+ controlStreamReserve: FfiConverterOptionalUInt64.readFromCursor(c),
955
+ maxPendingControl: FfiConverterOptionalUInt64.readFromCursor(c)
956
+ };
957
+ }
958
+ writeIntoCursor(value: TypeName, c: Cursor): void {
959
+ FfiConverterOptionalUInt32.writeIntoCursor(value.receiveWindow, c);
960
+ FfiConverterOptionalUInt32.writeIntoCursor(value.maxFrameLen, c);
961
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxStreams, c);
962
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxBufferedSend, c);
963
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxTotalBufferedSend, c);
964
+ FfiConverterOptionalUInt64.writeIntoCursor(value.controlStreamReserve, c);
965
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingControl, c);
966
+ }
967
+ allocationSize(value: TypeName): number {
968
+ return FfiConverterOptionalUInt32.allocationSize(value.receiveWindow) +
969
+ FfiConverterOptionalUInt32.allocationSize(value.maxFrameLen) +
970
+ FfiConverterOptionalUInt64.allocationSize(value.maxStreams) +
971
+ FfiConverterOptionalUInt64.allocationSize(value.maxBufferedSend) +
972
+ FfiConverterOptionalUInt64.allocationSize(value.maxTotalBufferedSend) +
973
+ FfiConverterOptionalUInt64.allocationSize(value.controlStreamReserve) +
974
+ FfiConverterOptionalUInt64.allocationSize(value.maxPendingControl);
975
+
976
+ }
977
+ };
978
+ return new FFIConverter();
979
+ })();
980
+
981
+ /**
982
+ * TCP overrides; each field mirrors `minip2p::TcpConfig` (its connection-id
983
+ * namespace stays internal).
984
+ */
985
+ export type TcpLimitsOptions = {
986
+ /**
987
+ * Connections held at once, dialed and accepted alike.
988
+ */
989
+ maxConnections?: bigint,
990
+ /**
991
+ * How long a connection may take to authenticate.
992
+ */
993
+ handshakeTimeoutMs?: TimeoutLimit,
994
+ /**
995
+ * Encrypted bytes one connection holds for its socket.
996
+ */
997
+ maxBufferedSend?: bigint,
998
+ /**
999
+ * How long a connection may hold bytes its socket refuses.
1000
+ */
1001
+ sendStallTimeoutMs?: TimeoutLimit,
1002
+ /**
1003
+ * Each TCP connection's Yamux limits; independent of
1004
+ * [`LimitsOptions::circuit`].
1005
+ */
1006
+ yamux?: YamuxOptions
1007
+ }
1008
+
1009
+ /**
1010
+ * Generated factory for {@link TcpLimitsOptions} record objects.
1011
+ */
1012
+ export const TcpLimitsOptions = (() => {
1013
+ const defaults = () => ({
1014
+ maxConnections: undefined,
1015
+ handshakeTimeoutMs: undefined,
1016
+ maxBufferedSend: undefined,
1017
+ sendStallTimeoutMs: undefined,
1018
+ yamux: undefined
1019
+ });
1020
+ const create = (() => {
1021
+ return uniffiCreateRecord<TcpLimitsOptions, ReturnType<typeof defaults>>(defaults);
1022
+ })();
1023
+ return Object.freeze({
1024
+ create,
1025
+ new: create,
1026
+ defaults: () => Object.freeze(defaults()) as Partial<TcpLimitsOptions>,
1027
+ });
1028
+ })();
1029
+
1030
+ const FfiConverterTypeTcpLimitsOptions = (() => {
1031
+ type TypeName = TcpLimitsOptions;
1032
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1033
+ readFromCursor(c: Cursor): TypeName {
1034
+ return {
1035
+ maxConnections: FfiConverterOptionalUInt64.readFromCursor(c),
1036
+ handshakeTimeoutMs: FfiConverterOptionalTypeTimeoutLimit.readFromCursor(c),
1037
+ maxBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
1038
+ sendStallTimeoutMs: FfiConverterOptionalTypeTimeoutLimit.readFromCursor(c),
1039
+ yamux: FfiConverterOptionalTypeYamuxOptions.readFromCursor(c)
1040
+ };
1041
+ }
1042
+ writeIntoCursor(value: TypeName, c: Cursor): void {
1043
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxConnections, c);
1044
+ FfiConverterOptionalTypeTimeoutLimit.writeIntoCursor(value.handshakeTimeoutMs, c);
1045
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxBufferedSend, c);
1046
+ FfiConverterOptionalTypeTimeoutLimit.writeIntoCursor(value.sendStallTimeoutMs, c);
1047
+ FfiConverterOptionalTypeYamuxOptions.writeIntoCursor(value.yamux, c);
1048
+ }
1049
+ allocationSize(value: TypeName): number {
1050
+ return FfiConverterOptionalUInt64.allocationSize(value.maxConnections) +
1051
+ FfiConverterOptionalTypeTimeoutLimit.allocationSize(value.handshakeTimeoutMs) +
1052
+ FfiConverterOptionalUInt64.allocationSize(value.maxBufferedSend) +
1053
+ FfiConverterOptionalTypeTimeoutLimit.allocationSize(value.sendStallTimeoutMs) +
1054
+ FfiConverterOptionalTypeYamuxOptions.allocationSize(value.yamux);
1055
+
1056
+ }
1057
+ };
1058
+ return new FFIConverter();
1059
+ })();
1060
+
1061
+ /**
1062
+ * Transport limit overrides.
1063
+ *
1064
+ * Every field is optional: an absent record or field keeps the native
1065
+ * default, so an omitted record and an empty one behave identically. Limits
1066
+ * for a transport the endpoint does not bind (TCP without a `/tcp` listen
1067
+ * address, say) are ignored, not validated. An invalid limit fails
1068
+ * construction with `InvalidConfig { capability: Transport }`.
1069
+ */
1070
+ export type LimitsOptions = {
1071
+ /**
1072
+ * QUIC (and WebTransport) transport limits.
1073
+ */
1074
+ quic?: QuicLimitsOptions,
1075
+ /**
1076
+ * TCP transport limits, including its connections' Yamux limits.
1077
+ */
1078
+ tcp?: TcpLimitsOptions,
1079
+ /**
1080
+ * Relay circuits' Yamux limits; independent of [`TcpLimitsOptions::yamux`].
1081
+ */
1082
+ circuit?: YamuxOptions,
1083
+ /**
1084
+ * Most relayed circuits held at once (`NatConfig::max_circuits`): past
1085
+ * it inbound circuits are refused and relay legs fail.
1086
+ */
1087
+ maxCircuits?: bigint
1088
+ }
1089
+
1090
+ /**
1091
+ * Generated factory for {@link LimitsOptions} record objects.
1092
+ */
1093
+ export const LimitsOptions = (() => {
1094
+ const defaults = () => ({
1095
+ quic: undefined,
1096
+ tcp: undefined,
1097
+ circuit: undefined,
1098
+ maxCircuits: undefined
1099
+ });
1100
+ const create = (() => {
1101
+ return uniffiCreateRecord<LimitsOptions, ReturnType<typeof defaults>>(defaults);
1102
+ })();
1103
+ return Object.freeze({
1104
+ create,
1105
+ new: create,
1106
+ defaults: () => Object.freeze(defaults()) as Partial<LimitsOptions>,
1107
+ });
1108
+ })();
1109
+
1110
+ const FfiConverterTypeLimitsOptions = (() => {
1111
+ type TypeName = LimitsOptions;
1112
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1113
+ readFromCursor(c: Cursor): TypeName {
1114
+ return {
1115
+ quic: FfiConverterOptionalTypeQuicLimitsOptions.readFromCursor(c),
1116
+ tcp: FfiConverterOptionalTypeTcpLimitsOptions.readFromCursor(c),
1117
+ circuit: FfiConverterOptionalTypeYamuxOptions.readFromCursor(c),
1118
+ maxCircuits: FfiConverterOptionalUInt64.readFromCursor(c)
1119
+ };
1120
+ }
1121
+ writeIntoCursor(value: TypeName, c: Cursor): void {
1122
+ FfiConverterOptionalTypeQuicLimitsOptions.writeIntoCursor(value.quic, c);
1123
+ FfiConverterOptionalTypeTcpLimitsOptions.writeIntoCursor(value.tcp, c);
1124
+ FfiConverterOptionalTypeYamuxOptions.writeIntoCursor(value.circuit, c);
1125
+ FfiConverterOptionalUInt64.writeIntoCursor(value.maxCircuits, c);
1126
+ }
1127
+ allocationSize(value: TypeName): number {
1128
+ return FfiConverterOptionalTypeQuicLimitsOptions.allocationSize(value.quic) +
1129
+ FfiConverterOptionalTypeTcpLimitsOptions.allocationSize(value.tcp) +
1130
+ FfiConverterOptionalTypeYamuxOptions.allocationSize(value.circuit) +
1131
+ FfiConverterOptionalUInt64.allocationSize(value.maxCircuits);
1132
+
1133
+ }
1134
+ };
1135
+ return new FFIConverter();
1136
+ })();
1137
+
478
1138
  /**
479
1139
  * Configuration used to construct an FFI endpoint.
480
1140
  */
@@ -518,7 +1178,11 @@ export type EndpointConfig = {
518
1178
  /**
519
1179
  * Local-link mDNS settings, or no mDNS discovery when absent.
520
1180
  */
521
- mdns?: MdnsOptions
1181
+ mdns?: MdnsOptions,
1182
+ /**
1183
+ * Transport limit overrides, or every native default when absent.
1184
+ */
1185
+ limits?: LimitsOptions
522
1186
  }
523
1187
 
524
1188
  /**
@@ -550,7 +1214,8 @@ const FfiConverterTypeEndpointConfig = (() => {
550
1214
  allowUnsigned: FfiConverterBool.readFromCursor(c),
551
1215
  protocols: FfiConverterSequenceString.readFromCursor(c),
552
1216
  discovery: FfiConverterOptionalTypeDiscoveryOptions.readFromCursor(c),
553
- mdns: FfiConverterOptionalTypeMdnsOptions.readFromCursor(c)
1217
+ mdns: FfiConverterOptionalTypeMdnsOptions.readFromCursor(c),
1218
+ limits: FfiConverterOptionalTypeLimitsOptions.readFromCursor(c)
554
1219
  };
555
1220
  }
556
1221
  writeIntoCursor(value: TypeName, c: Cursor): void {
@@ -563,6 +1228,7 @@ const FfiConverterTypeEndpointConfig = (() => {
563
1228
  FfiConverterSequenceString.writeIntoCursor(value.protocols, c);
564
1229
  FfiConverterOptionalTypeDiscoveryOptions.writeIntoCursor(value.discovery, c);
565
1230
  FfiConverterOptionalTypeMdnsOptions.writeIntoCursor(value.mdns, c);
1231
+ FfiConverterOptionalTypeLimitsOptions.writeIntoCursor(value.limits, c);
566
1232
  }
567
1233
  allocationSize(value: TypeName): number {
568
1234
  return FfiConverterOptionalString.allocationSize(value.agentVersion) +
@@ -573,7 +1239,8 @@ const FfiConverterTypeEndpointConfig = (() => {
573
1239
  FfiConverterBool.allocationSize(value.allowUnsigned) +
574
1240
  FfiConverterSequenceString.allocationSize(value.protocols) +
575
1241
  FfiConverterOptionalTypeDiscoveryOptions.allocationSize(value.discovery) +
576
- FfiConverterOptionalTypeMdnsOptions.allocationSize(value.mdns);
1242
+ FfiConverterOptionalTypeMdnsOptions.allocationSize(value.mdns) +
1243
+ FfiConverterOptionalTypeLimitsOptions.allocationSize(value.limits);
577
1244
 
578
1245
  }
579
1246
  };
@@ -4708,12 +5375,36 @@ const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiCon
4708
5375
  // FfiConverter for MdnsOptions | undefined
4709
5376
  const FfiConverterOptionalTypeMdnsOptions = new FfiConverterOptional(FfiConverterTypeMdnsOptions);
4710
5377
 
4711
- // FfiConverter for ArrayBuffer | undefined
4712
- const FfiConverterOptionalBytes = new FfiConverterOptional(FfiConverterArrayBuffer);
4713
-
4714
5378
  // FfiConverter for bigint | undefined
4715
5379
  const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
4716
5380
 
5381
+ // FfiConverter for boolean | undefined
5382
+ const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
5383
+
5384
+ // FfiConverter for WindowLimit | undefined
5385
+ const FfiConverterOptionalTypeWindowLimit = new FfiConverterOptional(FfiConverterTypeWindowLimit);
5386
+
5387
+ // FfiConverter for QuicLimitsOptions | undefined
5388
+ const FfiConverterOptionalTypeQuicLimitsOptions = new FfiConverterOptional(FfiConverterTypeQuicLimitsOptions);
5389
+
5390
+ // FfiConverter for TimeoutLimit | undefined
5391
+ const FfiConverterOptionalTypeTimeoutLimit = new FfiConverterOptional(FfiConverterTypeTimeoutLimit);
5392
+
5393
+ // FfiConverter for number | undefined
5394
+ const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
5395
+
5396
+ // FfiConverter for YamuxOptions | undefined
5397
+ const FfiConverterOptionalTypeYamuxOptions = new FfiConverterOptional(FfiConverterTypeYamuxOptions);
5398
+
5399
+ // FfiConverter for TcpLimitsOptions | undefined
5400
+ const FfiConverterOptionalTypeTcpLimitsOptions = new FfiConverterOptional(FfiConverterTypeTcpLimitsOptions);
5401
+
5402
+ // FfiConverter for LimitsOptions | undefined
5403
+ const FfiConverterOptionalTypeLimitsOptions = new FfiConverterOptional(FfiConverterTypeLimitsOptions);
5404
+
5405
+ // FfiConverter for ArrayBuffer | undefined
5406
+ const FfiConverterOptionalBytes = new FfiConverterOptional(FfiConverterArrayBuffer);
5407
+
4717
5408
  // FfiConverter for Array<bigint>
4718
5409
  const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
4719
5410
 
@@ -4758,14 +5449,20 @@ export default Object.freeze({
4758
5449
  FfiConverterTypeFfiError,
4759
5450
  FfiConverterTypeIdentifyInfo,
4760
5451
  FfiConverterTypeKnownPeerInfo,
5452
+ FfiConverterTypeLimitsOptions,
4761
5453
  FfiConverterTypeMdnsFailureKind,
4762
5454
  FfiConverterTypeMdnsOptions,
4763
5455
  FfiConverterTypeNatErrorKind,
4764
5456
  FfiConverterTypeOpenStreamResult,
4765
5457
  FfiConverterTypeP2pEvent,
4766
5458
  FfiConverterTypePathKind,
5459
+ FfiConverterTypeQuicLimitsOptions,
4767
5460
  FfiConverterTypeReachability,
4768
5461
  FfiConverterTypeRelayReservationInfo,
5462
+ FfiConverterTypeTcpLimitsOptions,
5463
+ FfiConverterTypeTimeoutLimit,
4769
5464
  FfiConverterTypeUnfinishedConnection,
5465
+ FfiConverterTypeWindowLimit,
5466
+ FfiConverterTypeYamuxOptions,
4770
5467
  }
4771
5468
  });