bun-types 1.2.9-canary.20250408T140629 → 1.2.10-canary.20250409T140705
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/docs/api/fetch.md +1 -1
- package/docs/api/spawn.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/installation.md +4 -4
- package/docs/runtime/debugger.md +3 -3
- package/docs/test/dom.md +1 -1
- package/package.json +1 -1
- package/redis.d.ts +164 -51
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.
|
|
340
|
+
[fetch] > User-Agent: Bun/1.2.10-canary.20250409T140705
|
|
341
341
|
[fetch] > Accept: */*
|
|
342
342
|
[fetch] > Host: example.com
|
|
343
343
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/spawn.md
CHANGED
|
@@ -120,7 +120,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
120
120
|
```ts
|
|
121
121
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
122
122
|
const text = await new Response(proc.stdout).text();
|
|
123
|
-
console.log(text); // => "1.2.
|
|
123
|
+
console.log(text); // => "1.2.10-canary.20250409T140705"
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
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.
|
|
12
|
+
bun install v1.2.10-canary.20250409T140705 (16b4bf34)
|
|
13
13
|
+ @nuxt/devtools@0.8.2
|
|
14
14
|
+ nuxt@3.7.0
|
|
15
15
|
785 packages installed [2.67s]
|
|
@@ -16,7 +16,7 @@ This will add the package to `peerDependencies` in `package.json`.
|
|
|
16
16
|
```json-diff
|
|
17
17
|
{
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
+ "@types/bun": "^1.2.
|
|
19
|
+
+ "@types/bun": "^1.2.10-canary.20250409T140705"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
```
|
|
@@ -28,7 +28,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
|
|
|
28
28
|
```json-diff
|
|
29
29
|
{
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@types/bun": "^1.2.
|
|
31
|
+
"@types/bun": "^1.2.10-canary.20250409T140705"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
34
34
|
+ "@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.
|
|
100
|
+
$ bun update @types/bun@1.2.10-canary.20250409T140705
|
|
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
|
+
bun test v1.2.10-canary.20250409T140705 (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.
|
|
50
|
+
bun test v1.2.10-canary.20250409T140705 (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.
|
|
88
|
+
bun test v1.2.10-canary.20250409T140705 (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.
|
|
21
|
+
bun test v1.2.10-canary.20250409T140705 (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.
|
|
64
|
+
bun test v1.2.10-canary.20250409T140705 (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.
|
|
81
|
+
bun test v1.2.10-canary.20250409T140705 (9c68abdb)
|
|
82
82
|
|
|
83
83
|
test/snap.test.ts:
|
|
84
84
|
✓ snapshot [0.86ms]
|
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.sh/install | bash # for macOS, Linux, and WSL
|
|
16
16
|
# to install a specific version
|
|
17
|
-
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.
|
|
17
|
+
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.10-canary.20250409T140705"
|
|
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.
|
|
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.10-canary.20250409T140705`.
|
|
193
193
|
|
|
194
194
|
```sh
|
|
195
|
-
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.
|
|
195
|
+
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.10-canary.20250409T140705"
|
|
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.sh/install.ps1)} -Version 1.2.
|
|
204
|
+
$ iex "& {$(irm https://bun.sh/install.ps1)} -Version 1.2.10-canary.20250409T140705"
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
## Downloading Bun binaries directly
|
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.
|
|
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.10-canary.20250409T140705" -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.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.2.10-canary.20250409T140705
|
|
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.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.2.10-canary.20250409T140705
|
|
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/package.json
CHANGED
package/redis.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ declare module "bun" {
|
|
|
103
103
|
/**
|
|
104
104
|
* Disconnect from the Redis server
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
close(): void;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Send a raw command to the Redis server
|
|
@@ -118,43 +118,156 @@ declare module "bun" {
|
|
|
118
118
|
* @param key The key to get
|
|
119
119
|
* @returns Promise that resolves with the key's value, or null if the key doesn't exist
|
|
120
120
|
*/
|
|
121
|
-
get(key: string |
|
|
121
|
+
get(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Set
|
|
124
|
+
* Set key to hold the string value
|
|
125
125
|
* @param key The key to set
|
|
126
126
|
* @param value The value to set
|
|
127
127
|
* @returns Promise that resolves with "OK" on success
|
|
128
128
|
*/
|
|
129
|
-
set(key: string |
|
|
129
|
+
set(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<"OK">;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Set key to hold the string value with expiration
|
|
133
|
+
* @param key The key to set
|
|
134
|
+
* @param value The value to set
|
|
135
|
+
* @param ex Set the specified expire time, in seconds
|
|
136
|
+
* @returns Promise that resolves with "OK" on success
|
|
137
|
+
*/
|
|
138
|
+
set(
|
|
139
|
+
key: string | ArrayBufferView | Blob,
|
|
140
|
+
value: string | ArrayBufferView | Blob,
|
|
141
|
+
ex: "EX",
|
|
142
|
+
seconds: number,
|
|
143
|
+
): Promise<"OK">;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Set key to hold the string value with expiration
|
|
147
|
+
* @param key The key to set
|
|
148
|
+
* @param value The value to set
|
|
149
|
+
* @param px Set the specified expire time, in milliseconds
|
|
150
|
+
* @returns Promise that resolves with "OK" on success
|
|
151
|
+
*/
|
|
152
|
+
set(
|
|
153
|
+
key: string | ArrayBufferView | Blob,
|
|
154
|
+
value: string | ArrayBufferView | Blob,
|
|
155
|
+
px: "PX",
|
|
156
|
+
milliseconds: number,
|
|
157
|
+
): Promise<"OK">;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Set key to hold the string value with expiration at a specific Unix timestamp
|
|
161
|
+
* @param key The key to set
|
|
162
|
+
* @param value The value to set
|
|
163
|
+
* @param exat Set the specified Unix time at which the key will expire, in seconds
|
|
164
|
+
* @returns Promise that resolves with "OK" on success
|
|
165
|
+
*/
|
|
166
|
+
set(
|
|
167
|
+
key: string | ArrayBufferView | Blob,
|
|
168
|
+
value: string | ArrayBufferView | Blob,
|
|
169
|
+
exat: "EXAT",
|
|
170
|
+
timestampSeconds: number,
|
|
171
|
+
): Promise<"OK">;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Set key to hold the string value with expiration at a specific Unix timestamp
|
|
175
|
+
* @param key The key to set
|
|
176
|
+
* @param value The value to set
|
|
177
|
+
* @param pxat Set the specified Unix time at which the key will expire, in milliseconds
|
|
178
|
+
* @returns Promise that resolves with "OK" on success
|
|
179
|
+
*/
|
|
180
|
+
set(
|
|
181
|
+
key: string | ArrayBufferView | Blob,
|
|
182
|
+
value: string | ArrayBufferView | Blob,
|
|
183
|
+
pxat: "PXAT",
|
|
184
|
+
timestampMilliseconds: number,
|
|
185
|
+
): Promise<"OK">;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Set key to hold the string value only if key does not exist
|
|
189
|
+
* @param key The key to set
|
|
190
|
+
* @param value The value to set
|
|
191
|
+
* @param nx Only set the key if it does not already exist
|
|
192
|
+
* @returns Promise that resolves with "OK" on success, or null if the key already exists
|
|
193
|
+
*/
|
|
194
|
+
set(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob, nx: "NX"): Promise<"OK" | null>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Set key to hold the string value only if key already exists
|
|
198
|
+
* @param key The key to set
|
|
199
|
+
* @param value The value to set
|
|
200
|
+
* @param xx Only set the key if it already exists
|
|
201
|
+
* @returns Promise that resolves with "OK" on success, or null if the key does not exist
|
|
202
|
+
*/
|
|
203
|
+
set(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob, xx: "XX"): Promise<"OK" | null>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Set key to hold the string value and return the old value
|
|
207
|
+
* @param key The key to set
|
|
208
|
+
* @param value The value to set
|
|
209
|
+
* @param get Return the old string stored at key, or null if key did not exist
|
|
210
|
+
* @returns Promise that resolves with the old value, or null if key did not exist
|
|
211
|
+
*/
|
|
212
|
+
set(
|
|
213
|
+
key: string | ArrayBufferView | Blob,
|
|
214
|
+
value: string | ArrayBufferView | Blob,
|
|
215
|
+
get: "GET",
|
|
216
|
+
): Promise<string | null>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Set key to hold the string value and retain the time to live
|
|
220
|
+
* @param key The key to set
|
|
221
|
+
* @param value The value to set
|
|
222
|
+
* @param keepttl Retain the time to live associated with the key
|
|
223
|
+
* @returns Promise that resolves with "OK" on success
|
|
224
|
+
*/
|
|
225
|
+
set(
|
|
226
|
+
key: string | ArrayBufferView | Blob,
|
|
227
|
+
value: string | ArrayBufferView | Blob,
|
|
228
|
+
keepttl: "KEEPTTL",
|
|
229
|
+
): Promise<"OK">;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Set key to hold the string value with various options
|
|
233
|
+
* @param key The key to set
|
|
234
|
+
* @param value The value to set
|
|
235
|
+
* @param options Array of options (EX, PX, EXAT, PXAT, NX, XX, KEEPTTL, GET)
|
|
236
|
+
* @returns Promise that resolves with "OK" on success, null if NX/XX condition not met, or the old value if GET is specified
|
|
237
|
+
*/
|
|
238
|
+
set(
|
|
239
|
+
key: string | ArrayBufferView | Blob,
|
|
240
|
+
value: string | ArrayBufferView | Blob,
|
|
241
|
+
...options: string[]
|
|
242
|
+
): Promise<"OK" | string | null>;
|
|
130
243
|
|
|
131
244
|
/**
|
|
132
245
|
* Delete a key
|
|
133
246
|
* @param key The key to delete
|
|
134
247
|
* @returns Promise that resolves with the number of keys removed
|
|
135
248
|
*/
|
|
136
|
-
del(key: string |
|
|
249
|
+
del(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
137
250
|
|
|
138
251
|
/**
|
|
139
252
|
* Increment the integer value of a key by one
|
|
140
253
|
* @param key The key to increment
|
|
141
254
|
* @returns Promise that resolves with the new value
|
|
142
255
|
*/
|
|
143
|
-
incr(key: string |
|
|
256
|
+
incr(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
144
257
|
|
|
145
258
|
/**
|
|
146
259
|
* Decrement the integer value of a key by one
|
|
147
260
|
* @param key The key to decrement
|
|
148
261
|
* @returns Promise that resolves with the new value
|
|
149
262
|
*/
|
|
150
|
-
decr(key: string |
|
|
263
|
+
decr(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
151
264
|
|
|
152
265
|
/**
|
|
153
266
|
* Determine if a key exists
|
|
154
267
|
* @param key The key to check
|
|
155
268
|
* @returns Promise that resolves with true if the key exists, false otherwise
|
|
156
269
|
*/
|
|
157
|
-
exists(key: string |
|
|
270
|
+
exists(key: string | ArrayBufferView | Blob): Promise<boolean>;
|
|
158
271
|
|
|
159
272
|
/**
|
|
160
273
|
* Set a key's time to live in seconds
|
|
@@ -162,14 +275,14 @@ declare module "bun" {
|
|
|
162
275
|
* @param seconds The number of seconds until expiration
|
|
163
276
|
* @returns Promise that resolves with 1 if the timeout was set, 0 if not
|
|
164
277
|
*/
|
|
165
|
-
expire(key: string |
|
|
278
|
+
expire(key: string | ArrayBufferView | Blob, seconds: number): Promise<number>;
|
|
166
279
|
|
|
167
280
|
/**
|
|
168
281
|
* Get the time to live for a key in seconds
|
|
169
282
|
* @param key The key to get the TTL for
|
|
170
283
|
* @returns Promise that resolves with the TTL, -1 if no expiry, or -2 if key doesn't exist
|
|
171
284
|
*/
|
|
172
|
-
ttl(key: string |
|
|
285
|
+
ttl(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
173
286
|
|
|
174
287
|
/**
|
|
175
288
|
* Set multiple hash fields to multiple values
|
|
@@ -177,7 +290,7 @@ declare module "bun" {
|
|
|
177
290
|
* @param fieldValues An array of alternating field names and values
|
|
178
291
|
* @returns Promise that resolves with "OK" on success
|
|
179
292
|
*/
|
|
180
|
-
hmset(key: string |
|
|
293
|
+
hmset(key: string | ArrayBufferView | Blob, fieldValues: string[]): Promise<string>;
|
|
181
294
|
|
|
182
295
|
/**
|
|
183
296
|
* Get the values of all the given hash fields
|
|
@@ -185,7 +298,7 @@ declare module "bun" {
|
|
|
185
298
|
* @param fields The fields to get
|
|
186
299
|
* @returns Promise that resolves with an array of values
|
|
187
300
|
*/
|
|
188
|
-
hmget(key: string |
|
|
301
|
+
hmget(key: string | ArrayBufferView | Blob, fields: string[]): Promise<Array<string | null>>;
|
|
189
302
|
|
|
190
303
|
/**
|
|
191
304
|
* Check if a value is a member of a set
|
|
@@ -193,7 +306,7 @@ declare module "bun" {
|
|
|
193
306
|
* @param member The member to check
|
|
194
307
|
* @returns Promise that resolves with true if the member exists, false otherwise
|
|
195
308
|
*/
|
|
196
|
-
sismember(key: string |
|
|
309
|
+
sismember(key: string | ArrayBufferView | Blob, member: string): Promise<boolean>;
|
|
197
310
|
|
|
198
311
|
/**
|
|
199
312
|
* Add a member to a set
|
|
@@ -201,7 +314,7 @@ declare module "bun" {
|
|
|
201
314
|
* @param member The member to add
|
|
202
315
|
* @returns Promise that resolves with 1 if the member was added, 0 if it already existed
|
|
203
316
|
*/
|
|
204
|
-
sadd(key: string |
|
|
317
|
+
sadd(key: string | ArrayBufferView | Blob, member: string): Promise<number>;
|
|
205
318
|
|
|
206
319
|
/**
|
|
207
320
|
* Remove a member from a set
|
|
@@ -209,28 +322,28 @@ declare module "bun" {
|
|
|
209
322
|
* @param member The member to remove
|
|
210
323
|
* @returns Promise that resolves with 1 if the member was removed, 0 if it didn't exist
|
|
211
324
|
*/
|
|
212
|
-
srem(key: string |
|
|
325
|
+
srem(key: string | ArrayBufferView | Blob, member: string): Promise<number>;
|
|
213
326
|
|
|
214
327
|
/**
|
|
215
328
|
* Get all the members in a set
|
|
216
329
|
* @param key The set key
|
|
217
330
|
* @returns Promise that resolves with an array of all members
|
|
218
331
|
*/
|
|
219
|
-
smembers(key: string |
|
|
332
|
+
smembers(key: string | ArrayBufferView | Blob): Promise<string[]>;
|
|
220
333
|
|
|
221
334
|
/**
|
|
222
335
|
* Get a random member from a set
|
|
223
336
|
* @param key The set key
|
|
224
337
|
* @returns Promise that resolves with a random member, or null if the set is empty
|
|
225
338
|
*/
|
|
226
|
-
srandmember(key: string |
|
|
339
|
+
srandmember(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
227
340
|
|
|
228
341
|
/**
|
|
229
342
|
* Remove and return a random member from a set
|
|
230
343
|
* @param key The set key
|
|
231
344
|
* @returns Promise that resolves with the removed member, or null if the set is empty
|
|
232
345
|
*/
|
|
233
|
-
spop(key: string |
|
|
346
|
+
spop(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
234
347
|
|
|
235
348
|
/**
|
|
236
349
|
* Increment the integer value of a hash field by the given number
|
|
@@ -239,7 +352,7 @@ declare module "bun" {
|
|
|
239
352
|
* @param increment The amount to increment by
|
|
240
353
|
* @returns Promise that resolves with the new value
|
|
241
354
|
*/
|
|
242
|
-
hincrby(key: string |
|
|
355
|
+
hincrby(key: string | ArrayBufferView | Blob, field: string, increment: string | number): Promise<number>;
|
|
243
356
|
|
|
244
357
|
/**
|
|
245
358
|
* Increment the float value of a hash field by the given amount
|
|
@@ -248,35 +361,35 @@ declare module "bun" {
|
|
|
248
361
|
* @param increment The amount to increment by
|
|
249
362
|
* @returns Promise that resolves with the new value as a string
|
|
250
363
|
*/
|
|
251
|
-
hincrbyfloat(key: string |
|
|
364
|
+
hincrbyfloat(key: string | ArrayBufferView | Blob, field: string, increment: string | number): Promise<string>;
|
|
252
365
|
|
|
253
366
|
/**
|
|
254
367
|
* Get all the fields and values in a hash
|
|
255
368
|
* @param key The hash key
|
|
256
369
|
* @returns Promise that resolves with an object containing all fields and values
|
|
257
370
|
*/
|
|
258
|
-
hgetall(key: string |
|
|
371
|
+
hgetall(key: string | ArrayBufferView | Blob): Promise<Record<string, string> | null>;
|
|
259
372
|
|
|
260
373
|
/**
|
|
261
374
|
* Get all field names in a hash
|
|
262
375
|
* @param key The hash key
|
|
263
376
|
* @returns Promise that resolves with an array of field names
|
|
264
377
|
*/
|
|
265
|
-
hkeys(key: string |
|
|
378
|
+
hkeys(key: string | ArrayBufferView | Blob): Promise<string[]>;
|
|
266
379
|
|
|
267
380
|
/**
|
|
268
381
|
* Get the number of fields in a hash
|
|
269
382
|
* @param key The hash key
|
|
270
383
|
* @returns Promise that resolves with the number of fields
|
|
271
384
|
*/
|
|
272
|
-
hlen(key: string |
|
|
385
|
+
hlen(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
273
386
|
|
|
274
387
|
/**
|
|
275
388
|
* Get all values in a hash
|
|
276
389
|
* @param key The hash key
|
|
277
390
|
* @returns Promise that resolves with an array of values
|
|
278
391
|
*/
|
|
279
|
-
hvals(key: string |
|
|
392
|
+
hvals(key: string | ArrayBufferView | Blob): Promise<string[]>;
|
|
280
393
|
|
|
281
394
|
/**
|
|
282
395
|
* Find all keys matching the given pattern
|
|
@@ -290,84 +403,84 @@ declare module "bun" {
|
|
|
290
403
|
* @param key The list key
|
|
291
404
|
* @returns Promise that resolves with the length of the list
|
|
292
405
|
*/
|
|
293
|
-
llen(key: string |
|
|
406
|
+
llen(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
294
407
|
|
|
295
408
|
/**
|
|
296
409
|
* Remove and get the first element in a list
|
|
297
410
|
* @param key The list key
|
|
298
411
|
* @returns Promise that resolves with the first element, or null if the list is empty
|
|
299
412
|
*/
|
|
300
|
-
lpop(key: string |
|
|
413
|
+
lpop(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
301
414
|
|
|
302
415
|
/**
|
|
303
416
|
* Remove the expiration from a key
|
|
304
417
|
* @param key The key to persist
|
|
305
418
|
* @returns Promise that resolves with 1 if the timeout was removed, 0 if the key doesn't exist or has no timeout
|
|
306
419
|
*/
|
|
307
|
-
persist(key: string |
|
|
420
|
+
persist(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
308
421
|
|
|
309
422
|
/**
|
|
310
423
|
* Get the expiration time of a key as a UNIX timestamp in milliseconds
|
|
311
424
|
* @param key The key to check
|
|
312
425
|
* @returns Promise that resolves with the timestamp, or -1 if the key has no expiration, or -2 if the key doesn't exist
|
|
313
426
|
*/
|
|
314
|
-
pexpiretime(key: string |
|
|
427
|
+
pexpiretime(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
315
428
|
|
|
316
429
|
/**
|
|
317
430
|
* Get the time to live for a key in milliseconds
|
|
318
431
|
* @param key The key to check
|
|
319
432
|
* @returns Promise that resolves with the TTL in milliseconds, or -1 if the key has no expiration, or -2 if the key doesn't exist
|
|
320
433
|
*/
|
|
321
|
-
pttl(key: string |
|
|
434
|
+
pttl(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
322
435
|
|
|
323
436
|
/**
|
|
324
437
|
* Remove and get the last element in a list
|
|
325
438
|
* @param key The list key
|
|
326
439
|
* @returns Promise that resolves with the last element, or null if the list is empty
|
|
327
440
|
*/
|
|
328
|
-
rpop(key: string |
|
|
441
|
+
rpop(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
329
442
|
|
|
330
443
|
/**
|
|
331
444
|
* Get the number of members in a set
|
|
332
445
|
* @param key The set key
|
|
333
446
|
* @returns Promise that resolves with the cardinality (number of elements) of the set
|
|
334
447
|
*/
|
|
335
|
-
scard(key: string |
|
|
448
|
+
scard(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
336
449
|
|
|
337
450
|
/**
|
|
338
451
|
* Get the length of the value stored in a key
|
|
339
452
|
* @param key The key to check
|
|
340
453
|
* @returns Promise that resolves with the length of the string value, or 0 if the key doesn't exist
|
|
341
454
|
*/
|
|
342
|
-
strlen(key: string |
|
|
455
|
+
strlen(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
343
456
|
|
|
344
457
|
/**
|
|
345
458
|
* Get the number of members in a sorted set
|
|
346
459
|
* @param key The sorted set key
|
|
347
460
|
* @returns Promise that resolves with the cardinality (number of elements) of the sorted set
|
|
348
461
|
*/
|
|
349
|
-
zcard(key: string |
|
|
462
|
+
zcard(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
350
463
|
|
|
351
464
|
/**
|
|
352
465
|
* Remove and return members with the highest scores in a sorted set
|
|
353
466
|
* @param key The sorted set key
|
|
354
467
|
* @returns Promise that resolves with the removed member and its score, or null if the set is empty
|
|
355
468
|
*/
|
|
356
|
-
zpopmax(key: string |
|
|
469
|
+
zpopmax(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
357
470
|
|
|
358
471
|
/**
|
|
359
472
|
* Remove and return members with the lowest scores in a sorted set
|
|
360
473
|
* @param key The sorted set key
|
|
361
474
|
* @returns Promise that resolves with the removed member and its score, or null if the set is empty
|
|
362
475
|
*/
|
|
363
|
-
zpopmin(key: string |
|
|
476
|
+
zpopmin(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
364
477
|
|
|
365
478
|
/**
|
|
366
479
|
* Get one or multiple random members from a sorted set
|
|
367
480
|
* @param key The sorted set key
|
|
368
481
|
* @returns Promise that resolves with a random member, or null if the set is empty
|
|
369
482
|
*/
|
|
370
|
-
zrandmember(key: string |
|
|
483
|
+
zrandmember(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
371
484
|
|
|
372
485
|
/**
|
|
373
486
|
* Append a value to a key
|
|
@@ -375,7 +488,7 @@ declare module "bun" {
|
|
|
375
488
|
* @param value The value to append
|
|
376
489
|
* @returns Promise that resolves with the length of the string after the append operation
|
|
377
490
|
*/
|
|
378
|
-
append(key: string |
|
|
491
|
+
append(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
379
492
|
|
|
380
493
|
/**
|
|
381
494
|
* Set the value of a key and return its old value
|
|
@@ -383,7 +496,7 @@ declare module "bun" {
|
|
|
383
496
|
* @param value The value to set
|
|
384
497
|
* @returns Promise that resolves with the old value, or null if the key didn't exist
|
|
385
498
|
*/
|
|
386
|
-
getset(key: string |
|
|
499
|
+
getset(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
387
500
|
|
|
388
501
|
/**
|
|
389
502
|
* Prepend one or multiple values to a list
|
|
@@ -391,7 +504,7 @@ declare module "bun" {
|
|
|
391
504
|
* @param value The value to prepend
|
|
392
505
|
* @returns Promise that resolves with the length of the list after the push operation
|
|
393
506
|
*/
|
|
394
|
-
lpush(key: string |
|
|
507
|
+
lpush(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
395
508
|
|
|
396
509
|
/**
|
|
397
510
|
* Prepend a value to a list, only if the list exists
|
|
@@ -399,7 +512,7 @@ declare module "bun" {
|
|
|
399
512
|
* @param value The value to prepend
|
|
400
513
|
* @returns Promise that resolves with the length of the list after the push operation, or 0 if the list doesn't exist
|
|
401
514
|
*/
|
|
402
|
-
lpushx(key: string |
|
|
515
|
+
lpushx(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
403
516
|
|
|
404
517
|
/**
|
|
405
518
|
* Add one or more members to a HyperLogLog
|
|
@@ -407,7 +520,7 @@ declare module "bun" {
|
|
|
407
520
|
* @param element The element to add
|
|
408
521
|
* @returns Promise that resolves with 1 if the HyperLogLog was altered, 0 otherwise
|
|
409
522
|
*/
|
|
410
|
-
pfadd(key: string |
|
|
523
|
+
pfadd(key: string | ArrayBufferView | Blob, element: string): Promise<number>;
|
|
411
524
|
|
|
412
525
|
/**
|
|
413
526
|
* Append one or multiple values to a list
|
|
@@ -415,7 +528,7 @@ declare module "bun" {
|
|
|
415
528
|
* @param value The value to append
|
|
416
529
|
* @returns Promise that resolves with the length of the list after the push operation
|
|
417
530
|
*/
|
|
418
|
-
rpush(key: string |
|
|
531
|
+
rpush(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
419
532
|
|
|
420
533
|
/**
|
|
421
534
|
* Append a value to a list, only if the list exists
|
|
@@ -423,7 +536,7 @@ declare module "bun" {
|
|
|
423
536
|
* @param value The value to append
|
|
424
537
|
* @returns Promise that resolves with the length of the list after the push operation, or 0 if the list doesn't exist
|
|
425
538
|
*/
|
|
426
|
-
rpushx(key: string |
|
|
539
|
+
rpushx(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
427
540
|
|
|
428
541
|
/**
|
|
429
542
|
* Set the value of a key, only if the key does not exist
|
|
@@ -431,7 +544,7 @@ declare module "bun" {
|
|
|
431
544
|
* @param value The value to set
|
|
432
545
|
* @returns Promise that resolves with 1 if the key was set, 0 if the key was not set
|
|
433
546
|
*/
|
|
434
|
-
setnx(key: string |
|
|
547
|
+
setnx(key: string | ArrayBufferView | Blob, value: string | ArrayBufferView | Blob): Promise<number>;
|
|
435
548
|
|
|
436
549
|
/**
|
|
437
550
|
* Get the score associated with the given member in a sorted set
|
|
@@ -439,49 +552,49 @@ declare module "bun" {
|
|
|
439
552
|
* @param member The member to get the score for
|
|
440
553
|
* @returns Promise that resolves with the score of the member as a string, or null if the member or key doesn't exist
|
|
441
554
|
*/
|
|
442
|
-
zscore(key: string |
|
|
555
|
+
zscore(key: string | ArrayBufferView | Blob, member: string): Promise<string | null>;
|
|
443
556
|
|
|
444
557
|
/**
|
|
445
558
|
* Get the values of all specified keys
|
|
446
559
|
* @param keys The keys to get
|
|
447
560
|
* @returns Promise that resolves with an array of values, with null for keys that don't exist
|
|
448
561
|
*/
|
|
449
|
-
mget(...keys: (string |
|
|
562
|
+
mget(...keys: (string | ArrayBufferView | Blob)[]): Promise<(string | null)[]>;
|
|
450
563
|
|
|
451
564
|
/**
|
|
452
565
|
* Count the number of set bits (population counting) in a string
|
|
453
566
|
* @param key The key to count bits in
|
|
454
567
|
* @returns Promise that resolves with the number of bits set to 1
|
|
455
568
|
*/
|
|
456
|
-
bitcount(key: string |
|
|
569
|
+
bitcount(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
457
570
|
|
|
458
571
|
/**
|
|
459
572
|
* Return a serialized version of the value stored at the specified key
|
|
460
573
|
* @param key The key to dump
|
|
461
574
|
* @returns Promise that resolves with the serialized value, or null if the key doesn't exist
|
|
462
575
|
*/
|
|
463
|
-
dump(key: string |
|
|
576
|
+
dump(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
464
577
|
|
|
465
578
|
/**
|
|
466
579
|
* Get the expiration time of a key as a UNIX timestamp in seconds
|
|
467
580
|
* @param key The key to check
|
|
468
581
|
* @returns Promise that resolves with the timestamp, or -1 if the key has no expiration, or -2 if the key doesn't exist
|
|
469
582
|
*/
|
|
470
|
-
expiretime(key: string |
|
|
583
|
+
expiretime(key: string | ArrayBufferView | Blob): Promise<number>;
|
|
471
584
|
|
|
472
585
|
/**
|
|
473
586
|
* Get the value of a key and delete the key
|
|
474
587
|
* @param key The key to get and delete
|
|
475
588
|
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
|
|
476
589
|
*/
|
|
477
|
-
getdel(key: string |
|
|
590
|
+
getdel(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
478
591
|
|
|
479
592
|
/**
|
|
480
593
|
* Get the value of a key and optionally set its expiration
|
|
481
594
|
* @param key The key to get
|
|
482
595
|
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
|
|
483
596
|
*/
|
|
484
|
-
getex(key: string |
|
|
597
|
+
getex(key: string | ArrayBufferView | Blob): Promise<string | null>;
|
|
485
598
|
}
|
|
486
599
|
|
|
487
600
|
/**
|