bun-types-no-globals 1.3.2-canary.20251103T140721 → 1.3.2-canary.20251105T140650

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/lib/bun.d.ts CHANGED
@@ -5791,11 +5791,11 @@ declare module "bun" {
5791
5791
  * @category Process Management
5792
5792
  *
5793
5793
  * ```js
5794
- * const subprocess = Bun.spawn({
5794
+ * const proc = Bun.spawn({
5795
5795
  * cmd: ["echo", "hello"],
5796
5796
  * stdout: "pipe",
5797
5797
  * });
5798
- * const text = await readableStreamToText(subprocess.stdout);
5798
+ * const text = await proc.stdout.text();
5799
5799
  * console.log(text); // "hello\n"
5800
5800
  * ```
5801
5801
  *
@@ -5829,8 +5829,8 @@ declare module "bun" {
5829
5829
  * Spawn a new process
5830
5830
  *
5831
5831
  * ```js
5832
- * const {stdout} = Bun.spawn(["echo", "hello"]);
5833
- * const text = await readableStreamToText(stdout);
5832
+ * const proc = Bun.spawn(["echo", "hello"]);
5833
+ * const text = await proc.stdout.text();
5834
5834
  * console.log(text); // "hello\n"
5835
5835
  * ```
5836
5836
  *
@@ -1,27 +1,21 @@
1
1
  export {};
2
2
  declare module "stream/web" {
3
- interface ReadableStream {
3
+ interface ReadableStream extends BunConsumerConvenienceMethods {
4
4
  /**
5
- * Consume a ReadableStream as text
6
- */
7
- text(): Promise<string>;
8
-
9
- /**
10
- * Consume a ReadableStream as a Uint8Array
11
- */
12
- bytes(): Promise<Uint8Array<ArrayBuffer>>;
13
-
14
- /**
15
- * Consume a ReadableStream as JSON
16
- */
17
- json(): Promise<any>;
18
-
19
- /**
20
- * Consume a ReadableStream as a Blob
5
+ * Consume as a Blob
21
6
  */
22
7
  blob(): Promise<Blob>;
23
8
  }
24
9
  }
10
+ declare module "buffer" {
11
+ interface Blob extends BunConsumerConvenienceMethods {
12
+ // We have to specify bytes again even though it comes from
13
+ // BunConsumerConvenienceMethods, because inheritance in TypeScript is
14
+ // slightly different from just "copying in the methods" (the difference is
15
+ // related to how type parameters are resolved)
16
+ bytes(): Promise<Uint8Array<ArrayBuffer>>;
17
+ }
18
+ }
25
19
  declare module "url" {
26
20
  interface URLSearchParams {
27
21
  toJSON(): Record<string, string>;
package/lib/test.d.ts CHANGED
@@ -172,7 +172,7 @@ declare module "bun:test" {
172
172
  /**
173
173
  * Mock a module
174
174
  */
175
- module: typeof mock.module;
175
+ mock: typeof mock.module;
176
176
  /**
177
177
  * Restore all mocks to their original implementation
178
178
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-types-no-globals",
3
- "version": "1.3.2-canary.20251103T140721",
3
+ "version": "1.3.2-canary.20251105T140650",
4
4
  "main": "./generator/index.ts",
5
5
  "types": "./lib/index.d.ts",
6
6
  "description": "TypeScript type definitions for Bun without global types pollution",