UNPKG

383 kBTypeScriptView Raw
1/**
2 * This file is generated by @ioredis/interface-generator.
3 * Don't edit it manually. Instead, run `npm run generate` to update
4 * this file.
5 */
6/// <reference types="node" />
7import { Callback } from "../types";
8export declare type RedisKey = string | Buffer;
9export declare type RedisValue = string | Buffer | number;
10export interface ResultTypes<Result, Context> {
11 default: Promise<Result>;
12 pipeline: ChainableCommander;
13}
14export interface ChainableCommander extends RedisCommander<{
15 type: "pipeline";
16}> {
17 length: number;
18}
19export declare type ClientContext = {
20 type: keyof ResultTypes<unknown, unknown>;
21};
22export declare type Result<T, Context extends ClientContext> = ResultTypes<T, Context>[Context["type"]];
23interface RedisCommander<Context extends ClientContext = {
24 type: "default";
25}> {
26 /**
27 * Call arbitrary commands.
28 *
29 * `redis.call('set', 'foo', 'bar')` is the same as `redis.set('foo', 'bar')`,
30 * so the only case you need to use this method is when the command is not
31 * supported by ioredis.
32 *
33 * ```ts
34 * redis.call('set', 'foo', 'bar');
35 * redis.call('get', 'foo', (err, value) => {
36 * // value === 'bar'
37 * });
38 * ```
39 */
40 call(command: string, callback?: Callback<unknown>): Result<unknown, Context>;
41 call(command: string, args: (string | Buffer | number)[], callback?: Callback<unknown>): Result<unknown, Context>;
42 call(...args: [
43 command: string,
44 ...args: (string | Buffer | number)[],
45 callback: Callback<unknown>
46 ]): Result<unknown, Context>;
47 call(...args: [command: string, ...args: (string | Buffer | number)[]]): Result<unknown, Context>;
48 callBuffer(command: string, callback?: Callback<unknown>): Result<unknown, Context>;
49 callBuffer(command: string, args: (string | Buffer | number)[], callback?: Callback<unknown>): Result<unknown, Context>;
50 callBuffer(...args: [
51 command: string,
52 ...args: (string | Buffer | number)[],
53 callback: Callback<unknown>
54 ]): Result<unknown, Context>;
55 callBuffer(...args: [command: string, ...args: (string | Buffer | number)[]]): Result<unknown, Context>;
56 /**
57 * List the ACL categories or the commands inside a category
58 * - _group_: server
59 * - _complexity_: O(1) since the categories and commands are a fixed set.
60 * - _since_: 6.0.0
61 */
62 acl(subcommand: "CAT", callback?: Callback<unknown>): Result<unknown, Context>;
63 acl(subcommand: "CAT", categoryname: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>;
64 /**
65 * Remove the specified ACL users and the associated rules
66 * - _group_: server
67 * - _complexity_: O(1) amortized time considering the typical user.
68 * - _since_: 6.0.0
69 */
70 acl(...args: [
71 subcommand: "DELUSER",
72 ...usernames: (string | Buffer)[],
73 callback: Callback<number>
74 ]): Result<number, Context>;
75 acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]): Result<number, Context>;
76 /**
77 * Returns whether the user can execute the given command without executing the command.
78 * - _group_: server
79 * - _complexity_: O(1).
80 * - _since_: 7.0.0
81 */
82 acl(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<string>): Result<string, Context>;
83 aclBuffer(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
84 acl(...args: [
85 subcommand: "DRYRUN",
86 username: string | Buffer,
87 command: string | Buffer,
88 ...args: (string | Buffer | number)[],
89 callback: Callback<string>
90 ]): Result<string, Context>;
91 aclBuffer(...args: [
92 subcommand: "DRYRUN",
93 username: string | Buffer,
94 command: string | Buffer,
95 ...args: (string | Buffer | number)[],
96 callback: Callback<Buffer>
97 ]): Result<Buffer, Context>;
98 acl(...args: [
99 subcommand: "DRYRUN",
100 username: string | Buffer,
101 command: string | Buffer,
102 ...args: (string | Buffer | number)[]
103 ]): Result<string, Context>;
104 aclBuffer(...args: [
105 subcommand: "DRYRUN",
106 username: string | Buffer,
107 command: string | Buffer,
108 ...args: (string | Buffer | number)[]
109 ]): Result<Buffer, Context>;
110 /**
111 * Generate a pseudorandom secure password to use for ACL users
112 * - _group_: server
113 * - _complexity_: O(1)
114 * - _since_: 6.0.0
115 */
116 acl(subcommand: "GENPASS", callback?: Callback<string>): Result<string, Context>;
117 aclBuffer(subcommand: "GENPASS", callback?: Callback<Buffer>): Result<Buffer, Context>;
118 acl(subcommand: "GENPASS", bits: number | string, callback?: Callback<string>): Result<string, Context>;
119 aclBuffer(subcommand: "GENPASS", bits: number | string, callback?: Callback<Buffer>): Result<Buffer, Context>;
120 /**
121 * Get the rules for a specific ACL user
122 * - _group_: server
123 * - _complexity_: O(N). Where N is the number of password, command and pattern rules that the user has.
124 * - _since_: 6.0.0
125 */
126 acl(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<string[] | null>): Result<string[] | null, Context>;
127 aclBuffer(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<Buffer[] | null>): Result<Buffer[] | null, Context>;
128 /**
129 * Show helpful text about the different subcommands
130 * - _group_: server
131 * - _complexity_: O(1)
132 * - _since_: 6.0.0
133 */
134 acl(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
135 /**
136 * List the current ACL rules in ACL config file format
137 * - _group_: server
138 * - _complexity_: O(N). Where N is the number of configured users.
139 * - _since_: 6.0.0
140 */
141 acl(subcommand: "LIST", callback?: Callback<string[]>): Result<string[], Context>;
142 aclBuffer(subcommand: "LIST", callback?: Callback<Buffer[]>): Result<Buffer[], Context>;
143 /**
144 * Reload the ACLs from the configured ACL file
145 * - _group_: server
146 * - _complexity_: O(N). Where N is the number of configured users.
147 * - _since_: 6.0.0
148 */
149 acl(subcommand: "LOAD", callback?: Callback<"OK">): Result<"OK", Context>;
150 /**
151 * List latest events denied because of ACLs in place
152 * - _group_: server
153 * - _complexity_: O(N) with N being the number of entries shown.
154 * - _since_: 6.0.0
155 */
156 acl(subcommand: "LOG", callback?: Callback<unknown>): Result<unknown, Context>;
157 acl(subcommand: "LOG", count: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
158 acl(subcommand: "LOG", reset: "RESET", callback?: Callback<unknown>): Result<unknown, Context>;
159 /**
160 * Save the current ACL rules in the configured ACL file
161 * - _group_: server
162 * - _complexity_: O(N). Where N is the number of configured users.
163 * - _since_: 6.0.0
164 */
165 acl(subcommand: "SAVE", callback?: Callback<"OK">): Result<"OK", Context>;
166 /**
167 * Modify or create the rules for a specific ACL user
168 * - _group_: server
169 * - _complexity_: O(N). Where N is the number of rules provided.
170 * - _since_: 6.0.0
171 */
172 acl(subcommand: "SETUSER", username: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
173 acl(...args: [
174 subcommand: "SETUSER",
175 username: string | Buffer,
176 ...rules: (string | Buffer)[],
177 callback: Callback<"OK">
178 ]): Result<"OK", Context>;
179 acl(...args: [
180 subcommand: "SETUSER",
181 username: string | Buffer,
182 ...rules: (string | Buffer)[]
183 ]): Result<"OK", Context>;
184 /**
185 * List the username of all the configured ACL rules
186 * - _group_: server
187 * - _complexity_: O(N). Where N is the number of configured users.
188 * - _since_: 6.0.0
189 */
190 acl(subcommand: "USERS", callback?: Callback<string[]>): Result<string[], Context>;
191 aclBuffer(subcommand: "USERS", callback?: Callback<Buffer[]>): Result<Buffer[], Context>;
192 /**
193 * Return the name of the user associated to the current connection
194 * - _group_: server
195 * - _complexity_: O(1)
196 * - _since_: 6.0.0
197 */
198 acl(subcommand: "WHOAMI", callback?: Callback<string>): Result<string, Context>;
199 aclBuffer(subcommand: "WHOAMI", callback?: Callback<Buffer>): Result<Buffer, Context>;
200 /**
201 * Append a value to a key
202 * - _group_: string
203 * - _complexity_: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
204 * - _since_: 2.0.0
205 */
206 append(key: RedisKey, value: string | Buffer | number, callback?: Callback<number>): Result<number, Context>;
207 /**
208 * Sent by cluster clients after an -ASK redirect
209 * - _group_: cluster
210 * - _complexity_: O(1)
211 * - _since_: 3.0.0
212 */
213 asking(callback?: Callback<"OK">): Result<"OK", Context>;
214 /**
215 * Authenticate to the server
216 * - _group_: connection
217 * - _complexity_: O(N) where N is the number of passwords defined for the user
218 * - _since_: 1.0.0
219 */
220 auth(password: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
221 auth(username: string | Buffer, password: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
222 /**
223 * Asynchronously rewrite the append-only file
224 * - _group_: server
225 * - _complexity_: O(1)
226 * - _since_: 1.0.0
227 */
228 bgrewriteaof(callback?: Callback<string>): Result<string, Context>;
229 bgrewriteaofBuffer(callback?: Callback<Buffer>): Result<Buffer, Context>;
230 /**
231 * Asynchronously save the dataset to disk
232 * - _group_: server
233 * - _complexity_: O(1)
234 * - _since_: 1.0.0
235 */
236 bgsave(callback?: Callback<"OK">): Result<"OK", Context>;
237 bgsave(schedule: "SCHEDULE", callback?: Callback<"OK">): Result<"OK", Context>;
238 /**
239 * Count set bits in a string
240 * - _group_: bitmap
241 * - _complexity_: O(N)
242 * - _since_: 2.6.0
243 */
244 bitcount(key: RedisKey, callback?: Callback<number>): Result<number, Context>;
245 bitcount(key: RedisKey, start: number | string, end: number | string, callback?: Callback<number>): Result<number, Context>;
246 bitcount(key: RedisKey, start: number | string, end: number | string, byte: "BYTE", callback?: Callback<number>): Result<number, Context>;
247 bitcount(key: RedisKey, start: number | string, end: number | string, bit: "BIT", callback?: Callback<number>): Result<number, Context>;
248 /**
249 * Perform arbitrary bitfield integer operations on strings
250 * - _group_: bitmap
251 * - _complexity_: O(1) for each subcommand specified
252 * - _since_: 3.2.0
253 */
254 bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
255 bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
256 bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
257 bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
258 bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
259 bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
260 bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
261 bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
262 bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
263 /**
264 * Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD
265 * - _group_: bitmap
266 * - _complexity_: O(1) for each subcommand specified
267 * - _since_: 6.0.0
268 */
269 bitfield_ro(...args: [
270 key: RedisKey,
271 encodingOffsetToken: "GET",
272 ...encodingOffsets: (string | Buffer | number)[],
273 callback: Callback<unknown[]>
274 ]): Result<unknown[], Context>;
275 bitfield_ro(...args: [
276 key: RedisKey,
277 encodingOffsetToken: "GET",
278 ...encodingOffsets: (string | Buffer | number)[]
279 ]): Result<unknown[], Context>;
280 /**
281 * Perform bitwise operations between strings
282 * - _group_: bitmap
283 * - _complexity_: O(N)
284 * - _since_: 2.6.0
285 */
286 bitop(...args: [
287 operation: string | Buffer,
288 destkey: RedisKey,
289 ...keys: RedisKey[],
290 callback: Callback<number>
291 ]): Result<number, Context>;
292 bitop(...args: [
293 operation: string | Buffer,
294 destkey: RedisKey,
295 keys: RedisKey[],
296 callback: Callback<number>
297 ]): Result<number, Context>;
298 bitop(...args: [
299 operation: string | Buffer,
300 destkey: RedisKey,
301 ...keys: RedisKey[]
302 ]): Result<number, Context>;
303 bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>;
304 /**
305 * Find first bit set or clear in a string
306 * - _group_: bitmap
307 * - _complexity_: O(N)
308 * - _since_: 2.8.7
309 */
310 bitpos(key: RedisKey, bit: number | string, callback?: Callback<number>): Result<number, Context>;
311 bitpos(key: RedisKey, bit: number | string, start: number | string, callback?: Callback<number>): Result<number, Context>;
312 bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, callback?: Callback<number>): Result<number, Context>;
313 bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, byte: "BYTE", callback?: Callback<number>): Result<number, Context>;
314 bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, bit1: "BIT", callback?: Callback<number>): Result<number, Context>;
315 /**
316 * Pop an element from a list, push it to another list and return it; or block until one is available
317 * - _group_: list
318 * - _complexity_: O(1)
319 * - _since_: 6.2.0
320 */
321 blmove(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
322 blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
323 blmove(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
324 blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
325 blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
326 blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
327 blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
328 blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
329 /**
330 * Pop elements from a list, or block until one is available
331 * - _group_: list
332 * - _complexity_: O(N+M) where N is the number of provided keys and M is the number of elements returned.
333 * - _since_: 7.0.0
334 */
335 blmpop(...args: [
336 timeout: number | string,
337 numkeys: number | string,
338 ...keys: RedisKey[],
339 left: "LEFT",
340 callback: Callback<[key: string, members: string[]] | null>
341 ]): Result<[key: string, members: string[]] | null, Context>;
342 blmpopBuffer(...args: [
343 timeout: number | string,
344 numkeys: number | string,
345 ...keys: RedisKey[],
346 left: "LEFT",
347 callback: Callback<[key: Buffer, members: Buffer[]] | null>
348 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
349 blmpop(...args: [
350 timeout: number | string,
351 numkeys: number | string,
352 keys: RedisKey[],
353 left: "LEFT",
354 callback: Callback<[key: string, members: string[]] | null>
355 ]): Result<[key: string, members: string[]] | null, Context>;
356 blmpopBuffer(...args: [
357 timeout: number | string,
358 numkeys: number | string,
359 keys: RedisKey[],
360 left: "LEFT",
361 callback: Callback<[key: Buffer, members: Buffer[]] | null>
362 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
363 blmpop(...args: [
364 timeout: number | string,
365 numkeys: number | string,
366 ...keys: RedisKey[],
367 left: "LEFT"
368 ]): Result<[key: string, members: string[]] | null, Context>;
369 blmpopBuffer(...args: [
370 timeout: number | string,
371 numkeys: number | string,
372 ...keys: RedisKey[],
373 left: "LEFT"
374 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
375 blmpop(...args: [
376 timeout: number | string,
377 numkeys: number | string,
378 keys: RedisKey[],
379 left: "LEFT"
380 ]): Result<[key: string, members: string[]] | null, Context>;
381 blmpopBuffer(...args: [
382 timeout: number | string,
383 numkeys: number | string,
384 keys: RedisKey[],
385 left: "LEFT"
386 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
387 blmpop(...args: [
388 timeout: number | string,
389 numkeys: number | string,
390 ...keys: RedisKey[],
391 left: "LEFT",
392 countToken: "COUNT",
393 count: number | string,
394 callback: Callback<[key: string, members: string[]] | null>
395 ]): Result<[key: string, members: string[]] | null, Context>;
396 blmpopBuffer(...args: [
397 timeout: number | string,
398 numkeys: number | string,
399 ...keys: RedisKey[],
400 left: "LEFT",
401 countToken: "COUNT",
402 count: number | string,
403 callback: Callback<[key: Buffer, members: Buffer[]] | null>
404 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
405 blmpop(...args: [
406 timeout: number | string,
407 numkeys: number | string,
408 keys: RedisKey[],
409 left: "LEFT",
410 countToken: "COUNT",
411 count: number | string,
412 callback: Callback<[key: string, members: string[]] | null>
413 ]): Result<[key: string, members: string[]] | null, Context>;
414 blmpopBuffer(...args: [
415 timeout: number | string,
416 numkeys: number | string,
417 keys: RedisKey[],
418 left: "LEFT",
419 countToken: "COUNT",
420 count: number | string,
421 callback: Callback<[key: Buffer, members: Buffer[]] | null>
422 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
423 blmpop(...args: [
424 timeout: number | string,
425 numkeys: number | string,
426 ...keys: RedisKey[],
427 left: "LEFT",
428 countToken: "COUNT",
429 count: number | string
430 ]): Result<[key: string, members: string[]] | null, Context>;
431 blmpopBuffer(...args: [
432 timeout: number | string,
433 numkeys: number | string,
434 ...keys: RedisKey[],
435 left: "LEFT",
436 countToken: "COUNT",
437 count: number | string
438 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
439 blmpop(...args: [
440 timeout: number | string,
441 numkeys: number | string,
442 keys: RedisKey[],
443 left: "LEFT",
444 countToken: "COUNT",
445 count: number | string
446 ]): Result<[key: string, members: string[]] | null, Context>;
447 blmpopBuffer(...args: [
448 timeout: number | string,
449 numkeys: number | string,
450 keys: RedisKey[],
451 left: "LEFT",
452 countToken: "COUNT",
453 count: number | string
454 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
455 blmpop(...args: [
456 timeout: number | string,
457 numkeys: number | string,
458 ...keys: RedisKey[],
459 right: "RIGHT",
460 callback: Callback<[key: string, members: string[]] | null>
461 ]): Result<[key: string, members: string[]] | null, Context>;
462 blmpopBuffer(...args: [
463 timeout: number | string,
464 numkeys: number | string,
465 ...keys: RedisKey[],
466 right: "RIGHT",
467 callback: Callback<[key: Buffer, members: Buffer[]] | null>
468 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
469 blmpop(...args: [
470 timeout: number | string,
471 numkeys: number | string,
472 keys: RedisKey[],
473 right: "RIGHT",
474 callback: Callback<[key: string, members: string[]] | null>
475 ]): Result<[key: string, members: string[]] | null, Context>;
476 blmpopBuffer(...args: [
477 timeout: number | string,
478 numkeys: number | string,
479 keys: RedisKey[],
480 right: "RIGHT",
481 callback: Callback<[key: Buffer, members: Buffer[]] | null>
482 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
483 blmpop(...args: [
484 timeout: number | string,
485 numkeys: number | string,
486 ...keys: RedisKey[],
487 right: "RIGHT"
488 ]): Result<[key: string, members: string[]] | null, Context>;
489 blmpopBuffer(...args: [
490 timeout: number | string,
491 numkeys: number | string,
492 ...keys: RedisKey[],
493 right: "RIGHT"
494 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
495 blmpop(...args: [
496 timeout: number | string,
497 numkeys: number | string,
498 keys: RedisKey[],
499 right: "RIGHT"
500 ]): Result<[key: string, members: string[]] | null, Context>;
501 blmpopBuffer(...args: [
502 timeout: number | string,
503 numkeys: number | string,
504 keys: RedisKey[],
505 right: "RIGHT"
506 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
507 blmpop(...args: [
508 timeout: number | string,
509 numkeys: number | string,
510 ...keys: RedisKey[],
511 right: "RIGHT",
512 countToken: "COUNT",
513 count: number | string,
514 callback: Callback<[key: string, members: string[]] | null>
515 ]): Result<[key: string, members: string[]] | null, Context>;
516 blmpopBuffer(...args: [
517 timeout: number | string,
518 numkeys: number | string,
519 ...keys: RedisKey[],
520 right: "RIGHT",
521 countToken: "COUNT",
522 count: number | string,
523 callback: Callback<[key: Buffer, members: Buffer[]] | null>
524 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
525 blmpop(...args: [
526 timeout: number | string,
527 numkeys: number | string,
528 keys: RedisKey[],
529 right: "RIGHT",
530 countToken: "COUNT",
531 count: number | string,
532 callback: Callback<[key: string, members: string[]] | null>
533 ]): Result<[key: string, members: string[]] | null, Context>;
534 blmpopBuffer(...args: [
535 timeout: number | string,
536 numkeys: number | string,
537 keys: RedisKey[],
538 right: "RIGHT",
539 countToken: "COUNT",
540 count: number | string,
541 callback: Callback<[key: Buffer, members: Buffer[]] | null>
542 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
543 blmpop(...args: [
544 timeout: number | string,
545 numkeys: number | string,
546 ...keys: RedisKey[],
547 right: "RIGHT",
548 countToken: "COUNT",
549 count: number | string
550 ]): Result<[key: string, members: string[]] | null, Context>;
551 blmpopBuffer(...args: [
552 timeout: number | string,
553 numkeys: number | string,
554 ...keys: RedisKey[],
555 right: "RIGHT",
556 countToken: "COUNT",
557 count: number | string
558 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
559 blmpop(...args: [
560 timeout: number | string,
561 numkeys: number | string,
562 keys: RedisKey[],
563 right: "RIGHT",
564 countToken: "COUNT",
565 count: number | string
566 ]): Result<[key: string, members: string[]] | null, Context>;
567 blmpopBuffer(...args: [
568 timeout: number | string,
569 numkeys: number | string,
570 keys: RedisKey[],
571 right: "RIGHT",
572 countToken: "COUNT",
573 count: number | string
574 ]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
575 /**
576 * Remove and get the first element in a list, or block until one is available
577 * - _group_: list
578 * - _complexity_: O(N) where N is the number of provided keys.
579 * - _since_: 2.0.0
580 */
581 blpop(...args: [
582 ...keys: RedisKey[],
583 timeout: number | string,
584 callback: Callback<[string, string] | null>
585 ]): Result<[string, string] | null, Context>;
586 blpopBuffer(...args: [
587 ...keys: RedisKey[],
588 timeout: number | string,
589 callback: Callback<[Buffer, Buffer] | null>
590 ]): Result<[Buffer, Buffer] | null, Context>;
591 blpop(...args: [
592 keys: RedisKey[],
593 timeout: number | string,
594 callback: Callback<[string, string] | null>
595 ]): Result<[string, string] | null, Context>;
596 blpopBuffer(...args: [
597 keys: RedisKey[],
598 timeout: number | string,
599 callback: Callback<[Buffer, Buffer] | null>
600 ]): Result<[Buffer, Buffer] | null, Context>;
601 blpop(...args: [...keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
602 blpopBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
603 blpop(...args: [keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
604 blpopBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
605 /**
606 * Remove and get the last element in a list, or block until one is available
607 * - _group_: list
608 * - _complexity_: O(N) where N is the number of provided keys.
609 * - _since_: 2.0.0
610 */
611 brpop(...args: [
612 ...keys: RedisKey[],
613 timeout: number | string,
614 callback: Callback<[string, string] | null>
615 ]): Result<[string, string] | null, Context>;
616 brpopBuffer(...args: [
617 ...keys: RedisKey[],
618 timeout: number | string,
619 callback: Callback<[Buffer, Buffer] | null>
620 ]): Result<[Buffer, Buffer] | null, Context>;
621 brpop(...args: [
622 keys: RedisKey[],
623 timeout: number | string,
624 callback: Callback<[string, string] | null>
625 ]): Result<[string, string] | null, Context>;
626 brpopBuffer(...args: [
627 keys: RedisKey[],
628 timeout: number | string,
629 callback: Callback<[Buffer, Buffer] | null>
630 ]): Result<[Buffer, Buffer] | null, Context>;
631 brpop(...args: [...keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
632 brpopBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
633 brpop(...args: [keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
634 brpopBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
635 /**
636 * Pop an element from a list, push it to another list and return it; or block until one is available
637 * - _group_: list
638 * - _complexity_: O(1)
639 * - _since_: 2.2.0
640 */
641 brpoplpush(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
642 brpoplpushBuffer(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
643 /**
644 * Remove and return members with scores in a sorted set or block until one is available
645 * - _group_: sorted-set
646 * - _complexity_: O(K) + O(N*log(M)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.
647 * - _since_: 7.0.0
648 */
649 bzmpop(...args: [
650 timeout: number | string,
651 numkeys: number | string,
652 ...keys: RedisKey[],
653 min: "MIN",
654 callback: Callback<unknown>
655 ]): Result<unknown, Context>;
656 bzmpop(...args: [
657 timeout: number | string,
658 numkeys: number | string,
659 keys: RedisKey[],
660 min: "MIN",
661 callback: Callback<unknown>
662 ]): Result<unknown, Context>;
663 bzmpop(...args: [
664 timeout: number | string,
665 numkeys: number | string,
666 ...keys: RedisKey[],
667 min: "MIN"
668 ]): Result<unknown, Context>;
669 bzmpop(...args: [
670 timeout: number | string,
671 numkeys: number | string,
672 keys: RedisKey[],
673 min: "MIN"
674 ]): Result<unknown, Context>;
675 bzmpop(...args: [
676 timeout: number | string,
677 numkeys: number | string,
678 ...keys: RedisKey[],
679 min: "MIN",
680 countToken: "COUNT",
681 count: number | string,
682 callback: Callback<unknown>
683 ]): Result<unknown, Context>;
684 bzmpop(...args: [
685 timeout: number | string,
686 numkeys: number | string,
687 keys: RedisKey[],
688 min: "MIN",
689 countToken: "COUNT",
690 count: number | string,
691 callback: Callback<unknown>
692 ]): Result<unknown, Context>;
693 bzmpop(...args: [
694 timeout: number | string,
695 numkeys: number | string,
696 ...keys: RedisKey[],
697 min: "MIN",
698 countToken: "COUNT",
699 count: number | string
700 ]): Result<unknown, Context>;
701 bzmpop(...args: [
702 timeout: number | string,
703 numkeys: number | string,
704 keys: RedisKey[],
705 min: "MIN",
706 countToken: "COUNT",
707 count: number | string
708 ]): Result<unknown, Context>;
709 bzmpop(...args: [
710 timeout: number | string,
711 numkeys: number | string,
712 ...keys: RedisKey[],
713 max: "MAX",
714 callback: Callback<unknown>
715 ]): Result<unknown, Context>;
716 bzmpop(...args: [
717 timeout: number | string,
718 numkeys: number | string,
719 keys: RedisKey[],
720 max: "MAX",
721 callback: Callback<unknown>
722 ]): Result<unknown, Context>;
723 bzmpop(...args: [
724 timeout: number | string,
725 numkeys: number | string,
726 ...keys: RedisKey[],
727 max: "MAX"
728 ]): Result<unknown, Context>;
729 bzmpop(...args: [
730 timeout: number | string,
731 numkeys: number | string,
732 keys: RedisKey[],
733 max: "MAX"
734 ]): Result<unknown, Context>;
735 bzmpop(...args: [
736 timeout: number | string,
737 numkeys: number | string,
738 ...keys: RedisKey[],
739 max: "MAX",
740 countToken: "COUNT",
741 count: number | string,
742 callback: Callback<unknown>
743 ]): Result<unknown, Context>;
744 bzmpop(...args: [
745 timeout: number | string,
746 numkeys: number | string,
747 keys: RedisKey[],
748 max: "MAX",
749 countToken: "COUNT",
750 count: number | string,
751 callback: Callback<unknown>
752 ]): Result<unknown, Context>;
753 bzmpop(...args: [
754 timeout: number | string,
755 numkeys: number | string,
756 ...keys: RedisKey[],
757 max: "MAX",
758 countToken: "COUNT",
759 count: number | string
760 ]): Result<unknown, Context>;
761 bzmpop(...args: [
762 timeout: number | string,
763 numkeys: number | string,
764 keys: RedisKey[],
765 max: "MAX",
766 countToken: "COUNT",
767 count: number | string
768 ]): Result<unknown, Context>;
769 /**
770 * Remove and return the member with the highest score from one or more sorted sets, or block until one is available
771 * - _group_: sorted-set
772 * - _complexity_: O(log(N)) with N being the number of elements in the sorted set.
773 * - _since_: 5.0.0
774 */
775 bzpopmax(...args: [
776 ...keys: RedisKey[],
777 timeout: number | string,
778 callback: Callback<[key: string, member: string, score: string] | null>
779 ]): Result<[key: string, member: string, score: string] | null, Context>;
780 bzpopmaxBuffer(...args: [
781 ...keys: RedisKey[],
782 timeout: number | string,
783 callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
784 ]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
785 bzpopmax(...args: [
786 keys: RedisKey[],
787 timeout: number | string,
788 callback: Callback<[key: string, member: string, score: string] | null>
789 ]): Result<[key: string, member: string, score: string] | null, Context>;
790 bzpopmaxBuffer(...args: [
791 keys: RedisKey[],
792 timeout: number | string,
793 callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
794 ]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
795 bzpopmax(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
796 bzpopmaxBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
797 bzpopmax(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
798 bzpopmaxBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
799 /**
800 * Remove and return the member with the lowest score from one or more sorted sets, or block until one is available
801 * - _group_: sorted-set
802 * - _complexity_: O(log(N)) with N being the number of elements in the sorted set.
803 * - _since_: 5.0.0
804 */
805 bzpopmin(...args: [
806 ...keys: RedisKey[],
807 timeout: number | string,
808 callback: Callback<[key: string, member: string, score: string] | null>
809 ]): Result<[key: string, member: string, score: string] | null, Context>;
810 bzpopminBuffer(...args: [
811 ...keys: RedisKey[],
812 timeout: number | string,
813 callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
814 ]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
815 bzpopmin(...args: [
816 keys: RedisKey[],
817 timeout: number | string,
818 callback: Callback<[key: string, member: string, score: string] | null>
819 ]): Result<[key: string, member: string, score: string] | null, Context>;
820 bzpopminBuffer(...args: [
821 keys: RedisKey[],
822 timeout: number | string,
823 callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
824 ]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
825 bzpopmin(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
826 bzpopminBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
827 bzpopmin(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
828 bzpopminBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
829 /**
830 * Instruct the server about tracking or not keys in the next request
831 * - _group_: connection
832 * - _complexity_: O(1)
833 * - _since_: 6.0.0
834 */
835 client(subcommand: "CACHING", yes: "YES", callback?: Callback<"OK">): Result<"OK", Context>;
836 client(subcommand: "CACHING", no: "NO", callback?: Callback<"OK">): Result<"OK", Context>;
837 /**
838 * Get the current connection name
839 * - _group_: connection
840 * - _complexity_: O(1)
841 * - _since_: 2.6.9
842 */
843 client(subcommand: "GETNAME", callback?: Callback<string | null>): Result<string | null, Context>;
844 clientBuffer(subcommand: "GETNAME", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
845 /**
846 * Get tracking notifications redirection client ID if any
847 * - _group_: connection
848 * - _complexity_: O(1)
849 * - _since_: 6.0.0
850 */
851 client(subcommand: "GETREDIR", callback?: Callback<number>): Result<number, Context>;
852 /**
853 * Show helpful text about the different subcommands
854 * - _group_: connection
855 * - _complexity_: O(1)
856 * - _since_: 5.0.0
857 */
858 client(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
859 /**
860 * Returns the client ID for the current connection
861 * - _group_: connection
862 * - _complexity_: O(1)
863 * - _since_: 5.0.0
864 */
865 client(subcommand: "ID", callback?: Callback<number>): Result<number, Context>;
866 /**
867 * Returns information about the current client connection.
868 * - _group_: connection
869 * - _complexity_: O(1)
870 * - _since_: 6.2.0
871 */
872 client(subcommand: "INFO", callback?: Callback<string>): Result<string, Context>;
873 clientBuffer(subcommand: "INFO", callback?: Callback<Buffer>): Result<Buffer, Context>;
874 /**
875 * Kill the connection of a client
876 * - _group_: connection
877 * - _complexity_: O(N) where N is the number of client connections
878 * - _since_: 2.4.0
879 */
880 client(...args: [
881 subcommand: "KILL",
882 ...args: RedisValue[],
883 callback: Callback<unknown>
884 ]): Result<unknown, Context>;
885 client(...args: [subcommand: "KILL", ...args: RedisValue[]]): Result<unknown, Context>;
886 /**
887 * Get the list of client connections
888 * - _group_: connection
889 * - _complexity_: O(N) where N is the number of client connections
890 * - _since_: 2.4.0
891 */
892 client(subcommand: "LIST", callback?: Callback<unknown>): Result<unknown, Context>;
893 client(...args: [
894 subcommand: "LIST",
895 idToken: "ID",
896 ...clientIds: (number | string)[],
897 callback: Callback<unknown>
898 ]): Result<unknown, Context>;
899 client(...args: [
900 subcommand: "LIST",
901 idToken: "ID",
902 ...clientIds: (number | string)[]
903 ]): Result<unknown, Context>;
904 client(subcommand: "LIST", type: "TYPE", normal: "NORMAL", callback?: Callback<unknown>): Result<unknown, Context>;
905 client(...args: [
906 subcommand: "LIST",
907 type: "TYPE",
908 normal: "NORMAL",
909 idToken: "ID",
910 ...clientIds: (number | string)[],
911 callback: Callback<unknown>
912 ]): Result<unknown, Context>;
913 client(...args: [
914 subcommand: "LIST",
915 type: "TYPE",
916 normal: "NORMAL",
917 idToken: "ID",
918 ...clientIds: (number | string)[]
919 ]): Result<unknown, Context>;
920 client(subcommand: "LIST", type: "TYPE", master: "MASTER", callback?: Callback<unknown>): Result<unknown, Context>;
921 client(...args: [
922 subcommand: "LIST",
923 type: "TYPE",
924 master: "MASTER",
925 idToken: "ID",
926 ...clientIds: (number | string)[],
927 callback: Callback<unknown>
928 ]): Result<unknown, Context>;
929 client(...args: [
930 subcommand: "LIST",
931 type: "TYPE",
932 master: "MASTER",
933 idToken: "ID",
934 ...clientIds: (number | string)[]
935 ]): Result<unknown, Context>;
936 client(subcommand: "LIST", type: "TYPE", replica: "REPLICA", callback?: Callback<unknown>): Result<unknown, Context>;
937 client(...args: [
938 subcommand: "LIST",
939 type: "TYPE",
940 replica: "REPLICA",
941 idToken: "ID",
942 ...clientIds: (number | string)[],
943 callback: Callback<unknown>
944 ]): Result<unknown, Context>;
945 client(...args: [
946 subcommand: "LIST",
947 type: "TYPE",
948 replica: "REPLICA",
949 idToken: "ID",
950 ...clientIds: (number | string)[]
951 ]): Result<unknown, Context>;
952 client(subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", callback?: Callback<unknown>): Result<unknown, Context>;
953 client(...args: [
954 subcommand: "LIST",
955 type: "TYPE",
956 pubsub: "PUBSUB",
957 idToken: "ID",
958 ...clientIds: (number | string)[],
959 callback: Callback<unknown>
960 ]): Result<unknown, Context>;
961 client(...args: [
962 subcommand: "LIST",
963 type: "TYPE",
964 pubsub: "PUBSUB",
965 idToken: "ID",
966 ...clientIds: (number | string)[]
967 ]): Result<unknown, Context>;
968 /**
969 * Set client eviction mode for the current connection
970 * - _group_: connection
971 * - _complexity_: O(1)
972 * - _since_: 7.0.0
973 */
974 client(subcommand: "NO-EVICT", on: "ON", callback?: Callback<unknown>): Result<unknown, Context>;
975 client(subcommand: "NO-EVICT", off: "OFF", callback?: Callback<unknown>): Result<unknown, Context>;
976 /**
977 * Stop processing commands from clients for some time
978 * - _group_: connection
979 * - _complexity_: O(1)
980 * - _since_: 2.9.50
981 */
982 client(subcommand: "PAUSE", timeout: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
983 client(subcommand: "PAUSE", timeout: number | string, write: "WRITE", callback?: Callback<"OK">): Result<"OK", Context>;
984 client(subcommand: "PAUSE", timeout: number | string, all: "ALL", callback?: Callback<"OK">): Result<"OK", Context>;
985 /**
986 * Instruct the server whether to reply to commands
987 * - _group_: connection
988 * - _complexity_: O(1)
989 * - _since_: 3.2.0
990 */
991 client(subcommand: "REPLY", on: "ON", callback?: Callback<unknown>): Result<unknown, Context>;
992 client(subcommand: "REPLY", off: "OFF", callback?: Callback<unknown>): Result<unknown, Context>;
993 client(subcommand: "REPLY", skip: "SKIP", callback?: Callback<unknown>): Result<unknown, Context>;
994 /**
995 * Set the current connection name
996 * - _group_: connection
997 * - _complexity_: O(1)
998 * - _since_: 2.6.9
999 */
1000 client(subcommand: "SETNAME", connectionName: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
1001 /**
1002 * Enable or disable server assisted client side caching support
1003 * - _group_: connection
1004 * - _complexity_: O(1). Some options may introduce additional complexity.
1005 * - _since_: 6.0.0
1006 */
1007 client(...args: [
1008 subcommand: "TRACKING",
1009 ...args: RedisValue[],
1010 callback: Callback<unknown>
1011 ]): Result<unknown, Context>;
1012 client(...args: [subcommand: "TRACKING", ...args: RedisValue[]]): Result<unknown, Context>;
1013 /**
1014 * Return information about server assisted client side caching for the current connection
1015 * - _group_: connection
1016 * - _complexity_: O(1)
1017 * - _since_: 6.2.0
1018 */
1019 client(subcommand: "TRACKINGINFO", callback?: Callback<string>): Result<string, Context>;
1020 clientBuffer(subcommand: "TRACKINGINFO", callback?: Callback<Buffer>): Result<Buffer, Context>;
1021 /**
1022 * Unblock a client blocked in a blocking command from a different connection
1023 * - _group_: connection
1024 * - _complexity_: O(log N) where N is the number of client connections
1025 * - _since_: 5.0.0
1026 */
1027 client(subcommand: "UNBLOCK", clientId: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
1028 client(subcommand: "UNBLOCK", clientId: number | string, timeout: "TIMEOUT", callback?: Callback<unknown>): Result<unknown, Context>;
1029 client(subcommand: "UNBLOCK", clientId: number | string, error: "ERROR", callback?: Callback<unknown>): Result<unknown, Context>;
1030 /**
1031 * Resume processing of clients that were paused
1032 * - _group_: connection
1033 * - _complexity_: O(N) Where N is the number of paused clients
1034 * - _since_: 6.2.0
1035 */
1036 client(subcommand: "UNPAUSE", callback?: Callback<"OK">): Result<"OK", Context>;
1037 /**
1038 * Assign new hash slots to receiving node
1039 * - _group_: cluster
1040 * - _complexity_: O(N) where N is the total number of hash slot arguments
1041 * - _since_: 3.0.0
1042 */
1043 cluster(...args: [
1044 subcommand: "ADDSLOTS",
1045 ...slots: (number | string)[],
1046 callback: Callback<[
1047 startSlotRange: number,
1048 endSlotRange: number,
1049 ...nodes: [
1050 host: string,
1051 port: number,
1052 nodeId: string,
1053 info: unknown[]
1054 ][]
1055 ][]>
1056 ]): Result<[
1057 startSlotRange: number,
1058 endSlotRange: number,
1059 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1060 ][], Context>;
1061 cluster(...args: [
1062 subcommand: "ADDSLOTS",
1063 slots: (number | string)[],
1064 callback: Callback<[
1065 startSlotRange: number,
1066 endSlotRange: number,
1067 ...nodes: [
1068 host: string,
1069 port: number,
1070 nodeId: string,
1071 info: unknown[]
1072 ][]
1073 ][]>
1074 ]): Result<[
1075 startSlotRange: number,
1076 endSlotRange: number,
1077 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1078 ][], Context>;
1079 cluster(...args: [subcommand: "ADDSLOTS", ...slots: (number | string)[]]): Result<[
1080 startSlotRange: number,
1081 endSlotRange: number,
1082 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1083 ][], Context>;
1084 cluster(...args: [subcommand: "ADDSLOTS", slots: (number | string)[]]): Result<[
1085 startSlotRange: number,
1086 endSlotRange: number,
1087 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1088 ][], Context>;
1089 /**
1090 * Assign new hash slots to receiving node
1091 * - _group_: cluster
1092 * - _complexity_: O(N) where N is the total number of the slots between the start slot and end slot arguments.
1093 * - _since_: 7.0.0
1094 */
1095 cluster(...args: [
1096 subcommand: "ADDSLOTSRANGE",
1097 ...startSlotEndSlots: (string | number)[],
1098 callback: Callback<[
1099 startSlotRange: number,
1100 endSlotRange: number,
1101 ...nodes: [
1102 host: string,
1103 port: number,
1104 nodeId: string,
1105 info: unknown[]
1106 ][]
1107 ][]>
1108 ]): Result<[
1109 startSlotRange: number,
1110 endSlotRange: number,
1111 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1112 ][], Context>;
1113 cluster(...args: [
1114 subcommand: "ADDSLOTSRANGE",
1115 ...startSlotEndSlots: (string | number)[]
1116 ]): Result<[
1117 startSlotRange: number,
1118 endSlotRange: number,
1119 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1120 ][], Context>;
1121 /**
1122 * Advance the cluster config epoch
1123 * - _group_: cluster
1124 * - _complexity_: O(1)
1125 * - _since_: 3.0.0
1126 */
1127 cluster(subcommand: "BUMPEPOCH", callback?: Callback<"BUMPED" | "STILL">): Result<"BUMPED" | "STILL", Context>;
1128 /**
1129 * Return the number of failure reports active for a given node
1130 * - _group_: cluster
1131 * - _complexity_: O(N) where N is the number of failure reports
1132 * - _since_: 3.0.0
1133 */
1134 cluster(subcommand: "COUNT-FAILURE-REPORTS", nodeId: string | Buffer | number, callback?: Callback<number>): Result<number, Context>;
1135 /**
1136 * Return the number of local keys in the specified hash slot
1137 * - _group_: cluster
1138 * - _complexity_: O(1)
1139 * - _since_: 3.0.0
1140 */
1141 cluster(subcommand: "COUNTKEYSINSLOT", slot: number | string, callback?: Callback<number>): Result<number, Context>;
1142 /**
1143 * Set hash slots as unbound in receiving node
1144 * - _group_: cluster
1145 * - _complexity_: O(N) where N is the total number of hash slot arguments
1146 * - _since_: 3.0.0
1147 */
1148 cluster(...args: [
1149 subcommand: "DELSLOTS",
1150 ...slots: (number | string)[],
1151 callback: Callback<[
1152 startSlotRange: number,
1153 endSlotRange: number,
1154 ...nodes: [
1155 host: string,
1156 port: number,
1157 nodeId: string,
1158 info: unknown[]
1159 ][]
1160 ][]>
1161 ]): Result<[
1162 startSlotRange: number,
1163 endSlotRange: number,
1164 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1165 ][], Context>;
1166 cluster(...args: [
1167 subcommand: "DELSLOTS",
1168 slots: (number | string)[],
1169 callback: Callback<[
1170 startSlotRange: number,
1171 endSlotRange: number,
1172 ...nodes: [
1173 host: string,
1174 port: number,
1175 nodeId: string,
1176 info: unknown[]
1177 ][]
1178 ][]>
1179 ]): Result<[
1180 startSlotRange: number,
1181 endSlotRange: number,
1182 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1183 ][], Context>;
1184 cluster(...args: [subcommand: "DELSLOTS", ...slots: (number | string)[]]): Result<[
1185 startSlotRange: number,
1186 endSlotRange: number,
1187 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1188 ][], Context>;
1189 cluster(...args: [subcommand: "DELSLOTS", slots: (number | string)[]]): Result<[
1190 startSlotRange: number,
1191 endSlotRange: number,
1192 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1193 ][], Context>;
1194 /**
1195 * Set hash slots as unbound in receiving node
1196 * - _group_: cluster
1197 * - _complexity_: O(N) where N is the total number of the slots between the start slot and end slot arguments.
1198 * - _since_: 7.0.0
1199 */
1200 cluster(...args: [
1201 subcommand: "DELSLOTSRANGE",
1202 ...startSlotEndSlots: (string | number)[],
1203 callback: Callback<[
1204 startSlotRange: number,
1205 endSlotRange: number,
1206 ...nodes: [
1207 host: string,
1208 port: number,
1209 nodeId: string,
1210 info: unknown[]
1211 ][]
1212 ][]>
1213 ]): Result<[
1214 startSlotRange: number,
1215 endSlotRange: number,
1216 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1217 ][], Context>;
1218 cluster(...args: [
1219 subcommand: "DELSLOTSRANGE",
1220 ...startSlotEndSlots: (string | number)[]
1221 ]): Result<[
1222 startSlotRange: number,
1223 endSlotRange: number,
1224 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1225 ][], Context>;
1226 /**
1227 * Forces a replica to perform a manual failover of its master.
1228 * - _group_: cluster
1229 * - _complexity_: O(1)
1230 * - _since_: 3.0.0
1231 */
1232 cluster(subcommand: "FAILOVER", callback?: Callback<"OK">): Result<"OK", Context>;
1233 cluster(subcommand: "FAILOVER", force: "FORCE", callback?: Callback<"OK">): Result<"OK", Context>;
1234 cluster(subcommand: "FAILOVER", takeover: "TAKEOVER", callback?: Callback<"OK">): Result<"OK", Context>;
1235 /**
1236 * Delete a node's own slots information
1237 * - _group_: cluster
1238 * - _complexity_: O(1)
1239 * - _since_: 3.0.0
1240 */
1241 cluster(subcommand: "FLUSHSLOTS", callback?: Callback<[
1242 startSlotRange: number,
1243 endSlotRange: number,
1244 ...nodes: [
1245 host: string,
1246 port: number,
1247 nodeId: string,
1248 info: unknown[]
1249 ][]
1250 ][]>): Result<[
1251 startSlotRange: number,
1252 endSlotRange: number,
1253 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1254 ][], Context>;
1255 /**
1256 * Remove a node from the nodes table
1257 * - _group_: cluster
1258 * - _complexity_: O(1)
1259 * - _since_: 3.0.0
1260 */
1261 cluster(subcommand: "FORGET", nodeId: string | Buffer | number, callback?: Callback<"OK">): Result<"OK", Context>;
1262 /**
1263 * Return local key names in the specified hash slot
1264 * - _group_: cluster
1265 * - _complexity_: O(log(N)) where N is the number of requested keys
1266 * - _since_: 3.0.0
1267 */
1268 cluster(subcommand: "GETKEYSINSLOT", slot: number | string, count: number | string, callback?: Callback<string[]>): Result<string[], Context>;
1269 /**
1270 * Show helpful text about the different subcommands
1271 * - _group_: cluster
1272 * - _complexity_: O(1)
1273 * - _since_: 5.0.0
1274 */
1275 cluster(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
1276 /**
1277 * Provides info about Redis Cluster node state
1278 * - _group_: cluster
1279 * - _complexity_: O(1)
1280 * - _since_: 3.0.0
1281 */
1282 cluster(subcommand: "INFO", callback?: Callback<string>): Result<string, Context>;
1283 /**
1284 * Returns the hash slot of the specified key
1285 * - _group_: cluster
1286 * - _complexity_: O(N) where N is the number of bytes in the key
1287 * - _since_: 3.0.0
1288 */
1289 cluster(subcommand: "KEYSLOT", key: string | Buffer, callback?: Callback<number>): Result<number, Context>;
1290 /**
1291 * Returns a list of all TCP links to and from peer nodes in cluster
1292 * - _group_: cluster
1293 * - _complexity_: O(N) where N is the total number of Cluster nodes
1294 * - _since_: 7.0.0
1295 */
1296 cluster(subcommand: "LINKS", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1297 /**
1298 * Force a node cluster to handshake with another node
1299 * - _group_: cluster
1300 * - _complexity_: O(1)
1301 * - _since_: 3.0.0
1302 */
1303 cluster(subcommand: "MEET", ip: string | Buffer, port: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1304 /**
1305 * Return the node id
1306 * - _group_: cluster
1307 * - _complexity_: O(1)
1308 * - _since_: 3.0.0
1309 */
1310 cluster(subcommand: "MYID", callback?: Callback<string>): Result<string, Context>;
1311 /**
1312 * Get Cluster config for the node
1313 * - _group_: cluster
1314 * - _complexity_: O(N) where N is the total number of Cluster nodes
1315 * - _since_: 3.0.0
1316 */
1317 cluster(subcommand: "NODES", callback?: Callback<unknown>): Result<unknown, Context>;
1318 /**
1319 * List replica nodes of the specified master node
1320 * - _group_: cluster
1321 * - _complexity_: O(1)
1322 * - _since_: 5.0.0
1323 */
1324 cluster(subcommand: "REPLICAS", nodeId: string | Buffer | number, callback?: Callback<unknown>): Result<unknown, Context>;
1325 /**
1326 * Reconfigure a node as a replica of the specified master node
1327 * - _group_: cluster
1328 * - _complexity_: O(1)
1329 * - _since_: 3.0.0
1330 */
1331 cluster(subcommand: "REPLICATE", nodeId: string | Buffer | number, callback?: Callback<"OK">): Result<"OK", Context>;
1332 /**
1333 * Reset a Redis Cluster node
1334 * - _group_: cluster
1335 * - _complexity_: O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.
1336 * - _since_: 3.0.0
1337 */
1338 cluster(subcommand: "RESET", callback?: Callback<"OK">): Result<"OK", Context>;
1339 cluster(subcommand: "RESET", hard: "HARD", callback?: Callback<"OK">): Result<"OK", Context>;
1340 cluster(subcommand: "RESET", soft: "SOFT", callback?: Callback<"OK">): Result<"OK", Context>;
1341 /**
1342 * Forces the node to save cluster state on disk
1343 * - _group_: cluster
1344 * - _complexity_: O(1)
1345 * - _since_: 3.0.0
1346 */
1347 cluster(subcommand: "SAVECONFIG", callback?: Callback<"OK">): Result<"OK", Context>;
1348 /**
1349 * Set the configuration epoch in a new node
1350 * - _group_: cluster
1351 * - _complexity_: O(1)
1352 * - _since_: 3.0.0
1353 */
1354 cluster(subcommand: "SET-CONFIG-EPOCH", configEpoch: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1355 /**
1356 * Bind a hash slot to a specific node
1357 * - _group_: cluster
1358 * - _complexity_: O(1)
1359 * - _since_: 3.0.0
1360 */
1361 cluster(subcommand: "SETSLOT", slot: number | string, nodeIdToken: "IMPORTING", nodeId: string | Buffer | number, callback?: Callback<"OK">): Result<"OK", Context>;
1362 cluster(subcommand: "SETSLOT", slot: number | string, nodeIdToken: "MIGRATING", nodeId: string | Buffer | number, callback?: Callback<"OK">): Result<"OK", Context>;
1363 cluster(subcommand: "SETSLOT", slot: number | string, nodeIdToken: "NODE", nodeId: string | Buffer | number, callback?: Callback<"OK">): Result<"OK", Context>;
1364 cluster(subcommand: "SETSLOT", slot: number | string, stable: "STABLE", callback?: Callback<"OK">): Result<"OK", Context>;
1365 /**
1366 * Get array of cluster slots to node mappings
1367 * - _group_: cluster
1368 * - _complexity_: O(N) where N is the total number of cluster nodes
1369 * - _since_: 7.0.0
1370 */
1371 cluster(subcommand: "SHARDS", callback?: Callback<unknown>): Result<unknown, Context>;
1372 /**
1373 * List replica nodes of the specified master node
1374 * - _group_: cluster
1375 * - _complexity_: O(1)
1376 * - _since_: 3.0.0
1377 */
1378 cluster(subcommand: "SLAVES", nodeId: string | Buffer | number, callback?: Callback<unknown>): Result<unknown, Context>;
1379 /**
1380 * Get array of Cluster slot to node mappings
1381 * - _group_: cluster
1382 * - _complexity_: O(N) where N is the total number of Cluster nodes
1383 * - _since_: 3.0.0
1384 */
1385 cluster(subcommand: "SLOTS", callback?: Callback<[
1386 startSlotRange: number,
1387 endSlotRange: number,
1388 ...nodes: [
1389 host: string,
1390 port: number,
1391 nodeId: string,
1392 info: unknown[]
1393 ][]
1394 ][]>): Result<[
1395 startSlotRange: number,
1396 endSlotRange: number,
1397 ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]
1398 ][], Context>;
1399 /**
1400 * Get total number of Redis commands
1401 * - _group_: server
1402 * - _complexity_: O(1)
1403 * - _since_: 2.8.13
1404 */
1405 command(subcommand: "COUNT", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1406 /**
1407 * Get array of specific Redis command documentation
1408 * - _group_: server
1409 * - _complexity_: O(N) where N is the number of commands to look up
1410 * - _since_: 7.0.0
1411 */
1412 command(subcommand: "DOCS", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1413 command(...args: [
1414 subcommand: "DOCS",
1415 ...commandNames: (string | Buffer)[],
1416 callback: Callback<unknown[]>
1417 ]): Result<unknown[], Context>;
1418 command(...args: [subcommand: "DOCS", ...commandNames: (string | Buffer)[]]): Result<unknown[], Context>;
1419 /**
1420 * Extract keys given a full Redis command
1421 * - _group_: server
1422 * - _complexity_: O(N) where N is the number of arguments to the command
1423 * - _since_: 2.8.13
1424 */
1425 command(subcommand: "GETKEYS", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1426 /**
1427 * Extract keys and access flags given a full Redis command
1428 * - _group_: server
1429 * - _complexity_: O(N) where N is the number of arguments to the command
1430 * - _since_: 7.0.0
1431 */
1432 command(subcommand: "GETKEYSANDFLAGS", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1433 /**
1434 * Show helpful text about the different subcommands
1435 * - _group_: server
1436 * - _complexity_: O(1)
1437 * - _since_: 5.0.0
1438 */
1439 command(subcommand: "HELP", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1440 /**
1441 * Get array of specific Redis command details, or all when no argument is given.
1442 * - _group_: server
1443 * - _complexity_: O(N) where N is the number of commands to look up
1444 * - _since_: 2.8.13
1445 */
1446 command(subcommand: "INFO", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1447 command(...args: [
1448 subcommand: "INFO",
1449 ...commandNames: (string | Buffer)[],
1450 callback: Callback<unknown[]>
1451 ]): Result<unknown[], Context>;
1452 command(...args: [subcommand: "INFO", ...commandNames: (string | Buffer)[]]): Result<unknown[], Context>;
1453 /**
1454 * Get an array of Redis command names
1455 * - _group_: server
1456 * - _complexity_: O(N) where N is the total number of Redis commands
1457 * - _since_: 7.0.0
1458 */
1459 command(subcommand: "LIST", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1460 command(subcommand: "LIST", filterby: "FILTERBY", moduleNameToken: "MODULE", moduleName: string | Buffer, callback?: Callback<unknown[]>): Result<unknown[], Context>;
1461 command(subcommand: "LIST", filterby: "FILTERBY", categoryToken: "ACLCAT", category: string | Buffer, callback?: Callback<unknown[]>): Result<unknown[], Context>;
1462 command(subcommand: "LIST", filterby: "FILTERBY", patternToken: "PATTERN", pattern: string, callback?: Callback<unknown[]>): Result<unknown[], Context>;
1463 /**
1464 * Get the values of configuration parameters
1465 * - _group_: server
1466 * - _complexity_: O(N) when N is the number of configuration parameters provided
1467 * - _since_: 2.0.0
1468 */
1469 config(...args: [
1470 subcommand: "GET",
1471 ...parameters: (string | Buffer)[],
1472 callback: Callback<unknown>
1473 ]): Result<unknown, Context>;
1474 config(...args: [subcommand: "GET", ...parameters: (string | Buffer)[]]): Result<unknown, Context>;
1475 /**
1476 * Show helpful text about the different subcommands
1477 * - _group_: server
1478 * - _complexity_: O(1)
1479 * - _since_: 5.0.0
1480 */
1481 config(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
1482 /**
1483 * Reset the stats returned by INFO
1484 * - _group_: server
1485 * - _complexity_: O(1)
1486 * - _since_: 2.0.0
1487 */
1488 config(subcommand: "RESETSTAT", callback?: Callback<unknown>): Result<unknown, Context>;
1489 /**
1490 * Rewrite the configuration file with the in memory configuration
1491 * - _group_: server
1492 * - _complexity_: O(1)
1493 * - _since_: 2.8.0
1494 */
1495 config(subcommand: "REWRITE", callback?: Callback<unknown>): Result<unknown, Context>;
1496 /**
1497 * Set configuration parameters to the given values
1498 * - _group_: server
1499 * - _complexity_: O(N) when N is the number of configuration parameters provided
1500 * - _since_: 2.0.0
1501 */
1502 config(...args: [
1503 subcommand: "SET",
1504 ...parameterValues: (string | Buffer | number)[],
1505 callback: Callback<unknown>
1506 ]): Result<unknown, Context>;
1507 config(...args: [
1508 subcommand: "SET",
1509 ...parameterValues: (string | Buffer | number)[]
1510 ]): Result<unknown, Context>;
1511 /**
1512 * Copy a key
1513 * - _group_: generic
1514 * - _complexity_: O(N) worst case for collections, where N is the number of nested items. O(1) for string values.
1515 * - _since_: 6.2.0
1516 */
1517 copy(source: RedisKey, destination: RedisKey, callback?: Callback<number>): Result<number, Context>;
1518 copy(source: RedisKey, destination: RedisKey, replace: "REPLACE", callback?: Callback<number>): Result<number, Context>;
1519 copy(source: RedisKey, destination: RedisKey, destinationDbToken: "DB", destinationDb: number | string, callback?: Callback<number>): Result<number, Context>;
1520 copy(source: RedisKey, destination: RedisKey, destinationDbToken: "DB", destinationDb: number | string, replace: "REPLACE", callback?: Callback<number>): Result<number, Context>;
1521 /**
1522 * Return the number of keys in the selected database
1523 * - _group_: server
1524 * - _complexity_: O(1)
1525 * - _since_: 1.0.0
1526 */
1527 dbsize(callback?: Callback<number>): Result<number, Context>;
1528 /**
1529 * A container for debugging commands
1530 * - _group_: server
1531 * - _complexity_: Depends on subcommand.
1532 * - _since_: 1.0.0
1533 */
1534 debug(subcommand: string, callback?: Callback<unknown>): Result<unknown, Context>;
1535 debug(...args: [
1536 subcommand: string,
1537 ...args: (string | Buffer | number)[],
1538 callback: Callback<unknown>
1539 ]): Result<unknown, Context>;
1540 debug(...args: [subcommand: string, ...args: (string | Buffer | number)[]]): Result<unknown, Context>;
1541 /**
1542 * Decrement the integer value of a key by one
1543 * - _group_: string
1544 * - _complexity_: O(1)
1545 * - _since_: 1.0.0
1546 */
1547 decr(key: RedisKey, callback?: Callback<number>): Result<number, Context>;
1548 /**
1549 * Decrement the integer value of a key by the given number
1550 * - _group_: string
1551 * - _complexity_: O(1)
1552 * - _since_: 1.0.0
1553 */
1554 decrby(key: RedisKey, decrement: number | string, callback?: Callback<number>): Result<number, Context>;
1555 /**
1556 * Delete a key
1557 * - _group_: generic
1558 * - _complexity_: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).
1559 * - _since_: 1.0.0
1560 */
1561 del(...args: [...keys: RedisKey[], callback: Callback<number>]): Result<number, Context>;
1562 del(...args: [keys: RedisKey[], callback: Callback<number>]): Result<number, Context>;
1563 del(...args: [...keys: RedisKey[]]): Result<number, Context>;
1564 del(...args: [keys: RedisKey[]]): Result<number, Context>;
1565 /**
1566 * Discard all commands issued after MULTI
1567 * - _group_: transactions
1568 * - _complexity_: O(N), when N is the number of queued commands
1569 * - _since_: 2.0.0
1570 */
1571 discard(callback?: Callback<"OK">): Result<"OK", Context>;
1572 /**
1573 * Return a serialized version of the value stored at the specified key.
1574 * - _group_: generic
1575 * - _complexity_: O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).
1576 * - _since_: 2.6.0
1577 */
1578 dump(key: RedisKey, callback?: Callback<string>): Result<string, Context>;
1579 dumpBuffer(key: RedisKey, callback?: Callback<Buffer>): Result<Buffer, Context>;
1580 /**
1581 * Echo the given string
1582 * - _group_: connection
1583 * - _complexity_: O(1)
1584 * - _since_: 1.0.0
1585 */
1586 echo(message: string | Buffer, callback?: Callback<string>): Result<string, Context>;
1587 echoBuffer(message: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
1588 /**
1589 * Execute a Lua script server side
1590 * - _group_: scripting
1591 * - _complexity_: Depends on the script that is executed.
1592 * - _since_: 2.6.0
1593 */
1594 eval(script: string | Buffer, numkeys: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
1595 eval(...args: [
1596 script: string | Buffer,
1597 numkeys: number | string,
1598 ...args: (string | Buffer | number)[],
1599 callback: Callback<unknown>
1600 ]): Result<unknown, Context>;
1601 eval(...args: [
1602 script: string | Buffer,
1603 numkeys: number | string,
1604 ...args: (string | Buffer | number)[]
1605 ]): Result<unknown, Context>;
1606 eval(...args: [
1607 script: string | Buffer,
1608 numkeys: number | string,
1609 ...keys: RedisKey[],
1610 callback: Callback<unknown>
1611 ]): Result<unknown, Context>;
1612 eval(...args: [
1613 script: string | Buffer,
1614 numkeys: number | string,
1615 keys: RedisKey[],
1616 callback: Callback<unknown>
1617 ]): Result<unknown, Context>;
1618 eval(...args: [
1619 script: string | Buffer,
1620 numkeys: number | string,
1621 ...keys: RedisKey[]
1622 ]): Result<unknown, Context>;
1623 eval(...args: [
1624 script: string | Buffer,
1625 numkeys: number | string,
1626 keys: RedisKey[]
1627 ]): Result<unknown, Context>;
1628 eval(...args: [
1629 script: string | Buffer,
1630 numkeys: number | string,
1631 ...args: RedisValue[],
1632 callback: Callback<unknown>
1633 ]): Result<unknown, Context>;
1634 eval(...args: [
1635 script: string | Buffer,
1636 numkeys: number | string,
1637 ...args: RedisValue[]
1638 ]): Result<unknown, Context>;
1639 /**
1640 * Execute a read-only Lua script server side
1641 * - _group_: scripting
1642 * - _complexity_: Depends on the script that is executed.
1643 * - _since_: 7.0.0
1644 */
1645 eval_ro(...args: [
1646 script: string | Buffer,
1647 numkeys: number | string,
1648 ...args: RedisValue[],
1649 callback: Callback<unknown>
1650 ]): Result<unknown, Context>;
1651 eval_ro(...args: [
1652 script: string | Buffer,
1653 numkeys: number | string,
1654 ...args: RedisValue[]
1655 ]): Result<unknown, Context>;
1656 /**
1657 * Execute a Lua script server side
1658 * - _group_: scripting
1659 * - _complexity_: Depends on the script that is executed.
1660 * - _since_: 2.6.0
1661 */
1662 evalsha(sha1: string | Buffer, numkeys: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
1663 evalsha(...args: [
1664 sha1: string | Buffer,
1665 numkeys: number | string,
1666 ...args: (string | Buffer | number)[],
1667 callback: Callback<unknown>
1668 ]): Result<unknown, Context>;
1669 evalsha(...args: [
1670 sha1: string | Buffer,
1671 numkeys: number | string,
1672 ...args: (string | Buffer | number)[]
1673 ]): Result<unknown, Context>;
1674 evalsha(...args: [
1675 sha1: string | Buffer,
1676 numkeys: number | string,
1677 ...keys: RedisKey[],
1678 callback: Callback<unknown>
1679 ]): Result<unknown, Context>;
1680 evalsha(...args: [
1681 sha1: string | Buffer,
1682 numkeys: number | string,
1683 keys: RedisKey[],
1684 callback: Callback<unknown>
1685 ]): Result<unknown, Context>;
1686 evalsha(...args: [
1687 sha1: string | Buffer,
1688 numkeys: number | string,
1689 ...keys: RedisKey[]
1690 ]): Result<unknown, Context>;
1691 evalsha(...args: [sha1: string | Buffer, numkeys: number | string, keys: RedisKey[]]): Result<unknown, Context>;
1692 evalsha(...args: [
1693 sha1: string | Buffer,
1694 numkeys: number | string,
1695 ...args: RedisValue[],
1696 callback: Callback<unknown>
1697 ]): Result<unknown, Context>;
1698 evalsha(...args: [
1699 sha1: string | Buffer,
1700 numkeys: number | string,
1701 ...args: RedisValue[]
1702 ]): Result<unknown, Context>;
1703 /**
1704 * Execute a read-only Lua script server side
1705 * - _group_: scripting
1706 * - _complexity_: Depends on the script that is executed.
1707 * - _since_: 7.0.0
1708 */
1709 evalsha_ro(...args: [
1710 sha1: string | Buffer,
1711 numkeys: number | string,
1712 ...args: RedisValue[],
1713 callback: Callback<unknown>
1714 ]): Result<unknown, Context>;
1715 evalsha_ro(...args: [
1716 sha1: string | Buffer,
1717 numkeys: number | string,
1718 ...args: RedisValue[]
1719 ]): Result<unknown, Context>;
1720 /**
1721 * Execute all commands issued after MULTI
1722 * - _group_: transactions
1723 * - _complexity_: Depends on commands in the transaction
1724 * - _since_: 1.2.0
1725 */
1726 exec(callback?: Callback<[error: Error | null, result: unknown][] | null>): Promise<[error: Error | null, result: unknown][] | null>;
1727 /**
1728 * Determine if a key exists
1729 * - _group_: generic
1730 * - _complexity_: O(N) where N is the number of keys to check.
1731 * - _since_: 1.0.0
1732 */
1733 exists(...args: [...keys: RedisKey[], callback: Callback<number>]): Result<number, Context>;
1734 exists(...args: [keys: RedisKey[], callback: Callback<number>]): Result<number, Context>;
1735 exists(...args: [...keys: RedisKey[]]): Result<number, Context>;
1736 exists(...args: [keys: RedisKey[]]): Result<number, Context>;
1737 /**
1738 * Set a key's time to live in seconds
1739 * - _group_: generic
1740 * - _complexity_: O(1)
1741 * - _since_: 1.0.0
1742 */
1743 expire(key: RedisKey, seconds: number | string, callback?: Callback<number>): Result<number, Context>;
1744 expire(key: RedisKey, seconds: number | string, nx: "NX", callback?: Callback<number>): Result<number, Context>;
1745 expire(key: RedisKey, seconds: number | string, xx: "XX", callback?: Callback<number>): Result<number, Context>;
1746 expire(key: RedisKey, seconds: number | string, gt: "GT", callback?: Callback<number>): Result<number, Context>;
1747 expire(key: RedisKey, seconds: number | string, lt: "LT", callback?: Callback<number>): Result<number, Context>;
1748 /**
1749 * Set the expiration for a key as a UNIX timestamp
1750 * - _group_: generic
1751 * - _complexity_: O(1)
1752 * - _since_: 1.2.0
1753 */
1754 expireat(key: RedisKey, unixTimeSeconds: number | string, callback?: Callback<number>): Result<number, Context>;
1755 expireat(key: RedisKey, unixTimeSeconds: number | string, nx: "NX", callback?: Callback<number>): Result<number, Context>;
1756 expireat(key: RedisKey, unixTimeSeconds: number | string, xx: "XX", callback?: Callback<number>): Result<number, Context>;
1757 expireat(key: RedisKey, unixTimeSeconds: number | string, gt: "GT", callback?: Callback<number>): Result<number, Context>;
1758 expireat(key: RedisKey, unixTimeSeconds: number | string, lt: "LT", callback?: Callback<number>): Result<number, Context>;
1759 /**
1760 * Get the expiration Unix timestamp for a key
1761 * - _group_: generic
1762 * - _complexity_: O(1)
1763 * - _since_: 7.0.0
1764 */
1765 expiretime(key: RedisKey, callback?: Callback<number>): Result<number, Context>;
1766 /**
1767 * Start a coordinated failover between this server and one of its replicas.
1768 * - _group_: server
1769 * - _complexity_: O(1)
1770 * - _since_: 6.2.0
1771 */
1772 failover(callback?: Callback<"OK">): Result<"OK", Context>;
1773 failover(millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1774 failover(abort: "ABORT", callback?: Callback<"OK">): Result<"OK", Context>;
1775 failover(abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1776 failover(targetToken: "TO", host: string | Buffer, port: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1777 failover(targetToken: "TO", host: string | Buffer, port: number | string, millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1778 failover(targetToken: "TO", host: string | Buffer, port: number | string, abort: "ABORT", callback?: Callback<"OK">): Result<"OK", Context>;
1779 failover(targetToken: "TO", host: string | Buffer, port: number | string, abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1780 failover(targetToken: "TO", host: string | Buffer, port: number | string, force: "FORCE", callback?: Callback<"OK">): Result<"OK", Context>;
1781 failover(targetToken: "TO", host: string | Buffer, port: number | string, force: "FORCE", millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1782 failover(targetToken: "TO", host: string | Buffer, port: number | string, force: "FORCE", abort: "ABORT", callback?: Callback<"OK">): Result<"OK", Context>;
1783 failover(targetToken: "TO", host: string | Buffer, port: number | string, force: "FORCE", abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: number | string, callback?: Callback<"OK">): Result<"OK", Context>;
1784 /**
1785 * Invoke a function
1786 * - _group_: scripting
1787 * - _complexity_: Depends on the function that is executed.
1788 * - _since_: 7.0.0
1789 */
1790 fcall(...args: [
1791 function: string | Buffer,
1792 numkeys: number | string,
1793 ...args: RedisValue[],
1794 callback: Callback<unknown>
1795 ]): Result<unknown, Context>;
1796 fcall(...args: [
1797 function: string | Buffer,
1798 numkeys: number | string,
1799 ...args: RedisValue[]
1800 ]): Result<unknown, Context>;
1801 /**
1802 * Invoke a read-only function
1803 * - _group_: scripting
1804 * - _complexity_: Depends on the function that is executed.
1805 * - _since_: 7.0.0
1806 */
1807 fcall_ro(...args: [
1808 function: string | Buffer,
1809 numkeys: number | string,
1810 ...args: RedisValue[],
1811 callback: Callback<unknown>
1812 ]): Result<unknown, Context>;
1813 fcall_ro(...args: [
1814 function: string | Buffer,
1815 numkeys: number | string,
1816 ...args: RedisValue[]
1817 ]): Result<unknown, Context>;
1818 /**
1819 * Remove all keys from all databases
1820 * - _group_: server
1821 * - _complexity_: O(N) where N is the total number of keys in all databases
1822 * - _since_: 1.0.0
1823 */
1824 flushall(callback?: Callback<"OK">): Result<"OK", Context>;
1825 flushall(async: "ASYNC", callback?: Callback<"OK">): Result<"OK", Context>;
1826 flushall(sync: "SYNC", callback?: Callback<"OK">): Result<"OK", Context>;
1827 /**
1828 * Remove all keys from the current database
1829 * - _group_: server
1830 * - _complexity_: O(N) where N is the number of keys in the selected database
1831 * - _since_: 1.0.0
1832 */
1833 flushdb(callback?: Callback<"OK">): Result<"OK", Context>;
1834 flushdb(async: "ASYNC", callback?: Callback<"OK">): Result<"OK", Context>;
1835 flushdb(sync: "SYNC", callback?: Callback<"OK">): Result<"OK", Context>;
1836 /**
1837 * Delete a function by name
1838 * - _group_: scripting
1839 * - _complexity_: O(1)
1840 * - _since_: 7.0.0
1841 */
1842 function(subcommand: "DELETE", libraryName: string | Buffer, callback?: Callback<string>): Result<string, Context>;
1843 functionBuffer(subcommand: "DELETE", libraryName: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
1844 /**
1845 * Dump all functions into a serialized binary payload
1846 * - _group_: scripting
1847 * - _complexity_: O(N) where N is the number of functions
1848 * - _since_: 7.0.0
1849 */
1850 function(subcommand: "DUMP", callback?: Callback<string>): Result<string, Context>;
1851 functionBuffer(subcommand: "DUMP", callback?: Callback<Buffer>): Result<Buffer, Context>;
1852 /**
1853 * Deleting all functions
1854 * - _group_: scripting
1855 * - _complexity_: O(N) where N is the number of functions deleted
1856 * - _since_: 7.0.0
1857 */
1858 function(subcommand: "FLUSH", callback?: Callback<string>): Result<string, Context>;
1859 functionBuffer(subcommand: "FLUSH", callback?: Callback<Buffer>): Result<Buffer, Context>;
1860 function(subcommand: "FLUSH", async: "ASYNC", callback?: Callback<string>): Result<string, Context>;
1861 functionBuffer(subcommand: "FLUSH", async: "ASYNC", callback?: Callback<Buffer>): Result<Buffer, Context>;
1862 function(subcommand: "FLUSH", sync: "SYNC", callback?: Callback<string>): Result<string, Context>;
1863 functionBuffer(subcommand: "FLUSH", sync: "SYNC", callback?: Callback<Buffer>): Result<Buffer, Context>;
1864 /**
1865 * Show helpful text about the different subcommands
1866 * - _group_: scripting
1867 * - _complexity_: O(1)
1868 * - _since_: 7.0.0
1869 */
1870 function(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
1871 /**
1872 * Kill the function currently in execution.
1873 * - _group_: scripting
1874 * - _complexity_: O(1)
1875 * - _since_: 7.0.0
1876 */
1877 function(subcommand: "KILL", callback?: Callback<string>): Result<string, Context>;
1878 functionBuffer(subcommand: "KILL", callback?: Callback<Buffer>): Result<Buffer, Context>;
1879 /**
1880 * List information about all the functions
1881 * - _group_: scripting
1882 * - _complexity_: O(N) where N is the number of functions
1883 * - _since_: 7.0.0
1884 */
1885 function(subcommand: "LIST", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1886 function(subcommand: "LIST", withcode: "WITHCODE", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1887 function(subcommand: "LIST", libraryNamePatternToken: "LIBRARYNAME", libraryNamePattern: string | Buffer, callback?: Callback<unknown[]>): Result<unknown[], Context>;
1888 function(subcommand: "LIST", libraryNamePatternToken: "LIBRARYNAME", libraryNamePattern: string | Buffer, withcode: "WITHCODE", callback?: Callback<unknown[]>): Result<unknown[], Context>;
1889 /**
1890 * Create a function with the given arguments (name, code, description)
1891 * - _group_: scripting
1892 * - _complexity_: O(1) (considering compilation time is redundant)
1893 * - _since_: 7.0.0
1894 */
1895 function(subcommand: "LOAD", functionCode: string | Buffer, callback?: Callback<string>): Result<string, Context>;
1896 functionBuffer(subcommand: "LOAD", functionCode: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
1897 function(subcommand: "LOAD", replace: "REPLACE", functionCode: string | Buffer, callback?: Callback<string>): Result<string, Context>;
1898 functionBuffer(subcommand: "LOAD", replace: "REPLACE", functionCode: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
1899 /**
1900 * Restore all the functions on the given payload
1901 * - _group_: scripting
1902 * - _complexity_: O(N) where N is the number of functions on the payload
1903 * - _since_: 7.0.0
1904 */
1905 function(subcommand: "RESTORE", serializedValue: string | Buffer | number, callback?: Callback<string>): Result<string, Context>;
1906 functionBuffer(subcommand: "RESTORE", serializedValue: string | Buffer | number, callback?: Callback<Buffer>): Result<Buffer, Context>;
1907 function(subcommand: "RESTORE", serializedValue: string | Buffer | number, flush: "FLUSH", callback?: Callback<string>): Result<string, Context>;
1908 functionBuffer(subcommand: "RESTORE", serializedValue: string | Buffer | number, flush: "FLUSH", callback?: Callback<Buffer>): Result<Buffer, Context>;
1909 function(subcommand: "RESTORE", serializedValue: string | Buffer | number, append: "APPEND", callback?: Callback<string>): Result<string, Context>;
1910 functionBuffer(subcommand: "RESTORE", serializedValue: string | Buffer | number, append: "APPEND", callback?: Callback<Buffer>): Result<Buffer, Context>;
1911 function(subcommand: "RESTORE", serializedValue: string | Buffer | number, replace: "REPLACE", callback?: Callback<string>): Result<string, Context>;
1912 functionBuffer(subcommand: "RESTORE", serializedValue: string | Buffer | number, replace: "REPLACE", callback?: Callback<Buffer>): Result<Buffer, Context>;
1913 /**
1914 * Return information about the function currently running (name, description, duration)
1915 * - _group_: scripting
1916 * - _complexity_: O(1)
1917 * - _since_: 7.0.0
1918 */
1919 function(subcommand: "STATS", callback?: Callback<unknown>): Result<unknown, Context>;
1920 /**
1921 * Add one or more geospatial items in the geospatial index represented using a sorted set
1922 * - _group_: geo
1923 * - _complexity_: O(log(N)) for each item added, where N is the number of elements in the sorted set.
1924 * - _since_: 3.2.0
1925 */
1926 geoadd(...args: [
1927 key: RedisKey,
1928 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1929 callback: Callback<number>
1930 ]): Result<number, Context>;
1931 geoadd(...args: [
1932 key: RedisKey,
1933 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1934 ]): Result<number, Context>;
1935 geoadd(...args: [
1936 key: RedisKey,
1937 ch: "CH",
1938 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1939 callback: Callback<number>
1940 ]): Result<number, Context>;
1941 geoadd(...args: [
1942 key: RedisKey,
1943 ch: "CH",
1944 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1945 ]): Result<number, Context>;
1946 geoadd(...args: [
1947 key: RedisKey,
1948 nx: "NX",
1949 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1950 callback: Callback<number>
1951 ]): Result<number, Context>;
1952 geoadd(...args: [
1953 key: RedisKey,
1954 nx: "NX",
1955 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1956 ]): Result<number, Context>;
1957 geoadd(...args: [
1958 key: RedisKey,
1959 nx: "NX",
1960 ch: "CH",
1961 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1962 callback: Callback<number>
1963 ]): Result<number, Context>;
1964 geoadd(...args: [
1965 key: RedisKey,
1966 nx: "NX",
1967 ch: "CH",
1968 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1969 ]): Result<number, Context>;
1970 geoadd(...args: [
1971 key: RedisKey,
1972 xx: "XX",
1973 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1974 callback: Callback<number>
1975 ]): Result<number, Context>;
1976 geoadd(...args: [
1977 key: RedisKey,
1978 xx: "XX",
1979 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1980 ]): Result<number, Context>;
1981 geoadd(...args: [
1982 key: RedisKey,
1983 xx: "XX",
1984 ch: "CH",
1985 ...longitudeLatitudeMembers: (string | Buffer | number)[],
1986 callback: Callback<number>
1987 ]): Result<number, Context>;
1988 geoadd(...args: [
1989 key: RedisKey,
1990 xx: "XX",
1991 ch: "CH",
1992 ...longitudeLatitudeMembers: (string | Buffer | number)[]
1993 ]): Result<number, Context>;
1994 /**
1995 * Returns the distance between two members of a geospatial index
1996 * - _group_: geo
1997 * - _complexity_: O(log(N))
1998 * - _since_: 3.2.0
1999 */
2000 geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, callback?: Callback<string | null>): Result<string | null, Context>;
2001 geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
2002 geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, m: "M", callback?: Callback<string | null>): Result<string | null, Context>;
2003 geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, m: "M", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
2004 geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, km: "KM", callback?: Callback<string | null>): Result<string | null, Context>;
2005 geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, km: "KM", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
2006 geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, ft: "FT", callback?: Callback<string | null>): Result<string | null, Context>;
2007 geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, ft: "FT", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
2008 geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, mi: "MI", callback?: Callback<string | null>): Result<string | null, Context>;
2009 geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, mi: "MI", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
2010 /**
2011 * Returns members of a geospatial index as standard geohash strings
2012 * - _group_: geo
2013 * - _complexity_: O(log(N)) for each member requested, where N is the number of elements in the sorted set.
2014 * - _since_: 3.2.0
2015 */
2016 geohash(...args: [
2017 key: RedisKey,
2018 ...members: (string | Buffer | number)[],
2019 callback: Callback<string[]>
2020 ]): Result<string[], Context>;
2021 geohashBuffer(...args: [
2022 key: RedisKey,
2023 ...members: (string | Buffer | number)[],
2024 callback: Callback<Buffer[]>
2025 ]): Result<Buffer[], Context>;
2026 geohash(...args: [
2027 key: RedisKey,
2028 members: (string | Buffer | number)[],
2029 callback: Callback<string[]>
2030 ]): Result<string[], Context>;
2031 geohashBuffer(...args: [
2032 key: RedisKey,
2033 members: (string | Buffer | number)[],
2034 callback: Callback<Buffer[]>
2035 ]): Result<Buffer[], Context>;
2036 geohash(...args: [key: RedisKey, ...members: (string | Buffer | number)[]]): Result<string[], Context>;
2037 geohashBuffer(...args: [key: RedisKey, ...members: (string | Buffer | number)[]]): Result<Buffer[], Context>;
2038 geohash(...args: [key: RedisKey, members: (string | Buffer | number)[]]): Result<string[], Context>;
2039 geohashBuffer(...args: [key: RedisKey, members: (string | Buffer | number)[]]): Result<Buffer[], Context>;
2040 /**
2041 * Returns longitude and latitude of members of a geospatial index
2042 * - _group_: geo
2043 * - _complexity_: O(N) where N is the number of m