bun-types 1.1.34 → 1.1.35-canary.20241108T140553

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.
Files changed (3) hide show
  1. package/bun.d.ts +26 -0
  2. package/globals.d.ts +9 -1
  3. package/package.json +1 -1
package/bun.d.ts CHANGED
@@ -4548,6 +4548,30 @@ declare module "bun" {
4548
4548
  */
4549
4549
  setMaxSendFragment(size: number): boolean;
4550
4550
 
4551
+ /**
4552
+ * Enable/disable the use of Nagle's algorithm.
4553
+ * Only available for already connected sockets, will return false otherwise
4554
+ * @param noDelay Default: `true`
4555
+ * @returns true if is able to setNoDelay and false if it fails.
4556
+ */
4557
+ setNoDelay(noDelay?: boolean): boolean;
4558
+
4559
+ /**
4560
+ * Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket.
4561
+ * Set `initialDelay` (in milliseconds) to set the delay between the last data packet received and the first keepalive probe.
4562
+ * Only available for already connected sockets, will return false otherwise.
4563
+ *
4564
+ * Enabling the keep-alive functionality will set the following socket options:
4565
+ * SO_KEEPALIVE=1
4566
+ * TCP_KEEPIDLE=initialDelay
4567
+ * TCP_KEEPCNT=10
4568
+ * TCP_KEEPINTVL=1
4569
+ * @param enable Default: `false`
4570
+ * @param initialDelay Default: `0`
4571
+ * @returns true if is able to setNoDelay and false if it fails.
4572
+ */
4573
+ setKeepAlive(enable?: boolean, initialDelay?: number): boolean;
4574
+
4551
4575
  /**
4552
4576
  * The number of bytes written to the socket.
4553
4577
  */
@@ -4668,6 +4692,7 @@ declare module "bun" {
4668
4692
  port: number;
4669
4693
  tls?: TLSOptions;
4670
4694
  exclusive?: boolean;
4695
+ allowHalfOpen?: boolean;
4671
4696
  }
4672
4697
 
4673
4698
  interface TCPSocketConnectOptions<Data = undefined>
@@ -4676,6 +4701,7 @@ declare module "bun" {
4676
4701
  port: number;
4677
4702
  tls?: boolean;
4678
4703
  exclusive?: boolean;
4704
+ allowHalfOpen?: boolean;
4679
4705
  }
4680
4706
 
4681
4707
  interface UnixSocketOptions<Data = undefined> extends SocketOptions<Data> {
package/globals.d.ts CHANGED
@@ -661,8 +661,16 @@ declare global {
661
661
  * @default true
662
662
  */
663
663
  // trackUnmanagedFds?: boolean;
664
-
665
664
  // resourceLimits?: import("worker_threads").ResourceLimits;
665
+
666
+ /**
667
+ * An array of module specifiers to preload in the worker.
668
+ *
669
+ * These modules load before the worker's entry point is executed.
670
+ *
671
+ * Equivalent to passing the `--preload` CLI argument, but only for this Worker.
672
+ */
673
+ preload?: string[] | string | undefined;
666
674
  }
667
675
 
668
676
  interface Worker extends EventTarget, AbstractWorker {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.34",
2
+ "version": "1.1.35-canary.20241108T140553",
3
3
  "name": "bun-types",
4
4
  "license": "MIT",
5
5
  "main": "",