///
import { ClientCommandOptions } from "../client";
import { CommandOptions } from "../command-options";
import { ValkeyScriptConfig, SHA1 } from "../lua-script";
export type ValkeyCommandRawReply = string | number | Buffer | null | undefined | Array;
export type ValkeyCommandArgument = string | Buffer;
export type ValkeyCommandArguments = Array & {
preserve?: unknown;
};
export interface ValkeyCommand {
FIRST_KEY_INDEX?: number | ((...args: Array) => ValkeyCommandArgument | undefined);
IS_READ_ONLY?: boolean;
TRANSFORM_LEGACY_REPLY?: boolean;
transformArguments(this: void, ...args: Array): ValkeyCommandArguments;
transformReply?(this: void, reply: any, preserved?: any): any;
}
export type ValkeyCommandReply = C["transformReply"] extends (...args: any) => infer T ? T : ValkeyCommandRawReply;
export type ConvertArgumentType = Type extends ValkeyCommandArgument ? Type extends string & ToType ? Type : ToType : Type extends Set ? Set> : Type extends Map ? Map> : Type extends Array ? Array> : Type extends Date ? Type : Type extends Record ? {
[Property in keyof Type]: ConvertArgumentType;
} : Type;
export type ValkeyCommandSignature = Parameters> = >(...args: Params | [options: Options, ...rest: Params]) => Promise, Options["returnBuffers"] extends true ? Buffer : string>>;
export interface ValkeyCommands {
[command: string]: ValkeyCommand;
}
export interface ValkeyModule {
[command: string]: ValkeyCommand;
}
export interface ValkeyModules {
[module: string]: ValkeyModule;
}
export interface ValkeyFunction extends ValkeyCommand {
NUMBER_OF_KEYS?: number;
}
export interface ValkeyFunctionLibrary {
[fn: string]: ValkeyFunction;
}
export interface ValkeyFunctions {
[library: string]: ValkeyFunctionLibrary;
}
export type ValkeyScript = ValkeyScriptConfig & SHA1;
export interface ValkeyScripts {
[script: string]: ValkeyScript;
}
export interface ValkeyExtensions {
modules?: M;
functions?: F;
scripts?: S;
}
export type ExcludeMappedString = string extends S ? never : S;