UNPKG

@valkey/client

Version:

The source code and documentation for this package are in the main [node-redis](https://github.com/redis/node-redis) repo.

31 lines (30 loc) 1.8 kB
import { ClientCommandOptions } from "./client"; import { CommandOptions } from "./command-options"; import { ValkeyCommand, ValkeyCommandArgument, ValkeyCommandArguments, ValkeyCommandReply, ValkeyFunction, ValkeyFunctions, ValkeyModules, ValkeyScript, ValkeyScripts } from "./commands"; type Instantiable<T = any> = new (...args: Array<any>) => T; type CommandsExecutor<C extends ValkeyCommand = ValkeyCommand> = (command: C, args: Array<unknown>, name: string) => unknown; interface AttachCommandsConfig<C extends ValkeyCommand> { BaseClass: Instantiable; commands: Record<string, C>; executor: CommandsExecutor<C>; } export declare function attachCommands<C extends ValkeyCommand>({ BaseClass, commands, executor, }: AttachCommandsConfig<C>): void; interface AttachExtensionsConfig<T extends Instantiable = Instantiable> { BaseClass: T; modulesExecutor: CommandsExecutor; modules?: ValkeyModules; functionsExecutor: CommandsExecutor<ValkeyFunction>; functions?: ValkeyFunctions; scriptsExecutor: CommandsExecutor<ValkeyScript>; scripts?: ValkeyScripts; } export declare function attachExtensions(config: AttachExtensionsConfig): any; export declare function transformCommandArguments<T = ClientCommandOptions>(command: ValkeyCommand, args: Array<unknown>): { jsArgs: Array<unknown>; args: ValkeyCommandArguments; options: CommandOptions<T> | undefined; }; export declare function transformLegacyCommandArguments(args: Array<any>): Array<any>; export declare function transformCommandReply<C extends ValkeyCommand>(command: C, rawReply: unknown, preserved: unknown): ValkeyCommandReply<C>; export declare function fCallArguments(name: ValkeyCommandArgument, fn: ValkeyFunction, args: ValkeyCommandArguments): ValkeyCommandArguments; export {};