@upstash/redis 0.0.0-ci.acc0588e9e893d8bbe5651955e3fef342d078490 → 0.0.0-ci.affbf5278b52d3b6175f5dc17ccc071f9c67ecb9-20231213110155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,6 +141,13 @@ type ZUnionStoreCommandOptions = {
141
141
  weight?: never;
142
142
  weights?: never;
143
143
  });
144
+ /**
145
+ * @see https://redis.io/commands/zunionstore
146
+ */
147
+ declare class ZUnionStoreCommand extends Command<number, number> {
148
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
149
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
150
+ }
144
151
 
145
152
  type ZUnionCommandOptions = {
146
153
  withScores?: boolean;
@@ -155,6 +162,13 @@ type ZUnionCommandOptions = {
155
162
  weight?: never;
156
163
  weights?: never;
157
164
  });
165
+ /**
166
+ * @see https://redis.io/commands/zunion
167
+ */
168
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
169
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
170
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
171
+ }
158
172
 
159
173
  type ZInterStoreCommandOptions = {
160
174
  aggregate?: "sum" | "min" | "max";
@@ -168,8 +182,21 @@ type ZInterStoreCommandOptions = {
168
182
  weight?: never;
169
183
  weights?: never;
170
184
  });
185
+ /**
186
+ * @see https://redis.io/commands/zInterstore
187
+ */
188
+ declare class ZInterStoreCommand extends Command<number, number> {
189
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
190
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
191
+ }
171
192
 
172
193
  type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
194
+ /**
195
+ * @see https://redis.io/commands/type
196
+ */
197
+ declare class TypeCommand extends Command<Type, Type> {
198
+ constructor(cmd: [key: string], opts?: CommandOptions<Type, Type>);
199
+ }
173
200
 
