UNPKG

iovalkey

Version:

A robust, performance-focused and full-featured Valkey/Redis client for Node.js.

1,106 lines 410 kB
/** * 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>; /** * Lists 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", category: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>; /** * Deletes ACL users, and terminates their connections. * - _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>; /** * Simulates the execution of a command by a user, 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>; /** * Generates a pseudorandom, secure password that can be used to identify 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>; /** * Lists the ACL rules of a 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>; /** * Returns helpful text about the different subcommands. * - _group_: server * - _complexity_: O(1) * - _since_: 6.0.0 */ acl(subcommand: "HELP", callback?: Callback<unknown>): Result<unknown, Context>; /** * Dumps the effective rules in ACL 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>; /** * Reloads the rules 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>; /** * Lists recent security events generated due to ACL rules. * - _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>; /** * Saves the effective 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>; /** * Creates and modifies an ACL user and its rules. * - _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>; /** * Lists all ACL users. * - _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>; /** * Returns the authenticated username of 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>; /** * Appends a string to the value of a key. Creates the key if it doesn't exist. * - _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 the server 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>; /** * 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>; /** * Authenticates the connection. * - _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 rewrites the append-only file to disk. * - _group_: server * - _complexity_: O(1) * - _since_: 1.0.0 */ bgrewriteaof(callback?: Callback<string>): Result<string, Context>; bgrewriteaofBuffer(callback?: Callback<Buffer>): Result<Buffer, Context>; /** * Asynchronously saves the database(s) 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>; /** * Counts the number of set bits (population counting) 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, 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>; /** * Performs arbitrary bitfield integer operations on strings. * - _group_: bitmap * - _complexity_: O(1) for each subcommand specified * - _since_: 3.2.0 */ bitfield(key: RedisKey, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, getBlockToken: "GET", encoding: string | Buffer, offset: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, setBlockToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, incrbyBlockToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", setBlockToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", incrbyBlockToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", setBlockToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", incrbyBlockToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", setBlockToken: "SET", encoding: string | Buffer, offset: number | string, value: number | string, callback?: Callback<unknown>): Result<unknown, Context>; bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", incrbyBlockToken: "INCRBY", encoding: string | Buffer, offset: number | string, increment: number | string, callback?: Callback<unknown>): Result<unknown, Context>; /** * Performs arbitrary read-only bitfield integer operations on strings. * - _group_: bitmap * - _complexity_: O(1) for each subcommand specified * - _since_: 6.0.0 */ bitfield_ro(key: RedisKey, callback?: Callback<unknown[]>): Result<unknown[], Context>; bitfield_ro(...args: [ key: RedisKey, getBlockToken: "GET", ...getBlocks: (string | Buffer | number)[], callback: Callback<unknown[]> ]): Result<unknown[], Context>; bitfield_ro(...args: [ key: RedisKey, getBlockToken: "GET", ...getBlocks: (string | Buffer | number)[] ]): Result<unknown[], Context>; /** * Performs bitwise operations on multiple strings, and stores the result. * - _group_: bitmap * - _complexity_: O(N) * - _since_: 2.6.0 */ bitop(...args: [ and: "AND", destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [ and: "AND", destkey: RedisKey, keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [and: "AND", destkey: RedisKey, ...keys: RedisKey[]]): Result<number, Context>; bitop(...args: [and: "AND", destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>; bitop(...args: [ or: "OR", destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [ or: "OR", destkey: RedisKey, keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [or: "OR", destkey: RedisKey, ...keys: RedisKey[]]): Result<number, Context>; bitop(...args: [or: "OR", destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>; bitop(...args: [ xor: "XOR", destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [ xor: "XOR", destkey: RedisKey, keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [xor: "XOR", destkey: RedisKey, ...keys: RedisKey[]]): Result<number, Context>; bitop(...args: [xor: "XOR", destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>; bitop(...args: [ not: "NOT", destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [ not: "NOT", destkey: RedisKey, keys: RedisKey[], callback: Callback<number> ]): Result<number, Context>; bitop(...args: [not: "NOT", destkey: RedisKey, ...keys: RedisKey[]]): Result<number, Context>; bitop(...args: [not: "NOT", destkey: RedisKey, keys: RedisKey[]]): Result<number, Context>; /** * Finds the first set (1) or clear (0) bit 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>; /** * Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved. * - _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>; /** * Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped. * - _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>; /** * Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. * - _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>; /** * Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. * - _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>; /** * Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped. * - _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>; /** * Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. * - _group_: sorted-set * - _complexity_: O(K) + O(M*log(N)) 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>; /** * Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped. * - _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>; /** * Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. * - _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>; /** * Instructs the server whether to track the 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>; /** * A client claims its capability. * - _group_: connection * - _complexity_: O(1) * - _since_: 8.0.0 */ client(...args: [ subcommand: "CAPA", ...capabilities: (string | Buffer)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [subcommand: "CAPA", ...capabilities: (string | Buffer)[]]): Result<unknown, Context>; /** * Returns the name of the connection. * - _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>; /** * Returns the client ID to which the connection's tracking notifications are redirected. * - _group_: connection * - _complexity_: O(1) * - _since_: 6.0.0 */ client(subcommand: "GETREDIR", callback?: Callback<number>): Result<number, Context>; /** * Returns 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 unique client ID of the connection. * - _group_: connection * - _complexity_: O(1) * - _since_: 5.0.0 */ client(subcommand: "ID", callback?: Callback<number>): Result<number, Context>; /** * Returns information about the connection. * - _group_: connection * - _complexity_: O(1) * - _since_: 6.2.0 */ client(subcommand: "INFO", callback?: Callback<string>): Result<string, Context>; clientBuffer(subcommand: "INFO", callback?: Callback<Buffer>): Result<Buffer, Context>; /** * Terminates open connections. * - _group_: connection * - _complexity_: O(N) where N is the number of client connections * - _since_: 2.4.0 */ client(subcommand: "KILL", oldFormat: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", clientIdToken: "ID", clientId: number | string, callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", normal: "NORMAL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", master: "MASTER", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", primary: "PRIMARY", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", slave: "SLAVE", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", replica: "REPLICA", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", type: "TYPE", pubsub: "PUBSUB", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", usernameToken: "USER", username: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", addrToken: "ADDR", addr: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", laddrToken: "LADDR", laddr: string | Buffer, callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", skipme: "SKIPME", yes: "YES", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", skipme: "SKIPME", no: "NO", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "KILL", maxageToken: "MAXAGE", maxage: number | string, callback?: Callback<unknown>): Result<unknown, Context>; /** * Lists open connections. * - _group_: connection * - _complexity_: O(N) where N is the number of client connections * - _since_: 2.4.0 */ client(subcommand: "LIST", callback?: Callback<unknown>): Result<unknown, Context>; client(...args: [ subcommand: "LIST", clientIdToken: "ID", ...clientIds: (number | string)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [ subcommand: "LIST", clientIdToken: "ID", ...clientIds: (number | string)[] ]): Result<unknown, Context>; client(subcommand: "LIST", type: "TYPE", normal: "NORMAL", callback?: Callback<unknown>): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", normal: "NORMAL", clientIdToken: "ID", ...clientIds: (number | string)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", normal: "NORMAL", clientIdToken: "ID", ...clientIds: (number | string)[] ]): Result<unknown, Context>; client(subcommand: "LIST", type: "TYPE", master: "MASTER", callback?: Callback<unknown>): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", master: "MASTER", clientIdToken: "ID", ...clientIds: (number | string)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", master: "MASTER", clientIdToken: "ID", ...clientIds: (number | string)[] ]): Result<unknown, Context>; client(subcommand: "LIST", type: "TYPE", replica: "REPLICA", callback?: Callback<unknown>): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", replica: "REPLICA", clientIdToken: "ID", ...clientIds: (number | string)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", replica: "REPLICA", clientIdToken: "ID", ...clientIds: (number | string)[] ]): Result<unknown, Context>; client(subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", callback?: Callback<unknown>): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", clientIdToken: "ID", ...clientIds: (number | string)[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [ subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", clientIdToken: "ID", ...clientIds: (number | string)[] ]): Result<unknown, Context>; /** * Sets the client eviction mode of the connection. * - _group_: connection * - _complexity_: O(1) * - _since_: 7.0.0 */ client(subcommand: "NO-EVICT", on: "ON", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "NO-EVICT", off: "OFF", callback?: Callback<unknown>): Result<unknown, Context>; /** * Controls whether commands sent by the client affect the LRU/LFU of accessed keys. * - _group_: connection * - _complexity_: O(1) * - _since_: 7.2.0 */ client(subcommand: "NO-TOUCH", on: "ON", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "NO-TOUCH", off: "OFF", callback?: Callback<unknown>): Result<unknown, Context>; /** * Suspends commands processing. * - _group_: connection * - _complexity_: O(1) * - _since_: 3.0.0 */ client(subcommand: "PAUSE", timeout: number | string, callback?: Callback<"OK">): Result<"OK", Context>; client(subcommand: "PAUSE", timeout: number | string, write: "WRITE", callback?: Callback<"OK">): Result<"OK", Context>; client(subcommand: "PAUSE", timeout: number | string, all: "ALL", callback?: Callback<"OK">): Result<"OK", Context>; /** * Instructs the server whether to reply to commands. * - _group_: connection * - _complexity_: O(1) * - _since_: 3.2.0 */ client(subcommand: "REPLY", on: "ON", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "REPLY", off: "OFF", callback?: Callback<unknown>): Result<unknown, Context>; client(subcommand: "REPLY", skip: "SKIP", callback?: Callback<unknown>): Result<unknown, Context>; /** * Sets information specific to the client or connection. * - _group_: connection * - _complexity_: O(1) * - _since_: 7.2.0 */ client(subcommand: "SETINFO", libnameToken: "LIB-NAME", libname: string | Buffer, callback?: Callback<string>): Result<string, Context>; clientBuffer(subcommand: "SETINFO", libnameToken: "LIB-NAME", libname: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>; client(subcommand: "SETINFO", libverToken: "LIB-VER", libver: string | Buffer, callback?: Callback<string>): Result<string, Context>; clientBuffer(subcommand: "SETINFO", libverToken: "LIB-VER", libver: string | Buffer, callback?: Callback<Buffer>): Result<Buffer, Context>; /** * Sets the connection name. * - _group_: connection * - _complexity_: O(1) * - _since_: 2.6.9 */ client(subcommand: "SETNAME", connectionName: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>; /** * Controls server-assisted client-side caching for the connection. * - _group_: connection * - _complexity_: O(1). Some options may introduce additional complexity. * - _since_: 6.0.0 */ client(...args: [ subcommand: "TRACKING", ...args: RedisValue[], callback: Callback<unknown> ]): Result<unknown, Context>; client(...args: [subcommand: "TRACKING", ...args: RedisValue[]]): Result<unknown, Context>; /** * Returns information about server-assisted client-side caching for the connection. * - _group_: connection * - _complexity_: O(1) * - _since_: 6.2.0 */ client(subcommand: "TRACKINGINFO", callback?: Callback<string>): Result<string, Context>; clientBuffer(su