@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.
- 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/lib/module/adapter.js +44 -2
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi_core.js +507 -6
- 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_core.d.ts +382 -2
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +55 -1
- package/src/generated/minip2p_ffi_core.ts +703 -6
|
@@ -343,6 +343,475 @@ const FfiConverterTypeMdnsOptions = (() => {
|
|
|
343
343
|
return new FFIConverter();
|
|
344
344
|
})();
|
|
345
345
|
|
|
346
|
+
// Enum: WindowLimit
|
|
347
|
+
export let WindowLimit_Tags = /*#__PURE__*/function (WindowLimit_Tags) {
|
|
348
|
+
WindowLimit_Tags["Bounded"] = "Bounded";
|
|
349
|
+
WindowLimit_Tags["Unlimited"] = "Unlimited";
|
|
350
|
+
return WindowLimit_Tags;
|
|
351
|
+
}({});
|
|
352
|
+
/**
|
|
353
|
+
* A receive window that may be unbounded.
|
|
354
|
+
*/
|
|
355
|
+
export const WindowLimit = (() => {
|
|
356
|
+
/**
|
|
357
|
+
* At most `bytes`.
|
|
358
|
+
*/
|
|
359
|
+
class Bounded_ extends UniffiEnum {
|
|
360
|
+
/**
|
|
361
|
+
* @private
|
|
362
|
+
* This field is private and should not be used, use `tag` instead.
|
|
363
|
+
*/
|
|
364
|
+
[uniffiTypeNameSymbol] = "WindowLimit";
|
|
365
|
+
tag = WindowLimit_Tags.Bounded;
|
|
366
|
+
constructor(inner) {
|
|
367
|
+
super("WindowLimit", "Bounded");
|
|
368
|
+
this.inner = Object.freeze(inner);
|
|
369
|
+
}
|
|
370
|
+
static new(inner) {
|
|
371
|
+
return new Bounded_(inner);
|
|
372
|
+
}
|
|
373
|
+
static instanceOf(obj) {
|
|
374
|
+
return obj.tag === WindowLimit_Tags.Bounded;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* No window.
|
|
379
|
+
*/
|
|
380
|
+
class Unlimited_ extends UniffiEnum {
|
|
381
|
+
/**
|
|
382
|
+
* @private
|
|
383
|
+
* This field is private and should not be used, use `tag` instead.
|
|
384
|
+
*/
|
|
385
|
+
[uniffiTypeNameSymbol] = "WindowLimit";
|
|
386
|
+
tag = WindowLimit_Tags.Unlimited;
|
|
387
|
+
constructor() {
|
|
388
|
+
super("WindowLimit", "Unlimited");
|
|
389
|
+
}
|
|
390
|
+
static new() {
|
|
391
|
+
return new Unlimited_();
|
|
392
|
+
}
|
|
393
|
+
static instanceOf(obj) {
|
|
394
|
+
return obj.tag === WindowLimit_Tags.Unlimited;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function instanceOf(obj) {
|
|
398
|
+
return obj[uniffiTypeNameSymbol] === "WindowLimit";
|
|
399
|
+
}
|
|
400
|
+
return Object.freeze({
|
|
401
|
+
instanceOf,
|
|
402
|
+
Bounded: Bounded_,
|
|
403
|
+
Unlimited: Unlimited_
|
|
404
|
+
});
|
|
405
|
+
})();
|
|
406
|
+
/**
|
|
407
|
+
* A receive window that may be unbounded.
|
|
408
|
+
*/
|
|
409
|
+
|
|
410
|
+
// FfiConverter for enum WindowLimit
|
|
411
|
+
const FfiConverterTypeWindowLimit = (() => {
|
|
412
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
413
|
+
readFromCursor(c) {
|
|
414
|
+
switch (c.readI32()) {
|
|
415
|
+
case 1:
|
|
416
|
+
return new WindowLimit.Bounded({
|
|
417
|
+
bytes: FfiConverterUInt64.readFromCursor(c)
|
|
418
|
+
});
|
|
419
|
+
case 2:
|
|
420
|
+
return new WindowLimit.Unlimited();
|
|
421
|
+
default:
|
|
422
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
writeIntoCursor(value, c) {
|
|
426
|
+
switch (value.tag) {
|
|
427
|
+
case WindowLimit_Tags.Bounded:
|
|
428
|
+
{
|
|
429
|
+
c.writeI32(1);
|
|
430
|
+
const inner = value.inner;
|
|
431
|
+
FfiConverterUInt64.writeIntoCursor(inner.bytes, c);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
case WindowLimit_Tags.Unlimited:
|
|
435
|
+
{
|
|
436
|
+
c.writeI32(2);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
default:
|
|
440
|
+
// Throwing from here means that WindowLimit_Tags hasn't matched an ordinal.
|
|
441
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
allocationSize(value) {
|
|
445
|
+
switch (value.tag) {
|
|
446
|
+
case WindowLimit_Tags.Bounded:
|
|
447
|
+
{
|
|
448
|
+
const inner = value.inner;
|
|
449
|
+
let size = 4;
|
|
450
|
+
size += FfiConverterUInt64.allocationSize(inner.bytes);
|
|
451
|
+
return size;
|
|
452
|
+
}
|
|
453
|
+
case WindowLimit_Tags.Unlimited:
|
|
454
|
+
{
|
|
455
|
+
return 4;
|
|
456
|
+
}
|
|
457
|
+
default:
|
|
458
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return new FFIConverter();
|
|
463
|
+
})();
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* QUIC overrides; each field mirrors `minip2p::QuicLimits`.
|
|
467
|
+
*/
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Generated factory for {@link QuicLimitsOptions} record objects.
|
|
471
|
+
*/
|
|
472
|
+
export const QuicLimitsOptions = (() => {
|
|
473
|
+
const defaults = () => ({
|
|
474
|
+
maxConnections: undefined,
|
|
475
|
+
maxStreamsPerConnection: undefined,
|
|
476
|
+
maxPendingBytesPerStream: undefined,
|
|
477
|
+
maxPendingConnectionBytes: undefined,
|
|
478
|
+
controlStreamReserveBytes: undefined,
|
|
479
|
+
maxPendingDatagrams: undefined,
|
|
480
|
+
idleTimeoutMs: undefined,
|
|
481
|
+
requireAddressValidation: undefined,
|
|
482
|
+
streamReceiveWindow: undefined,
|
|
483
|
+
connectionReceiveWindow: undefined,
|
|
484
|
+
sendWindow: undefined,
|
|
485
|
+
webtransportHandshakeTimeoutMs: undefined
|
|
486
|
+
});
|
|
487
|
+
const create = (() => {
|
|
488
|
+
return uniffiCreateRecord(defaults);
|
|
489
|
+
})();
|
|
490
|
+
return Object.freeze({
|
|
491
|
+
create,
|
|
492
|
+
new: create,
|
|
493
|
+
defaults: () => Object.freeze(defaults())
|
|
494
|
+
});
|
|
495
|
+
})();
|
|
496
|
+
const FfiConverterTypeQuicLimitsOptions = (() => {
|
|
497
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
498
|
+
readFromCursor(c) {
|
|
499
|
+
return {
|
|
500
|
+
maxConnections: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
501
|
+
maxStreamsPerConnection: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
502
|
+
maxPendingBytesPerStream: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
503
|
+
maxPendingConnectionBytes: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
504
|
+
controlStreamReserveBytes: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
505
|
+
maxPendingDatagrams: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
506
|
+
idleTimeoutMs: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
507
|
+
requireAddressValidation: FfiConverterOptionalBoolean.readFromCursor(c),
|
|
508
|
+
streamReceiveWindow: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
509
|
+
connectionReceiveWindow: FfiConverterOptionalTypeWindowLimit.readFromCursor(c),
|
|
510
|
+
sendWindow: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
511
|
+
webtransportHandshakeTimeoutMs: FfiConverterOptionalUInt64.readFromCursor(c)
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
writeIntoCursor(value, c) {
|
|
515
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxConnections, c);
|
|
516
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxStreamsPerConnection, c);
|
|
517
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingBytesPerStream, c);
|
|
518
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingConnectionBytes, c);
|
|
519
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.controlStreamReserveBytes, c);
|
|
520
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingDatagrams, c);
|
|
521
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.idleTimeoutMs, c);
|
|
522
|
+
FfiConverterOptionalBoolean.writeIntoCursor(value.requireAddressValidation, c);
|
|
523
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.streamReceiveWindow, c);
|
|
524
|
+
FfiConverterOptionalTypeWindowLimit.writeIntoCursor(value.connectionReceiveWindow, c);
|
|
525
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.sendWindow, c);
|
|
526
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.webtransportHandshakeTimeoutMs, c);
|
|
527
|
+
}
|
|
528
|
+
allocationSize(value) {
|
|
529
|
+
return FfiConverterOptionalUInt64.allocationSize(value.maxConnections) + FfiConverterOptionalUInt64.allocationSize(value.maxStreamsPerConnection) + FfiConverterOptionalUInt64.allocationSize(value.maxPendingBytesPerStream) + FfiConverterOptionalUInt64.allocationSize(value.maxPendingConnectionBytes) + FfiConverterOptionalUInt64.allocationSize(value.controlStreamReserveBytes) + FfiConverterOptionalUInt64.allocationSize(value.maxPendingDatagrams) + FfiConverterOptionalUInt64.allocationSize(value.idleTimeoutMs) + FfiConverterOptionalBoolean.allocationSize(value.requireAddressValidation) + FfiConverterOptionalUInt64.allocationSize(value.streamReceiveWindow) + FfiConverterOptionalTypeWindowLimit.allocationSize(value.connectionReceiveWindow) + FfiConverterOptionalUInt64.allocationSize(value.sendWindow) + FfiConverterOptionalUInt64.allocationSize(value.webtransportHandshakeTimeoutMs);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
;
|
|
533
|
+
return new FFIConverter();
|
|
534
|
+
})();
|
|
535
|
+
|
|
536
|
+
// Enum: TimeoutLimit
|
|
537
|
+
export let TimeoutLimit_Tags = /*#__PURE__*/function (TimeoutLimit_Tags) {
|
|
538
|
+
TimeoutLimit_Tags["AfterMs"] = "AfterMs";
|
|
539
|
+
TimeoutLimit_Tags["Never"] = "Never";
|
|
540
|
+
return TimeoutLimit_Tags;
|
|
541
|
+
}({});
|
|
542
|
+
/**
|
|
543
|
+
* A timeout that may be disabled.
|
|
544
|
+
*/
|
|
545
|
+
export const TimeoutLimit = (() => {
|
|
546
|
+
/**
|
|
547
|
+
* Fires after `ms` milliseconds.
|
|
548
|
+
*/
|
|
549
|
+
class AfterMs_ extends UniffiEnum {
|
|
550
|
+
/**
|
|
551
|
+
* @private
|
|
552
|
+
* This field is private and should not be used, use `tag` instead.
|
|
553
|
+
*/
|
|
554
|
+
[uniffiTypeNameSymbol] = "TimeoutLimit";
|
|
555
|
+
tag = TimeoutLimit_Tags.AfterMs;
|
|
556
|
+
constructor(inner) {
|
|
557
|
+
super("TimeoutLimit", "AfterMs");
|
|
558
|
+
this.inner = Object.freeze(inner);
|
|
559
|
+
}
|
|
560
|
+
static new(inner) {
|
|
561
|
+
return new AfterMs_(inner);
|
|
562
|
+
}
|
|
563
|
+
static instanceOf(obj) {
|
|
564
|
+
return obj.tag === TimeoutLimit_Tags.AfterMs;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Waits indefinitely.
|
|
569
|
+
*/
|
|
570
|
+
class Never_ extends UniffiEnum {
|
|
571
|
+
/**
|
|
572
|
+
* @private
|
|
573
|
+
* This field is private and should not be used, use `tag` instead.
|
|
574
|
+
*/
|
|
575
|
+
[uniffiTypeNameSymbol] = "TimeoutLimit";
|
|
576
|
+
tag = TimeoutLimit_Tags.Never;
|
|
577
|
+
constructor() {
|
|
578
|
+
super("TimeoutLimit", "Never");
|
|
579
|
+
}
|
|
580
|
+
static new() {
|
|
581
|
+
return new Never_();
|
|
582
|
+
}
|
|
583
|
+
static instanceOf(obj) {
|
|
584
|
+
return obj.tag === TimeoutLimit_Tags.Never;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function instanceOf(obj) {
|
|
588
|
+
return obj[uniffiTypeNameSymbol] === "TimeoutLimit";
|
|
589
|
+
}
|
|
590
|
+
return Object.freeze({
|
|
591
|
+
instanceOf,
|
|
592
|
+
AfterMs: AfterMs_,
|
|
593
|
+
Never: Never_
|
|
594
|
+
});
|
|
595
|
+
})();
|
|
596
|
+
/**
|
|
597
|
+
* A timeout that may be disabled.
|
|
598
|
+
*/
|
|
599
|
+
|
|
600
|
+
// FfiConverter for enum TimeoutLimit
|
|
601
|
+
const FfiConverterTypeTimeoutLimit = (() => {
|
|
602
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
603
|
+
readFromCursor(c) {
|
|
604
|
+
switch (c.readI32()) {
|
|
605
|
+
case 1:
|
|
606
|
+
return new TimeoutLimit.AfterMs({
|
|
607
|
+
ms: FfiConverterUInt64.readFromCursor(c)
|
|
608
|
+
});
|
|
609
|
+
case 2:
|
|
610
|
+
return new TimeoutLimit.Never();
|
|
611
|
+
default:
|
|
612
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
writeIntoCursor(value, c) {
|
|
616
|
+
switch (value.tag) {
|
|
617
|
+
case TimeoutLimit_Tags.AfterMs:
|
|
618
|
+
{
|
|
619
|
+
c.writeI32(1);
|
|
620
|
+
const inner = value.inner;
|
|
621
|
+
FfiConverterUInt64.writeIntoCursor(inner.ms, c);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
case TimeoutLimit_Tags.Never:
|
|
625
|
+
{
|
|
626
|
+
c.writeI32(2);
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
default:
|
|
630
|
+
// Throwing from here means that TimeoutLimit_Tags hasn't matched an ordinal.
|
|
631
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
allocationSize(value) {
|
|
635
|
+
switch (value.tag) {
|
|
636
|
+
case TimeoutLimit_Tags.AfterMs:
|
|
637
|
+
{
|
|
638
|
+
const inner = value.inner;
|
|
639
|
+
let size = 4;
|
|
640
|
+
size += FfiConverterUInt64.allocationSize(inner.ms);
|
|
641
|
+
return size;
|
|
642
|
+
}
|
|
643
|
+
case TimeoutLimit_Tags.Never:
|
|
644
|
+
{
|
|
645
|
+
return 4;
|
|
646
|
+
}
|
|
647
|
+
default:
|
|
648
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return new FFIConverter();
|
|
653
|
+
})();
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Yamux overrides; each field mirrors `minip2p::YamuxConfig`.
|
|
657
|
+
*/
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Generated factory for {@link YamuxOptions} record objects.
|
|
661
|
+
*/
|
|
662
|
+
export const YamuxOptions = (() => {
|
|
663
|
+
const defaults = () => ({
|
|
664
|
+
receiveWindow: undefined,
|
|
665
|
+
maxFrameLen: undefined,
|
|
666
|
+
maxStreams: undefined,
|
|
667
|
+
maxBufferedSend: undefined,
|
|
668
|
+
maxTotalBufferedSend: undefined,
|
|
669
|
+
controlStreamReserve: undefined,
|
|
670
|
+
maxPendingControl: undefined
|
|
671
|
+
});
|
|
672
|
+
const create = (() => {
|
|
673
|
+
return uniffiCreateRecord(defaults);
|
|
674
|
+
})();
|
|
675
|
+
return Object.freeze({
|
|
676
|
+
create,
|
|
677
|
+
new: create,
|
|
678
|
+
defaults: () => Object.freeze(defaults())
|
|
679
|
+
});
|
|
680
|
+
})();
|
|
681
|
+
const FfiConverterTypeYamuxOptions = (() => {
|
|
682
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
683
|
+
readFromCursor(c) {
|
|
684
|
+
return {
|
|
685
|
+
receiveWindow: FfiConverterOptionalUInt32.readFromCursor(c),
|
|
686
|
+
maxFrameLen: FfiConverterOptionalUInt32.readFromCursor(c),
|
|
687
|
+
maxStreams: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
688
|
+
maxBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
689
|
+
maxTotalBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
690
|
+
controlStreamReserve: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
691
|
+
maxPendingControl: FfiConverterOptionalUInt64.readFromCursor(c)
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
writeIntoCursor(value, c) {
|
|
695
|
+
FfiConverterOptionalUInt32.writeIntoCursor(value.receiveWindow, c);
|
|
696
|
+
FfiConverterOptionalUInt32.writeIntoCursor(value.maxFrameLen, c);
|
|
697
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxStreams, c);
|
|
698
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxBufferedSend, c);
|
|
699
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxTotalBufferedSend, c);
|
|
700
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.controlStreamReserve, c);
|
|
701
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxPendingControl, c);
|
|
702
|
+
}
|
|
703
|
+
allocationSize(value) {
|
|
704
|
+
return FfiConverterOptionalUInt32.allocationSize(value.receiveWindow) + FfiConverterOptionalUInt32.allocationSize(value.maxFrameLen) + FfiConverterOptionalUInt64.allocationSize(value.maxStreams) + FfiConverterOptionalUInt64.allocationSize(value.maxBufferedSend) + FfiConverterOptionalUInt64.allocationSize(value.maxTotalBufferedSend) + FfiConverterOptionalUInt64.allocationSize(value.controlStreamReserve) + FfiConverterOptionalUInt64.allocationSize(value.maxPendingControl);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
;
|
|
708
|
+
return new FFIConverter();
|
|
709
|
+
})();
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* TCP overrides; each field mirrors `minip2p::TcpConfig` (its connection-id
|
|
713
|
+
* namespace stays internal).
|
|
714
|
+
*/
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Generated factory for {@link TcpLimitsOptions} record objects.
|
|
718
|
+
*/
|
|
719
|
+
export const TcpLimitsOptions = (() => {
|
|
720
|
+
const defaults = () => ({
|
|
721
|
+
maxConnections: undefined,
|
|
722
|
+
handshakeTimeoutMs: undefined,
|
|
723
|
+
maxBufferedSend: undefined,
|
|
724
|
+
sendStallTimeoutMs: undefined,
|
|
725
|
+
yamux: undefined
|
|
726
|
+
});
|
|
727
|
+
const create = (() => {
|
|
728
|
+
return uniffiCreateRecord(defaults);
|
|
729
|
+
})();
|
|
730
|
+
return Object.freeze({
|
|
731
|
+
create,
|
|
732
|
+
new: create,
|
|
733
|
+
defaults: () => Object.freeze(defaults())
|
|
734
|
+
});
|
|
735
|
+
})();
|
|
736
|
+
const FfiConverterTypeTcpLimitsOptions = (() => {
|
|
737
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
738
|
+
readFromCursor(c) {
|
|
739
|
+
return {
|
|
740
|
+
maxConnections: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
741
|
+
handshakeTimeoutMs: FfiConverterOptionalTypeTimeoutLimit.readFromCursor(c),
|
|
742
|
+
maxBufferedSend: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
743
|
+
sendStallTimeoutMs: FfiConverterOptionalTypeTimeoutLimit.readFromCursor(c),
|
|
744
|
+
yamux: FfiConverterOptionalTypeYamuxOptions.readFromCursor(c)
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
writeIntoCursor(value, c) {
|
|
748
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxConnections, c);
|
|
749
|
+
FfiConverterOptionalTypeTimeoutLimit.writeIntoCursor(value.handshakeTimeoutMs, c);
|
|
750
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxBufferedSend, c);
|
|
751
|
+
FfiConverterOptionalTypeTimeoutLimit.writeIntoCursor(value.sendStallTimeoutMs, c);
|
|
752
|
+
FfiConverterOptionalTypeYamuxOptions.writeIntoCursor(value.yamux, c);
|
|
753
|
+
}
|
|
754
|
+
allocationSize(value) {
|
|
755
|
+
return FfiConverterOptionalUInt64.allocationSize(value.maxConnections) + FfiConverterOptionalTypeTimeoutLimit.allocationSize(value.handshakeTimeoutMs) + FfiConverterOptionalUInt64.allocationSize(value.maxBufferedSend) + FfiConverterOptionalTypeTimeoutLimit.allocationSize(value.sendStallTimeoutMs) + FfiConverterOptionalTypeYamuxOptions.allocationSize(value.yamux);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
;
|
|
759
|
+
return new FFIConverter();
|
|
760
|
+
})();
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Transport limit overrides.
|
|
764
|
+
*
|
|
765
|
+
* Every field is optional: an absent record or field keeps the native
|
|
766
|
+
* default, so an omitted record and an empty one behave identically. Limits
|
|
767
|
+
* for a transport the endpoint does not bind (TCP without a `/tcp` listen
|
|
768
|
+
* address, say) are ignored, not validated. An invalid limit fails
|
|
769
|
+
* construction with `InvalidConfig { capability: Transport }`.
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Generated factory for {@link LimitsOptions} record objects.
|
|
774
|
+
*/
|
|
775
|
+
export const LimitsOptions = (() => {
|
|
776
|
+
const defaults = () => ({
|
|
777
|
+
quic: undefined,
|
|
778
|
+
tcp: undefined,
|
|
779
|
+
circuit: undefined,
|
|
780
|
+
maxCircuits: undefined
|
|
781
|
+
});
|
|
782
|
+
const create = (() => {
|
|
783
|
+
return uniffiCreateRecord(defaults);
|
|
784
|
+
})();
|
|
785
|
+
return Object.freeze({
|
|
786
|
+
create,
|
|
787
|
+
new: create,
|
|
788
|
+
defaults: () => Object.freeze(defaults())
|
|
789
|
+
});
|
|
790
|
+
})();
|
|
791
|
+
const FfiConverterTypeLimitsOptions = (() => {
|
|
792
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
793
|
+
readFromCursor(c) {
|
|
794
|
+
return {
|
|
795
|
+
quic: FfiConverterOptionalTypeQuicLimitsOptions.readFromCursor(c),
|
|
796
|
+
tcp: FfiConverterOptionalTypeTcpLimitsOptions.readFromCursor(c),
|
|
797
|
+
circuit: FfiConverterOptionalTypeYamuxOptions.readFromCursor(c),
|
|
798
|
+
maxCircuits: FfiConverterOptionalUInt64.readFromCursor(c)
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
writeIntoCursor(value, c) {
|
|
802
|
+
FfiConverterOptionalTypeQuicLimitsOptions.writeIntoCursor(value.quic, c);
|
|
803
|
+
FfiConverterOptionalTypeTcpLimitsOptions.writeIntoCursor(value.tcp, c);
|
|
804
|
+
FfiConverterOptionalTypeYamuxOptions.writeIntoCursor(value.circuit, c);
|
|
805
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.maxCircuits, c);
|
|
806
|
+
}
|
|
807
|
+
allocationSize(value) {
|
|
808
|
+
return FfiConverterOptionalTypeQuicLimitsOptions.allocationSize(value.quic) + FfiConverterOptionalTypeTcpLimitsOptions.allocationSize(value.tcp) + FfiConverterOptionalTypeYamuxOptions.allocationSize(value.circuit) + FfiConverterOptionalUInt64.allocationSize(value.maxCircuits);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
;
|
|
812
|
+
return new FFIConverter();
|
|
813
|
+
})();
|
|
814
|
+
|
|
346
815
|
/**
|
|
347
816
|
* Configuration used to construct an FFI endpoint.
|
|
348
817
|
*/
|
|
@@ -373,7 +842,8 @@ const FfiConverterTypeEndpointConfig = (() => {
|
|
|
373
842
|
allowUnsigned: FfiConverterBool.readFromCursor(c),
|
|
374
843
|
protocols: FfiConverterSequenceString.readFromCursor(c),
|
|
375
844
|
discovery: FfiConverterOptionalTypeDiscoveryOptions.readFromCursor(c),
|
|
376
|
-
mdns: FfiConverterOptionalTypeMdnsOptions.readFromCursor(c)
|
|
845
|
+
mdns: FfiConverterOptionalTypeMdnsOptions.readFromCursor(c),
|
|
846
|
+
limits: FfiConverterOptionalTypeLimitsOptions.readFromCursor(c)
|
|
377
847
|
};
|
|
378
848
|
}
|
|
379
849
|
writeIntoCursor(value, c) {
|
|
@@ -386,9 +856,10 @@ const FfiConverterTypeEndpointConfig = (() => {
|
|
|
386
856
|
FfiConverterSequenceString.writeIntoCursor(value.protocols, c);
|
|
387
857
|
FfiConverterOptionalTypeDiscoveryOptions.writeIntoCursor(value.discovery, c);
|
|
388
858
|
FfiConverterOptionalTypeMdnsOptions.writeIntoCursor(value.mdns, c);
|
|
859
|
+
FfiConverterOptionalTypeLimitsOptions.writeIntoCursor(value.limits, c);
|
|
389
860
|
}
|
|
390
861
|
allocationSize(value) {
|
|
391
|
-
return FfiConverterOptionalString.allocationSize(value.agentVersion) + FfiConverterSequenceString.allocationSize(value.relays) + FfiConverterSequenceString.allocationSize(value.autonatServers) + FfiConverterOptionalSequenceString.allocationSize(value.listen) + FfiConverterBool.allocationSize(value.forceRelay) + FfiConverterBool.allocationSize(value.allowUnsigned) + FfiConverterSequenceString.allocationSize(value.protocols) + FfiConverterOptionalTypeDiscoveryOptions.allocationSize(value.discovery) + FfiConverterOptionalTypeMdnsOptions.allocationSize(value.mdns);
|
|
862
|
+
return FfiConverterOptionalString.allocationSize(value.agentVersion) + FfiConverterSequenceString.allocationSize(value.relays) + FfiConverterSequenceString.allocationSize(value.autonatServers) + FfiConverterOptionalSequenceString.allocationSize(value.listen) + FfiConverterBool.allocationSize(value.forceRelay) + FfiConverterBool.allocationSize(value.allowUnsigned) + FfiConverterSequenceString.allocationSize(value.protocols) + FfiConverterOptionalTypeDiscoveryOptions.allocationSize(value.discovery) + FfiConverterOptionalTypeMdnsOptions.allocationSize(value.mdns) + FfiConverterOptionalTypeLimitsOptions.allocationSize(value.limits);
|
|
392
863
|
}
|
|
393
864
|
}
|
|
394
865
|
;
|
|
@@ -4062,12 +4533,36 @@ const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiCon
|
|
|
4062
4533
|
// FfiConverter for MdnsOptions | undefined
|
|
4063
4534
|
const FfiConverterOptionalTypeMdnsOptions = new FfiConverterOptional(FfiConverterTypeMdnsOptions);
|
|
4064
4535
|
|
|
4065
|
-
// FfiConverter for ArrayBuffer | undefined
|
|
4066
|
-
const FfiConverterOptionalBytes = new FfiConverterOptional(FfiConverterArrayBuffer);
|
|
4067
|
-
|
|
4068
4536
|
// FfiConverter for bigint | undefined
|
|
4069
4537
|
const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
4070
4538
|
|
|
4539
|
+
// FfiConverter for boolean | undefined
|
|
4540
|
+
const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
|
|
4541
|
+
|
|
4542
|
+
// FfiConverter for WindowLimit | undefined
|
|
4543
|
+
const FfiConverterOptionalTypeWindowLimit = new FfiConverterOptional(FfiConverterTypeWindowLimit);
|
|
4544
|
+
|
|
4545
|
+
// FfiConverter for QuicLimitsOptions | undefined
|
|
4546
|
+
const FfiConverterOptionalTypeQuicLimitsOptions = new FfiConverterOptional(FfiConverterTypeQuicLimitsOptions);
|
|
4547
|
+
|
|
4548
|
+
// FfiConverter for TimeoutLimit | undefined
|
|
4549
|
+
const FfiConverterOptionalTypeTimeoutLimit = new FfiConverterOptional(FfiConverterTypeTimeoutLimit);
|
|
4550
|
+
|
|
4551
|
+
// FfiConverter for number | undefined
|
|
4552
|
+
const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
|
|
4553
|
+
|
|
4554
|
+
// FfiConverter for YamuxOptions | undefined
|
|
4555
|
+
const FfiConverterOptionalTypeYamuxOptions = new FfiConverterOptional(FfiConverterTypeYamuxOptions);
|
|
4556
|
+
|
|
4557
|
+
// FfiConverter for TcpLimitsOptions | undefined
|
|
4558
|
+
const FfiConverterOptionalTypeTcpLimitsOptions = new FfiConverterOptional(FfiConverterTypeTcpLimitsOptions);
|
|
4559
|
+
|
|
4560
|
+
// FfiConverter for LimitsOptions | undefined
|
|
4561
|
+
const FfiConverterOptionalTypeLimitsOptions = new FfiConverterOptional(FfiConverterTypeLimitsOptions);
|
|
4562
|
+
|
|
4563
|
+
// FfiConverter for ArrayBuffer | undefined
|
|
4564
|
+
const FfiConverterOptionalBytes = new FfiConverterOptional(FfiConverterArrayBuffer);
|
|
4565
|
+
|
|
4071
4566
|
// FfiConverter for Array<bigint>
|
|
4072
4567
|
const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
|
|
4073
4568
|
|
|
@@ -4109,15 +4604,21 @@ export default Object.freeze({
|
|
|
4109
4604
|
FfiConverterTypeFfiError,
|
|
4110
4605
|
FfiConverterTypeIdentifyInfo,
|
|
4111
4606
|
FfiConverterTypeKnownPeerInfo,
|
|
4607
|
+
FfiConverterTypeLimitsOptions,
|
|
4112
4608
|
FfiConverterTypeMdnsFailureKind,
|
|
4113
4609
|
FfiConverterTypeMdnsOptions,
|
|
4114
4610
|
FfiConverterTypeNatErrorKind,
|
|
4115
4611
|
FfiConverterTypeOpenStreamResult,
|
|
4116
4612
|
FfiConverterTypeP2pEvent,
|
|
4117
4613
|
FfiConverterTypePathKind,
|
|
4614
|
+
FfiConverterTypeQuicLimitsOptions,
|
|
4118
4615
|
FfiConverterTypeReachability,
|
|
4119
4616
|
FfiConverterTypeRelayReservationInfo,
|
|
4120
|
-
|
|
4617
|
+
FfiConverterTypeTcpLimitsOptions,
|
|
4618
|
+
FfiConverterTypeTimeoutLimit,
|
|
4619
|
+
FfiConverterTypeUnfinishedConnection,
|
|
4620
|
+
FfiConverterTypeWindowLimit,
|
|
4621
|
+
FfiConverterTypeYamuxOptions
|
|
4121
4622
|
}
|
|
4122
4623
|
});
|
|
4123
4624
|
//# sourceMappingURL=minip2p_ffi_core.js.map
|