///
import { Callback } from "../types";
export declare type RedisKey = string | Buffer;
export declare type RedisValue = string | Buffer | number;
export interface ResultTypes {
default: Promise;
pipeline: ChainableCommander;
}
export interface ChainableCommander extends RedisCommander<{
type: "pipeline";
}> {
}
export declare type ClientContext = {
type: keyof ResultTypes;
};
export declare type Result = ResultTypes[Context["type"]];
interface RedisCommander {
/**
* Call arbitrary commands.
*
* `redis.call('set', 'foo', 'bar')` is the same as `redis.set('foo', 'bar')`,
* so the only case you need to use this method is when the command is not
* supported by ioredis.
*
* ```ts
* redis.call('set', 'foo', 'bar');
* redis.call('get', 'foo', (err, value) => {
* // value === 'bar'
* });
* ```
*/
call(command: string, callback?: Callback): Result;
call(command: string, args: (string | Buffer | number)[], callback?: Callback): Result;
call(...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback
]): Result;
call(...args: [command: string, ...args: (string | Buffer | number)[]]): Result;
callBuffer(command: string, callback?: Callback): Result;
callBuffer(command: string, args: (string | Buffer | number)[], callback?: Callback): Result;
callBuffer(...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback
]): Result;
callBuffer(...args: [command: string, ...args: (string | Buffer | number)[]]): Result;
/**
* List the ACL categories or the commands inside a category
* - _group_: server
* - _complexity_: O(1) since the categories and commands are a fixed set.
* - _since_: 6.0.0
*/
acl(subcommand: "CAT", callback?: Callback): Result;
acl(subcommand: "CAT", categoryname: string | Buffer, callback?: Callback): Result;
/**
* Remove the specified ACL users and the associated rules
* - _group_: server
* - _complexity_: O(1) amortized time considering the typical user.
* - _since_: 6.0.0
*/
acl(...args: [
subcommand: "DELUSER",
...usernames: (string | Buffer)[],
callback: Callback
]): Result;
acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]): Result;
/**
* Returns whether the user can execute the given command without executing the command.
* - _group_: server
* - _complexity_: O(1).
* - _since_: 7.0.0
*/
acl(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback): Result;
aclBuffer(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback): Result;
acl(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[],
callback: Callback
]): Result;
aclBuffer(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[],
callback: Callback
]): Result;
acl(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[]
]): Result;
aclBuffer(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[]
]): Result;
/**
* Generate a pseudorandom secure password to use for ACL users
* - _group_: server
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
acl(subcommand: "GENPASS", callback?: Callback): Result;
aclBuffer(subcommand: "GENPASS", callback?: Callback): Result;
acl(subcommand: "GENPASS", bits: number | string, callback?: Callback): Result;
aclBuffer(subcommand: "GENPASS", bits: number | string, callback?: Callback): Result;
/**
* Get the rules for a specific ACL user
* - _group_: server
* - _complexity_: O(N). Where N is the number of password, command and pattern rules that the user has.
* - _since_: 6.0.0
*/
acl(subcommand: "GETUSER", username: string | Buffer, callback?: Callback): Result;
aclBuffer(subcommand: "GETUSER", username: string | Buffer, callback?: Callback): Result;
/**
* Show helpful text about the different subcommands
* - _group_: server
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
acl(subcommand: "HELP", callback?: Callback): Result;
/**
* List the current ACL rules in ACL config file format
* - _group_: server
* - _complexity_: O(N). Where N is the number of configured users.
* - _since_: 6.0.0
*/
acl(subcommand: "LIST", callback?: Callback): Result;
aclBuffer(subcommand: "LIST", callback?: Callback): Result;
/**
* Reload the ACLs from the configured ACL file
* - _group_: server
* - _complexity_: O(N). Where N is the number of configured users.
* - _since_: 6.0.0
*/
acl(subcommand: "LOAD", callback?: Callback<"OK">): Result<"OK", Context>;
/**
* List latest events denied because of ACLs in place
* - _group_: server
* - _complexity_: O(N) with N being the number of entries shown.
* - _since_: 6.0.0
*/
acl(subcommand: "LOG", callback?: Callback): Result;
acl(subcommand: "LOG", count: number | string, callback?: Callback): Result;
acl(subcommand: "LOG", reset: "RESET", callback?: Callback): Result;
/**
* Save the current ACL rules in the configured ACL file
* - _group_: server
* - _complexity_: O(N). Where N is the number of configured users.
* - _since_: 6.0.0
*/
acl(subcommand: "SAVE", callback?: Callback<"OK">): Result<"OK", Context>;
/**
* Modify or create the rules for a specific ACL user
* - _group_: server
* - _complexity_: O(N). Where N is the number of rules provided.
* - _since_: 6.0.0
*/
acl(subcommand: "SETUSER", username: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
acl(...args: [
subcommand: "SETUSER",
username: string | Buffer,
...rules: (string | Buffer)[],
callback: Callback<"OK">
]): Result<"OK", Context>;
acl(...args: [
subcommand: "SETUSER",
username: string | Buffer,
...rules: (string | Buffer)[]
]): Result<"OK", Context>;
/**
* List the username of all the configured ACL rules
* - _group_: server
* - _complexity_: O(N). Where N is the number of configured users.
* - _since_: 6.0.0
*/
acl(subcommand: "USERS", callback?: Callback): Result;
aclBuffer(subcommand: "USERS", callback?: Callback): Result;
/**
* Return the name of the user associated to the current connection
* - _group_: server
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
acl(subcommand: "WHOAMI", callback?: Callback): Result;
aclBuffer(subcommand: "WHOAMI", callback?: Callback): Result;
/**
* Append a value to a key
* - _group_: string
* - _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.
* - _since_: 2.0.0
*/
append(key: RedisKey, value: string | Buffer | number, callback?: Callback): Result;
/**
* Sent by cluster clients after an -ASK redirect
* - _group_: cluster
* - _complexity_: O(1)
* - _since_: 3.0.0
*/
asking(callback?: Callback<"OK">): Result<"OK", Context>;
/**
* Authenticate to the server
* - _group_: connection
* - _complexity_: O(N) where N is the number of passwords defined for the user
* - _since_: 1.0.0
*/
auth(password: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
auth(username: string | Buffer, password: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>;
/**
* Asynchronously rewrite the append-only file
* - _group_: server
* - _complexity_: O(1)
* - _since_: 1.0.0
*/
bgrewriteaof(callback?: Callback): Result;
bgrewriteaofBuffer(callback?: Callback): Result;
/**
* Asynchronously save the dataset to disk
* - _group_: server
* - _complexity_: O(1)
* - _since_: 1.0.0
*/
bgsave(callback?: Callback<"OK">): Result<"OK", Context>;
bgsave(schedule: "SCHEDULE", callback?: Callback<"OK">): Result<"OK", Context>;
/**
* Count set bits in a string
* - _group_: bitmap
* - _complexity_: O(N)
* - _since_: 2.6.0
*/
bitcount(key: RedisKey, callback?: Callback): Result;
bitcount(key: RedisKey, start: number | string, end: number | string, callback?: Callback): Result;
bitcount(key: RedisKey, start: number | string, end: number | string, byte: "BYTE", callback?: Callback): Result;
bitcount(key: RedisKey, start: number | string, end: number | string, bit: "BIT", callback?: Callback): Result;
/**
* Perform arbitrary bitfield integer operations on strings
* - _group_: bitmap
* - _complexity_: O(1) for each subcommand specified
* - _since_: 3.2.0
*/
bitfield(key: RedisKey, callback?: Callback): Result;
bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetIncrementToken: "INCRBY", encoding1: string | Buffer, offset1: number | string, increment: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding2: string | Buffer, offset2: number | string, increment: number | string, callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding2: string | Buffer, offset2: number | string, increment: number | string, overflow: "OVERFLOW", wrap: "WRAP", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding2: string | Buffer, offset2: number | string, increment: number | string, overflow: "OVERFLOW", sat: "SAT", callback?: Callback): Result;
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, encodingOffsetValueToken: "SET", encoding1: string | Buffer, offset1: number | string, value: number | string, encodingOffsetIncrementToken: "INCRBY", encoding2: string | Buffer, offset2: number | string, increment: number | string, overflow: "OVERFLOW", fail: "FAIL", callback?: Callback): Result;
/**
* Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD
* - _group_: bitmap
* - _complexity_: O(1) for each subcommand specified
* - _since_: 6.2.0
*/
bitfield_ro(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, callback?: Callback): Result;
/**
* Perform bitwise operations between strings
* - _group_: bitmap
* - _complexity_: O(N)
* - _since_: 2.6.0
*/
bitop(...args: [
operation: string | Buffer,
destkey: RedisKey,
...keys: RedisKey[],
callback: Callback
]): Result;
bitop(...args: [
operation: string | Buffer,
destkey: RedisKey,
keys: RedisKey[],
callback: Callback
]): Result;
bitop(...args: [
operation: string | Buffer,
destkey: RedisKey,
...keys: RedisKey[]
]): Result;
bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[]]): Result;
/**
* Find first bit set or clear in a string
* - _group_: bitmap
* - _complexity_: O(N)
* - _since_: 2.8.7
*/
bitpos(key: RedisKey, bit: number | string, callback?: Callback): Result;
bitpos(key: RedisKey, bit: number | string, start: number | string, callback?: Callback): Result;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, callback?: Callback): Result;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, byte: "BYTE", callback?: Callback): Result;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, bit1: "BIT", callback?: Callback): Result;
/**
* Pop an element from a list, push it to another list and return it; or block until one is available
* - _group_: list
* - _complexity_: O(1)
* - _since_: 6.2.0
*/
blmove(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback): Result;
blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback): Result;
blmove(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback): Result;
blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback): Result;
blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback): Result;
blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback): Result;
blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback): Result;
blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback): Result;
/**
* Pop elements from a list, or block until one is available
* - _group_: list
* - _complexity_: O(N+M) where N is the number of provided keys and M is the number of elements returned.
* - _since_: 7.0.0
*/
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT"
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT"
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT"
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT"
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
left: "LEFT",
countToken: "COUNT",
count: number | string
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT"
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT"
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT"
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT"
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: string, members: string[]] | null>
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string,
callback: Callback<[key: Buffer, members: Buffer[]] | null>
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
blmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string
]): Result<[key: string, members: string[]] | null, Context>;
blmpopBuffer(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
right: "RIGHT",
countToken: "COUNT",
count: number | string
]): Result<[key: Buffer, members: Buffer[]] | null, Context>;
/**
* Remove and get the first element in a list, or block until one is available
* - _group_: list
* - _complexity_: O(N) where N is the number of provided keys.
* - _since_: 2.0.0
*/
blpop(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[string, string] | null>
]): Result<[string, string] | null, Context>;
blpopBuffer(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[Buffer, Buffer] | null>
]): Result<[Buffer, Buffer] | null, Context>;
blpop(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[string, string] | null>
]): Result<[string, string] | null, Context>;
blpopBuffer(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[Buffer, Buffer] | null>
]): Result<[Buffer, Buffer] | null, Context>;
blpop(...args: [...keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
blpopBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
blpop(...args: [keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
blpopBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
/**
* Remove and get the last element in a list, or block until one is available
* - _group_: list
* - _complexity_: O(N) where N is the number of provided keys.
* - _since_: 2.0.0
*/
brpop(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[string, string] | null>
]): Result<[string, string] | null, Context>;
brpopBuffer(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[Buffer, Buffer] | null>
]): Result<[Buffer, Buffer] | null, Context>;
brpop(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[string, string] | null>
]): Result<[string, string] | null, Context>;
brpopBuffer(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[Buffer, Buffer] | null>
]): Result<[Buffer, Buffer] | null, Context>;
brpop(...args: [...keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
brpopBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
brpop(...args: [keys: RedisKey[], timeout: number | string]): Result<[string, string] | null, Context>;
brpopBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[Buffer, Buffer] | null, Context>;
/**
* Pop an element from a list, push it to another list and return it; or block until one is available
* - _group_: list
* - _complexity_: O(1)
* - _since_: 2.2.0
*/
brpoplpush(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback): Result;
brpoplpushBuffer(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback): Result;
/**
* Remove and return members with scores in a sorted set or block until one is available
* - _group_: sorted-set
* - _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.
* - _since_: 7.0.0
*/
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN",
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN"
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN"
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string,
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string,
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX"
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX"
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string,
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string,
callback: Callback
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string
]): Result;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string
]): Result;
/**
* Remove and return the member with the highest score from one or more sorted sets, or block until one is available
* - _group_: sorted-set
* - _complexity_: O(log(N)) with N being the number of elements in the sorted set.
* - _since_: 5.0.0
*/
bzpopmax(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: string, member: string, score: string] | null>
]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopmaxBuffer(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmax(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: string, member: string, score: string] | null>
]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopmaxBuffer(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmax(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopmaxBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmax(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopmaxBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
/**
* Remove and return the member with the lowest score from one or more sorted sets, or block until one is available
* - _group_: sorted-set
* - _complexity_: O(log(N)) with N being the number of elements in the sorted set.
* - _since_: 5.0.0
*/
bzpopmin(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: string, member: string, score: string] | null>
]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopminBuffer(...args: [
...keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmin(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: string, member: string, score: string] | null>
]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopminBuffer(...args: [
keys: RedisKey[],
timeout: number | string,
callback: Callback<[key: Buffer, member: Buffer, score: Buffer] | null>
]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmin(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopminBuffer(...args: [...keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
bzpopmin(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: string, member: string, score: string] | null, Context>;
bzpopminBuffer(...args: [keys: RedisKey[], timeout: number | string]): Result<[key: Buffer, member: Buffer, score: Buffer] | null, Context>;
/**
* Instruct the server about tracking or not keys in the next request
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
client(subcommand: "CACHING", yes: "YES", callback?: Callback<"OK">): Result<"OK", Context>;
client(subcommand: "CACHING", no: "NO", callback?: Callback<"OK">): Result<"OK", Context>;
/**
* Get the current connection name
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 2.6.9
*/
client(subcommand: "GETNAME", callback?: Callback): Result;
clientBuffer(subcommand: "GETNAME", callback?: Callback): Result;
/**
* Get tracking notifications redirection client ID if any
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
client(subcommand: "GETREDIR", callback?: Callback): Result;
/**
* Show helpful text about the different subcommands
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 5.0.0
*/
client(subcommand: "HELP", callback?: Callback): Result;
/**
* Returns the client ID for the current connection
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 5.0.0
*/
client(subcommand: "ID", callback?: Callback): Result;
/**
* Returns information about the current client connection.
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 6.2.0
*/
client(subcommand: "INFO", callback?: Callback): Result;
clientBuffer(subcommand: "INFO", callback?: Callback): Result;
/**
* Kill the connection of a client
* - _group_: connection
* - _complexity_: O(N) where N is the number of client connections
* - _since_: 2.4.0
*/
client(...args: [
subcommand: "KILL",
...args: RedisValue[],
callback: Callback
]): Result;
client(...args: [subcommand: "KILL", ...args: RedisValue[]]): Result;
/**
* Get the list of client connections
* - _group_: connection
* - _complexity_: O(N) where N is the number of client connections
* - _since_: 2.4.0
*/
client(subcommand: "LIST", callback?: Callback): Result;
client(...args: [
subcommand: "LIST",
idToken: "ID",
...clientIds: (number | string)[],
callback: Callback
]): Result;
client(...args: [
subcommand: "LIST",
idToken: "ID",
...clientIds: (number | string)[]
]): Result;
client(subcommand: "LIST", type: "TYPE", normal: "NORMAL", callback?: Callback): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
normal: "NORMAL",
idToken: "ID",
...clientIds: (number | string)[],
callback: Callback
]): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
normal: "NORMAL",
idToken: "ID",
...clientIds: (number | string)[]
]): Result;
client(subcommand: "LIST", type: "TYPE", master: "MASTER", callback?: Callback): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
master: "MASTER",
idToken: "ID",
...clientIds: (number | string)[],
callback: Callback
]): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
master: "MASTER",
idToken: "ID",
...clientIds: (number | string)[]
]): Result;
client(subcommand: "LIST", type: "TYPE", replica: "REPLICA", callback?: Callback): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
replica: "REPLICA",
idToken: "ID",
...clientIds: (number | string)[],
callback: Callback
]): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
replica: "REPLICA",
idToken: "ID",
...clientIds: (number | string)[]
]): Result;
client(subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", callback?: Callback): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
pubsub: "PUBSUB",
idToken: "ID",
...clientIds: (number | string)[],
callback: Callback
]): Result;
client(...args: [
subcommand: "LIST",
type: "TYPE",
pubsub: "PUBSUB",
idToken: "ID",
...clientIds: (number | string)[]
]): Result;
/**
* Set client eviction mode for the current connection
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 7.0.0
*/
client(subcommand: "NO-EVICT", on: "ON", callback?: Callback): Result;
client(subcommand: "NO-EVICT", off: "OFF", callback?: Callback): Result