Skip to content

Commit 20c16e0

Browse files
authored
(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
1 parent e4a1ca4 commit 20c16e0

File tree

491 files changed

+3861
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

491 files changed

+3861
-1
lines changed

packages/bloom/lib/commands/bloom/ADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Adds an item to a Bloom Filter
9+
* @param parser - The command parser
10+
* @param key - The name of the Bloom filter
11+
* @param item - The item to add to the filter
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('BF.ADD');
915
parser.pushKey(key);

packages/bloom/lib/commands/bloom/CARD.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { RedisArgument, NumberReply, Command } from '@redis/client/dist/lib/RESP
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Returns the cardinality (number of items) in a Bloom Filter
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to query
10+
*/
611
parseCommand(parser: CommandParser, key: RedisArgument) {
712
parser.push('BF.CARD');
813
parser.pushKey(key);

packages/bloom/lib/commands/bloom/EXISTS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: true,
7+
/**
8+
* Checks if an item exists in a Bloom Filter
9+
* @param parser - The command parser
10+
* @param key - The name of the Bloom filter
11+
* @param item - The item to check for existence
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('BF.EXISTS');
915
parser.pushKey(key);

packages/bloom/lib/commands/bloom/INFO.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export type BfInfoReplyMap = TuplesToMapReply<[
1212

1313
export default {
1414
IS_READ_ONLY: true,
15+
/**
16+
* Returns information about a Bloom Filter, including capacity, size, number of filters, items inserted, and expansion rate
17+
* @param parser - The command parser
18+
* @param key - The name of the Bloom filter to get information about
19+
*/
1520
parseCommand(parser: CommandParser, key: RedisArgument) {
1621
parser.push('BF.INFO');
1722
parser.pushKey(key);

packages/bloom/lib/commands/bloom/INSERT.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ export interface BfInsertOptions {
1313

1414
export default {
1515
IS_READ_ONLY: false,
16+
/**
17+
* Adds one or more items to a Bloom Filter, creating it if it does not exist
18+
* @param parser - The command parser
19+
* @param key - The name of the Bloom filter
20+
* @param items - One or more items to add to the filter
21+
* @param options - Optional parameters for filter creation
22+
* @param options.CAPACITY - Desired capacity for a new filter
23+
* @param options.ERROR - Desired error rate for a new filter
24+
* @param options.EXPANSION - Expansion rate for a new filter
25+
* @param options.NOCREATE - If true, prevents automatic filter creation
26+
* @param options.NONSCALING - Prevents the filter from creating additional sub-filters
27+
*/
1628
parseCommand(
1729
parser: CommandParser,
1830
key: RedisArgument,

packages/bloom/lib/commands/bloom/LOADCHUNK.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Restores a Bloom Filter chunk previously saved using SCANDUMP
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to restore
10+
* @param iterator - Iterator value from the SCANDUMP command
11+
* @param chunk - Data chunk from the SCANDUMP command
12+
*/
613
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number, chunk: RedisArgument) {
714
parser.push('BF.LOADCHUNK');
815
parser.pushKey(key);

packages/bloom/lib/commands/bloom/MADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { transformBooleanArrayReply } from '@redis/client/dist/lib/commands/gene
55

66
export default {
77
IS_READ_ONLY: false,
8+
/**
9+
* Adds multiple items to a Bloom Filter in a single call
10+
* @param parser - The command parser
11+
* @param key - The name of the Bloom filter
12+
* @param items - One or more items to add to the filter
13+
*/
814
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
915
parser.push('BF.MADD');
1016
parser.pushKey(key);

packages/bloom/lib/commands/bloom/MEXISTS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { transformBooleanArrayReply } from '@redis/client/dist/lib/commands/gene
55

66
export default {
77
IS_READ_ONLY: true,
8+
/**
9+
* Checks if multiple items exist in a Bloom Filter in a single call
10+
* @param parser - The command parser
11+
* @param key - The name of the Bloom filter
12+
* @param items - One or more items to check for existence
13+
*/
814
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
915
parser.push('BF.MEXISTS');
1016
parser.pushKey(key);

packages/bloom/lib/commands/bloom/RESERVE.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ export interface BfReserveOptions {
88

99
export default {
1010
IS_READ_ONLY: true,
11+
/**
12+
* Creates an empty Bloom Filter with a given desired error ratio and initial capacity
13+
* @param parser - The command parser
14+
* @param key - The name of the Bloom filter to create
15+
* @param errorRate - The desired probability for false positives (between 0 and 1)
16+
* @param capacity - The number of entries intended to be added to the filter
17+
* @param options - Optional parameters to tune the filter
18+
* @param options.EXPANSION - Expansion rate for the filter
19+
* @param options.NONSCALING - Prevents the filter from creating additional sub-filters
20+
*/
1121
parseCommand(
1222
parser: CommandParser,
1323
key: RedisArgument,

packages/bloom/lib/commands/bloom/SCANDUMP.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, UnwrapReply,
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Begins an incremental save of a Bloom Filter. This is useful for large filters that can't be saved at once
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to save
10+
* @param iterator - Iterator value; Start at 0, and use the iterator from the response for the next chunk
11+
*/
612
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number) {
713
parser.push('BF.SCANDUMP');
814
parser.pushKey(key);

0 commit comments

Comments
 (0)