174
201
  type ScriptFlushCommandOptions = {
175
202
  sync: true;
@@ -178,86 +205,863 @@ type ScriptFlushCommandOptions = {
178
205
  sync?: never;
179
206
  async: true;
180
207
  };
208
+ /**
209
+ * @see https://redis.io/commands/script-flush
210
+ */
211
+ declare class ScriptFlushCommand extends Command<"OK", "OK"> {
212
+ constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
213
+ }
181
214
 
182
215
  type ScanCommandOptions = {
183
216
  match?: string;
184
217
  count?: number;
185
218
  type?: string;
186
219
  };
220
+ /**
221
+ * @see https://redis.io/commands/scan
222
+ */
223
+ declare class ScanCommand extends Command<[number, string[]], [number, string[]]> {
224
+ constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, string[]], [number, string[]]>);
225
+ }
226
+
227
+ type GeoAddCommandOptions = {
228
+ nx?: boolean;
229
+ xx?: never;
230
+ } | ({
231
+ nx?: never;
232
+ xx?: boolean;
233
+ } & {
234
+ ch?: boolean;
235
+ });
236
+ interface GeoMember<TMemberType> {
237
+ latitude: number;
238
+ longitude: number;
239
+ member: TMemberType;
240
+ }
241
+ /**
242
+ * @see https://redis.io/commands/geoadd
243
+ */
244
+ declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
245
+ constructor([key, arg1, ...arg2]: [
246
+ string,
247
+ GeoMember<TMemberType> | GeoAddCommandOptions,
248
+ ...GeoMember<TMemberType>[]
249
+ ], opts?: CommandOptions<number | null, number | null>);
250
+ }
251
+
252
+ /**
253
+ * @see https://redis.io/commands/append
254
+ */
255
+ declare class AppendCommand extends Command<number, number> {
256
+ constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
257
+ }
258
+
259
+ /**
260
+ * @see https://redis.io/commands/bitcount
261
+ */
262
+ declare class BitCountCommand extends Command<number, number> {
263
+ constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
264
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
265
+ }
266
+
267
+ /**
268
+ * @see https://redis.io/commands/bitop
269
+ */
270
+ declare class BitOpCommand extends Command<number, number> {
271
+ constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
272
+ constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
273
+ }
274
+
275
+ /**
276
+ * @see https://redis.io/commands/bitpos
277
+ */
278
+ declare class BitPosCommand extends Command<number, number> {
279
+ constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
280
+ }
281
+
282
+ /**
283
+ * @see https://redis.io/commands/copy
284
+ */
285
+ declare class CopyCommand extends Command<number, "COPIED" | "NOT_COPIED"> {
286
+ constructor([key, destinationKey, opts]: [key: string, destinationKey: string, opts?: {
287
+ replace: boolean;
288
+ }], commandOptions?: CommandOptions<number, "COPIED" | "NOT_COPIED">);
289
+ }
290
+
291
+ /**
292
+ * @see https://redis.io/commands/dbsize
293
+ */
294
+ declare class DBSizeCommand extends Command<number, number> {
295
+ constructor(opts?: CommandOptions<number, number>);
296
+ }
297
+
298
+ /**
299
+ * @see https://redis.io/commands/decr
300
+ */
301
+ declare class DecrCommand extends Command<number, number> {
302
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
303
+ }
304
+
305
+ /**
306
+ * @see https://redis.io/commands/decrby
307
+ */
308
+ declare class DecrByCommand extends Command<number, number> {
309
+ constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
310
+ }
311
+
312
+ /**
313
+ * @see https://redis.io/commands/del
314
+ */
315
+ declare class DelCommand extends Command<number, number> {
316
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
317
+ }
318
+
319
+ /**
320
+ * @see https://redis.io/commands/echo
321
+ */
322
+ declare class EchoCommand extends Command<string, string> {
323
+ constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
324
+ }
325
+
326
+ /**
327
+ * @see https://redis.io/commands/eval
328
+ */
329
+ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
330
+ constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
331
+ }
332
+
333
+ /**
334
+ * @see https://redis.io/commands/evalsha
335
+ */
336
+ declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
337
+ constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
338
+ }
339
+
340
+ /**
341
+ * @see https://redis.io/commands/exists
342
+ */
343
+ declare class ExistsCommand extends Command<number, number> {
344
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
345
+ }
346
+
347
+ /**
348
+ * @see https://redis.io/commands/expire
349
+ */
350
+ declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
351
+ constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
352
+ }
353
+
354
+ /**
355
+ * @see https://redis.io/commands/expireat
356
+ */
357
+ declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
358
+ constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
359
+ }
360
+
361
+ /**
362
+ * @see https://redis.io/commands/flushall
363
+ */
364
+ declare class FlushAllCommand extends Command<"OK", "OK"> {
365
+ constructor(args?: [{
366
+ async?: boolean;
367
+ }], opts?: CommandOptions<"OK", "OK">);
368
+ }
369
+
370
+ /**
371
+ * @see https://redis.io/commands/flushdb
372
+ */
373
+ declare class FlushDBCommand extends Command<"OK", "OK"> {
374
+ constructor([opts]: [opts?: {
375
+ async?: boolean;
376
+ }], cmdOpts?: CommandOptions<"OK", "OK">);
377
+ }
378
+
379
+ /**
380
+ * @see https://redis.io/commands/geodist
381
+ */
382
+ declare class GeoDistCommand<TMemberType = string> extends Command<number | null, number | null> {
383
+ constructor([key, member1, member2, unit]: [
384
+ key: string,
385
+ member1: TMemberType,
386
+ member2: TMemberType,
387
+ unit?: "M" | "KM" | "FT" | "MI"
388
+ ], opts?: CommandOptions<number | null, number | null>);
389
+ }
390
+
391
+ type Coordinates = {
392
+ lng: number;
393
+ lat: number;
394
+ };
395
+ /**
396
+ * @see https://redis.io/commands/geopos
397
+ */
398
+ declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][], Coordinates[]> {
399
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
400
+ }
401
+
402
+ /**
403
+ * @see https://redis.io/commands/geohash
404
+ */
405
+ declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
406
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
407
+ }
408
+
409
+ type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
410
+ type CenterPoint$1<TMemberType> = {
411
+ type: "FROMMEMBER" | "frommember";
412
+ member: TMemberType;
413
+ } | {
414
+ type: "FROMLONLAT" | "fromlonlat";
415
+ coordinate: {
416
+ lon: number;
417
+ lat: number;
418
+ };
419
+ };
420
+ type Shape$1 = {
421
+ type: "BYRADIUS" | "byradius";
422
+ radius: number;
423
+ radiusType: RadiusOptions$1;
424
+ } | {
425
+ type: "BYBOX" | "bybox";
426
+ rect: {
427
+ width: number;
428
+ height: number;
429
+ };
430
+ rectType: RadiusOptions$1;
431
+ };
432
+ type GeoSearchCommandOptions$1 = {
433
+ count?: {
434
+ limit: number;
435
+ any?: boolean;
436
+ };
437
+ withCoord?: boolean;
438
+ withDist?: boolean;
439
+ withHash?: boolean;
440
+ };
441
+ type OptionMappings = {
442
+ withHash: "hash";
443
+ withCoord: "coord";
444
+ withDist: "dist";
445
+ };
446
+ type GeoSearchOptions<TOptions> = {
447
+ [K in keyof TOptions as K extends keyof OptionMappings ? OptionMappings[K] : never]: K extends "withHash" ? string : K extends "withCoord" ? {
448
+ long: number;
449
+ lat: number;
450
+ } : K extends "withDist" ? number : never;
451
+ };
452
+ type GeoSearchResponse<TOptions, TMemberType> = ({
453
+ member: TMemberType;
454
+ } & GeoSearchOptions<TOptions>)[];
455
+ /**
456
+ * @see https://redis.io/commands/geosearch
457
+ */
458
+ declare class GeoSearchCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions$1 = GeoSearchCommandOptions$1> extends Command<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>> {
459
+ constructor([key, centerPoint, shape, order, opts]: [
460
+ key: string,
461
+ centerPoint: CenterPoint$1<TMemberType>,
462
+ shape: Shape$1,
463
+ order: "ASC" | "DESC" | "asc" | "desc",
464
+ opts?: TOptions
465
+ ], commandOptions?: CommandOptions<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>>);
466
+ }
467
+
468
+ type RadiusOptions = "M" | "KM" | "FT" | "MI";
469
+ type CenterPoint<TMemberType> = {
470
+ type: "FROMMEMBER" | "frommember";
471
+ member: TMemberType;
472
+ } | {
473
+ type: "FROMLONLAT" | "fromlonlat";
474
+ coordinate: {
475
+ lon: number;
476
+ lat: number;
477
+ };
478
+ };
479
+ type Shape = {
480
+ type: "BYRADIUS" | "byradius";
481
+ radius: number;
482
+ radiusType: RadiusOptions;
483
+ } | {
484
+ type: "BYBOX" | "bybox";
485
+ rect: {
486
+ width: number;
487
+ height: number;
488
+ };
489
+ rectType: RadiusOptions;
490
+ };
491
+ type GeoSearchCommandOptions = {
492
+ count?: {
493
+ limit: number;
494
+ any?: boolean;
495
+ };
496
+ storeDist?: boolean;
497
+ };
498
+ /**
499
+ * @see https://redis.io/commands/geosearchstore
500
+ */
501
+ declare class GeoSearchStoreCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions = GeoSearchCommandOptions> extends Command<any[] | any[][], number> {
502
+ constructor([destination, key, centerPoint, shape, order, opts]: [
503
+ destination: string,
504
+ key: string,
505
+ centerPoint: CenterPoint<TMemberType>,
506
+ shape: Shape,
507
+ order: "ASC" | "DESC" | "asc" | "desc",
508
+ opts?: TOptions
509
+ ], commandOptions?: CommandOptions<any[] | any[][], number>);
510
+ }
511
+
512
+ /**
513
+ * @see https://redis.io/commands/get
514
+ */
515
+ declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
516
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
517
+ }
518
+
519
+ /**
520
+ * @see https://redis.io/commands/getbit
521
+ */
522
+ declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
523
+ constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
524
+ }
525
+
526
+ /**
527
+ * @see https://redis.io/commands/getdel
528
+ */
529
+ declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
530
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
531
+ }
532
+
533
+ /**
534
+ * @see https://redis.io/commands/getrange
535
+ */
536
+ declare class GetRangeCommand extends Command<string, string> {
537
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
538
+ }
539
+
540
+ /**
541
+ * @see https://redis.io/commands/getset
542
+ */
543
+ declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
544
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
545
+ }
546
+
547
+ /**
548
+ * @see https://redis.io/commands/hdel
549
+ */
550
+ declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
551
+ constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
552
+ }
553
+
554
+ /**
555
+ * @see https://redis.io/commands/hexists
556
+ */
557
+ declare class HExistsCommand extends Command<number, number> {
558
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
559
+ }
560
+
561
+ /**
562
+ * @see https://redis.io/commands/hget
563
+ */
564
+ declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
565
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
566
+ }
567
+
568
+ /**
569
+ * @see https://redis.io/commands/hgetall
570
+ */
571
+ declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
572
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
573
+ }
574
+
575
+ /**
576
+ * @see https://redis.io/commands/hincrby
577
+ */
578
+ declare class HIncrByCommand extends Command<number, number> {
579
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
580
+ }
581
+
582
+ /**
583
+ * @see https://redis.io/commands/hincrbyfloat
584
+ */
585
+ declare class HIncrByFloatCommand extends Command<number, number> {
586
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
587
+ }
588
+
589
+ /**
590
+ * @see https://redis.io/commands/hkeys
591
+ */
592
+ declare class HKeysCommand extends Command<string[], string[]> {
593
+ constructor([key]: [key: string], opts?: CommandOptions<string[], string[]>);
594
+ }
595
+
596
+ /**
597
+ * @see https://redis.io/commands/hlen
598
+ */
599
+ declare class HLenCommand extends Command<number, number> {
600
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
601
+ }
602
+
603
+ /**
604
+ * hmget returns an object of all requested fields from a hash
605
+ * The field values are returned as an object like this:
606
+ * ```ts
607
+ * {[fieldName: string]: T | null}
608
+ * ```
609
+ *
610
+ * In case the hash does not exist or all fields are empty `null` is returned
611
+ *
612
+ * @see https://redis.io/commands/hmget
613
+ */
614
+ declare class HMGetCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
615
+ constructor([key, ...fields]: [key: string, ...fields: string[]], opts?: CommandOptions<(string | null)[], TData | null>);
616
+ }
617
+
618
+ /**
619
+ * @see https://redis.io/commands/hmset
620
+ */
621
+ declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
622
+ constructor([key, kv]: [key: string, kv: {
623
+ [field: string]: TData;
624
+ }], opts?: CommandOptions<"OK", "OK">);
625
+ }
626
+
627
+ /**
628
+ * @see https://redis.io/commands/hrandfield
629
+ */
630
+ declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
631
+ constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
632
+ constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
633
+ constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
634
+ }
635
+
636
+ /**
637
+ * @see https://redis.io/commands/hscan
638
+ */
639
+ declare class HScanCommand extends Command<[
640
+ number,
641
+ (string | number)[]
642
+ ], [
643
+ number,
644
+ (string | number)[]
645
+ ]> {
646
+ constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
647
+ }
648
+
649
+ /**
650
+ * @see https://redis.io/commands/hset
651
+ */
652
+ declare class HSetCommand<TData> extends Command<number, number> {
653
+ constructor([key, kv]: [key: string, kv: {
654
+ [field: string]: TData;
655
+ }], opts?: CommandOptions<number, number>);
656
+ }
657
+
658
+ /**
659
+ * @see https://redis.io/commands/hsetnx
660
+ */
661
+ declare class HSetNXCommand<TData> extends Command<"0" | "1", 0 | 1> {
662
+ constructor(cmd: [key: string, field: string, value: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
663
+ }
664
+
665
+ /**
666
+ * @see https://redis.io/commands/hstrlen
667
+ */
668
+ declare class HStrLenCommand extends Command<number, number> {
669
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
670
+ }
671
+
672
+ /**
673
+ * @see https://redis.io/commands/hvals
674
+ */
675
+ declare class HValsCommand<TData extends unknown[]> extends Command<unknown[], TData> {
676
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
677
+ }
678
+
679
+ /**
680
+ * @see https://redis.io/commands/incr
681
+ */
682
+ declare class IncrCommand extends Command<number, number> {
683
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
684
+ }
685
+
686
+ /**
687
+ * @see https://redis.io/commands/incrby
688
+ */
689
+ declare class IncrByCommand extends Command<number, number> {
690
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
691
+ }
692
+
693
+ /**
694
+ * @see https://redis.io/commands/incrbyfloat
695
+ */
696
+ declare class IncrByFloatCommand extends Command<number, number> {
697
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
698
+ }
699
+
700
+ /**
701
+ * @see https://redis.io/commands/json.arrappend
702
+ */
703
+ declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
704
+ constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
705
+ }
706
+
707
+ /**
708
+ * @see https://redis.io/commands/json.arrindex
709
+ */
710
+ declare class JsonArrIndexCommand<TValue> extends Command<(null | string)[], (null | number)[]> {
711
+ constructor(cmd: [key: string, path: string, value: TValue, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
712
+ }
713
+
714
+ /**
715
+ * @see https://redis.io/commands/json.arrinsert
716
+ */
717
+ declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
718
+ constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
719
+ }
720
+
721
+ /**
722
+ * @see https://redis.io/commands/json.arrlen
723
+ */
724
+ declare class JsonArrLenCommand extends Command<(null | string)[], (null | number)[]> {
725
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
726
+ }
727
+
728
+ /**
729
+ * @see https://redis.io/commands/json.arrpop
730
+ */
731
+ declare class JsonArrPopCommand<TData> extends Command<(null | string)[], (TData | null)[]> {
732
+ constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
733
+ }
734
+
735
+ /**
736
+ * @see https://redis.io/commands/json.arrtrim
737
+ */
738
+ declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
739
+ constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
740
+ }
741
+
742
+ /**
743
+ * @see https://redis.io/commands/json.clear
744
+ */
745
+ declare class JsonClearCommand extends Command<number, number> {
746
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
747
+ }
748
+
749
+ /**
750
+ * @see https://redis.io/commands/json.del
751
+ */
752
+ declare class JsonDelCommand extends Command<number, number> {
753
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
754
+ }
755
+
756
+ /**
757
+ * @see https://redis.io/commands/json.forget
758
+ */
759
+ declare class JsonForgetCommand extends Command<number, number> {
760
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
761
+ }
762
+
763
+ /**
764
+ * @see https://redis.io/commands/json.get
765
+ */
766
+ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
767
+ constructor(cmd: [
768
+ key: string,
769
+ opts?: {
770
+ indent?: string;
771
+ newline?: string;
772
+ space?: string;
773
+ },
774
+ ...path: string[]
775
+ ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
776
+ }
777
+
778
+ /**
779
+ * @see https://redis.io/commands/json.mget
780
+ */
781
+ declare class JsonMGetCommand<TData extends (unknown | Record<string, unknown>)[]> extends Command<TData, TData> {
782
+ constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
783
+ }
784
+
785
+ /**
786
+ * @see https://redis.io/commands/json.numincrby
787
+ */
788
+ declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
789
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
790
+ }
791
+
792
+ /**
793
+ * @see https://redis.io/commands/json.nummultby
794
+ */
795
+ declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
796
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
797
+ }
798
+
799
+ /**
800
+ * @see https://redis.io/commands/json.objkeys
801
+ */
802
+ declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
803
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
804
+ }
805
+
806
+ /**
807
+ * @see https://redis.io/commands/json.objlen
808
+ */
809
+ declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
810
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
811
+ }
812
+
813
+ /**
814
+ * @see https://redis.io/commands/json.resp
815
+ */
816
+ declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
817
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
818
+ }
819
+
820
+ /**
821
+ * @see https://redis.io/commands/json.set
822
+ */
823
+ declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
824
+ constructor(cmd: [
825
+ key: string,
826
+ path: string,
827
+ value: TData,
828
+ opts?: {
829
+ nx: true;
830
+ xx?: never;
831
+ } | {
832
+ nx?: never;
833
+ xx: true;
834
+ }
835
+ ], opts?: CommandOptions<"OK" | null, "OK" | null>);
836
+ }
837
+
838
+ /**
839
+ * @see https://redis.io/commands/json.strappend
840
+ */
841
+ declare class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
842
+ constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
843
+ }
844
+
845
+ /**
846
+ * @see https://redis.io/commands/json.strlen
847
+ */
848
+ declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
849
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
850
+ }
851
+
852
+ /**
853
+ * @see https://redis.io/commands/json.toggle
854
+ */
855
+ declare class JsonToggleCommand extends Command<number[], number[]> {
856
+ constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
857
+ }
858
+
859
+ /**
860
+ * @see https://redis.io/commands/json.type
861
+ */
862
+ declare class JsonTypeCommand extends Command<string[], string[]> {
863
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
864
+ }
865
+
866
+ /**
867
+ * @see https://redis.io/commands/keys
868
+ */
869
+ declare class KeysCommand extends Command<string[], string[]> {
870
+ constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>);
871
+ }
872
+
873
+ declare class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
874
+ constructor(cmd: [key: string, index: number], opts?: CommandOptions<unknown | null, TData | null>);
875
+ }
876
+
877
+ declare class LInsertCommand<TData = string> extends Command<number, number> {
878
+ constructor(cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData], opts?: CommandOptions<number, number>);
879
+ }
880
+
881
+ /**
882
+ * @see https://redis.io/commands/llen
883
+ */
884
+ declare class LLenCommand extends Command<number, number> {
885
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
886
+ }
887
+
888
+ /**
889
+ * @see https://redis.io/commands/lmove
890
+ */
891
+ declare class LMoveCommand<TData = string> extends Command<TData, TData> {
892
+ constructor(cmd: [
893
+ source: string,
894
+ destination: string,
895
+ whereFrom: "left" | "right",
896
+ whereTo: "left" | "right"
897
+ ], opts?: CommandOptions<TData, TData>);
898
+ }
899
+
900
+ /**
901
+ * @see https://redis.io/commands/lpop
902
+ */
903
+ declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
904
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
905
+ }
906
+
907
+ /**
908
+ * @see https://redis.io/commands/lpush
909
+ */
910
+ declare class LPushCommand<TData = string> extends Command<number, number> {
911
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
912
+ }
913
+
914
+ /**
915
+ * @see https://redis.io/commands/lpushx
916
+ */
917
+ declare class LPushXCommand<TData> extends Command<number, number> {
918
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
919
+ }
920
+
921
+ declare class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
922
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<unknown[], TData[]>);
923
+ }
924
+
925
+ declare class LRemCommand<TData> extends Command<number, number> {
926
+ constructor(cmd: [key: string, count: number, value: TData], opts?: CommandOptions<number, number>);
927
+ }
928
+
929
+ declare class LSetCommand<TData = string> extends Command<"OK", "OK"> {
930
+ constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">);
931
+ }
932
+
933
+ declare class LTrimCommand extends Command<"OK", "OK"> {
934
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">);
935
+ }
936
+
937
+ /**
938
+ * @see https://redis.io/commands/mget
939
+ */
940
+ declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
941
+ constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
942
+ }
943
+
944
+ /**
945
+ * @see https://redis.io/commands/mset
946
+ */
947
+ declare class MSetCommand<TData> extends Command<"OK", "OK"> {
948
+ constructor([kv]: [kv: {
949
+ [key: string]: TData;
950
+ }], opts?: CommandOptions<"OK", "OK">);
951
+ }
952
+
953
+ /**
954
+ * @see https://redis.io/commands/msetnx
955
+ */
956
+ declare class MSetNXCommand<TData = string> extends Command<number, number> {
957
+ constructor([kv]: [kv: {
958
+ [key: string]: TData;
959
+ }], opts?: CommandOptions<number, number>);
960
+ }
961
+
962
+ /**
963
+ * @see https://redis.io/commands/persist
964
+ */
965
+ declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
966
+ constructor(cmd: [key: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
967
+ }
968
+
969
+ /**
970
+ * @see https://redis.io/commands/pexpire
971
+ */
972
+ declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
973
+ constructor(cmd: [key: string, milliseconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
974
+ }
975
+
976
+ /**
977
+ * @see https://redis.io/commands/pexpireat
978
+ */
979
+ declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
980
+ constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
981
+ }
982
+
983
+ /**
984
+ * @see https://redis.io/commands/ping
985
+ */
986
+ declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
987
+ constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
988
+ }
989
+
990
+ /**
991
+ * @see https://redis.io/commands/psetex
992
+ */
993
+ declare class PSetEXCommand<TData = string> extends Command<string, string> {
994
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<string, string>);
995
+ }
996
+
997
+ /**
998
+ * @see https://redis.io/commands/pttl
999
+ */
1000
+ declare class PTtlCommand extends Command<number, number> {
1001
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1002
+ }
187
1003
 
