bun-types 1.1.44-canary.20250114T140519 → 1.1.44-canary.20250115T140647
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/ambient.d.ts +6 -0
- package/bun.d.ts +27 -0
- package/docs/api/fetch.md +1 -1
- package/docs/api/hashing.md +3 -0
- package/docs/api/spawn.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/runtime/debugger.md +4 -4
- package/docs/test/dom.md +1 -1
- package/package.json +1 -1
package/ambient.d.ts
CHANGED
package/bun.d.ts
CHANGED
|
@@ -2081,6 +2081,18 @@ declare module "bun" {
|
|
|
2081
2081
|
data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
2082
2082
|
seed?: bigint,
|
|
2083
2083
|
) => bigint;
|
|
2084
|
+
xxHash32: (
|
|
2085
|
+
data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
2086
|
+
seed?: number,
|
|
2087
|
+
) => number;
|
|
2088
|
+
xxHash64: (
|
|
2089
|
+
data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
2090
|
+
seed?: bigint,
|
|
2091
|
+
) => bigint;
|
|
2092
|
+
xxHash3: (
|
|
2093
|
+
data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
2094
|
+
seed?: bigint,
|
|
2095
|
+
) => bigint;
|
|
2084
2096
|
murmur32v3: (
|
|
2085
2097
|
data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
2086
2098
|
seed?: number,
|
|
@@ -5387,6 +5399,21 @@ declare module "bun" {
|
|
|
5387
5399
|
*/
|
|
5388
5400
|
const isMainThread: boolean;
|
|
5389
5401
|
|
|
5402
|
+
/**
|
|
5403
|
+
* Used when importing an HTML file at runtime.
|
|
5404
|
+
*
|
|
5405
|
+
* @example
|
|
5406
|
+
*
|
|
5407
|
+
* ```ts
|
|
5408
|
+
* import app from "./index.html";
|
|
5409
|
+
* ```
|
|
5410
|
+
*
|
|
5411
|
+
* Bun.build support for this isn't imlpemented yet.
|
|
5412
|
+
*/
|
|
5413
|
+
interface HTMLBundle {
|
|
5414
|
+
index: string;
|
|
5415
|
+
}
|
|
5416
|
+
|
|
5390
5417
|
interface Socket<Data = undefined> extends Disposable {
|
|
5391
5418
|
/**
|
|
5392
5419
|
* Write `data` to the socket
|
package/docs/api/fetch.md
CHANGED
|
@@ -195,7 +195,7 @@ This will print the request and response headers to your terminal:
|
|
|
195
195
|
```sh
|
|
196
196
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
197
197
|
[fetch] > Connection: keep-alive
|
|
198
|
-
[fetch] > User-Agent: Bun/1.1.44-canary.
|
|
198
|
+
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
|
|
199
199
|
[fetch] > Accept: */*
|
|
200
200
|
[fetch] > Host: example.com
|
|
201
201
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/hashing.md
CHANGED
|
@@ -169,6 +169,9 @@ Bun.hash.crc32("data", 1234);
|
|
|
169
169
|
Bun.hash.adler32("data", 1234);
|
|
170
170
|
Bun.hash.cityHash32("data", 1234);
|
|
171
171
|
Bun.hash.cityHash64("data", 1234);
|
|
172
|
+
Bun.hash.xxHash32("data", 1234);
|
|
173
|
+
Bun.hash.xxHash64("data", 1234);
|
|
174
|
+
Bun.hash.xxHash3("data", 1234);
|
|
172
175
|
Bun.hash.murmur32v3("data", 1234);
|
|
173
176
|
Bun.hash.murmur32v2("data", 1234);
|
|
174
177
|
Bun.hash.murmur64v2("data", 1234);
|
package/docs/api/spawn.md
CHANGED
|
@@ -110,7 +110,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
110
110
|
```ts
|
|
111
111
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
112
112
|
const text = await new Response(proc.stdout).text();
|
|
113
|
-
console.log(text); // => "1.1.44-canary.
|
|
113
|
+
console.log(text); // => "1.1.44-canary.20250115T140647"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/cli/publish.md
CHANGED
package/docs/runtime/debugger.md
CHANGED
|
@@ -124,11 +124,11 @@ await fetch("https://example.com", {
|
|
|
124
124
|
This prints the `fetch` request as a single-line `curl` command to let you copy-paste into your terminal to replicate the request.
|
|
125
125
|
|
|
126
126
|
```sh
|
|
127
|
-
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.44-canary.
|
|
127
|
+
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.44-canary.20250115T140647" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
|
|
128
128
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
129
129
|
[fetch] > content-type: application/json
|
|
130
130
|
[fetch] > Connection: keep-alive
|
|
131
|
-
[fetch] > User-Agent: Bun/1.1.44-canary.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
|
|
132
132
|
[fetch] > Accept: */*
|
|
133
133
|
[fetch] > Host: example.com
|
|
134
134
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -170,7 +170,7 @@ This prints the following to the console:
|
|
|
170
170
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
171
171
|
[fetch] > content-type: application/json
|
|
172
172
|
[fetch] > Connection: keep-alive
|
|
173
|
-
[fetch] > User-Agent: Bun/1.1.44-canary.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -192,7 +192,7 @@ This prints the following to the console:
|
|
|
192
192
|
|
|
193
193
|
Bun transpiles every file, which sounds like it would mean that the stack traces you see in the console would unhelpfully point to the transpiled output. To address this, Bun automatically generates and serves sourcemapped files for every file it transpiles. When you see a stack trace in the console, you can click on the file path and be taken to the original source code, even though it was written in TypeScript or JSX, or has some other transformation applied.
|
|
194
194
|
|
|
195
|
-
<!-- TODO: uncomment once v1.1.13 regression is fixed (cc @
|
|
195
|
+
<!-- TODO: uncomment once v1.1.13 regression is fixed (cc @paperclover) -->
|
|
196
196
|
<!-- In Bun, each `Error` object gets four additional properties:
|
|
197
197
|
|
|
198
198
|
- `line` — the source-mapped line number. This number points to the input source code, not the transpiled output.
|
package/docs/test/dom.md
CHANGED
package/package.json
CHANGED