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

@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: false,
/**
* Adds an item to a Cuckoo Filter, creating the filter if it does not exist
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param item - The item to add to the filter
*/
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
parser.push('CF.ADD');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: false,
/**
* Adds an item to a Cuckoo Filter only if it does not exist
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param item - The item to add to the filter if it doesn't exist
*/
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
parser.push('CF.ADDNX');
parser.pushKey(key);

View File

@@ -3,6 +3,12 @@ import { RedisArgument, NumberReply, Command } from '@redis/client/dist/lib/RESP
export default {
IS_READ_ONLY: true,
/**
* Returns the number of times an item appears in a Cuckoo Filter
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param item - The item to count occurrences of
*/
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
parser.push('CF.COUNT');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: false,
/**
* Removes an item from a Cuckoo Filter if it exists
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param item - The item to remove from the filter
*/
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
parser.push('CF.DEL');
parser.pushKey(key);

View File

@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
export default {
IS_READ_ONLY: false,
/**
* Checks if an item exists in a Cuckoo Filter
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param item - The item to check for existence
*/
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
parser.push('CF.EXISTS');
parser.pushKey(key);

View File

@@ -15,6 +15,11 @@ export type CfInfoReplyMap = TuplesToMapReply<[
export default {
IS_READ_ONLY: true,
/**
* Returns detailed information about a Cuckoo Filter including size, buckets, filters count, items statistics and configuration
* @param parser - The command parser
* @param key - The name of the Cuckoo filter to get information about
*/
parseCommand(parser: CommandParser, key: RedisArgument) {
parser.push('CF.INFO');
parser.pushKey(key);

View File

@@ -29,6 +29,15 @@ export function parseCfInsertArguments(
export default {
IS_READ_ONLY: false,
/**
* Adds one or more items to a Cuckoo Filter, creating it if it does not exist
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param items - One or more items to add to the filter
* @param options - Optional parameters for filter creation
* @param options.CAPACITY - The number of entries intended to be added to the filter
* @param options.NOCREATE - If true, prevents automatic filter creation
*/
parseCommand(...args: Parameters<typeof parseCfInsertArguments>) {
args[0].push('CF.INSERT');
parseCfInsertArguments(...args);

View File

@@ -1,6 +1,15 @@
import { Command } from '@redis/client/dist/lib/RESP/types';
import INSERT, { parseCfInsertArguments } from './INSERT';
/**
* Adds one or more items to a Cuckoo Filter only if they do not exist yet, creating the filter if needed
* @param parser - The command parser
* @param key - The name of the Cuckoo filter
* @param items - One or more items to add to the filter
* @param options - Optional parameters for filter creation
* @param options.CAPACITY - The number of entries intended to be added to the filter
* @param options.NOCREATE - If true, prevents automatic filter creation
*/
export default {
IS_READ_ONLY: INSERT.IS_READ_ONLY,
parseCommand(...args: Parameters<typeof parseCfInsertArguments>) {

View File

@@ -3,6 +3,13 @@ import { SimpleStringReply, Command, RedisArgument } from '@redis/client/dist/li
export default {
IS_READ_ONLY: false,
/**
* Restores a Cuckoo Filter chunk previously saved using SCANDUMP
* @param parser - The command parser
* @param key - The name of the Cuckoo filter to restore
* @param iterator - Iterator value from the SCANDUMP command
* @param chunk - Data chunk from the SCANDUMP command
*/
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number, chunk: RedisArgument) {
parser.push('CF.LOADCHUNK');
parser.pushKey(key);

View File

@@ -9,6 +9,16 @@ export interface CfReserveOptions {
export default {
IS_READ_ONLY: false,
/**
* Creates an empty Cuckoo Filter with specified capacity and parameters
* @param parser - The command parser
* @param key - The name of the Cuckoo filter to create
* @param capacity - The number of entries intended to be added to the filter
* @param options - Optional parameters to tune the filter
* @param options.BUCKETSIZE - Number of items in each bucket
* @param options.MAXITERATIONS - Maximum number of iterations before declaring filter full
* @param options.EXPANSION - Number of additional buckets per expansion
*/
parseCommand(
parser: CommandParser,
key: RedisArgument,

View File

@@ -3,6 +3,12 @@ import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, NullReply, Un
export default {
IS_READ_ONLY: true,
/**
* Begins an incremental save of a Cuckoo Filter. This is useful for large filters that can't be saved at once
* @param parser - The command parser
* @param key - The name of the Cuckoo filter to save
* @param iterator - Iterator value; Start at 0, and use the iterator from the response for the next chunk
*/
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number) {
parser.push('CF.SCANDUMP');
parser.pushKey(key);