@upstash/redis 1.24.0 → 1.24.2

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
+ }
214
+
215
+ type ScanCommandOptions = {
216
+ match?: string;
217
+ count?: number;
218
+ type?: string;
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
+ }
181
1003
 
182
- type ScanCommandOptions = {
183
- match?: string;
184
- count?: number;
185
- type?: string;
186
- };
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>);
1009
+ }
187
1010
 
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;
1011
+ /**
1012
+ * @see https://redis.io/commands/randomkey
1013
+ */
1014
+ declare class RandomKeyCommand extends Command<string | null, string | null> {
1015
+ constructor(opts?: CommandOptions<string | null, string | null>);
201
1016
  }
202
1017
 
203
1018
  /**
204
- * @see https://redis.io/commands/bitop
1019
+ * @see https://redis.io/commands/rename
205
1020
  */
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>);
1021
+ declare class RenameCommand extends Command<"OK", "OK"> {
1022
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
209
1023
  }
210
1024
 
211
1025
  /**
212
- * @see https://redis.io/commands/del
1026
+ * @see https://redis.io/commands/renamenx
213
1027
  */
214
- declare class DelCommand extends Command<number, number> {
215
- 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>);
216
1030
  }
217
1031
 
218
1032
  /**
219
- * @see https://redis.io/commands/exists
1033
+ * @see https://redis.io/commands/rpop
220
1034
  */
221
- declare class ExistsCommand extends Command<number, number> {
222
- constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
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>);
223
1037
  }
224
1038
 
225
1039
  /**
226
- * @see https://redis.io/commands/flushall
1040
+ * @see https://redis.io/commands/rpush
227
1041
  */
228
- declare class FlushAllCommand extends Command<"OK", "OK"> {
229
- constructor(args?: [{
230
- async?: boolean;
231
- }], opts?: CommandOptions<"OK", "OK">);
1042
+ declare class RPushCommand<TData = string> extends Command<number, number> {
1043
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
232
1044
  }
233
1045
 
234
1046
  /**
235
- * @see https://redis.io/commands/json.get
1047
+ * @see https://redis.io/commands/rpushx
236
1048
  */
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>);
1049
+ declare class RPushXCommand<TData = string> extends Command<number, number> {
1050
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
247
1051
  }
248
1052
 
249
1053
  /**
250
- * @see https://redis.io/commands/mget
1054
+ * @see https://redis.io/commands/sadd
251
1055
  */
252
- declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
253
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
1056
+ declare class SAddCommand<TData = string> extends Command<number, number> {
1057
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
254
1058
  }
255
1059
 
256
1060
  /**
257
- * @see https://redis.io/commands/ping
1061
+ * @see https://redis.io/commands/scard
258
1062
  */
259
- declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
260
- constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
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,6 +1300,40 @@ declare class UnlinkCommand extends Command<number, number> {
330
1300
  constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
331
1301
  }
332
1302
 
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
+
333
1337
  type ZAddCommandOptions = ({
334
1338
  nx: true;
335
1339
  xx?: never;
@@ -349,6 +1353,59 @@ type ScoreMember<TData> = {
349
1353
  score: number;
350
1354
  member: TData;
351
1355
  };
1356
+ /**
1357
+ * @see https://redis.io/commands/zadd
1358
+ */
1359
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1360
+ constructor(cmd: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1361
+ constructor(cmd: [
1362
+ key: string,
1363
+ opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
1364
+ ...scoreMemberPairs: ScoreMember<TData>[]
1365
+ ], opts?: CommandOptions<number | null, number | null>);
1366
+ }
1367
+
1368
+ /**
1369
+ * @see https://redis.io/commands/zcard
1370
+ */
1371
+ declare class ZCardCommand extends Command<number, number> {
1372
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1373
+ }
1374
+
1375
+ /**
1376
+ * @see https://redis.io/commands/zcount
1377
+ */
1378
+ declare class ZCountCommand extends Command<number, number> {
1379
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1380
+ }
1381
+
1382
+ /**
1383
+ * @see https://redis.io/commands/zincrby
1384
+ */
1385
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1386
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1387
+ }
1388
+
1389
+ /**
1390
+ * @see https://redis.io/commands/zlexcount
1391
+ */
1392
+ declare class ZLexCountCommand extends Command<number, number> {
1393
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1394
+ }
1395
+
1396
+ /**
1397
+ * @see https://redis.io/commands/zpopmax
1398
+ */
1399
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1400
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1401
+ }
1402
+
1403
+ /**
1404
+ * @see https://redis.io/commands/zpopmin
1405
+ */
1406
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1407
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1408
+ }
352
1409
 