188
- type GeoAddCommandOptions = {
189
- nx?: boolean;
190
- xx?: never;
191
- } | ({
192
- nx?: never;
193
- xx?: boolean;
194
- } & {
195
- ch?: boolean;
196
- });
197
- interface GeoMember<TMemberType> {
198
- latitude: number;
199
- longitude: number;
200
- member: TMemberType;
1004
+ /**
1005
+ * @see https://redis.io/commands/publish
1006
+ */
1007
+ declare class PublishCommand<TMessage = unknown> extends Command<number, number> {
1008
+ constructor(cmd: [channel: string, message: TMessage], opts?: CommandOptions<number, number>);
201
1009
  }
202
1010
 
203
1011
  /**
204
- * @see https://redis.io/commands/bitop
1012
+ * @see https://redis.io/commands/randomkey
205
1013
  */
206
- declare class BitOpCommand extends Command<number, number> {
207
- constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
208
- constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
1014
+ declare class RandomKeyCommand extends Command<string | null, string | null> {
1015
+ constructor(opts?: CommandOptions<string | null, string | null>);
209
1016
  }
210
1017
 
211
1018
  /**
212
- * @see https://redis.io/commands/del
1019
+ * @see https://redis.io/commands/rename
213
1020
  */
214
- declare class DelCommand extends Command<number, number> {
215
- constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1021
+ declare class RenameCommand extends Command<"OK", "OK"> {
1022
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
216
1023
  }
217
1024
 
218
1025
  /**
219
- * @see https://redis.io/commands/exists
1026
+ * @see https://redis.io/commands/renamenx
220
1027
  */
221
- declare class ExistsCommand extends Command<number, number> {
222
- constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1028
+ declare class RenameNXCommand extends Command<"0" | "1", 0 | 1> {
1029
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
223
1030
  }
224
1031
 
225
1032
  /**
226
- * @see https://redis.io/commands/flushall
1033
+ * @see https://redis.io/commands/rpop
227
1034
  */
228
- declare class FlushAllCommand extends Command<"OK", "OK"> {
229
- constructor(args?: [{
230
- async?: boolean;
231
- }], opts?: CommandOptions<"OK", "OK">);
1035
+ declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
1036
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
232
1037
  }
233
1038
 
234
1039
  /**
235
- * @see https://redis.io/commands/json.get
1040
+ * @see https://redis.io/commands/rpush
236
1041
  */
237
- declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
238
- constructor(cmd: [
239
- key: string,
240
- opts?: {
241
- indent?: string;
242
- newline?: string;
243
- space?: string;
244
- },
245
- ...path: string[]
246
- ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
1042
+ declare class RPushCommand<TData = string> extends Command<number, number> {
1043
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
247
1044
  }
248
1045
 
249
1046
  /**
250
- * @see https://redis.io/commands/mget
1047
+ * @see https://redis.io/commands/rpushx
251
1048
  */
252
- declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
253
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
1049
+ declare class RPushXCommand<TData = string> extends Command<number, number> {
1050
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
254
1051
  }
255
1052
 
256
1053
  /**
257
- * @see https://redis.io/commands/ping
1054
+ * @see https://redis.io/commands/sadd
258
1055
  */
259
- declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
260
- constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
1056
+ declare class SAddCommand<TData = string> extends Command<number, number> {
1057
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1058
+ }
1059
+
1060
+ /**
1061
+ * @see https://redis.io/commands/scard
1062
+ */
1063
+ declare class SCardCommand extends Command<number, number> {
1064
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
261
1065
  }
262
1066
 
263
1067
  /**
@@ -267,6 +1071,27 @@ declare class ScriptExistsCommand<T extends string[]> extends Command<string[],
267
1071
  constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
268
1072
  }
269
1073
 
1074
+ /**
1075
+ * @see https://redis.io/commands/script-load
1076
+ */
1077
+ declare class ScriptLoadCommand extends Command<string, string> {
1078
+ constructor(args: [script: string], opts?: CommandOptions<string, string>);
1079
+ }
1080
+
1081
+ /**
1082
+ * @see https://redis.io/commands/sdiff
1083
+ */
1084
+ declare class SDiffCommand<TData> extends Command<unknown[], TData[]> {
1085
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1086
+ }
1087
+
1088
+ /**
1089
+ * @see https://redis.io/commands/sdiffstore
1090
+ */
1091
+ declare class SDiffStoreCommand extends Command<number, number> {
1092
+ constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1093
+ }
1094
+
270
1095
  type SetCommandOptions = {
271
1096
  get?: boolean;
272
1097
  } & ({
@@ -315,6 +1140,144 @@ type SetCommandOptions = {
315
1140
  xx?: never;
316
1141
  nx?: never;
317
1142
  });
1143
+ /**
1144
+ * @see https://redis.io/commands/set
1145
+ */
1146
+ declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
1147
+ constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
1148
+ }
1149
+
1150
+ /**
1151
+ * @see https://redis.io/commands/setbit
1152
+ */
1153
+ declare class SetBitCommand extends Command<"0" | "1", 0 | 1> {
1154
+ constructor(cmd: [key: string, offset: number, value: 0 | 1], opts?: CommandOptions<"0" | "1", 0 | 1>);
1155
+ }
1156
+
1157
+ /**
1158
+ * @see https://redis.io/commands/setex
1159
+ */
1160
+ declare class SetExCommand<TData = string> extends Command<"OK", "OK"> {
1161
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<"OK", "OK">);
1162
+ }
1163
+
1164
+ /**
1165
+ * @see https://redis.io/commands/setnx
1166
+ */
1167
+ declare class SetNxCommand<TData = string> extends Command<number, number> {
1168
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<number, number>);
1169
+ }
1170
+
1171
+ /**
1172
+ * @see https://redis.io/commands/setrange
1173
+ */
1174
+ declare class SetRangeCommand extends Command<number, number> {
1175
+ constructor(cmd: [key: string, offset: number, value: string], opts?: CommandOptions<number, number>);
1176
+ }
1177
+
1178
+ /**
1179
+ * @see https://redis.io/commands/sinter
1180
+ */
1181
+ declare class SInterCommand<TData = string> extends Command<unknown[], TData[]> {
1182
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1183
+ }
1184
+
1185
+ /**
1186
+ * @see https://redis.io/commands/sinterstore
1187
+ */
1188
+ declare class SInterStoreCommand extends Command<number, number> {
1189
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1190
+ }
1191
+
1192
+ /**
1193
+ * @see https://redis.io/commands/sismember
1194
+ */
1195
+ declare class SIsMemberCommand<TData = string> extends Command<"0" | "1", 0 | 1> {
1196
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1197
+ }
1198
+
1199
+ /**
1200
+ * @see https://redis.io/commands/smembers
1201
+ */
1202
+ declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
1203
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
1204
+ }
1205
+
1206
+ /**
1207
+ * @see https://redis.io/commands/smismember
1208
+ */
1209
+ declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
1210
+ constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
1211
+ }
1212
+
1213
+ /**
1214
+ * @see https://redis.io/commands/smove
1215
+ */
1216
+ declare class SMoveCommand<TData> extends Command<"0" | "1", 0 | 1> {
1217
+ constructor(cmd: [source: string, destination: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1218
+ }
1219
+
1220
+ /**
1221
+ * @see https://redis.io/commands/spop
1222
+ */
1223
+ declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
1224
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
1225
+ }
1226
+
1227
+ /**
1228
+ * @see https://redis.io/commands/srandmember
1229
+ */
1230
+ declare class SRandMemberCommand<TData> extends Command<string | null, TData | null> {
1231
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
1232
+ }
1233
+
1234
+ /**
1235
+ * @see https://redis.io/commands/srem
1236
+ */
1237
+ declare class SRemCommand<TData = string> extends Command<number, number> {
1238
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1239
+ }
1240
+
1241
+ /**
1242
+ * @see https://redis.io/commands/sscan
1243
+ */
1244
+ declare class SScanCommand extends Command<[
1245
+ number,
1246
+ (string | number)[]
1247
+ ], [
1248
+ number,
1249
+ (string | number)[]
1250
+ ]> {
1251
+ constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1252
+ }
1253
+
1254
+ /**
1255
+ * @see https://redis.io/commands/strlen
1256
+ */
1257
+ declare class StrLenCommand extends Command<number, number> {
1258
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1259
+ }
1260
+
1261
+ /**
1262
+ * @see https://redis.io/commands/sunion
1263
+ */
1264
+ declare class SUnionCommand<TData> extends Command<string[], TData[]> {
1265
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<string[], TData[]>);
1266
+ }
1267
+
1268
+ /**
1269
+ * @see https://redis.io/commands/sunionstore
1270
+ */
1271
+ declare class SUnionStoreCommand extends Command<number, number> {
1272
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1273
+ }
1274
+
1275
+ /**
1276
+ * @see https://redis.io/commands/time
1277
+ */
1278
+ declare class TimeCommand extends Command<[number, number], [number, number]> {
1279
+ constructor(opts?: CommandOptions<[number, number], [number, number]>);
1280
+ }
318
1281
 
319
1282
  /**
320
1283
  * @see https://redis.io/commands/touch
@@ -323,6 +1286,13 @@ declare class TouchCommand extends Command<number, number> {
323
1286
  constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
324
1287
  }
325
1288
 
1289
+ /**
1290
+ * @see https://redis.io/commands/ttl
1291
+ */
1292
+ declare class TtlCommand extends Command<number, number> {
1293
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1294
+ }
1295
+
326
1296
  /**
327
1297
  * @see https://redis.io/commands/unlink
328
1298
  */
@@ -330,7 +1300,41 @@ declare class UnlinkCommand extends Command<number, number> {
330
1300
  constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
331
1301
  }
332
1302
 
333
- type ZAddCommandOptions = ({
1303
+ type XAddCommandOptions = {
1304
+ nomkStream?: boolean;
1305
+ trim?: ({
1306
+ type: "MAXLEN" | "maxlen";
1307
+ threshold: number;
1308
+ } | {
1309
+ type: "MINID" | "minid";
1310
+ threshold: string;
1311
+ }) & ({
1312
+ comparison: "~";
1313
+ limit?: number;
1314
+ } | {
1315
+ comparison: "=";
1316
+ limit?: never;
1317
+ });
1318
+ };
1319
+ /**
1320
+ * @see https://redis.io/commands/xadd
1321
+ */
1322
+ declare class XAddCommand extends Command<string, string> {
1323
+ constructor([key, id, entries, opts]: [
1324
+ key: string,
1325
+ id: "*" | string,
1326
+ entries: {
1327
+ [field: string]: unknown;
1328
+ },
1329
+ opts?: XAddCommandOptions
1330
+ ], commandOptions?: CommandOptions<string, string>);
1331
+ }
1332
+
1333
+ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
1334
+ constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
1335
+ }
1336
+
1337
+ type NXAndXXOptions = {
334
1338
  nx: true;
335
1339
  xx?: never;
336
1340
  } | {
@@ -339,16 +1343,75 @@ type ZAddCommandOptions = ({
339
1343
  } | {
340
1344
  nx?: never;
341
1345
  xx?: never;
342
- }) & {
343
- ch?: true;
344
1346
  };
345
- type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
346
- incr: true;
1347
+ type LTAndGTOptions = {
1348
+ lt: true;
1349
+ gt?: never;
1350
+ } | {
1351
+ lt?: never;
1352
+ gt: true;
1353
+ } | {
1354
+ lt?: never;
1355
+ gt?: never;
1356
+ };
1357
+ type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
1358
+ ch?: true;
1359
+ } & {
1360
+ incr?: true;
347
1361
  };
1362
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
348
1363
  type ScoreMember<TData> = {
349
1364
  score: number;
350
1365
  member: TData;
351
1366
  };
1367
+ /**
1368
+ * @see https://redis.io/commands/zadd
1369
+ */
1370
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1371
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1372
+ }
1373
+
1374
+ /**
1375
+ * @see https://redis.io/commands/zcard
1376
+ */
1377
+ declare class ZCardCommand extends Command<number, number> {
1378
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1379
+ }
1380
+
1381
+ /**
1382
+ * @see https://redis.io/commands/zcount
1383
+ */
1384
+ declare class ZCountCommand extends Command<number, number> {
1385
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1386
+ }
1387
+
1388
+ /**
1389
+ * @see https://redis.io/commands/zincrby
1390
+ */
1391
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1392
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1393
+ }
1394
+
1395
+ /**
1396
+ * @see https://redis.io/commands/zlexcount
1397
+ */
1398
+ declare class ZLexCountCommand extends Command<number, number> {
1399
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1400
+ }
1401
+
1402
+ /**
1403
+ * @see https://redis.io/commands/zpopmax
1404
+ */
1405
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1406
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1407
+ }
1408
+
1409
+ /**
1410
+ * @see https://redis.io/commands/zpopmin
1411
+ */
1412
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1413
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1414
+ }
352
1415
 
