1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +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

@@ -4,6 +4,12 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: false,
/**
* Adds one or more items to a Top-K filter and returns items dropped from the top-K list
* @param parser - The command parser
* @param key - The name of the Top-K filter
* @param items - One or more items to add to the filter
*/
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
parser.push('TOPK.ADD');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: true,
/**
* Returns the count of occurrences for one or more items in a Top-K filter
* @param parser - The command parser
* @param key - The name of the Top-K filter
* @param items - One or more items to get counts for
*/
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
parser.push('TOPK.COUNT');
parser.pushKey(key);

View File

@@ -12,6 +12,12 @@ function pushIncrByItem(parser: CommandParser, { item, incrementBy }: TopKIncrBy
export default {
IS_READ_ONLY: false,
/**
* Increases the score of one or more items in a Top-K filter by specified increments
* @param parser - The command parser
* @param key - The name of the Top-K filter
* @param items - A single item or array of items to increment, each with an item name and increment value
*/
parseCommand(
parser: CommandParser,
key: RedisArgument,

View File

@@ -12,6 +12,11 @@ export type TopKInfoReplyMap = TuplesToMapReply<[
export default {
IS_READ_ONLY: true,
/**
* Returns configuration and statistics of a Top-K filter, including k, width, depth, and decay parameters
* @param parser - The command parser
* @param key - The name of the Top-K filter to get information about
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TOPK.INFO');
parser.pushKey(key);

View File

@@ -3,6 +3,11 @@ import { RedisArgument, ArrayReply, BlobStringReply, Command } from '@redis/clie
export default {
IS_READ_ONLY: true,
/**
* Returns all items in a Top-K filter
* @param parser - The command parser
* @param key - The name of the Top-K filter
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TOPK.LIST');
parser.pushKey(key);

View File

@@ -3,6 +3,11 @@ import { RedisArgument, ArrayReply, BlobStringReply, NumberReply, UnwrapReply, C
export default {
IS_READ_ONLY: true,
/**
* Returns all items in a Top-K filter with their respective counts
* @param parser - The command parser
* @param key - The name of the Top-K filter
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('TOPK.LIST');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { RedisVariadicArgument, transformBooleanArrayReply } from '@redis/client
export default {
IS_READ_ONLY: false,
/**
* Checks if one or more items are in the Top-K list
* @param parser - The command parser
* @param key - The name of the Top-K filter
* @param items - One or more items to check in the filter
*/
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
parser.push('TOPK.QUERY');
parser.pushKey(key);

View File

@@ -9,6 +9,16 @@ export interface TopKReserveOptions {
export default {
IS_READ_ONLY: false,
/**
* Creates a new Top-K filter with specified parameters
* @param parser - The command parser
* @param key - The name of the Top-K filter
* @param topK - Number of top occurring items to keep
* @param options - Optional parameters for filter configuration
* @param options.width - Number of counters in each array
* @param options.depth - Number of counter-arrays
* @param options.decay - Counter decay factor
*/
parseCommand(parser: CommandParser, key: RedisArgument, topK: number, options?: TopKReserveOptions) {
parser.push('TOPK.RESERVE');
parser.pushKey(key);