bun-types 1.3.3-canary.20251118T140713 → 1.3.3-canary.20251120T140720

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/bun.d.ts CHANGED
@@ -1933,6 +1933,26 @@ declare module "bun" {
1933
1933
  execArgv?: string[];
1934
1934
  executablePath?: string;
1935
1935
  outfile?: string;
1936
+ /**
1937
+ * Whether to autoload .env files when the standalone executable runs
1938
+ *
1939
+ * Standalone-only: applies only when building/running the standalone executable.
1940
+ *
1941
+ * Equivalent CLI flags: `--compile-autoload-dotenv`, `--no-compile-autoload-dotenv`
1942
+ *
1943
+ * @default true
1944
+ */
1945
+ autoloadDotenv?: boolean;
1946
+ /**
1947
+ * Whether to autoload bunfig.toml when the standalone executable runs
1948
+ *
1949
+ * Standalone-only: applies only when building/running the standalone executable.
1950
+ *
1951
+ * Equivalent CLI flags: `--compile-autoload-bunfig`, `--no-compile-autoload-bunfig`
1952
+ *
1953
+ * @default true
1954
+ */
1955
+ autoloadBunfig?: boolean;
1936
1956
  windows?: {
1937
1957
  hideConsole?: boolean;
1938
1958
  icon?: string;
package/overrides.d.ts CHANGED
@@ -23,16 +23,6 @@ interface BunConsumerConvenienceMethods {
23
23
  * Consume as JSON
24
24
  */
25
25
  json(): Promise<any>;
26
-
27
- /**
28
- * Consume as a FormData instance
29
- */
30
- formData(): Promise<FormData>;
31
-
32
- /**
33
- * Consume as an ArrayBuffer
34
- */
35
- arrayBuffer(): Promise<ArrayBuffer>;
36
26
  }
37
27
 
38
28
  declare module "stream/web" {
@@ -51,6 +41,21 @@ declare module "buffer" {
51
41
  // slightly different from just "copying in the methods" (the difference is
52
42
  // related to how type parameters are resolved)
53
43
  bytes(): Promise<Uint8Array<ArrayBuffer>>;
44
+
45
+ /**
46
+ * Consume the blob as a FormData instance
47
+ */
48
+ formData(): Promise<FormData>;
49
+
50
+ /**
51
+ * Consume the blob as an ArrayBuffer
52
+ */
53
+ arrayBuffer(): Promise<ArrayBuffer>;
54
+
55
+ /**
56
+ * Returns a readable stream of the blob's contents
57
+ */
58
+ stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
54
59
  }
55
60
  }
56
61
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.3-canary.20251118T140713",
2
+ "version": "1.3.3-canary.20251120T140720",
3
3
  "name": "bun-types",
4
4
  "license": "MIT",
5
5
  "types": "./index.d.ts",
package/serve.d.ts CHANGED
@@ -283,7 +283,8 @@ declare module "bun" {
283
283
  * return new Response();
284
284
  * },
285
285
  * websocket: {
286
- * open(ws) {
286
+ * data: {} as {accessToken: string | null},
287
+ * message(ws) {
287
288
  * console.log(ws.data.accessToken);
288
289
  * }
289
290
  * }
@@ -486,13 +487,15 @@ declare module "bun" {
486
487
  }
487
488
 
488
489
  namespace Serve {
489
- type ExtractRouteParams<T> = T extends `${string}:${infer Param}/${infer Rest}`
490
- ? { [K in Param]: string } & ExtractRouteParams<Rest>
491
- : T extends `${string}:${infer Param}`
492
- ? { [K in Param]: string }
493
- : T extends `${string}*`
494
- ? {}
495
- : {};
490
+ type ExtractRouteParams<T> = string extends T
491
+ ? Record<string, string>
492
+ : T extends `${string}:${infer Param}/${infer Rest}`
493
+ ? { [K in Param]: string } & ExtractRouteParams<Rest>
494
+ : T extends `${string}:${infer Param}`
495
+ ? { [K in Param]: string }
496
+ : T extends `${string}*`
497
+ ? {}
498
+ : {};
496
499
 
497
500
  /**
498
501
  * Development configuration for {@link Bun.serve}
@@ -549,14 +552,16 @@ declare module "bun" {
549
552
  [Path in R]:
550
553
  | BaseRouteValue
551
554
  | Handler<BunRequest<Path>, Server<WebSocketData>, Response>
552
- | Partial<Record<HTTPMethod, Handler<BunRequest<Path>, Server<WebSocketData>, Response>>>;
555
+ | Partial<Record<HTTPMethod, Handler<BunRequest<Path>, Server<WebSocketData>, Response> | Response>>;
553
556
  };
554
557
 
555
558
  type RoutesWithUpgrade<WebSocketData, R extends string> = {
556
559
  [Path in R]:
557
560
  | BaseRouteValue
558
561
  | Handler<BunRequest<Path>, Server<WebSocketData>, Response | undefined | void>
559
- | Partial<Record<HTTPMethod, Handler<BunRequest<Path>, Server<WebSocketData>, Response | undefined | void>>>;
562
+ | Partial<
563
+ Record<HTTPMethod, Handler<BunRequest<Path>, Server<WebSocketData>, Response | undefined | void> | Response>
564
+ >;
560
565
  };
561
566
 
562
567
  type FetchOrRoutes<WebSocketData, R extends string> =
@@ -786,7 +791,7 @@ declare module "bun" {
786
791
  * } satisfies Bun.Serve.Options<{ name: string }>;
787
792
  * ```
788
793
  */
789
- type Options<WebSocketData, R extends string = never> = Bun.__internal.XOR<
794
+ type Options<WebSocketData, R extends string = string> = Bun.__internal.XOR<
790
795
  HostnamePortServeOptions<WebSocketData>,
791
796
  UnixServeOptions<WebSocketData>
792
797
  > &
@@ -1276,7 +1281,7 @@ declare module "bun" {
1276
1281
  * });
1277
1282
  * ```
1278
1283
  */
1279
- function serve<WebSocketData = undefined, R extends string = string>(
1284
+ function serve<WebSocketData = undefined, R extends string = never>(
1280
1285
  options: Serve.Options<WebSocketData, R>,
1281
1286
  ): Server<WebSocketData>;
1282
1287
  }