353
1416
  type ZRangeCommandOptions = {
354
1417
  withScores?: boolean;
@@ -369,6 +1432,90 @@ type ZRangeCommandOptions = {
369
1432
  offset?: never;
370
1433
  count?: never;
371
1434
  });
1435
+ /**
1436
+ * @see https://redis.io/commands/zrange
1437
+ */
1438
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1439
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1440
+ constructor(cmd: [
1441
+ key: string,
1442
+ min: `(${string}` | `[${string}` | "-" | "+",
1443
+ max: `(${string}` | `[${string}` | "-" | "+",
1444
+ opts: {
1445
+ byLex: true;
1446
+ } & ZRangeCommandOptions
1447
+ ], cmdOpts?: CommandOptions<string[], TData>);
1448
+ constructor(cmd: [
1449
+ key: string,
1450
+ min: number | `(${number}` | "-inf" | "+inf",
1451
+ max: number | `(${number}` | "-inf" | "+inf",
1452
+ opts: {
1453
+ byScore: true;
1454
+ } & ZRangeCommandOptions
1455
+ ], cmdOpts?: CommandOptions<string[], TData>);
1456
+ }
1457
+
1458
+ /**
1459
+ * @see https://redis.io/commands/zrank
1460
+ */
1461
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1462
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1463
+ }
1464
+
1465
+ /**
1466
+ * @see https://redis.io/commands/zrem
1467
+ */
1468
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1469
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1470
+ }
1471
+
1472
+ /**
1473
+ * @see https://redis.io/commands/zremrangebylex
1474
+ */
1475
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1476
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1477
+ }
1478
+
1479
+ /**
1480
+ * @see https://redis.io/commands/zremrangebyrank
1481
+ */
1482
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1483
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1484
+ }
1485
+
1486
+ /**
1487
+ * @see https://redis.io/commands/zremrangebyscore
1488
+ */
1489
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1490
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1491
+ }
1492
+
1493
+ /**
1494
+ * @see https://redis.io/commands/zrevrank
1495
+ */
1496
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1497
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1498
+ }
1499
+
1500
+ /**
1501
+ * @see https://redis.io/commands/zscan
1502
+ */
1503
+ declare class ZScanCommand extends Command<[
1504
+ number,
1505
+ (string | number)[]
1506
+ ], [
1507
+ number,
1508
+ (string | number)[]
1509
+ ]> {
1510
+ constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1511
+ }
1512
+
1513
+ /**
1514
+ * @see https://redis.io/commands/zscore
1515
+ */
1516
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1517
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1518
+ }
372
1519
 
