1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

(docs) add jsdoc comments to command parsers (#2984)

* (docs) bloom: add jsdocs for all commands

* (docs) json: add jsdocs

* (docs) search: add jsdocs for all commands

* (docs) jsdocs for std commands

* (docs) jsdoc comments to time series commands
This commit is contained in:
Bobby I.
2025-06-03 14:38:07 +03:00
committed by GitHub
parent e4a1ca467f
commit 20c16e0c2c
491 changed files with 3861 additions and 1 deletions

View File

@@ -3,6 +3,12 @@ import { SimpleStringReply, Command, RedisArgument } from '@redis/client/dist/li
export default {
IS_READ_ONLY: false,
/**
* Adds one or more observations to a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param values - Array of numeric values to add to the sketch
*/
parseCommand(parser: CommandParser, key: RedisArgument, values: Array<number>) {
parser.push('TDIGEST.ADD');
parser.pushKey(key);

View File

@@ -16,6 +16,12 @@ export function transformByRankArguments(
export default {
IS_READ_ONLY: true,
/**
* Returns value estimates for one or more ranks in a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param ranks - Array of ranks to get value estimates for (ascending order)
*/
parseCommand(...args: Parameters<typeof transformByRankArguments>) {
args[0].push('TDIGEST.BYRANK');
transformByRankArguments(...args);

View File

@@ -1,6 +1,12 @@
import { Command } from '@redis/client/dist/lib/RESP/types';
import BYRANK, { transformByRankArguments } from './BYRANK';
/**
* Returns value estimates for one or more ranks in a t-digest sketch, starting from highest rank
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param ranks - Array of ranks to get value estimates for (descending order)
*/
export default {
IS_READ_ONLY: BYRANK.IS_READ_ONLY,
parseCommand(...args: Parameters<typeof transformByRankArguments>) {

View File

@@ -4,6 +4,12 @@ import { transformDoubleArrayReply } from '@redis/client/dist/lib/commands/gener
export default {
IS_READ_ONLY: true,
/**
* Estimates the cumulative distribution function for values in a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param values - Array of values to get CDF estimates for
*/
parseCommand(parser: CommandParser, key: RedisArgument, values: Array<number>) {
parser.push('TDIGEST.CDF');
parser.pushKey(key);

View File

@@ -7,6 +7,13 @@ export interface TDigestCreateOptions {
export default {
IS_READ_ONLY: false,
/**
* Creates a new t-digest sketch for storing distributions
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param options - Optional parameters for sketch creation
* @param options.COMPRESSION - Compression parameter that affects performance and accuracy
*/
parseCommand(parser: CommandParser, key: RedisArgument, options?: TDigestCreateOptions) {
parser.push('TDIGEST.CREATE');
parser.pushKey(key);

View File

@@ -16,6 +16,11 @@ export type TdInfoReplyMap = TuplesToMapReply<[
export default {
IS_READ_ONLY: true,
/**
* Returns information about a t-digest sketch including compression, capacity, nodes, weights, observations and memory usage
* @param parser - The command parser
* @param key - The name of the t-digest sketch to get information about
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TDIGEST.INFO');
parser.pushKey(key);

View File

@@ -4,6 +4,11 @@ import { transformDoubleReply } from '@redis/client/dist/lib/commands/generic-tr
export default {
IS_READ_ONLY: true,
/**
* Returns the maximum value from a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TDIGEST.MAX');
parser.pushKey(key);

View File

@@ -9,6 +9,15 @@ export interface TDigestMergeOptions {
export default {
IS_READ_ONLY: false,
/**
* Merges multiple t-digest sketches into one, with optional compression and override settings
* @param parser - The command parser
* @param destination - The name of the destination t-digest sketch
* @param source - One or more source sketch names to merge from
* @param options - Optional parameters for merge operation
* @param options.COMPRESSION - New compression value for merged sketch
* @param options.OVERRIDE - If true, override destination sketch if it exists
*/
parseCommand(
parser: CommandParser,
destination: RedisArgument,

View File

@@ -4,6 +4,11 @@ import { transformDoubleReply } from '@redis/client/dist/lib/commands/generic-tr
export default {
IS_READ_ONLY: true,
/**
* Returns the minimum value from a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TDIGEST.MIN');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { transformDoubleArrayReply } from '@redis/client/dist/lib/commands/gener
export default {
IS_READ_ONLY: true,
/**
* Returns value estimates at requested quantiles from a t-digest sketch
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param quantiles - Array of quantiles (between 0 and 1) to get value estimates for
*/
parseCommand(parser: CommandParser, key: RedisArgument, quantiles: Array<number>) {
parser.push('TDIGEST.QUANTILE');
parser.pushKey(key);

View File

@@ -15,6 +15,12 @@ export function transformRankArguments(
export default {
IS_READ_ONLY: true,
/**
* Returns the rank of one or more values in a t-digest sketch (number of values that are lower than each value)
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param values - Array of values to get ranks for
*/
parseCommand(...args: Parameters<typeof transformRankArguments>) {
args[0].push('TDIGEST.RANK');
transformRankArguments(...args);

View File

@@ -3,6 +3,11 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
export default {
IS_READ_ONLY: false,
/**
* Resets a t-digest sketch, clearing all previously added observations
* @param parser - The command parser
* @param key - The name of the t-digest sketch to reset
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TDIGEST.RESET');
parser.pushKey(key);

View File

@@ -1,6 +1,12 @@
import { Command } from '@redis/client/dist/lib/RESP/types';
import RANK, { transformRankArguments } from './RANK';
/**
* Returns the reverse rank of one or more values in a t-digest sketch (number of values that are higher than each value)
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param values - Array of values to get reverse ranks for
*/
export default {
IS_READ_ONLY: RANK.IS_READ_ONLY,
parseCommand(...args: Parameters<typeof transformRankArguments>) {

View File

@@ -4,6 +4,13 @@ import { transformDoubleReply } from '@redis/client/dist/lib/commands/generic-tr
export default {
IS_READ_ONLY: true,
/**
* Returns the mean value from a t-digest sketch after trimming values at specified percentiles
* @param parser - The command parser
* @param key - The name of the t-digest sketch
* @param lowCutPercentile - Lower percentile cutoff (between 0 and 100)
* @param highCutPercentile - Higher percentile cutoff (between 0 and 100)
*/
parseCommand(
parser: CommandParser,
key: RedisArgument,