353
1410
  type ZRangeCommandOptions = {
354
1411
  withScores?: boolean;
@@ -369,6 +1426,90 @@ type ZRangeCommandOptions = {
369
1426
  offset?: never;
370
1427
  count?: never;
371
1428
  });
1429
+ /**
1430
+ * @see https://redis.io/commands/zrange
1431
+ */
1432
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1433
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1434
+ constructor(cmd: [
1435
+ key: string,
1436
+ min: `(${string}` | `[${string}` | "-" | "+",
1437
+ max: `(${string}` | `[${string}` | "-" | "+",
1438
+ opts: {
1439
+ byLex: true;
1440
+ } & ZRangeCommandOptions
1441
+ ], cmdOpts?: CommandOptions<string[], TData>);
1442
+ constructor(cmd: [
1443
+ key: string,
1444
+ min: number | `(${number}` | "-inf" | "+inf",
1445
+ max: number | `(${number}` | "-inf" | "+inf",
1446
+ opts: {
1447
+ byScore: true;
1448
+ } & ZRangeCommandOptions
1449
+ ], cmdOpts?: CommandOptions<string[], TData>);
1450
+ }
1451
+
1452
+ /**
1453
+ * @see https://redis.io/commands/zrank
1454
+ */
1455
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1456
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1457
+ }
1458
+
1459
+ /**
1460
+ * @see https://redis.io/commands/zrem
1461
+ */
1462
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1463
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1464
+ }
1465
+
1466
+ /**
1467
+ * @see https://redis.io/commands/zremrangebylex
1468
+ */
1469
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1470
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1471
+ }
1472
+
1473
+ /**
1474
+ * @see https://redis.io/commands/zremrangebyrank
1475
+ */
1476
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1477
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1478
+ }
1479
+
1480
+ /**
1481
+ * @see https://redis.io/commands/zremrangebyscore
1482
+ */
1483
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1484
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1485
+ }
1486
+
1487
+ /**
1488
+ * @see https://redis.io/commands/zrevrank
1489
+ */
1490
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1491
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1492
+ }
1493
+
1494
+ /**
1495
+ * @see https://redis.io/commands/zscan
1496
+ */
1497
+ declare class ZScanCommand extends Command<[
1498
+ number,
1499
+ (string | number)[]
1500
+ ], [
1501
+ number,
1502
+ (string | number)[]
1503
+ ]> {
1504
+ constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1505
+ }
1506
+
1507
+ /**
1508
+ * @see https://redis.io/commands/zscore
1509
+ */
1510
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1511
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1512
+ }
372
1513
 
