ioredis
Version:
A robust, performance-focused and full-featured Redis client for Node.js.
1,029 lines • 463 kB
TypeScript
/**
* This file is generated by @ioredis/interface-generator.
* Don't edit it manually. Instead, run `npm run generate` to update
* this file.
*/
/// <reference types="node" />
import { Callback } from "../types";
export declare type RedisKey = string | Buffer;
export declare type RedisValue = string | Buffer | number;
export interface ResultTypes<Result, Context> {
default: Promise<Result>;
pipeline: ChainableCommander;
}
export interface ChainableCommander extends RedisCommander<{
type: "pipeline";
}> {
length: number;
}
export declare type ClientContext = {
type: keyof ResultTypes<unknown, unknown>;
};
export declare type Result<T, Context extends ClientContext> = ResultTypes<T, Context>[Context["type"]];
interface RedisCommander<Context extends ClientContext = {
type: "default";
}> {
/**
* 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<unknown>): Result<unknown, Context>;
call(command: string, args: (string | Buffer | number)[], callback?: Callback<unknown>): Result<unknown, Context>;
call(...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback<unknown>
]): Result<unknown, Context>;
call(...args: [command: string, ...args: (string | Buffer | number)[]]): Result<unknown, Context>;
callBuffer(command: string, callback?: Callback<unknown>): Result<unknown, Context>;
callBuffer(command: string, args: (string | Buffer | number)[], callback?: Callback<unknown>): Result<unknown, Context>;
callBuffer(...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback<unknown>
]): Result<unknown, Context>;
callBuffer(...args: [command: string, ...args: (string | Buffer | number)[]]): Result<unknown, Context>;
/**
* 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<unknown>): Result<unknown, Context>;
acl(subcommand: "CAT", categoryname: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>;
/**
* 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<number>
]): Result<number, Context>;
acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]): Result<number, Context>;
/**
* 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<string>): Result<string, Context>;
aclBuffer(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>;
acl(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[],
callback: Callback<string>
]): Result<string, Context>;
aclBuffer(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[],
callback: Callback<Buffer>
]): Result<Buffer, Context>;
acl(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[]
]): Result<string, Context>;
aclBuffer(...args: [
subcommand: "DRYRUN",
username: string | Buffer,
command: string | Buffer,
...args: (string | Buffer | number)[]
]): Result<Buffer, Context>;
/**
* Generate a pseudorandom secure password to use for ACL users
* - _group_: server
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
acl(subcommand: "GENPASS", callback?: Callback<string>): Result<string, Context>;
aclBuffer(subcommand: "GENPASS", callback?: Callback<Buffer>): Result<Buffer, Context>;
acl(subcommand: "GENPASS", bits: number | string, callback?: Callback<string>): Result<string, Context>;
aclBuffer(subcommand: "GENPASS", bits: number | string, callback?: Callback<Buffer>): Result<Buffer, Context>;
/**
* 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<string[] | null>): Result<string[] | null, Context>;
aclBuffer(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<Buffer[] | null>): Result<Buffer[] | null, Context>;
/**
* Show helpful text about the different subcommands
* - _group_: server
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
acl(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
/**
* 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<string[]>): Result<string[], Context>;
aclBuffer(subcommand: "LIST", callback?: Callback<Buffer[]>): Result<Buffer[], Context>;
/**
* 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<unknown>): Result<unknown, Context>;
acl(subcommand: "LOG", count: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
acl(subcommand: "LOG", reset: "RESET", callback?: Callback<unknown>): Result<unknown, Context>;
/**
* 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<string[]>): Result<string[], Context>;
aclBuffer(subcommand: "USERS", callback?: Callback<Buffer[]>): Result<Buffer[], Context>;
/**
* 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<string>): Result<string, Context>;
aclBuffer(subcommand: "WHOAMI", callback?: Callback<Buffer>): Result<Buffer, Context>;
/**
* 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<number>): Result<number, Context>;
/**
* Returns the number of non-empty elements in an array.
* - _group_: array
* - _complexity_: O(1)
* - _since_: 8.8.0
*/
arcount(key: RedisKey, callback?: Callback<number>): Result<number, Context>;
/**
* Deletes elements at the specified indices in an array.
* - _group_: array
* - _complexity_: O(N) where N is the number of indices to delete
* - _since_: 8.8.0
*/
ardel(...args: [key: RedisKey, ...indices: (number | string)[], callback: Callback<number>]): Result<number, Context>;
ardel(...args: [key: RedisKey, ...indices: (number | string)[]]): Result<number, Context>;
/**
* Deletes elements in one or more ranges.
* - _group_: array
* - _complexity_: Proportional to the number of existing elements / slices touched, not to the numeric span of the requested ranges
* - _since_: 8.8.0
*/
ardelrange(...args: [key: RedisKey, ...ranges: (string | number)[], callback: Callback<number>]): Result<number, Context>;
ardelrange(...args: [key: RedisKey, ...ranges: (string | number)[]]): Result<number, Context>;
/**
* Gets the value at an index in an array.
* - _group_: array
* - _complexity_: O(1)
* - _since_: 8.8.0
*/
arget(key: RedisKey, index: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
argetBuffer(key: RedisKey, index: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
/**
* Gets values in a range of indices.
* - _group_: array
* - _complexity_: O(N) where N is the range length
* - _since_: 8.8.0
*/
argetrange(key: RedisKey, start: number | string, end: number | string, callback?: Callback<(string | null)[]>): Result<(string | null)[], Context>;
argetrangeBuffer(key: RedisKey, start: number | string, end: number | string, callback?: Callback<(Buffer | null)[]>): Result<(Buffer | null)[], Context>;
/**
* Searches array elements in a range using textual predicates.
* - _group_: array
* - _complexity_: O(P * C) where P is the number of visited positions in touched slices and C is the cost of evaluating the predicates on one existing element.
* - _since_: 8.8.0
*/
argrep(key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, callback: Callback<number[]>): Result<number[], Context>;
argrep(...args: [key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, ...args: RedisValue[], callback: Callback<number[] | Array<[index: number, value: string]>>]): Result<number[] | Array<[index: number, value: string]>, Context>;
argrep<T extends RedisValue[]>(...args: [key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, ...args: T]): Result<'WITHVALUES' extends T[number] ? Array<[index: number, value: string]> : number[], Context>;
argrepBuffer(key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, callback: Callback<number[]>): Result<number[], Context>;
argrepBuffer(...args: [key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, ...args: RedisValue[], callback: Callback<number[] | Array<[index: number, value: Buffer]>>]): Result<number[] | Array<[index: number, value: Buffer]>, Context>;
argrepBuffer<T extends RedisValue[]>(...args: [key: RedisKey, start: number | string, end: number | string, predicate: 'EXACT' | 'MATCH' | 'GLOB' | 'RE', value: RedisValue, ...args: T]): Result<'WITHVALUES' extends T[number] ? Array<[index: number, value: Buffer]> : number[], Context>;
/**
* Returns metadata about an array.
* - _group_: array
* - _complexity_: O(1), or O(N) with FULL option where N is the number of slices.
* - _since_: 8.8.0
*/
arinfo(key: RedisKey, callback?: Callback<(string | number)[]>): Result<(string | number)[], Context>;
arinfoBuffer(key: RedisKey, callback?: Callback<(Buffer | number)[]>): Result<(Buffer | number)[], Context>;
arinfo(key: RedisKey, full: 'FULL', callback?: Callback<(string | number)[]>): Result<(string | number)[], Context>;
arinfoBuffer(key: RedisKey, full: 'FULL', callback?: Callback<(Buffer | number)[]>): Result<(Buffer | number)[], Context>;
/**
* Inserts one or more values at consecutive indices.
* - _group_: array
* - _complexity_: O(N) where N is the number of values
* - _since_: 8.8.0
*/
arinsert(...args: [key: RedisKey, ...values: (string | Buffer | number)[], callback: Callback<number>]): Result<number, Context>;
arinsert(...args: [key: RedisKey, ...values: (string | Buffer | number)[]]): Result<number, Context>;
/**
* Returns the most recently inserted elements.
* - _group_: array
* - _complexity_: O(N) where N is the count
* - _since_: 8.8.0
*/
arlastitems(key: RedisKey, count: number | string, callback?: Callback<(string | null)[]>): Result<(string | null)[], Context>;
arlastitemsBuffer(key: RedisKey, count: number | string, callback?: Callback<(Buffer | null)[]>): Result<(Buffer | null)[], Context>;
arlastitems(key: RedisKey, count: number | string, rev: 'REV', callback?: Callback<(string | null)[]>): Result<(string | null)[], Context>;
arlastitemsBuffer(key: RedisKey, count: number | string, rev: 'REV', callback?: Callback<(Buffer | null)[]>): Result<(Buffer | null)[], Context>;
/**
* Returns the length of an array (max index + 1).
* - _group_: array
* - _complexity_: O(1)
* - _since_: 8.8.0
*/
arlen(key: RedisKey, callback?: Callback<number>): Result<number, Context>;
/**
* Gets values at multiple indices in an array.
* - _group_: array
* - _complexity_: O(N) where N is the number of indices
* - _since_: 8.8.0
*/
armget(...args: [key: RedisKey, ...indices: (number | string)[], callback: Callback<(string | null)[]>]): Result<(string | null)[], Context>;
armgetBuffer(...args: [key: RedisKey, ...indices: (number | string)[], callback: Callback<(Buffer | null)[]>]): Result<(Buffer | null)[], Context>;
armget(...args: [key: RedisKey, ...indices: (number | string)[]]): Result<(string | null)[], Context>;
armgetBuffer(...args: [key: RedisKey, ...indices: (number | string)[]]): Result<(Buffer | null)[], Context>;
/**
* Sets multiple index-value pairs in an array.
* - _group_: array
* - _complexity_: O(N) where N is the number of pairs
* - _since_: 8.8.0
*/
armset(...args: [key: RedisKey, ...data: (string | Buffer | number)[], callback: Callback<number>]): Result<number, Context>;
armset(...args: [key: RedisKey, ...data: (string | Buffer | number)[]]): Result<number, Context>;
/**
* Returns the next index ARINSERT would use.
* - _group_: array
* - _complexity_: O(1)
* - _since_: 8.8.0
*/
arnext(key: RedisKey, callback?: Callback<number | null>): Result<number | null, Context>;
/**
* Performs aggregate operations on array elements in a range.
* - _group_: array
* - _complexity_: O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.
* - _since_: 8.8.0
*/
arop(key: RedisKey, start: number | string, end: number | string, sum: 'SUM', callback?: Callback<string | null>): Result<string | null, Context>;
aropBuffer(key: RedisKey, start: number | string, end: number | string, sum: 'SUM', callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, min: 'MIN', callback?: Callback<string | null>): Result<string | null, Context>;
aropBuffer(key: RedisKey, start: number | string, end: number | string, min: 'MIN', callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, max: 'MAX', callback?: Callback<string | null>): Result<string | null, Context>;
aropBuffer(key: RedisKey, start: number | string, end: number | string, max: 'MAX', callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, and: 'AND', callback?: Callback<number | null>): Result<number | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, or: 'OR', callback?: Callback<number | null>): Result<number | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, xor: 'XOR', callback?: Callback<number | null>): Result<number | null, Context>;
arop(key: RedisKey, start: number | string, end: number | string, match: 'MATCH', value: string | Buffer | number, callback?: Callback<number>): Result<number, Context>;
arop(key: RedisKey, start: number | string, end: number | string, used: 'USED', callback?: Callback<number>): Result<number, Context>;
/**
* Inserts values into a ring buffer of specified size, wrapping and truncating as needed.
* - _group_: array
* - _complexity_: O(M) normally, O(N+M) on ring resize, where N is the maximum of the old and new ring size and M is the number of inserted values
* - _since_: 8.8.0
*/
arring(...args: [key: RedisKey, size: number | string, ...values: (string | Buffer | number)[], callback: Callback<number>]): Result<number, Context>;
arring(...args: [key: RedisKey, size: number | string, ...values: (string | Buffer | number)[]]): Result<number, Context>;
/**
* Iterates existing elements in a range, returning index-value pairs.
* - _group_: array
* - _complexity_: O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.
* - _since_: 8.8.0
*/
arscan(key: RedisKey, start: number | string, end: number | string, callback?: Callback<Array<[index: number, value: string]>>): Result<Array<[index: number, value: string]>, Context>;
arscanBuffer(key: RedisKey, start: number | string, end: number | string, callback?: Callback<Array<[index: number, value: Buffer]>>): Result<Array<[index: number, value: Buffer]>, Context>;
arscan(key: RedisKey, start: number | string, end: number | string, limitToken: 'LIMIT', limit: number | string, callback?: Callback<Array<[index: number, value: string]>>): Result<Array<[index: number, value: string]>, Context>;
arscanBuffer(key: RedisKey, start: number | string, end: number | string, limitToken: 'LIMIT', limit: number | string, callback?: Callback<Array<[index: number, value: Buffer]>>): Result<Array<[index: number, value: Buffer]>, Context>;
/**
* Sets the ARINSERT / ARRING cursor to a specific index.
* - _group_: array
* - _complexity_: O(1)
* - _since_: 8.8.0
*/
arseek(key: RedisKey, index: number | string, callback?: Callback<number>): Result<number, Context>;
/**
* Sets one or more contiguous values starting at an index in an array.
* - _group_: array
* - _complexity_: O(N) where N is the number of values
* - _since_: 8.8.0
*/
arset(...args: [key: RedisKey, index: number | string, ...values: (string | Buffer | number)[], callback: Callback<number>]): Result<number, Context>;
arset(...args: [key: RedisKey, index: number | string, ...values: (string | Buffer | number)[]]): Result<number, Context>;
/**
* Signals that a cluster client is following 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<string>): Result<string, Context>;
bgrewriteaofBuffer(callback?: Callback<Buffer>): Result<Buffer, Context>;
/**
* 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<number>): Result<number, Context>;
bitcount(key: RedisKey, start: number | string, end: number | string, callback?: Callback<number>): Result<number, Context>;
bitcount(key: RedisKey, start: number | string, end: number | string, byte: "BYTE", callback?: Callback<number>): Result<number, Context>;
bitcount(key: RedisKey, start: number | string, end: number | string, bit: "BIT", callback?: Callback<number>): Result<number, Context>;
/**
* Perform arbitrary bitfield integer operations on strings
* - _group_: bitmap
* - _complexity_: O(1) for each subcommand specified
* - _since_: 3.2.0
*/
bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>;
/**
* Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD
* - _group_: bitmap
* - _complexity_: O(1) for each subcommand specified
* - _since_: 6.0.0
*/
bitfield_ro(...args: [
key: RedisKey,
encodingOffsetToken: "GET",
...encodingOffsets: (string | Buffer | number)[],
callback: Callback<unknown[]>
]): Result<unknown[], Context>;
bitfield_ro(...args: [
key: RedisKey,
encodingOffsetToken: "GET",
...encodingOffsets: (string | Buffer | number)[]
]): Result<unknown[], Context>;
/**
* 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<number>
]): Result<number, Context>;
bitop(...args: [
operation: string | Buffer,
destkey: RedisKey,
keys: RedisKey[],
callback: Callback<number>
]): Result<number, Context>;
bitop(...args: [
operation: string | Buffer,
destkey: RedisKey,
...keys: RedisKey[]
]): Result<number, Context>;
bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>;
/**
* 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<number>): Result<number, Context>;
bitpos(key: RedisKey, bit: number | string, start: number | string, callback?: Callback<number>): Result<number, Context>;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, callback?: Callback<number>): Result<number, Context>;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, byte: "BYTE", callback?: Callback<number>): Result<number, Context>;
bitpos(key: RedisKey, bit: number | string, start: number | string, end: number | string, bit1: "BIT", callback?: Callback<number>): Result<number, 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_: 6.2.0
*/
blmove(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
blmove(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback<string | null>): Result<string | null, Context>;
blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
/**
* 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<string | null>): Result<string | null, Context>;
brpoplpushBuffer(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
/**
* 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<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN"
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN"
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string,
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string,
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
min: "MIN",
countToken: "COUNT",
count: number | string
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX"
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX"
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string,
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string,
callback: Callback<unknown>
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
...keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string
]): Result<unknown, Context>;
bzmpop(...args: [
timeout: number | string,
numkeys: number | string,
keys: RedisKey[],
max: "MAX",
countToken: "COUNT",
count: number | string
]): Result<unknown, Context>;
/**
* 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<string | null>): Result<string | null, Context>;
clientBuffer(subcommand: "GETNAME", callback?: Callback<Buffer | null>): Result<Buffer | null, Context>;
/**
* Get tracking notifications redirection client ID if any
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 6.0.0
*/
client(subcommand: "GETREDIR", callback?: Callback<number>): Result<number, Context>;
/**
* Show helpful text about the different subcommands
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 5.0.0
*/
client(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>;
/**
* Returns the client ID for the current connection
* - _group_: connection
* - _complexity_: O(1)
* - _since_: 5.0.0
*/
client(subcommand: "ID", callback?: Callback<number>): Result<number, Context>;
/**
* Returns information about the current client connection.
* - _group_: