bun-types 1.2.24-canary.20251006T140715 → 1.2.24-canary.20251008T140733
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 +65 -1514
- package/bun.ns.d.ts +0 -2
- package/deprecated.d.ts +5 -0
- package/docs/api/fetch.md +1 -1
- package/docs/api/spawn.md +1 -1
- package/docs/api/websockets.md +9 -3
- package/docs/cli/pm.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/guides/ecosystem/nuxt.md +1 -1
- package/docs/guides/install/add-peer.md +2 -2
- package/docs/guides/install/from-npm-install-to-bun-install.md +1 -1
- package/docs/guides/test/run-tests.md +3 -3
- package/docs/guides/test/snapshot.md +3 -3
- package/docs/guides/test/update-snapshots.md +1 -1
- package/docs/guides/util/version.md +1 -1
- package/docs/guides/websocket/context.md +8 -3
- package/docs/guides/websocket/pubsub.md +4 -1
- package/docs/guides/websocket/simple.md +1 -1
- package/docs/installation.md +4 -4
- package/docs/project/contributing.md +1 -1
- package/docs/runtime/bunfig.md +40 -0
- package/docs/runtime/debugger.md +3 -3
- package/docs/test/dom.md +1 -1
- package/globals.d.ts +64 -12
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/serve.d.ts +1272 -0
- package/test.d.ts +24 -9
package/bun.ns.d.ts
CHANGED
package/deprecated.d.ts
CHANGED
|
@@ -98,6 +98,11 @@ declare module "bun" {
|
|
|
98
98
|
): void;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use {@link Serve.Options Bun.Serve.Options<T, R>} instead
|
|
103
|
+
*/
|
|
104
|
+
type ServeOptions<T = undefined, R extends string = never> = Serve.Options<T, R>;
|
|
105
|
+
|
|
101
106
|
/** @deprecated Use {@link SQL.Query Bun.SQL.Query} */
|
|
102
107
|
type SQLQuery<T = any> = SQL.Query<T>;
|
|
103
108
|
|
package/docs/api/fetch.md
CHANGED
|
@@ -337,7 +337,7 @@ This will print the request and response headers to your terminal:
|
|
|
337
337
|
```sh
|
|
338
338
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
339
339
|
[fetch] > Connection: keep-alive
|
|
340
|
-
[fetch] > User-Agent: Bun/1.2.24-canary.
|
|
340
|
+
[fetch] > User-Agent: Bun/1.2.24-canary.20251008T140733
|
|
341
341
|
[fetch] > Accept: */*
|
|
342
342
|
[fetch] > Host: example.com
|
|
343
343
|
[fetch] > Accept-Encoding: gzip, deflate, br, zstd
|
package/docs/api/spawn.md
CHANGED
|
@@ -140,7 +140,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
140
140
|
```ts
|
|
141
141
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
142
142
|
const text = await proc.stdout.text();
|
|
143
|
-
console.log(text); // => "1.2.24-canary.
|
|
143
|
+
console.log(text); // => "1.2.24-canary.20251008T140733\n"
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/api/websockets.md
CHANGED
|
@@ -114,8 +114,7 @@ type WebSocketData = {
|
|
|
114
114
|
authToken: string;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
Bun.serve<WebSocketData>({
|
|
117
|
+
Bun.serve({
|
|
119
118
|
fetch(req, server) {
|
|
120
119
|
const cookies = new Bun.CookieMap(req.headers.get("cookie")!);
|
|
121
120
|
|
|
@@ -131,8 +130,12 @@ Bun.serve<WebSocketData>({
|
|
|
131
130
|
return undefined;
|
|
132
131
|
},
|
|
133
132
|
websocket: {
|
|
133
|
+
// TypeScript: specify the type of ws.data like this
|
|
134
|
+
data: {} as WebSocketData,
|
|
135
|
+
|
|
134
136
|
// handler called when a message is received
|
|
135
137
|
async message(ws, message) {
|
|
138
|
+
// ws.data is now properly typed as WebSocketData
|
|
136
139
|
const user = getUserFromToken(ws.data.authToken);
|
|
137
140
|
|
|
138
141
|
await saveMessageToDatabase({
|
|
@@ -164,7 +167,7 @@ socket.addEventListener("message", event => {
|
|
|
164
167
|
Bun's `ServerWebSocket` implementation implements a native publish-subscribe API for topic-based broadcasting. Individual sockets can `.subscribe()` to a topic (specified with a string identifier) and `.publish()` messages to all other subscribers to that topic (excluding itself). This topic-based broadcast API is similar to [MQTT](https://en.wikipedia.org/wiki/MQTT) and [Redis Pub/Sub](https://redis.io/topics/pubsub).
|
|
165
168
|
|
|
166
169
|
```ts
|
|
167
|
-
const server = Bun.serve
|
|
170
|
+
const server = Bun.serve({
|
|
168
171
|
fetch(req, server) {
|
|
169
172
|
const url = new URL(req.url);
|
|
170
173
|
if (url.pathname === "/chat") {
|
|
@@ -179,6 +182,9 @@ const server = Bun.serve<{ username: string }>({
|
|
|
179
182
|
return new Response("Hello world");
|
|
180
183
|
},
|
|
181
184
|
websocket: {
|
|
185
|
+
// TypeScript: specify the type of ws.data like this
|
|
186
|
+
data: {} as { username: string },
|
|
187
|
+
|
|
182
188
|
open(ws) {
|
|
183
189
|
const msg = `${ws.data.username} has entered the chat`;
|
|
184
190
|
ws.subscribe("the-group-chat");
|
package/docs/cli/pm.md
CHANGED
|
@@ -213,7 +213,7 @@ To display current package version and help:
|
|
|
213
213
|
|
|
214
214
|
```bash
|
|
215
215
|
$ bun pm version
|
|
216
|
-
bun pm version v1.2.24-canary.
|
|
216
|
+
bun pm version v1.2.24-canary.20251008T140733 (ca7428e9)
|
|
217
217
|
Current package version: v1.0.0
|
|
218
218
|
|
|
219
219
|
Increment:
|
package/docs/cli/publish.md
CHANGED
|
@@ -9,7 +9,7 @@ $ bunx nuxi init my-nuxt-app
|
|
|
9
9
|
✔ Which package manager would you like to use?
|
|
10
10
|
bun
|
|
11
11
|
◐ Installing dependencies...
|
|
12
|
-
bun install v1.2.24-canary.
|
|
12
|
+
bun install v1.2.24-canary.20251008T140733 (16b4bf34)
|
|
13
13
|
+ @nuxt/devtools@0.8.2
|
|
14
14
|
+ nuxt@3.7.0
|
|
15
15
|
785 packages installed [2.67s]
|
|
@@ -15,7 +15,7 @@ This will add the package to `peerDependencies` in `package.json`.
|
|
|
15
15
|
```json-diff
|
|
16
16
|
{
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
+ "@types/bun": "^1.2.24-canary.
|
|
18
|
+
+ "@types/bun": "^1.2.24-canary.20251008T140733"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
```
|
|
@@ -27,7 +27,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
|
|
|
27
27
|
```json-diff
|
|
28
28
|
{
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@types/bun": "^1.2.24-canary.
|
|
30
|
+
"@types/bun": "^1.2.24-canary.20251008T140733"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
+ "@types/bun": {
|
|
@@ -97,7 +97,7 @@ $ bun update
|
|
|
97
97
|
$ bun update @types/bun --latest
|
|
98
98
|
|
|
99
99
|
# Update a dependency to a specific version
|
|
100
|
-
$ bun update @types/bun@1.2.24-canary.
|
|
100
|
+
$ bun update @types/bun@1.2.24-canary.20251008T140733
|
|
101
101
|
|
|
102
102
|
# Update all dependencies to the latest versions
|
|
103
103
|
$ bun update --latest
|
|
@@ -21,7 +21,7 @@ Here's what the output of a typical test run looks like. In this case, there are
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
$ bun test
|
|
24
|
-
bun test v1.2.24-canary.
|
|
24
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
25
25
|
|
|
26
26
|
test.test.js:
|
|
27
27
|
✓ add [0.87ms]
|
|
@@ -47,7 +47,7 @@ To only run certain test files, pass a positional argument to `bun test`. The ru
|
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
$ bun test test3
|
|
50
|
-
bun test v1.2.24-canary.
|
|
50
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
51
51
|
|
|
52
52
|
test3.test.js:
|
|
53
53
|
✓ add [1.40ms]
|
|
@@ -85,7 +85,7 @@ Adding `-t add` will only run tests with "add" in the name. This works with test
|
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
87
|
$ bun test -t add
|
|
88
|
-
bun test v1.2.24-canary.
|
|
88
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
89
89
|
|
|
90
90
|
test.test.js:
|
|
91
91
|
✓ add [1.79ms]
|
|
@@ -18,7 +18,7 @@ The first time this test is executed, Bun will evaluate the value passed into `e
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
$ bun test test/snap
|
|
21
|
-
bun test v1.2.24-canary.
|
|
21
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
22
22
|
|
|
23
23
|
test/snap.test.ts:
|
|
24
24
|
✓ snapshot [1.48ms]
|
|
@@ -61,7 +61,7 @@ Later, when this test file is executed again, Bun will read the snapshot file an
|
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
63
|
$ bun test
|
|
64
|
-
bun test v1.2.24-canary.
|
|
64
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
65
65
|
|
|
66
66
|
test/snap.test.ts:
|
|
67
67
|
✓ snapshot [1.05ms]
|
|
@@ -78,7 +78,7 @@ To update snapshots, use the `--update-snapshots` flag.
|
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
80
|
$ bun test --update-snapshots
|
|
81
|
-
bun test v1.2.24-canary.
|
|
81
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
82
82
|
|
|
83
83
|
test/snap.test.ts:
|
|
84
84
|
✓ snapshot [0.86ms]
|
|
@@ -29,7 +29,7 @@ To regenerate snapshots, use the `--update-snapshots` flag.
|
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
$ bun test --update-snapshots
|
|
32
|
-
bun test v1.2.24-canary.
|
|
32
|
+
bun test v1.2.24-canary.20251008T140733 (9c68abdb)
|
|
33
33
|
|
|
34
34
|
test/snap.test.ts:
|
|
35
35
|
✓ snapshot [0.86ms]
|
|
@@ -7,7 +7,7 @@ When building a WebSocket server, it's typically necessary to store some identif
|
|
|
7
7
|
With [Bun.serve()](https://bun.com/docs/api/websockets#contextual-data), this "contextual data" is set when the connection is initially upgraded by passing a `data` parameter in the `server.upgrade()` call.
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
Bun.serve
|
|
10
|
+
Bun.serve({
|
|
11
11
|
fetch(req, server) {
|
|
12
12
|
const success = server.upgrade(req, {
|
|
13
13
|
data: {
|
|
@@ -20,6 +20,9 @@ Bun.serve<{ socketId: number }>({
|
|
|
20
20
|
// ...
|
|
21
21
|
},
|
|
22
22
|
websocket: {
|
|
23
|
+
// TypeScript: specify the type of ws.data like this
|
|
24
|
+
data: {} as { socketId: number },
|
|
25
|
+
|
|
23
26
|
// define websocket handlers
|
|
24
27
|
async message(ws, message) {
|
|
25
28
|
// the contextual data is available as the `data` property
|
|
@@ -41,8 +44,7 @@ type WebSocketData = {
|
|
|
41
44
|
userId: string;
|
|
42
45
|
};
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
Bun.serve<WebSocketData>({
|
|
47
|
+
Bun.serve({
|
|
46
48
|
async fetch(req, server) {
|
|
47
49
|
// use a library to parse cookies
|
|
48
50
|
const cookies = parseCookies(req.headers.get("Cookie"));
|
|
@@ -60,6 +62,9 @@ Bun.serve<WebSocketData>({
|
|
|
60
62
|
if (upgraded) return undefined;
|
|
61
63
|
},
|
|
62
64
|
websocket: {
|
|
65
|
+
// TypeScript: specify the type of ws.data like this
|
|
66
|
+
data: {} as WebSocketData,
|
|
67
|
+
|
|
63
68
|
async message(ws, message) {
|
|
64
69
|
// save the message to a database
|
|
65
70
|
await saveMessageToDatabase({
|
|
@@ -7,7 +7,7 @@ Bun's server-side `WebSocket` API provides a native pub-sub API. Sockets can be
|
|
|
7
7
|
This code snippet implements a simple single-channel chat server.
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
const server = Bun.serve
|
|
10
|
+
const server = Bun.serve({
|
|
11
11
|
fetch(req, server) {
|
|
12
12
|
const cookies = req.headers.get("cookie");
|
|
13
13
|
const username = getUsernameFromCookies(cookies);
|
|
@@ -17,6 +17,9 @@ const server = Bun.serve<{ username: string }>({
|
|
|
17
17
|
return new Response("Hello world");
|
|
18
18
|
},
|
|
19
19
|
websocket: {
|
|
20
|
+
// TypeScript: specify the type of ws.data like this
|
|
21
|
+
data: {} as { username: string },
|
|
22
|
+
|
|
20
23
|
open(ws) {
|
|
21
24
|
const msg = `${ws.data.username} has entered the chat`;
|
|
22
25
|
ws.subscribe("the-group-chat");
|
|
@@ -7,7 +7,7 @@ Start a simple WebSocket server using [`Bun.serve`](https://bun.com/docs/api/htt
|
|
|
7
7
|
Inside `fetch`, we attempt to upgrade incoming `ws:` or `wss:` requests to WebSocket connections.
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
const server = Bun.serve
|
|
10
|
+
const server = Bun.serve({
|
|
11
11
|
fetch(req, server) {
|
|
12
12
|
const success = server.upgrade(req);
|
|
13
13
|
if (success) {
|
package/docs/installation.md
CHANGED
|
@@ -14,7 +14,7 @@ Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Us
|
|
|
14
14
|
```bash#macOS/Linux_(curl)
|
|
15
15
|
$ curl -fsSL https://bun.com/install | bash # for macOS, Linux, and WSL
|
|
16
16
|
# to install a specific version
|
|
17
|
-
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.24-canary.
|
|
17
|
+
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.24-canary.20251008T140733"
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```bash#npm
|
|
@@ -189,10 +189,10 @@ Since Bun is a single binary, you can install older versions of Bun by re-runnin
|
|
|
189
189
|
|
|
190
190
|
### Installing a specific version of Bun on Linux/Mac
|
|
191
191
|
|
|
192
|
-
To install a specific version of Bun, you can pass the git tag of the version you want to install to the install script, such as `bun-v1.2.0` or `bun-v1.2.24-canary.
|
|
192
|
+
To install a specific version of Bun, you can pass the git tag of the version you want to install to the install script, such as `bun-v1.2.0` or `bun-v1.2.24-canary.20251008T140733`.
|
|
193
193
|
|
|
194
194
|
```sh
|
|
195
|
-
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.24-canary.
|
|
195
|
+
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.24-canary.20251008T140733"
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
### Installing a specific version of Bun on Windows
|
|
@@ -201,7 +201,7 @@ On Windows, you can install a specific version of Bun by passing the version num
|
|
|
201
201
|
|
|
202
202
|
```sh
|
|
203
203
|
# PowerShell:
|
|
204
|
-
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.24-canary.
|
|
204
|
+
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.24-canary.20251008T140733"
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
## Downloading Bun binaries directly
|
|
@@ -149,7 +149,7 @@ Bun generally takes about 2.5 minutes to compile a debug build when there are Zi
|
|
|
149
149
|
- Batch up your changes
|
|
150
150
|
- Ensure zls is running with incremental watching for LSP errors (if you use VSCode and install Zig and run `bun run build` once to download Zig, this should just work)
|
|
151
151
|
- Prefer using the debugger ("CodeLLDB" in VSCode) to step through the code.
|
|
152
|
-
- Use debug logs. `BUN_DEBUG_<scope>=1` will enable debug logging for the corresponding `Output.scoped(.<scope>,
|
|
152
|
+
- Use debug logs. `BUN_DEBUG_<scope>=1` will enable debug logging for the corresponding `Output.scoped(.<scope>, .hidden)` logs. You can also set `BUN_DEBUG_QUIET_LOGS=1` to disable all debug logging that isn't explicitly enabled. To dump debug lgos into a file, `BUN_DEBUG=<path-to-file>.log`. Debug logs are aggressively removed in release builds.
|
|
153
153
|
- src/js/\*\*.ts changes are pretty much instant to rebuild. C++ changes are a bit slower, but still much faster than the Zig code (Zig is one compilation unit, C++ is many).
|
|
154
154
|
|
|
155
155
|
## Code generation scripts
|
package/docs/runtime/bunfig.md
CHANGED
|
@@ -249,6 +249,46 @@ This is useful for:
|
|
|
249
249
|
|
|
250
250
|
The `--concurrent` CLI flag will override this setting when specified.
|
|
251
251
|
|
|
252
|
+
### `test.randomize`
|
|
253
|
+
|
|
254
|
+
Run tests in random order. Default `false`.
|
|
255
|
+
|
|
256
|
+
```toml
|
|
257
|
+
[test]
|
|
258
|
+
randomize = true
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
This helps catch bugs related to test interdependencies by running tests in a different order each time. When combined with `seed`, the random order becomes reproducible.
|
|
262
|
+
|
|
263
|
+
The `--randomize` CLI flag will override this setting when specified.
|
|
264
|
+
|
|
265
|
+
### `test.seed`
|
|
266
|
+
|
|
267
|
+
Set the random seed for test randomization. This option requires `randomize` to be `true`.
|
|
268
|
+
|
|
269
|
+
```toml
|
|
270
|
+
[test]
|
|
271
|
+
randomize = true
|
|
272
|
+
seed = 2444615283
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Using a seed makes the randomized test order reproducible across runs, which is useful for debugging flaky tests. When you encounter a test failure with randomization enabled, you can use the same seed to reproduce the exact test order.
|
|
276
|
+
|
|
277
|
+
The `--seed` CLI flag will override this setting when specified.
|
|
278
|
+
|
|
279
|
+
### `test.rerunEach`
|
|
280
|
+
|
|
281
|
+
Re-run each test file a specified number of times. Default `0` (run once).
|
|
282
|
+
|
|
283
|
+
```toml
|
|
284
|
+
[test]
|
|
285
|
+
rerunEach = 3
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
This is useful for catching flaky tests or non-deterministic behavior. Each test file will be executed the specified number of times.
|
|
289
|
+
|
|
290
|
+
The `--rerun-each` CLI flag will override this setting when specified.
|
|
291
|
+
|
|
252
292
|
## Package manager
|
|
253
293
|
|
|
254
294
|
Package management is a complex issue; to support a range of use cases, the behavior of `bun install` can be configured under the `[install]` section.
|
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.2.24-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.2.24-canary.20251008T140733" -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.2.24-canary.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.2.24-canary.20251008T140733
|
|
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.2.24-canary.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.2.24-canary.20251008T140733
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/test/dom.md
CHANGED
package/globals.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ declare module "bun" {
|
|
|
7
7
|
type LibWorkerOrBunWorker = LibDomIsLoaded extends true ? {} : Bun.Worker;
|
|
8
8
|
type LibEmptyOrBunWebSocket = LibDomIsLoaded extends true ? {} : Bun.WebSocket;
|
|
9
9
|
|
|
10
|
+
type LibEmptyOrNodeStreamWebCompressionStream = LibDomIsLoaded extends true
|
|
11
|
+
? {}
|
|
12
|
+
: import("node:stream/web").CompressionStream;
|
|
13
|
+
type LibEmptyOrNodeStreamWebDecompressionStream = LibDomIsLoaded extends true
|
|
14
|
+
? {}
|
|
15
|
+
: import("node:stream/web").DecompressionStream;
|
|
16
|
+
|
|
10
17
|
type LibPerformanceOrNodePerfHooksPerformance = LibDomIsLoaded extends true ? {} : import("perf_hooks").Performance;
|
|
11
18
|
type LibEmptyOrPerformanceEntry = LibDomIsLoaded extends true ? {} : import("node:perf_hooks").PerformanceEntry;
|
|
12
19
|
type LibEmptyOrPerformanceMark = LibDomIsLoaded extends true ? {} : import("node:perf_hooks").PerformanceMark;
|
|
@@ -271,6 +278,30 @@ declare var Event: {
|
|
|
271
278
|
new (type: string, eventInitDict?: Bun.EventInit): Event;
|
|
272
279
|
};
|
|
273
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Unimplemented in Bun
|
|
283
|
+
*/
|
|
284
|
+
interface CompressionStream extends Bun.__internal.LibEmptyOrNodeStreamWebCompressionStream {}
|
|
285
|
+
/**
|
|
286
|
+
* Unimplemented in Bun
|
|
287
|
+
*/
|
|
288
|
+
declare var CompressionStream: Bun.__internal.UseLibDomIfAvailable<
|
|
289
|
+
"CompressionStream",
|
|
290
|
+
typeof import("node:stream/web").CompressionStream
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Unimplemented in Bun
|
|
295
|
+
*/
|
|
296
|
+
interface DecompressionStream extends Bun.__internal.LibEmptyOrNodeStreamWebCompressionStream {}
|
|
297
|
+
/**
|
|
298
|
+
* Unimplemented in Bun
|
|
299
|
+
*/
|
|
300
|
+
declare var DecompressionStream: Bun.__internal.UseLibDomIfAvailable<
|
|
301
|
+
"DecompressionStream",
|
|
302
|
+
typeof import("node:stream/web").DecompressionStream
|
|
303
|
+
>;
|
|
304
|
+
|
|
274
305
|
interface EventTarget {
|
|
275
306
|
/**
|
|
276
307
|
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
|
|
@@ -860,7 +891,10 @@ interface ErrnoException extends Error {
|
|
|
860
891
|
syscall?: string | undefined;
|
|
861
892
|
}
|
|
862
893
|
|
|
863
|
-
/**
|
|
894
|
+
/**
|
|
895
|
+
* An abnormal event (called an exception) which occurs as a result of calling a
|
|
896
|
+
* method or accessing a property of a web API
|
|
897
|
+
*/
|
|
864
898
|
interface DOMException extends Error {
|
|
865
899
|
readonly message: string;
|
|
866
900
|
readonly name: string;
|
|
@@ -890,11 +924,35 @@ interface DOMException extends Error {
|
|
|
890
924
|
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
891
925
|
readonly DATA_CLONE_ERR: 25;
|
|
892
926
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
927
|
+
declare var DOMException: {
|
|
928
|
+
prototype: DOMException;
|
|
929
|
+
new (message?: string, name?: string): DOMException;
|
|
930
|
+
readonly INDEX_SIZE_ERR: 1;
|
|
931
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
|
932
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
933
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
|
934
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
|
935
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
936
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
937
|
+
readonly NOT_FOUND_ERR: 8;
|
|
938
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
|
939
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
940
|
+
readonly INVALID_STATE_ERR: 11;
|
|
941
|
+
readonly SYNTAX_ERR: 12;
|
|
942
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
|
943
|
+
readonly NAMESPACE_ERR: 14;
|
|
944
|
+
readonly INVALID_ACCESS_ERR: 15;
|
|
945
|
+
readonly VALIDATION_ERR: 16;
|
|
946
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
|
947
|
+
readonly SECURITY_ERR: 18;
|
|
948
|
+
readonly NETWORK_ERR: 19;
|
|
949
|
+
readonly ABORT_ERR: 20;
|
|
950
|
+
readonly URL_MISMATCH_ERR: 21;
|
|
951
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
952
|
+
readonly TIMEOUT_ERR: 23;
|
|
953
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
954
|
+
readonly DATA_CLONE_ERR: 25;
|
|
955
|
+
};
|
|
898
956
|
|
|
899
957
|
declare function alert(message?: string): void;
|
|
900
958
|
declare function confirm(message?: string): boolean;
|
|
@@ -1605,12 +1663,6 @@ declare var AbortSignal: Bun.__internal.UseLibDomIfAvailable<
|
|
|
1605
1663
|
}
|
|
1606
1664
|
>;
|
|
1607
1665
|
|
|
1608
|
-
interface DOMException {}
|
|
1609
|
-
declare var DOMException: Bun.__internal.UseLibDomIfAvailable<
|
|
1610
|
-
"DOMException",
|
|
1611
|
-
{ prototype: DOMException; new (): DOMException }
|
|
1612
|
-
>;
|
|
1613
|
-
|
|
1614
1666
|
interface FormData {
|
|
1615
1667
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1616
1668
|
append(name: string, value: string | Blob): void;
|
package/index.d.ts
CHANGED
package/package.json
CHANGED