373
1514
  type InferResponseData<T extends unknown[]> = {
374
1515
  [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
@@ -462,6 +1603,12 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
462
1603
  * @see https://redis.io/commands/bitpos
463
1604
  */
464
1605
  bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1606
+ /**
1607
+ * @see https://redis.io/commands/copy
1608
+ */
1609
+ copy: (key: string, destinationKey: string, opts?: {
1610
+ replace: boolean;
1611
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
465
1612
  /**
466
1613
  * @see https://redis.io/commands/zdiffstore
467
1614
  */
@@ -998,22 +2145,22 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
998
2145
  /**
999
2146
  * @see https://redis.io/commands/geoadd
1000
2147
  */
1001
- geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
2148
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
1002
2149
  /**
1003
2150
  * @see https://redis.io/commands/geodist
1004
2151
  */
1005
- geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2152
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
1006
2153
  /**
1007
2154
  * @see https://redis.io/commands/geopos
1008
2155
  */
1009
- geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
2156
+ geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
1010
2157
  lng: number;
1011
2158
  lat: number;
1012
- }[]>;
2159
+ }[]>]>;
1013
2160
  /**
1014
2161
  * @see https://redis.io/commands/geohash
1015
2162
  */
1016
- geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
2163
+ geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
1017
2164
  /**
1018
2165
  * @see https://redis.io/commands/geosearch
1019
2166
  */
@@ -1045,7 +2192,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1045
2192
  withCoord?: boolean | undefined;
1046
2193
  withDist?: boolean | undefined;
1047
2194
  withHash?: boolean | undefined;
1048
- } | undefined) => Promise<({
2195
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
1049
2196
  member: unknown;
1050
2197
  } & {
1051
2198
  coord?: {
@@ -1054,7 +2201,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1054
2201
  } | undefined;
1055
2202
  dist?: number | undefined;
1056
2203
  hash?: string | undefined;
1057
- })[]>;
2204
+ })[]>]>;
1058
2205
  /**
1059
2206
  * @see https://redis.io/commands/geosearchstore
1060
2207
  */
@@ -1084,7 +2231,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1084
2231
  any?: boolean | undefined;
1085
2232
  } | undefined;
1086
2233
  storeDist?: boolean | undefined;
1087
- } | undefined) => Promise<number>;
2234
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1088
2235
  /**
1089
2236
  * @see https://redis.io/commands/json.get
1090
2237
  */
@@ -1429,6 +2576,12 @@ declare class Redis {
1429
2576
  * @see https://redis.io/commands/bitpos
1430
2577
  */
1431
2578
  bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
2579
+ /**
2580
+ * @see https://redis.io/commands/copy
2581
+ */
2582
+ copy: (key: string, destinationKey: string, opts?: {
2583
+ replace: boolean;
2584
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
1432
2585
  /**
1433
2586
  * @see https://redis.io/commands/dbsize
1434
2587
  */
@@ -1956,4 +3109,18 @@ declare class Redis {
1956
3109
  zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
1957
3110
  }
1958
3111
 
1959
- export { RedisOptions as R, UpstashRequest as U, RequesterConfig as a, Redis as b, Requester as c, UpstashResponse as d };
3112
+ /**
3113
+ * @see https://redis.io/commands/zdiffstore
3114
+ */
3115
+ declare class ZDiffStoreCommand extends Command<number, number> {
3116
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3117
+ }
3118
+
3119
+ /**
3120
+ * @see https://redis.io/commands/zmscore
3121
+ */
3122
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3123
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3124
+ }
3125
+
3126
+ 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, ZRangeCommand as bA, ZRangeCommandOptions as bB, ZRankCommand as bC, ZRemCommand as bD, ZRemRangeByLexCommand as bE, ZRemRangeByRankCommand as bF, ZRemRangeByScoreCommand as bG, ZRevRankCommand as bH, ZScanCommand as bI, ZScoreCommand as bJ, ZUnionCommand as bK, ZUnionCommandOptions as bL, ZUnionStoreCommand as bM, ZUnionStoreCommandOptions as bN, 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, ZAddCommandOptionsWithIncr as bo, ZAddCommand as bp, ZCardCommand as bq, ZCountCommand as br, ZDiffStoreCommand as bs, ZIncrByCommand as bt, ZInterStoreCommand as bu, ZInterStoreCommandOptions as bv, ZLexCountCommand as bw, ZMScoreCommand as bx, ZPopMaxCommand as by, ZPopMinCommand 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 };