373
1520
  type InferResponseData<T extends unknown[]> = {
374
1521
  [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
@@ -456,7 +1603,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
456
1603
  */
457
1604
  bitop: {
458
1605
  (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
459
- (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
1606
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[
1607
+ ...TCommands,
1608
+ BitOpCommand
1609
+ ]>;
460
1610
  };
461
1611
  /**
462
1612
  * @see https://redis.io/commands/bitpos
@@ -706,6 +1856,18 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
706
1856
  * @see https://redis.io/commands/pexpireat
707
1857
  */
708
1858
  pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1859
+ /**
1860
+ * @see https://redis.io/commands/pfadd
1861
+ */
1862
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
1863
+ /**
1864
+ * @see https://redis.io/commands/pfcount
1865
+ */
1866
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1867
+ /**
1868
+ * @see https://redis.io/commands/pfmerge
1869
+ */
1870
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
709
1871
  /**
710
1872
  * @see https://redis.io/commands/ping
711
1873
  */
@@ -870,7 +2032,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
870
2032
  /**
871
2033
  * @see https://redis.io/commands/zadd
872
2034
  */
873
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2035
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
874
2036
  /**
875
2037
  * @see https://redis.io/commands/zcard
876
2038
  */
@@ -1679,6 +2841,18 @@ declare class Redis {
1679
2841
  * @see https://redis.io/commands/pexpireat
1680
2842
  */
1681
2843
  pexpireat: (key: string, unix: number) => Promise<0 | 1>;
2844
+ /**
2845
+ * @see https://redis.io/commands/pfadd
2846
+ */
2847
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
2848
+ /**
2849
+ * @see https://redis.io/commands/pfcount
2850
+ */
2851
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
2852
+ /**
2853
+ * @see https://redis.io/commands/pfmerge
2854
+ */
2855
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
1682
2856
  /**
1683
2857
  * @see https://redis.io/commands/ping
1684
2858
  */
@@ -1871,7 +3045,7 @@ declare class Redis {
1871
3045
  /**
1872
3046
  * @see https://redis.io/commands/zadd
1873
3047
  */
1874
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
3048
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
1875
3049
  /**
1876
3050
  * @see https://redis.io/commands/zcard
1877
3051
  */
@@ -1968,4 +3142,18 @@ declare class Redis {
1968
3142
  zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
1969
3143
  }
1970
3144
 
1971
- export { RedisOptions as R, UpstashRequest as U, RequesterConfig as a, Redis as b, Requester as c, UpstashResponse as d };
3145
+ /**
3146
+ * @see https://redis.io/commands/zdiffstore
3147
+ */
3148
+ declare class ZDiffStoreCommand extends Command<number, number> {
3149
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3150
+ }
3151
+
3152
+ /**
3153
+ * @see https://redis.io/commands/zmscore
3154
+ */
3155
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3156
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3157
+ }
3158
+
3159
+ export { IncrByCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetSetCommand as H, HDelCommand as I, HExistsCommand as J, HGetCommand as K, HGetAllCommand as L, HIncrByCommand as M, HIncrByFloatCommand as N, HKeysCommand as O, HLenCommand as P, HMGetCommand as Q, RedisOptions as R, HMSetCommand as S, HRandFieldCommand as T, UpstashRequest as U, HScanCommand as V, HSetCommand as W, HSetNXCommand as X, HStrLenCommand as Y, HValsCommand as Z, IncrCommand as _, RequesterConfig as a, SetNxCommand as a$, IncrByFloatCommand as a0, JsonArrAppendCommand as a1, JsonArrIndexCommand as a2, JsonArrInsertCommand as a3, JsonArrLenCommand as a4, JsonArrPopCommand as a5, JsonArrTrimCommand as a6, JsonClearCommand as a7, JsonDelCommand as a8, JsonForgetCommand as a9, MSetNXCommand as aA, PersistCommand as aB, PExpireCommand as aC, PExpireAtCommand as aD, PingCommand as aE, PSetEXCommand as aF, PTtlCommand as aG, PublishCommand as aH, RandomKeyCommand as aI, RenameCommand as aJ, RenameNXCommand as aK, RPopCommand as aL, RPushCommand as aM, RPushXCommand as aN, SAddCommand as aO, ScanCommand as aP, ScanCommandOptions as aQ, SCardCommand as aR, ScriptExistsCommand as aS, ScriptFlushCommand as aT, ScriptLoadCommand as aU, SDiffCommand as aV, SDiffStoreCommand as aW, SetCommand as aX, SetCommandOptions as aY, SetBitCommand as aZ, SetExCommand as a_, JsonGetCommand as aa, JsonMGetCommand as ab, JsonNumIncrByCommand as ac, JsonNumMultByCommand as ad, JsonObjKeysCommand as ae, JsonObjLenCommand as af, JsonRespCommand as ag, JsonSetCommand as ah, JsonStrAppendCommand as ai, JsonStrLenCommand as aj, JsonToggleCommand as ak, JsonTypeCommand as al, KeysCommand as am, LIndexCommand as an, LInsertCommand as ao, LLenCommand as ap, LMoveCommand as aq, LPopCommand as ar, LPushCommand as as, LPushXCommand as at, LRangeCommand as au, LRemCommand as av, LSetCommand as aw, LTrimCommand as ax, MGetCommand as ay, MSetCommand as az, Redis as b, SetRangeCommand as b0, SInterCommand as b1, SInterStoreCommand as b2, SIsMemberCommand as b3, SMembersCommand as b4, SMIsMemberCommand as b5, SMoveCommand as b6, SPopCommand as b7, SRandMemberCommand as b8, SRemCommand as b9, ZRangeCommandOptions as bA, ZRankCommand as bB, ZRemCommand as bC, ZRemRangeByLexCommand as bD, ZRemRangeByRankCommand as bE, ZRemRangeByScoreCommand as bF, ZRevRankCommand as bG, ZScanCommand as bH, ZScoreCommand as bI, ZUnionCommand as bJ, ZUnionCommandOptions as bK, ZUnionStoreCommand as bL, ZUnionStoreCommandOptions as bM, SScanCommand as ba, StrLenCommand as bb, SUnionCommand as bc, SUnionStoreCommand as bd, TimeCommand as be, TouchCommand as bf, TtlCommand as bg, Type as bh, TypeCommand as bi, UnlinkCommand as bj, XAddCommand as bk, XRangeCommand as bl, ScoreMember as bm, ZAddCommandOptions as bn, ZAddCommand as bo, ZCardCommand as bp, ZCountCommand as bq, ZDiffStoreCommand as br, ZIncrByCommand as bs, ZInterStoreCommand as bt, ZInterStoreCommandOptions as bu, ZLexCountCommand as bv, ZMScoreCommand as bw, ZPopMaxCommand as bx, ZPopMinCommand as by, ZRangeCommand as bz, Requester as c, UpstashResponse as d, BitOpCommand as e, BitPosCommand as f, DecrCommand as g, DecrByCommand as h, DelCommand as i, EvalCommand as j, EvalshaCommand as k, ExistsCommand as l, ExpireCommand as m, ExpireAtCommand as n, FlushDBCommand as o, GeoAddCommandOptions as p, GeoMember as q, GeoDistCommand as r, GeoHashCommand as s, GeoPosCommand as t, GeoSearchCommand as u, GeoSearchStoreCommand as v, GetCommand as w, GetBitCommand as x, GetDelCommand as y, GetRangeCommand as z };