@upstash/redis 0.0.0-ci.d9c08accc3bdd7a1d21f3d860e54e9cb1570f23e-20231215001420 → 0.0.0-ci.da1a5cb507eab3a0864199c49d02985f16e8bcd0-20250729064120

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.
@@ -0,0 +1,4031 @@
1
+ type CommandArgs<TCommand extends new (..._args: any) => any> = ConstructorParameters<TCommand>[0];
2
+ type Telemetry = {
3
+ /**
4
+ * Upstash-Telemetry-Sdk
5
+ * @example @upstash/redis@v1.1.1
6
+ */
7
+ sdk?: string;
8
+ /**
9
+ * Upstash-Telemetry-Platform
10
+ * @example cloudflare
11
+ */
12
+ platform?: string;
13
+ /**
14
+ * Upstash-Telemetry-Runtime
15
+ * @example node@v18
16
+ */
17
+ runtime?: string;
18
+ };
19
+ type RedisOptions = {
20
+ /**
21
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
22
+ *
23
+ * @default true
24
+ */
25
+ automaticDeserialization?: boolean;
26
+ latencyLogging?: boolean;
27
+ enableTelemetry?: boolean;
28
+ enableAutoPipelining?: boolean;
29
+ readYourWrites?: boolean;
30
+ };
31
+
32
+ type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
33
+ type UpstashRequest = {
34
+ path?: string[];
35
+ /**
36
+ * Request body will be serialized to json
37
+ */
38
+ body?: unknown;
39
+ /**
40
+ * Additional headers for the request
41
+ */
42
+ headers?: Record<string, string>;
43
+ upstashSyncToken?: string;
44
+ /**
45
+ * Callback for handling streaming messages
46
+ */
47
+ onMessage?: (data: string) => void;
48
+ /**
49
+ * Whether this request expects a streaming response
50
+ */
51
+ isStreaming?: boolean;
52
+ /**
53
+ * Abort signal for the request
54
+ */
55
+ signal?: AbortSignal;
56
+ };
57
+ type UpstashResponse<TResult> = {
58
+ result?: TResult;
59
+ error?: string;
60
+ };
61
+ interface Requester {
62
+ /**
63
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
64
+ */
65
+ readYourWrites?: boolean;
66
+ /**
67
+ * This token is used to ensure that the client is in sync with the server. On each request, we send this token in the header, and the server will return a new token.
68
+ */
69
+ upstashSyncToken?: string;
70
+ request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
71
+ }
72
+ type RetryConfig = false | {
73
+ /**
74
+ * The number of retries to attempt before giving up.
75
+ *
76
+ * @default 5
77
+ */
78
+ retries?: number;
79
+ /**
80
+ * A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
81
+ *
82
+ * @default
83
+ * ```ts
84
+ * Math.exp(retryCount) * 50
85
+ * ```
86
+ */
87
+ backoff?: (retryCount: number) => number;
88
+ };
89
+ type Options$1 = {
90
+ backend?: string;
91
+ };
92
+ type RequesterConfig = {
93
+ /**
94
+ * Configure the retry behaviour in case of network errors
95
+ */
96
+ retry?: RetryConfig;
97
+ /**
98
+ * Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
99
+ * valid json and will therefore cause errors when deserializing. This used to happen very
100
+ * frequently with non-utf8 data, such as emojis.
101
+ *
102
+ * By default we will therefore encode the data as base64 on the server, before sending it to the
103
+ * client. The client will then decode the base64 data and parse it as utf8.
104
+ *
105
+ * For very large entries, this can add a few milliseconds, so if you are sure that your data is
106
+ * valid utf8, you can disable this behaviour by setting this option to false.
107
+ *
108
+ * Here's what the response body looks like:
109
+ *
110
+ * ```json
111
+ * {
112
+ * result?: "base64-encoded",
113
+ * error?: string
114
+ * }
115
+ * ```
116
+ *
117
+ * @default "base64"
118
+ */
119
+ responseEncoding?: false | "base64";
120
+ /**
121
+ * Configure the cache behaviour
122
+ * @default "no-store"
123
+ */
124
+ cache?: CacheSetting;
125
+ };
126
+ type HttpClientConfig = {
127
+ headers?: Record<string, string>;
128
+ baseUrl: string;
129
+ options?: Options$1;
130
+ retry?: RetryConfig;
131
+ agent?: any;
132
+ signal?: AbortSignal | (() => AbortSignal);
133
+ keepAlive?: boolean;
134
+ /**
135
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
136
+ */
137
+ readYourWrites?: boolean;
138
+ } & RequesterConfig;
139
+
140
+ type Serialize = (data: unknown) => string | number | boolean;
141
+ type Deserialize<TResult, TData> = (result: TResult) => TData;
142
+ type CommandOptions<TResult, TData> = {
143
+ /**
144
+ * Custom deserializer
145
+ */
146
+ deserialize?: (result: TResult) => TData;
147
+ /**
148
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
149
+ *
150
+ * @default true
151
+ */
152
+ automaticDeserialization?: boolean;
153
+ latencyLogging?: boolean;
154
+ /**
155
+ * Additional headers to be sent with the request
156
+ */
157
+ headers?: Record<string, string>;
158
+ /**
159
+ * Path to append to the URL
160
+ */
161
+ path?: string[];
162
+ /**
163
+ * Options for streaming requests, mainly used for subscribe, monitor commands
164
+ **/
165
+ streamOptions?: {
166
+ /**
167
+ * Callback to be called when a message is received
168
+ */
169
+ onMessage?: (data: string) => void;
170
+ /**
171
+ * Whether the request is streaming
172
+ */
173
+ isStreaming?: boolean;
174
+ /**
175
+ * Signal to abort the request
176
+ */
177
+ signal?: AbortSignal;
178
+ };
179
+ };
180
+ /**
181
+ * Command offers default (de)serialization and the exec method to all commands.
182
+ *
183
+ * TData represents what the user will enter or receive,
184
+ * TResult is the raw data returned from upstash, which may need to be transformed or parsed.
185
+ */
186
+ declare class Command<TResult, TData> {
187
+ readonly command: (string | number | boolean)[];
188
+ readonly serialize: Serialize;
189
+ readonly deserialize: Deserialize<TResult, TData>;
190
+ protected readonly headers?: Record<string, string>;
191
+ protected readonly path?: string[];
192
+ protected readonly onMessage?: (data: string) => void;
193
+ protected readonly isStreaming: boolean;
194
+ protected readonly signal?: AbortSignal;
195
+ /**
196
+ * Create a new command instance.
197
+ *
198
+ * You can define a custom `deserialize` function. By default we try to deserialize as json.
199
+ */
200
+ constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
201
+ /**
202
+ * Execute the command using a client.
203
+ */
204
+ exec(client: Requester): Promise<TData>;
205
+ }
206
+
207
+ type ZUnionStoreCommandOptions = {
208
+ aggregate?: "sum" | "min" | "max";
209
+ } & ({
210
+ weight: number;
211
+ weights?: never;
212
+ } | {
213
+ weight?: never;
214
+ weights: number[];
215
+ } | {
216
+ weight?: never;
217
+ weights?: never;
218
+ });
219
+ /**
220
+ * @see https://redis.io/commands/zunionstore
221
+ */
222
+ declare class ZUnionStoreCommand extends Command<number, number> {
223
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
224
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
225
+ }
226
+
227
+ type ZUnionCommandOptions = {
228
+ withScores?: boolean;
229
+ aggregate?: "sum" | "min" | "max";
230
+ } & ({
231
+ weight: number;
232
+ weights?: never;
233
+ } | {
234
+ weight?: never;
235
+ weights: number[];
236
+ } | {
237
+ weight?: never;
238
+ weights?: never;
239
+ });
240
+ /**
241
+ * @see https://redis.io/commands/zunion
242
+ */
243
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
244
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
245
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
246
+ }
247
+
248
+ type ZInterStoreCommandOptions = {
249
+ aggregate?: "sum" | "min" | "max";
250
+ } & ({
251
+ weight: number;
252
+ weights?: never;
253
+ } | {
254
+ weight?: never;
255
+ weights: number[];
256
+ } | {
257
+ weight?: never;
258
+ weights?: never;
259
+ });
260
+ /**
261
+ * @see https://redis.io/commands/zInterstore
262
+ */
263
+ declare class ZInterStoreCommand extends Command<number, number> {
264
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
265
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
266
+ }
267
+
268
+ type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
269
+ /**
270
+ * @see https://redis.io/commands/type
271
+ */
272
+ declare class TypeCommand extends Command<Type, Type> {
273
+ constructor(cmd: [key: string], opts?: CommandOptions<Type, Type>);
274
+ }
275
+
276
+ type ScriptFlushCommandOptions = {
277
+ sync: true;
278
+ async?: never;
279
+ } | {
280
+ sync?: never;
281
+ async: true;
282
+ };
283
+ /**
284
+ * @see https://redis.io/commands/script-flush
285
+ */
286
+ declare class ScriptFlushCommand extends Command<"OK", "OK"> {
287
+ constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
288
+ }
289
+
290
+ type GeoAddCommandOptions = {
291
+ nx?: boolean;
292
+ xx?: never;
293
+ } | ({
294
+ nx?: never;
295
+ xx?: boolean;
296
+ } & {
297
+ ch?: boolean;
298
+ });
299
+ type GeoMember<TMemberType> = {
300
+ latitude: number;
301
+ longitude: number;
302
+ member: TMemberType;
303
+ };
304
+ /**
305
+ * @see https://redis.io/commands/geoadd
306
+ */
307
+ declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
308
+ constructor([key, arg1, ...arg2]: [
309
+ string,
310
+ GeoMember<TMemberType> | GeoAddCommandOptions,
311
+ ...GeoMember<TMemberType>[]
312
+ ], opts?: CommandOptions<number | null, number | null>);
313
+ }
314
+
315
+ type ExpireOption = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
316
+ declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
317
+ constructor(cmd: [key: string, seconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
318
+ }
319
+
320
+ /**
321
+ * @see https://redis.io/commands/append
322
+ */
323
+ declare class AppendCommand extends Command<number, number> {
324
+ constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
325
+ }
326
+
327
+ /**
328
+ * @see https://redis.io/commands/bitcount
329
+ */
330
+ declare class BitCountCommand extends Command<number, number> {
331
+ constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
332
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
333
+ }
334
+
335
+ type SubCommandArgs<TRest extends unknown[] = []> = [
336
+ encoding: string,
337
+ offset: number | string,
338
+ ...rest: TRest
339
+ ];
340
+ /**
341
+ * @see https://redis.io/commands/bitfield
342
+ */
343
+ declare class BitFieldCommand<T = Promise<number[]>> {
344
+ private client;
345
+ private opts?;
346
+ private execOperation;
347
+ private command;
348
+ constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
349
+ private chain;
350
+ get(...args: SubCommandArgs): this;
351
+ set(...args: SubCommandArgs<[value: number]>): this;
352
+ incrby(...args: SubCommandArgs<[increment: number]>): this;
353
+ overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
354
+ exec(): T;
355
+ }
356
+
357
+ /**
358
+ * @see https://redis.io/commands/bitop
359
+ */
360
+ declare class BitOpCommand extends Command<number, number> {
361
+ constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
362
+ constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
363
+ }
364
+
365
+ /**
366
+ * @see https://redis.io/commands/bitpos
367
+ */
368
+ declare class BitPosCommand extends Command<number, number> {
369
+ constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
370
+ }
371
+
372
+ /**
373
+ * @see https://redis.io/commands/copy
374
+ */
375
+ declare class CopyCommand extends Command<number, "COPIED" | "NOT_COPIED"> {
376
+ constructor([key, destinationKey, opts]: [key: string, destinationKey: string, opts?: {
377
+ replace: boolean;
378
+ }], commandOptions?: CommandOptions<number, "COPIED" | "NOT_COPIED">);
379
+ }
380
+
381
+ /**
382
+ * @see https://redis.io/commands/dbsize
383
+ */
384
+ declare class DBSizeCommand extends Command<number, number> {
385
+ constructor(opts?: CommandOptions<number, number>);
386
+ }
387
+
388
+ /**
389
+ * @see https://redis.io/commands/decr
390
+ */
391
+ declare class DecrCommand extends Command<number, number> {
392
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
393
+ }
394
+
395
+ /**
396
+ * @see https://redis.io/commands/decrby
397
+ */
398
+ declare class DecrByCommand extends Command<number, number> {
399
+ constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
400
+ }
401
+
402
+ /**
403
+ * @see https://redis.io/commands/del
404
+ */
405
+ declare class DelCommand extends Command<number, number> {
406
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
407
+ }
408
+
409
+ /**
410
+ * @see https://redis.io/commands/echo
411
+ */
412
+ declare class EchoCommand extends Command<string, string> {
413
+ constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
414
+ }
415
+
416
+ /**
417
+ * @see https://redis.io/commands/eval_ro
418
+ */
419
+ declare class EvalROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
420
+ constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
421
+ }
422
+
423
+ /**
424
+ * @see https://redis.io/commands/eval
425
+ */
426
+ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
427
+ constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
428
+ }
429
+
430
+ /**
431
+ * @see https://redis.io/commands/evalsha_ro
432
+ */
433
+ declare class EvalshaROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
434
+ constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
435
+ }
436
+
437
+ /**
438
+ * @see https://redis.io/commands/evalsha
439
+ */
440
+ declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
441
+ constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
442
+ }
443
+
444
+ /**
445
+ * @see https://redis.io/commands/exists
446
+ */
447
+ declare class ExistsCommand extends Command<number, number> {
448
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
449
+ }
450
+
451
+ /**
452
+ * @see https://redis.io/commands/expireat
453
+ */
454
+ declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
455
+ constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
456
+ }
457
+
458
+ /**
459
+ * @see https://redis.io/commands/flushall
460
+ */
461
+ declare class FlushAllCommand extends Command<"OK", "OK"> {
462
+ constructor(args?: [{
463
+ async?: boolean;
464
+ }], opts?: CommandOptions<"OK", "OK">);
465
+ }
466
+
467
+ /**
468
+ * @see https://redis.io/commands/flushdb
469
+ */
470
+ declare class FlushDBCommand extends Command<"OK", "OK"> {
471
+ constructor([opts]: [opts?: {
472
+ async?: boolean;
473
+ }], cmdOpts?: CommandOptions<"OK", "OK">);
474
+ }
475
+
476
+ /**
477
+ * @see https://redis.io/commands/geodist
478
+ */
479
+ declare class GeoDistCommand<TMemberType = string> extends Command<number | null, number | null> {
480
+ constructor([key, member1, member2, unit]: [
481
+ key: string,
482
+ member1: TMemberType,
483
+ member2: TMemberType,
484
+ unit?: "M" | "KM" | "FT" | "MI"
485
+ ], opts?: CommandOptions<number | null, number | null>);
486
+ }
487
+
488
+ /**
489
+ * @see https://redis.io/commands/geohash
490
+ */
491
+ declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
492
+ constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
493
+ }
494
+
495
+ type Coordinates = {
496
+ lng: number;
497
+ lat: number;
498
+ };
499
+ /**
500
+ * @see https://redis.io/commands/geopos
501
+ */
502
+ declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][], Coordinates[]> {
503
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
504
+ }
505
+
506
+ type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
507
+ type CenterPoint$1<TMemberType> = {
508
+ type: "FROMMEMBER" | "frommember";
509
+ member: TMemberType;
510
+ } | {
511
+ type: "FROMLONLAT" | "fromlonlat";
512
+ coordinate: {
513
+ lon: number;
514
+ lat: number;
515
+ };
516
+ };
517
+ type Shape$1 = {
518
+ type: "BYRADIUS" | "byradius";
519
+ radius: number;
520
+ radiusType: RadiusOptions$1;
521
+ } | {
522
+ type: "BYBOX" | "bybox";
523
+ rect: {
524
+ width: number;
525
+ height: number;
526
+ };
527
+ rectType: RadiusOptions$1;
528
+ };
529
+ type GeoSearchCommandOptions$1 = {
530
+ count?: {
531
+ limit: number;
532
+ any?: boolean;
533
+ };
534
+ withCoord?: boolean;
535
+ withDist?: boolean;
536
+ withHash?: boolean;
537
+ };
538
+ type OptionMappings = {
539
+ withHash: "hash";
540
+ withCoord: "coord";
541
+ withDist: "dist";
542
+ };
543
+ type GeoSearchOptions<TOptions> = {
544
+ [K in keyof TOptions as K extends keyof OptionMappings ? OptionMappings[K] : never]: K extends "withHash" ? string : K extends "withCoord" ? {
545
+ long: number;
546
+ lat: number;
547
+ } : K extends "withDist" ? number : never;
548
+ };
549
+ type GeoSearchResponse<TOptions, TMemberType> = ({
550
+ member: TMemberType;
551
+ } & GeoSearchOptions<TOptions>)[];
552
+ /**
553
+ * @see https://redis.io/commands/geosearch
554
+ */
555
+ declare class GeoSearchCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions$1 = GeoSearchCommandOptions$1> extends Command<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>> {
556
+ constructor([key, centerPoint, shape, order, opts]: [
557
+ key: string,
558
+ centerPoint: CenterPoint$1<TMemberType>,
559
+ shape: Shape$1,
560
+ order: "ASC" | "DESC" | "asc" | "desc",
561
+ opts?: TOptions
562
+ ], commandOptions?: CommandOptions<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>>);
563
+ }
564
+
565
+ type RadiusOptions = "M" | "KM" | "FT" | "MI";
566
+ type CenterPoint<TMemberType> = {
567
+ type: "FROMMEMBER" | "frommember";
568
+ member: TMemberType;
569
+ } | {
570
+ type: "FROMLONLAT" | "fromlonlat";
571
+ coordinate: {
572
+ lon: number;
573
+ lat: number;
574
+ };
575
+ };
576
+ type Shape = {
577
+ type: "BYRADIUS" | "byradius";
578
+ radius: number;
579
+ radiusType: RadiusOptions;
580
+ } | {
581
+ type: "BYBOX" | "bybox";
582
+ rect: {
583
+ width: number;
584
+ height: number;
585
+ };
586
+ rectType: RadiusOptions;
587
+ };
588
+ type GeoSearchCommandOptions = {
589
+ count?: {
590
+ limit: number;
591
+ any?: boolean;
592
+ };
593
+ storeDist?: boolean;
594
+ };
595
+ /**
596
+ * @see https://redis.io/commands/geosearchstore
597
+ */
598
+ declare class GeoSearchStoreCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions = GeoSearchCommandOptions> extends Command<any[] | any[][], number> {
599
+ constructor([destination, key, centerPoint, shape, order, opts]: [
600
+ destination: string,
601
+ key: string,
602
+ centerPoint: CenterPoint<TMemberType>,
603
+ shape: Shape,
604
+ order: "ASC" | "DESC" | "asc" | "desc",
605
+ opts?: TOptions
606
+ ], commandOptions?: CommandOptions<any[] | any[][], number>);
607
+ }
608
+
609
+ /**
610
+ * @see https://redis.io/commands/get
611
+ */
612
+ declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
613
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
614
+ }
615
+
616
+ /**
617
+ * @see https://redis.io/commands/getbit
618
+ */
619
+ declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
620
+ constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
621
+ }
622
+
623
+ /**
624
+ * @see https://redis.io/commands/getdel
625
+ */
626
+ declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
627
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
628
+ }
629
+
630
+ type GetExCommandOptions = {
631
+ ex: number;
632
+ px?: never;
633
+ exat?: never;
634
+ pxat?: never;
635
+ persist?: never;
636
+ } | {
637
+ ex?: never;
638
+ px: number;
639
+ exat?: never;
640
+ pxat?: never;
641
+ persist?: never;
642
+ } | {
643
+ ex?: never;
644
+ px?: never;
645
+ exat: number;
646
+ pxat?: never;
647
+ persist?: never;
648
+ } | {
649
+ ex?: never;
650
+ px?: never;
651
+ exat?: never;
652
+ pxat: number;
653
+ persist?: never;
654
+ } | {
655
+ ex?: never;
656
+ px?: never;
657
+ exat?: never;
658
+ pxat?: never;
659
+ persist: true;
660
+ } | {
661
+ ex?: never;
662
+ px?: never;
663
+ exat?: never;
664
+ pxat?: never;
665
+ persist?: never;
666
+ };
667
+ /**
668
+ * @see https://redis.io/commands/getex
669
+ */
670
+ declare class GetExCommand<TData = string> extends Command<unknown | null, TData | null> {
671
+ constructor([key, opts]: [key: string, opts?: GetExCommandOptions], cmdOpts?: CommandOptions<unknown | null, TData | null>);
672
+ }
673
+
674
+ /**
675
+ * @see https://redis.io/commands/getrange
676
+ */
677
+ declare class GetRangeCommand extends Command<string, string> {
678
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
679
+ }
680
+
681
+ /**
682
+ * @see https://redis.io/commands/getset
683
+ */
684
+ declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
685
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
686
+ }
687
+
688
+ /**
689
+ * @see https://redis.io/commands/hdel
690
+ */
691
+ declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
692
+ constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
693
+ }
694
+
695
+ /**
696
+ * @see https://redis.io/commands/hexists
697
+ */
698
+ declare class HExistsCommand extends Command<number, number> {
699
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
700
+ }
701
+
702
+ declare class HExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
703
+ constructor(cmd: [
704
+ key: string,
705
+ fields: (string | number) | (string | number)[],
706
+ seconds: number,
707
+ option?: ExpireOption
708
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
709
+ }
710
+
711
+ declare class HExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
712
+ constructor(cmd: [
713
+ key: string,
714
+ fields: (string | number) | (string | number)[],
715
+ timestamp: number,
716
+ option?: ExpireOption
717
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
718
+ }
719
+
720
+ declare class HExpireTimeCommand extends Command<number[], number[]> {
721
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
722
+ }
723
+
724
+ declare class HPersistCommand extends Command<(-2 | -1 | 1)[], (-2 | -1 | 1)[]> {
725
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<(-2 | -1 | 1)[], (-2 | -1 | 1)[]>);
726
+ }
727
+
728
+ declare class HPExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
729
+ constructor(cmd: [
730
+ key: string,
731
+ fields: (string | number) | (string | number)[],
732
+ milliseconds: number,
733
+ option?: ExpireOption
734
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
735
+ }
736
+
737
+ declare class HPExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
738
+ constructor(cmd: [
739
+ key: string,
740
+ fields: (string | number) | (string | number)[],
741
+ timestamp: number,
742
+ option?: ExpireOption
743
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
744
+ }
745
+
746
+ declare class HPExpireTimeCommand extends Command<number[], number[]> {
747
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
748
+ }
749
+
750
+ declare class HPTtlCommand extends Command<number[], number[]> {
751
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
752
+ }
753
+
754
+ /**
755
+ * @see https://redis.io/commands/hget
756
+ */
757
+ declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
758
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
759
+ }
760
+
761
+ /**
762
+ * @see https://redis.io/commands/hgetall
763
+ */
764
+ declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
765
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
766
+ }
767
+
768
+ /**
769
+ * @see https://redis.io/commands/hincrby
770
+ */
771
+ declare class HIncrByCommand extends Command<number, number> {
772
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
773
+ }
774
+
775
+ /**
776
+ * @see https://redis.io/commands/hincrbyfloat
777
+ */
778
+ declare class HIncrByFloatCommand extends Command<number, number> {
779
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
780
+ }
781
+
782
+ /**
783
+ * @see https://redis.io/commands/hkeys
784
+ */
785
+ declare class HKeysCommand extends Command<string[], string[]> {
786
+ constructor([key]: [key: string], opts?: CommandOptions<string[], string[]>);
787
+ }
788
+
789
+ /**
790
+ * @see https://redis.io/commands/hlen
791
+ */
792
+ declare class HLenCommand extends Command<number, number> {
793
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
794
+ }
795
+
796
+ /**
797
+ * hmget returns an object of all requested fields from a hash
798
+ * The field values are returned as an object like this:
799
+ * ```ts
800
+ * {[fieldName: string]: T | null}
801
+ * ```
802
+ *
803
+ * In case the hash does not exist or all fields are empty `null` is returned
804
+ *
805
+ * @see https://redis.io/commands/hmget
806
+ */
807
+ declare class HMGetCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
808
+ constructor([key, ...fields]: [key: string, ...fields: string[]], opts?: CommandOptions<(string | null)[], TData | null>);
809
+ }
810
+
811
+ /**
812
+ * @see https://redis.io/commands/hmset
813
+ */
814
+ declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
815
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
816
+ }
817
+
818
+ /**
819
+ * @see https://redis.io/commands/hrandfield
820
+ */
821
+ declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
822
+ constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
823
+ constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
824
+ constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
825
+ }
826
+
827
+ type ScanCommandOptionsStandard = {
828
+ match?: string;
829
+ count?: number;
830
+ type?: string;
831
+ withType?: false;
832
+ };
833
+ type ScanCommandOptionsWithType = {
834
+ match?: string;
835
+ count?: number;
836
+ /**
837
+ * Includes types of each key in the result
838
+ *
839
+ * @example
840
+ * ```typescript
841
+ * await redis.scan("0", { withType: true })
842
+ * // ["0", [{ key: "key1", type: "string" }, { key: "key2", type: "list" }]]
843
+ * ```
844
+ */
845
+ withType: true;
846
+ };
847
+ type ScanCommandOptions = ScanCommandOptionsStandard | ScanCommandOptionsWithType;
848
+ type ScanResultStandard = [string, string[]];
849
+ type ScanResultWithType = [string, {
850
+ key: string;
851
+ type: string;
852
+ }[]];
853
+ /**
854
+ * @see https://redis.io/commands/scan
855
+ */
856
+ declare class ScanCommand<TData = ScanResultStandard> extends Command<[string, string[]], TData> {
857
+ constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], TData>);
858
+ }
859
+
860
+ /**
861
+ * @see https://redis.io/commands/hscan
862
+ */
863
+ declare class HScanCommand extends Command<[
864
+ string,
865
+ (string | number)[]
866
+ ], [
867
+ string,
868
+ (string | number)[]
869
+ ]> {
870
+ constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
871
+ }
872
+
873
+ /**
874
+ * @see https://redis.io/commands/hset
875
+ */
876
+ declare class HSetCommand<TData> extends Command<number, number> {
877
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
878
+ }
879
+
880
+ /**
881
+ * @see https://redis.io/commands/hsetnx
882
+ */
883
+ declare class HSetNXCommand<TData> extends Command<"0" | "1", 0 | 1> {
884
+ constructor(cmd: [key: string, field: string, value: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
885
+ }
886
+
887
+ /**
888
+ * @see https://redis.io/commands/hstrlen
889
+ */
890
+ declare class HStrLenCommand extends Command<number, number> {
891
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
892
+ }
893
+
894
+ declare class HTtlCommand extends Command<number[], number[]> {
895
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
896
+ }
897
+
898
+ /**
899
+ * @see https://redis.io/commands/hvals
900
+ */
901
+ declare class HValsCommand<TData extends unknown[]> extends Command<unknown[], TData> {
902
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
903
+ }
904
+
905
+ /**
906
+ * @see https://redis.io/commands/incr
907
+ */
908
+ declare class IncrCommand extends Command<number, number> {
909
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
910
+ }
911
+
912
+ /**
913
+ * @see https://redis.io/commands/incrby
914
+ */
915
+ declare class IncrByCommand extends Command<number, number> {
916
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
917
+ }
918
+
919
+ /**
920
+ * @see https://redis.io/commands/incrbyfloat
921
+ */
922
+ declare class IncrByFloatCommand extends Command<number, number> {
923
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
924
+ }
925
+
926
+ /**
927
+ * @see https://redis.io/commands/json.arrappend
928
+ */
929
+ declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
930
+ constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
931
+ }
932
+
933
+ /**
934
+ * @see https://redis.io/commands/json.arrindex
935
+ */
936
+ declare class JsonArrIndexCommand<TValue> extends Command<(null | string)[], (null | number)[]> {
937
+ constructor(cmd: [key: string, path: string, value: TValue, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
938
+ }
939
+
940
+ /**
941
+ * @see https://redis.io/commands/json.arrinsert
942
+ */
943
+ declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
944
+ constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
945
+ }
946
+
947
+ /**
948
+ * @see https://redis.io/commands/json.arrlen
949
+ */
950
+ declare class JsonArrLenCommand extends Command<(null | string)[], (null | number)[]> {
951
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
952
+ }
953
+
954
+ /**
955
+ * @see https://redis.io/commands/json.arrpop
956
+ */
957
+ declare class JsonArrPopCommand<TData> extends Command<(null | string)[], (TData | null)[]> {
958
+ constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
959
+ }
960
+
961
+ /**
962
+ * @see https://redis.io/commands/json.arrtrim
963
+ */
964
+ declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
965
+ constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
966
+ }
967
+
968
+ /**
969
+ * @see https://redis.io/commands/json.clear
970
+ */
971
+ declare class JsonClearCommand extends Command<number, number> {
972
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
973
+ }
974
+
975
+ /**
976
+ * @see https://redis.io/commands/json.del
977
+ */
978
+ declare class JsonDelCommand extends Command<number, number> {
979
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
980
+ }
981
+
982
+ /**
983
+ * @see https://redis.io/commands/json.forget
984
+ */
985
+ declare class JsonForgetCommand extends Command<number, number> {
986
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
987
+ }
988
+
989
+ /**
990
+ * @see https://redis.io/commands/json.get
991
+ */
992
+ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
993
+ constructor(cmd: [
994
+ key: string,
995
+ opts?: {
996
+ indent?: string;
997
+ newline?: string;
998
+ space?: string;
999
+ },
1000
+ ...path: string[]
1001
+ ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
1002
+ }
1003
+
1004
+ /**
1005
+ * @see https://redis.io/commands/json.merge
1006
+ */
1007
+ declare class JsonMergeCommand<TData extends string | number | Record<string, unknown> | Array<unknown>> extends Command<"OK" | null, "OK" | null> {
1008
+ constructor(cmd: [key: string, path: string, value: TData], opts?: CommandOptions<"OK" | null, "OK" | null>);
1009
+ }
1010
+
1011
+ /**
1012
+ * @see https://redis.io/commands/json.mget
1013
+ */
1014
+ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
1015
+ constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
1016
+ }
1017
+
1018
+ /**
1019
+ * @see https://redis.io/commands/json.mset
1020
+ */
1021
+ declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
1022
+ constructor(cmd: {
1023
+ key: string;
1024
+ path: string;
1025
+ value: TData;
1026
+ }[], opts?: CommandOptions<"OK" | null, "OK" | null>);
1027
+ }
1028
+
1029
+ /**
1030
+ * @see https://redis.io/commands/json.numincrby
1031
+ */
1032
+ declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
1033
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
1034
+ }
1035
+
1036
+ /**
1037
+ * @see https://redis.io/commands/json.nummultby
1038
+ */
1039
+ declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
1040
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
1041
+ }
1042
+
1043
+ /**
1044
+ * @see https://redis.io/commands/json.objkeys
1045
+ */
1046
+ declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
1047
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
1048
+ }
1049
+
1050
+ /**
1051
+ * @see https://redis.io/commands/json.objlen
1052
+ */
1053
+ declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
1054
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
1055
+ }
1056
+
1057
+ /**
1058
+ * @see https://redis.io/commands/json.resp
1059
+ */
1060
+ declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
1061
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
1062
+ }
1063
+
1064
+ /**
1065
+ * @see https://redis.io/commands/json.set
1066
+ */
1067
+ declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
1068
+ constructor(cmd: [
1069
+ key: string,
1070
+ path: string,
1071
+ value: TData,
1072
+ opts?: {
1073
+ nx: true;
1074
+ xx?: never;
1075
+ } | {
1076
+ nx?: never;
1077
+ xx: true;
1078
+ }
1079
+ ], opts?: CommandOptions<"OK" | null, "OK" | null>);
1080
+ }
1081
+
1082
+ /**
1083
+ * @see https://redis.io/commands/json.strappend
1084
+ */
1085
+ declare class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
1086
+ constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
1087
+ }
1088
+
1089
+ /**
1090
+ * @see https://redis.io/commands/json.strlen
1091
+ */
1092
+ declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
1093
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
1094
+ }
1095
+
1096
+ /**
1097
+ * @see https://redis.io/commands/json.toggle
1098
+ */
1099
+ declare class JsonToggleCommand extends Command<number[], number[]> {
1100
+ constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
1101
+ }
1102
+
1103
+ /**
1104
+ * @see https://redis.io/commands/json.type
1105
+ */
1106
+ declare class JsonTypeCommand extends Command<string[], string[]> {
1107
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
1108
+ }
1109
+
1110
+ /**
1111
+ * @see https://redis.io/commands/keys
1112
+ */
1113
+ declare class KeysCommand extends Command<string[], string[]> {
1114
+ constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>);
1115
+ }
1116
+
1117
+ declare class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
1118
+ constructor(cmd: [key: string, index: number], opts?: CommandOptions<unknown | null, TData | null>);
1119
+ }
1120
+
1121
+ declare class LInsertCommand<TData = string> extends Command<number, number> {
1122
+ constructor(cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData], opts?: CommandOptions<number, number>);
1123
+ }
1124
+
1125
+ /**
1126
+ * @see https://redis.io/commands/llen
1127
+ */
1128
+ declare class LLenCommand extends Command<number, number> {
1129
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1130
+ }
1131
+
1132
+ /**
1133
+ * @see https://redis.io/commands/lmove
1134
+ */
1135
+ declare class LMoveCommand<TData = string> extends Command<TData, TData> {
1136
+ constructor(cmd: [
1137
+ source: string,
1138
+ destination: string,
1139
+ whereFrom: "left" | "right",
1140
+ whereTo: "left" | "right"
1141
+ ], opts?: CommandOptions<TData, TData>);
1142
+ }
1143
+
1144
+ /**
1145
+ * @see https://redis.io/commands/lpop
1146
+ */
1147
+ declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
1148
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
1149
+ }
1150
+
1151
+ /**
1152
+ * @see https://redis.io/commands/lpush
1153
+ */
1154
+ declare class LPushCommand<TData = string> extends Command<number, number> {
1155
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1156
+ }
1157
+
1158
+ /**
1159
+ * @see https://redis.io/commands/lpushx
1160
+ */
1161
+ declare class LPushXCommand<TData> extends Command<number, number> {
1162
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1163
+ }
1164
+
1165
+ declare class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
1166
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<unknown[], TData[]>);
1167
+ }
1168
+
1169
+ declare class LRemCommand<TData> extends Command<number, number> {
1170
+ constructor(cmd: [key: string, count: number, value: TData], opts?: CommandOptions<number, number>);
1171
+ }
1172
+
1173
+ declare class LSetCommand<TData = string> extends Command<"OK", "OK"> {
1174
+ constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">);
1175
+ }
1176
+
1177
+ declare class LTrimCommand extends Command<"OK", "OK"> {
1178
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">);
1179
+ }
1180
+
1181
+ /**
1182
+ * @see https://redis.io/commands/mget
1183
+ */
1184
+ declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
1185
+ constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
1186
+ }
1187
+
1188
+ /**
1189
+ * @see https://redis.io/commands/mset
1190
+ */
1191
+ declare class MSetCommand<TData> extends Command<"OK", "OK"> {
1192
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
1193
+ }
1194
+
1195
+ /**
1196
+ * @see https://redis.io/commands/msetnx
1197
+ */
1198
+ declare class MSetNXCommand<TData = string> extends Command<number, number> {
1199
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
1200
+ }
1201
+
1202
+ /**
1203
+ * @see https://redis.io/commands/persist
1204
+ */
1205
+ declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
1206
+ constructor(cmd: [key: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
1207
+ }
1208
+
1209
+ /**
1210
+ * @see https://redis.io/commands/pexpire
1211
+ */
1212
+ declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
1213
+ constructor(cmd: [key: string, milliseconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
1214
+ }
1215
+
1216
+ /**
1217
+ * @see https://redis.io/commands/pexpireat
1218
+ */
1219
+ declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
1220
+ constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
1221
+ }
1222
+
1223
+ /**
1224
+ * @see https://redis.io/commands/ping
1225
+ */
1226
+ declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
1227
+ constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
1228
+ }
1229
+
1230
+ /**
1231
+ * @see https://redis.io/commands/psetex
1232
+ */
1233
+ declare class PSetEXCommand<TData = string> extends Command<string, string> {
1234
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<string, string>);
1235
+ }
1236
+
1237
+ /**
1238
+ * @see https://redis.io/commands/pttl
1239
+ */
1240
+ declare class PTtlCommand extends Command<number, number> {
1241
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1242
+ }
1243
+
1244
+ /**
1245
+ * @see https://redis.io/commands/publish
1246
+ */
1247
+ declare class PublishCommand<TMessage = unknown> extends Command<number, number> {
1248
+ constructor(cmd: [channel: string, message: TMessage], opts?: CommandOptions<number, number>);
1249
+ }
1250
+
1251
+ /**
1252
+ * @see https://redis.io/commands/randomkey
1253
+ */
1254
+ declare class RandomKeyCommand extends Command<string | null, string | null> {
1255
+ constructor(opts?: CommandOptions<string | null, string | null>);
1256
+ }
1257
+
1258
+ /**
1259
+ * @see https://redis.io/commands/rename
1260
+ */
1261
+ declare class RenameCommand extends Command<"OK", "OK"> {
1262
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
1263
+ }
1264
+
1265
+ /**
1266
+ * @see https://redis.io/commands/renamenx
1267
+ */
1268
+ declare class RenameNXCommand extends Command<"0" | "1", 0 | 1> {
1269
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
1270
+ }
1271
+
1272
+ /**
1273
+ * @see https://redis.io/commands/rpop
1274
+ */
1275
+ declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
1276
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
1277
+ }
1278
+
1279
+ /**
1280
+ * @see https://redis.io/commands/rpush
1281
+ */
1282
+ declare class RPushCommand<TData = string> extends Command<number, number> {
1283
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1284
+ }
1285
+
1286
+ /**
1287
+ * @see https://redis.io/commands/rpushx
1288
+ */
1289
+ declare class RPushXCommand<TData = string> extends Command<number, number> {
1290
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1291
+ }
1292
+
1293
+ /**
1294
+ * @see https://redis.io/commands/sadd
1295
+ */
1296
+ declare class SAddCommand<TData = string> extends Command<number, number> {
1297
+ constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
1298
+ }
1299
+
1300
+ /**
1301
+ * @see https://redis.io/commands/scard
1302
+ */
1303
+ declare class SCardCommand extends Command<number, number> {
1304
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1305
+ }
1306
+
1307
+ /**
1308
+ * @see https://redis.io/commands/script-exists
1309
+ */
1310
+ declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
1311
+ constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
1312
+ }
1313
+
1314
+ /**
1315
+ * @see https://redis.io/commands/script-load
1316
+ */
1317
+ declare class ScriptLoadCommand extends Command<string, string> {
1318
+ constructor(args: [script: string], opts?: CommandOptions<string, string>);
1319
+ }
1320
+
1321
+ /**
1322
+ * @see https://redis.io/commands/sdiff
1323
+ */
1324
+ declare class SDiffCommand<TData> extends Command<unknown[], TData[]> {
1325
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1326
+ }
1327
+
1328
+ /**
1329
+ * @see https://redis.io/commands/sdiffstore
1330
+ */
1331
+ declare class SDiffStoreCommand extends Command<number, number> {
1332
+ constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1333
+ }
1334
+
1335
+ type SetCommandOptions = {
1336
+ get?: boolean;
1337
+ } & ({
1338
+ ex: number;
1339
+ px?: never;
1340
+ exat?: never;
1341
+ pxat?: never;
1342
+ keepTtl?: never;
1343
+ } | {
1344
+ ex?: never;
1345
+ px: number;
1346
+ exat?: never;
1347
+ pxat?: never;
1348
+ keepTtl?: never;
1349
+ } | {
1350
+ ex?: never;
1351
+ px?: never;
1352
+ exat: number;
1353
+ pxat?: never;
1354
+ keepTtl?: never;
1355
+ } | {
1356
+ ex?: never;
1357
+ px?: never;
1358
+ exat?: never;
1359
+ pxat: number;
1360
+ keepTtl?: never;
1361
+ } | {
1362
+ ex?: never;
1363
+ px?: never;
1364
+ exat?: never;
1365
+ pxat?: never;
1366
+ keepTtl: true;
1367
+ } | {
1368
+ ex?: never;
1369
+ px?: never;
1370
+ exat?: never;
1371
+ pxat?: never;
1372
+ keepTtl?: never;
1373
+ }) & ({
1374
+ nx: true;
1375
+ xx?: never;
1376
+ } | {
1377
+ xx: true;
1378
+ nx?: never;
1379
+ } | {
1380
+ xx?: never;
1381
+ nx?: never;
1382
+ });
1383
+ /**
1384
+ * @see https://redis.io/commands/set
1385
+ */
1386
+ declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
1387
+ constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
1388
+ }
1389
+
1390
+ /**
1391
+ * @see https://redis.io/commands/setbit
1392
+ */
1393
+ declare class SetBitCommand extends Command<"0" | "1", 0 | 1> {
1394
+ constructor(cmd: [key: string, offset: number, value: 0 | 1], opts?: CommandOptions<"0" | "1", 0 | 1>);
1395
+ }
1396
+
1397
+ /**
1398
+ * @see https://redis.io/commands/setex
1399
+ */
1400
+ declare class SetExCommand<TData = string> extends Command<"OK", "OK"> {
1401
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<"OK", "OK">);
1402
+ }
1403
+
1404
+ /**
1405
+ * @see https://redis.io/commands/setnx
1406
+ */
1407
+ declare class SetNxCommand<TData = string> extends Command<number, number> {
1408
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<number, number>);
1409
+ }
1410
+
1411
+ /**
1412
+ * @see https://redis.io/commands/setrange
1413
+ */
1414
+ declare class SetRangeCommand extends Command<number, number> {
1415
+ constructor(cmd: [key: string, offset: number, value: string], opts?: CommandOptions<number, number>);
1416
+ }
1417
+
1418
+ /**
1419
+ * @see https://redis.io/commands/sinter
1420
+ */
1421
+ declare class SInterCommand<TData = string> extends Command<unknown[], TData[]> {
1422
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1423
+ }
1424
+
1425
+ /**
1426
+ * @see https://redis.io/commands/sinterstore
1427
+ */
1428
+ declare class SInterStoreCommand extends Command<number, number> {
1429
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1430
+ }
1431
+
1432
+ /**
1433
+ * @see https://redis.io/commands/sismember
1434
+ */
1435
+ declare class SIsMemberCommand<TData = string> extends Command<"0" | "1", 0 | 1> {
1436
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1437
+ }
1438
+
1439
+ /**
1440
+ * @see https://redis.io/commands/smembers
1441
+ */
1442
+ declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
1443
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
1444
+ }
1445
+
1446
+ /**
1447
+ * @see https://redis.io/commands/smismember
1448
+ */
1449
+ declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
1450
+ constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
1451
+ }
1452
+
1453
+ /**
1454
+ * @see https://redis.io/commands/smove
1455
+ */
1456
+ declare class SMoveCommand<TData> extends Command<"0" | "1", 0 | 1> {
1457
+ constructor(cmd: [source: string, destination: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1458
+ }
1459
+
1460
+ /**
1461
+ * @see https://redis.io/commands/spop
1462
+ */
1463
+ declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
1464
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
1465
+ }
1466
+
1467
+ /**
1468
+ * @see https://redis.io/commands/srandmember
1469
+ */
1470
+ declare class SRandMemberCommand<TData> extends Command<string | null, TData | null> {
1471
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
1472
+ }
1473
+
1474
+ /**
1475
+ * @see https://redis.io/commands/srem
1476
+ */
1477
+ declare class SRemCommand<TData = string> extends Command<number, number> {
1478
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1479
+ }
1480
+
1481
+ /**
1482
+ * @see https://redis.io/commands/sscan
1483
+ */
1484
+ declare class SScanCommand extends Command<[
1485
+ string,
1486
+ (string | number)[]
1487
+ ], [
1488
+ string,
1489
+ (string | number)[]
1490
+ ]> {
1491
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1492
+ }
1493
+
1494
+ /**
1495
+ * @see https://redis.io/commands/strlen
1496
+ */
1497
+ declare class StrLenCommand extends Command<number, number> {
1498
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1499
+ }
1500
+
1501
+ /**
1502
+ * @see https://redis.io/commands/sunion
1503
+ */
1504
+ declare class SUnionCommand<TData> extends Command<string[], TData[]> {
1505
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<string[], TData[]>);
1506
+ }
1507
+
1508
+ /**
1509
+ * @see https://redis.io/commands/sunionstore
1510
+ */
1511
+ declare class SUnionStoreCommand extends Command<number, number> {
1512
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1513
+ }
1514
+
1515
+ /**
1516
+ * @see https://redis.io/commands/time
1517
+ */
1518
+ declare class TimeCommand extends Command<[number, number], [number, number]> {
1519
+ constructor(opts?: CommandOptions<[number, number], [number, number]>);
1520
+ }
1521
+
1522
+ /**
1523
+ * @see https://redis.io/commands/touch
1524
+ */
1525
+ declare class TouchCommand extends Command<number, number> {
1526
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1527
+ }
1528
+
1529
+ /**
1530
+ * @see https://redis.io/commands/ttl
1531
+ */
1532
+ declare class TtlCommand extends Command<number, number> {
1533
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1534
+ }
1535
+
1536
+ /**
1537
+ * @see https://redis.io/commands/unlink
1538
+ */
1539
+ declare class UnlinkCommand extends Command<number, number> {
1540
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1541
+ }
1542
+
1543
+ type XAddCommandOptions = {
1544
+ nomkStream?: boolean;
1545
+ trim?: ({
1546
+ type: "MAXLEN" | "maxlen";
1547
+ threshold: number;
1548
+ } | {
1549
+ type: "MINID" | "minid";
1550
+ threshold: string;
1551
+ }) & ({
1552
+ comparison: "~";
1553
+ limit?: number;
1554
+ } | {
1555
+ comparison: "=";
1556
+ limit?: never;
1557
+ });
1558
+ };
1559
+ /**
1560
+ * @see https://redis.io/commands/xadd
1561
+ */
1562
+ declare class XAddCommand extends Command<string, string> {
1563
+ constructor([key, id, entries, opts]: [
1564
+ key: string,
1565
+ id: "*" | string,
1566
+ entries: Record<string, unknown>,
1567
+ opts?: XAddCommandOptions
1568
+ ], commandOptions?: CommandOptions<string, string>);
1569
+ }
1570
+
1571
+ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
1572
+ constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
1573
+ }
1574
+
1575
+ type XReadCommandOptions = [
1576
+ key: string | string[],
1577
+ id: string | string[],
1578
+ options?: {
1579
+ count?: number;
1580
+ blockMS?: number;
1581
+ }
1582
+ ];
1583
+ type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [key: string, id: string, options?: {
1584
+ count?: number;
1585
+ blockMS?: number;
1586
+ }] : never : K extends string[] ? I extends string[] ? [key: string[], id: string[], options?: {
1587
+ count?: number;
1588
+ blockMS?: number;
1589
+ }] : never : never : never;
1590
+ /**
1591
+ * @see https://redis.io/commands/xread
1592
+ */
1593
+ declare class XReadCommand extends Command<number, unknown[]> {
1594
+ constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
1595
+ }
1596
+
1597
+ type Options = {
1598
+ count?: number;
1599
+ blockMS?: number;
1600
+ NOACK?: boolean;
1601
+ };
1602
+ type XReadGroupCommandOptions = [
1603
+ group: string,
1604
+ consumer: string,
1605
+ key: string | string[],
1606
+ id: string | string[],
1607
+ options?: Options
1608
+ ];
1609
+ type XReadGroupOptions = XReadGroupCommandOptions extends [
1610
+ string,
1611
+ string,
1612
+ infer TKey,
1613
+ infer TId,
1614
+ ...any[]
1615
+ ] ? TKey extends string ? TId extends string ? [group: string, consumer: string, key: string, id: string, options?: Options] : never : TKey extends string[] ? TId extends string[] ? [group: string, consumer: string, key: string[], id: string[], options?: Options] : never : never : never;
1616
+ /**
1617
+ * @see https://redis.io/commands/xreadgroup
1618
+ */
1619
+ declare class XReadGroupCommand extends Command<number, unknown[]> {
1620
+ constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
1621
+ }
1622
+
1623
+ type NXAndXXOptions = {
1624
+ nx: true;
1625
+ xx?: never;
1626
+ } | {
1627
+ nx?: never;
1628
+ xx: true;
1629
+ } | {
1630
+ nx?: never;
1631
+ xx?: never;
1632
+ };
1633
+ type LTAndGTOptions = {
1634
+ lt: true;
1635
+ gt?: never;
1636
+ } | {
1637
+ lt?: never;
1638
+ gt: true;
1639
+ } | {
1640
+ lt?: never;
1641
+ gt?: never;
1642
+ };
1643
+ type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
1644
+ ch?: true;
1645
+ } & {
1646
+ incr?: true;
1647
+ };
1648
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
1649
+ type ScoreMember<TData> = {
1650
+ score: number;
1651
+ member: TData;
1652
+ };
1653
+ /**
1654
+ * @see https://redis.io/commands/zadd
1655
+ */
1656
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1657
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1658
+ }
1659
+
1660
+ /**
1661
+ * @see https://redis.io/commands/zcard
1662
+ */
1663
+ declare class ZCardCommand extends Command<number, number> {
1664
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1665
+ }
1666
+
1667
+ /**
1668
+ * @see https://redis.io/commands/zcount
1669
+ */
1670
+ declare class ZCountCommand extends Command<number, number> {
1671
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1672
+ }
1673
+
1674
+ /**
1675
+ * @see https://redis.io/commands/zincrby
1676
+ */
1677
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1678
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1679
+ }
1680
+
1681
+ /**
1682
+ * @see https://redis.io/commands/zlexcount
1683
+ */
1684
+ declare class ZLexCountCommand extends Command<number, number> {
1685
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1686
+ }
1687
+
1688
+ /**
1689
+ * @see https://redis.io/commands/zpopmax
1690
+ */
1691
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1692
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1693
+ }
1694
+
1695
+ /**
1696
+ * @see https://redis.io/commands/zpopmin
1697
+ */
1698
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1699
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1700
+ }
1701
+
1702
+ type ZRangeCommandOptions = {
1703
+ withScores?: boolean;
1704
+ rev?: boolean;
1705
+ } & ({
1706
+ byScore: true;
1707
+ byLex?: never;
1708
+ } | {
1709
+ byScore?: never;
1710
+ byLex: true;
1711
+ } | {
1712
+ byScore?: never;
1713
+ byLex?: never;
1714
+ }) & ({
1715
+ offset: number;
1716
+ count: number;
1717
+ } | {
1718
+ offset?: never;
1719
+ count?: never;
1720
+ });
1721
+ /**
1722
+ * @see https://redis.io/commands/zrange
1723
+ */
1724
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1725
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1726
+ constructor(cmd: [
1727
+ key: string,
1728
+ min: `(${string}` | `[${string}` | "-" | "+",
1729
+ max: `(${string}` | `[${string}` | "-" | "+",
1730
+ opts: {
1731
+ byLex: true;
1732
+ } & ZRangeCommandOptions
1733
+ ], cmdOpts?: CommandOptions<string[], TData>);
1734
+ constructor(cmd: [
1735
+ key: string,
1736
+ min: number | `(${number}` | "-inf" | "+inf",
1737
+ max: number | `(${number}` | "-inf" | "+inf",
1738
+ opts: {
1739
+ byScore: true;
1740
+ } & ZRangeCommandOptions
1741
+ ], cmdOpts?: CommandOptions<string[], TData>);
1742
+ }
1743
+
1744
+ /**
1745
+ * @see https://redis.io/commands/zrank
1746
+ */
1747
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1748
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1749
+ }
1750
+
1751
+ /**
1752
+ * @see https://redis.io/commands/zrem
1753
+ */
1754
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1755
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1756
+ }
1757
+
1758
+ /**
1759
+ * @see https://redis.io/commands/zremrangebylex
1760
+ */
1761
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1762
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1763
+ }
1764
+
1765
+ /**
1766
+ * @see https://redis.io/commands/zremrangebyrank
1767
+ */
1768
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1769
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1770
+ }
1771
+
1772
+ /**
1773
+ * @see https://redis.io/commands/zremrangebyscore
1774
+ */
1775
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1776
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1777
+ }
1778
+
1779
+ /**
1780
+ * @see https://redis.io/commands/zrevrank
1781
+ */
1782
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1783
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1784
+ }
1785
+
1786
+ /**
1787
+ * @see https://redis.io/commands/zscan
1788
+ */
1789
+ declare class ZScanCommand extends Command<[
1790
+ string,
1791
+ (string | number)[]
1792
+ ], [
1793
+ string,
1794
+ (string | number)[]
1795
+ ]> {
1796
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1797
+ }
1798
+
1799
+ /**
1800
+ * @see https://redis.io/commands/zscore
1801
+ */
1802
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1803
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1804
+ }
1805
+
1806
+ type BaseMessageData<TMessage> = {
1807
+ channel: string;
1808
+ message: TMessage;
1809
+ };
1810
+ type PatternMessageData<TMessage> = BaseMessageData<TMessage> & {
1811
+ pattern: string;
1812
+ };
1813
+ type SubscriptionCountEvent = number;
1814
+ type MessageEventMap<TMessage> = {
1815
+ message: BaseMessageData<TMessage>;
1816
+ subscribe: SubscriptionCountEvent;
1817
+ unsubscribe: SubscriptionCountEvent;
1818
+ pmessage: PatternMessageData<TMessage>;
1819
+ psubscribe: SubscriptionCountEvent;
1820
+ punsubscribe: SubscriptionCountEvent;
1821
+ error: Error;
1822
+ [key: `message:${string}`]: BaseMessageData<TMessage>;
1823
+ [key: `pmessage:${string}`]: PatternMessageData<TMessage>;
1824
+ };
1825
+ type EventType = keyof MessageEventMap<any>;
1826
+ type Listener<TMessage, T extends EventType> = (event: MessageEventMap<TMessage>[T]) => void;
1827
+ declare class Subscriber<TMessage = any> extends EventTarget {
1828
+ private subscriptions;
1829
+ private client;
1830
+ private listeners;
1831
+ constructor(client: Requester, channels: string[], isPattern?: boolean);
1832
+ private subscribeToChannel;
1833
+ private subscribeToPattern;
1834
+ private handleMessage;
1835
+ private dispatchToListeners;
1836
+ on<T extends keyof MessageEventMap<TMessage>>(type: T, listener: Listener<TMessage, T>): void;
1837
+ removeAllListeners(): void;
1838
+ unsubscribe(channels?: string[]): Promise<void>;
1839
+ getSubscribedChannels(): string[];
1840
+ }
1841
+
1842
+ type InferResponseData<T extends unknown[]> = {
1843
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1844
+ };
1845
+ interface ExecMethod<TCommands extends Command<any, any>[]> {
1846
+ /**
1847
+ * Send the pipeline request to upstash.
1848
+ *
1849
+ * Returns an array with the results of all pipelined commands.
1850
+ *
1851
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1852
+ * ```ts
1853
+ * const p = redis.pipeline()
1854
+ * p.get("key")
1855
+ * const result = p.exec<[{ greeting: string }]>()
1856
+ * ```
1857
+ *
1858
+ * If one of the commands get an error, the whole pipeline fails. Alternatively, you can set the keepErrors option to true in order to get the errors individually.
1859
+ *
1860
+ * If keepErrors is set to true, a list of objects is returned where each object corresponds to a command and is of type: `{ result: unknown, error?: string }`.
1861
+ *
1862
+ * ```ts
1863
+ * const p = redis.pipeline()
1864
+ * p.get("key")
1865
+ *
1866
+ * const result = await p.exec({ keepErrors: true });
1867
+ * const getResult = result[0].result
1868
+ * const getError = result[0].error
1869
+ * ```
1870
+ */
1871
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
1872
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
1873
+ keepErrors: true;
1874
+ }): Promise<{
1875
+ [K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
1876
+ }>;
1877
+ }
1878
+ /**
1879
+ * Upstash REST API supports command pipelining to send multiple commands in
1880
+ * batch, instead of sending each command one by one and waiting for a response.
1881
+ * When using pipelines, several commands are sent using a single HTTP request,
1882
+ * and a single JSON array response is returned. Each item in the response array
1883
+ * corresponds to the command in the same order within the pipeline.
1884
+ *
1885
+ * **NOTE:**
1886
+ *
1887
+ * Execution of the pipeline is not atomic. Even though each command in
1888
+ * the pipeline will be executed in order, commands sent by other clients can
1889
+ * interleave with the pipeline.
1890
+ *
1891
+ * **Examples:**
1892
+ *
1893
+ * ```ts
1894
+ * const p = redis.pipeline() // or redis.multi()
1895
+ * p.set("key","value")
1896
+ * p.get("key")
1897
+ * const res = await p.exec()
1898
+ * ```
1899
+ *
1900
+ * You can also chain commands together
1901
+ * ```ts
1902
+ * const p = redis.pipeline()
1903
+ * const res = await p.set("key","value").get("key").exec()
1904
+ * ```
1905
+ *
1906
+ * Return types are inferred if all commands are chained, but you can still
1907
+ * override the response type manually:
1908
+ * ```ts
1909
+ * redis.pipeline()
1910
+ * .set("key", { greeting: "hello"})
1911
+ * .get("key")
1912
+ * .exec<["OK", { greeting: string } ]>()
1913
+ *
1914
+ * ```
1915
+ */
1916
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1917
+ private client;
1918
+ private commands;
1919
+ private commandOptions?;
1920
+ private multiExec;
1921
+ constructor(opts: {
1922
+ client: Requester;
1923
+ commandOptions?: CommandOptions<any, any>;
1924
+ multiExec?: boolean;
1925
+ });
1926
+ exec: ExecMethod<TCommands>;
1927
+ /**
1928
+ * Returns the length of pipeline before the execution
1929
+ */
1930
+ length(): number;
1931
+ /**
1932
+ * Pushes a command into the pipeline and returns a chainable instance of the
1933
+ * pipeline
1934
+ */
1935
+ private chain;
1936
+ /**
1937
+ * @see https://redis.io/commands/append
1938
+ */
1939
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1940
+ /**
1941
+ * @see https://redis.io/commands/bitcount
1942
+ */
1943
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
1944
+ /**
1945
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
1946
+ *
1947
+ * @example
1948
+ * ```typescript
1949
+ * redis.set("mykey", 0);
1950
+ * const result = await redis.pipeline()
1951
+ * .bitfield("mykey")
1952
+ * .set("u4", 0, 16)
1953
+ * .incr("u4", "#1", 1)
1954
+ * .exec();
1955
+ * console.log(result); // [[0, 1]]
1956
+ * ```
1957
+ *
1958
+ * @see https://redis.io/commands/bitfield
1959
+ */
1960
+ bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
1961
+ /**
1962
+ * @see https://redis.io/commands/bitop
1963
+ */
1964
+ bitop: {
1965
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
1966
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
1967
+ };
1968
+ /**
1969
+ * @see https://redis.io/commands/bitpos
1970
+ */
1971
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1972
+ /**
1973
+ * @see https://redis.io/commands/copy
1974
+ */
1975
+ copy: (key: string, destinationKey: string, opts?: {
1976
+ replace: boolean;
1977
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
1978
+ /**
1979
+ * @see https://redis.io/commands/zdiffstore
1980
+ */
1981
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1982
+ /**
1983
+ * @see https://redis.io/commands/dbsize
1984
+ */
1985
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
1986
+ /**
1987
+ * @see https://redis.io/commands/decr
1988
+ */
1989
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1990
+ /**
1991
+ * @see https://redis.io/commands/decrby
1992
+ */
1993
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
1994
+ /**
1995
+ * @see https://redis.io/commands/del
1996
+ */
1997
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1998
+ /**
1999
+ * @see https://redis.io/commands/echo
2000
+ */
2001
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
2002
+ /**
2003
+ * @see https://redis.io/commands/eval_ro
2004
+ */
2005
+ evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
2006
+ /**
2007
+ * @see https://redis.io/commands/eval
2008
+ */
2009
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
2010
+ /**
2011
+ * @see https://redis.io/commands/evalsha_ro
2012
+ */
2013
+ evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
2014
+ /**
2015
+ * @see https://redis.io/commands/evalsha
2016
+ */
2017
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
2018
+ /**
2019
+ * @see https://redis.io/commands/exists
2020
+ */
2021
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2022
+ /**
2023
+ * @see https://redis.io/commands/expire
2024
+ */
2025
+ expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2026
+ /**
2027
+ * @see https://redis.io/commands/expireat
2028
+ */
2029
+ expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2030
+ /**
2031
+ * @see https://redis.io/commands/flushall
2032
+ */
2033
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2034
+ /**
2035
+ * @see https://redis.io/commands/flushdb
2036
+ */
2037
+ flushdb: (opts?: {
2038
+ async?: boolean;
2039
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
2040
+ /**
2041
+ * @see https://redis.io/commands/geoadd
2042
+ */
2043
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2044
+ /**
2045
+ * @see https://redis.io/commands/geodist
2046
+ */
2047
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
2048
+ /**
2049
+ * @see https://redis.io/commands/geopos
2050
+ */
2051
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
2052
+ lng: number;
2053
+ lat: number;
2054
+ }[]>]>;
2055
+ /**
2056
+ * @see https://redis.io/commands/geohash
2057
+ */
2058
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
2059
+ /**
2060
+ * @see https://redis.io/commands/geosearch
2061
+ */
2062
+ geosearch: <TData>(key: string, centerPoint: {
2063
+ type: "FROMLONLAT" | "fromlonlat";
2064
+ coordinate: {
2065
+ lon: number;
2066
+ lat: number;
2067
+ };
2068
+ } | {
2069
+ type: "FROMMEMBER" | "frommember";
2070
+ member: TData;
2071
+ }, shape: {
2072
+ type: "BYRADIUS" | "byradius";
2073
+ radius: number;
2074
+ radiusType: "M" | "KM" | "FT" | "MI";
2075
+ } | {
2076
+ type: "BYBOX" | "bybox";
2077
+ rect: {
2078
+ width: number;
2079
+ height: number;
2080
+ };
2081
+ rectType: "M" | "KM" | "FT" | "MI";
2082
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2083
+ count?: {
2084
+ limit: number;
2085
+ any?: boolean;
2086
+ };
2087
+ withCoord?: boolean;
2088
+ withDist?: boolean;
2089
+ withHash?: boolean;
2090
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
2091
+ member: TData;
2092
+ } & {
2093
+ coord?: {
2094
+ long: number;
2095
+ lat: number;
2096
+ } | undefined;
2097
+ dist?: number | undefined;
2098
+ hash?: string | undefined;
2099
+ })[]>]>;
2100
+ /**
2101
+ * @see https://redis.io/commands/geosearchstore
2102
+ */
2103
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
2104
+ type: "FROMLONLAT" | "fromlonlat";
2105
+ coordinate: {
2106
+ lon: number;
2107
+ lat: number;
2108
+ };
2109
+ } | {
2110
+ type: "FROMMEMBER" | "frommember";
2111
+ member: TData;
2112
+ }, shape: {
2113
+ type: "BYRADIUS" | "byradius";
2114
+ radius: number;
2115
+ radiusType: "M" | "KM" | "FT" | "MI";
2116
+ } | {
2117
+ type: "BYBOX" | "bybox";
2118
+ rect: {
2119
+ width: number;
2120
+ height: number;
2121
+ };
2122
+ rectType: "M" | "KM" | "FT" | "MI";
2123
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2124
+ count?: {
2125
+ limit: number;
2126
+ any?: boolean;
2127
+ };
2128
+ storeDist?: boolean;
2129
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2130
+ /**
2131
+ * @see https://redis.io/commands/get
2132
+ */
2133
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2134
+ /**
2135
+ * @see https://redis.io/commands/getbit
2136
+ */
2137
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2138
+ /**
2139
+ * @see https://redis.io/commands/getdel
2140
+ */
2141
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2142
+ /**
2143
+ * @see https://redis.io/commands/getex
2144
+ */
2145
+ getex: <TData>(key: string, opts?: ({
2146
+ ex: number;
2147
+ px?: never;
2148
+ exat?: never;
2149
+ pxat?: never;
2150
+ persist?: never;
2151
+ } | {
2152
+ ex?: never;
2153
+ px: number;
2154
+ exat?: never;
2155
+ pxat?: never;
2156
+ persist?: never;
2157
+ } | {
2158
+ ex?: never;
2159
+ px?: never;
2160
+ exat: number;
2161
+ pxat?: never;
2162
+ persist?: never;
2163
+ } | {
2164
+ ex?: never;
2165
+ px?: never;
2166
+ exat?: never;
2167
+ pxat: number;
2168
+ persist?: never;
2169
+ } | {
2170
+ ex?: never;
2171
+ px?: never;
2172
+ exat?: never;
2173
+ pxat?: never;
2174
+ persist: true;
2175
+ } | {
2176
+ ex?: never;
2177
+ px?: never;
2178
+ exat?: never;
2179
+ pxat?: never;
2180
+ persist?: never;
2181
+ }) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2182
+ /**
2183
+ * @see https://redis.io/commands/getrange
2184
+ */
2185
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
2186
+ /**
2187
+ * @see https://redis.io/commands/getset
2188
+ */
2189
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2190
+ /**
2191
+ * @see https://redis.io/commands/hdel
2192
+ */
2193
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2194
+ /**
2195
+ * @see https://redis.io/commands/hexists
2196
+ */
2197
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
2198
+ /**
2199
+ * @see https://redis.io/commands/hexpire
2200
+ */
2201
+ hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2202
+ /**
2203
+ * @see https://redis.io/commands/hexpireat
2204
+ */
2205
+ hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2206
+ /**
2207
+ * @see https://redis.io/commands/hexpiretime
2208
+ */
2209
+ hexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2210
+ /**
2211
+ * @see https://redis.io/commands/httl
2212
+ */
2213
+ httl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2214
+ /**
2215
+ * @see https://redis.io/commands/hpexpire
2216
+ */
2217
+ hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2218
+ /**
2219
+ * @see https://redis.io/commands/hpexpireat
2220
+ */
2221
+ hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2222
+ /**
2223
+ * @see https://redis.io/commands/hpexpiretime
2224
+ */
2225
+ hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2226
+ /**
2227
+ * @see https://redis.io/commands/hpttl
2228
+ */
2229
+ hpttl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2230
+ /**
2231
+ * @see https://redis.io/commands/hpersist
2232
+ */
2233
+ hpersist: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, (1 | -2 | -1)[]>]>;
2234
+ /**
2235
+ * @see https://redis.io/commands/hget
2236
+ */
2237
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2238
+ /**
2239
+ * @see https://redis.io/commands/hgetall
2240
+ */
2241
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2242
+ /**
2243
+ * @see https://redis.io/commands/hincrby
2244
+ */
2245
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
2246
+ /**
2247
+ * @see https://redis.io/commands/hincrbyfloat
2248
+ */
2249
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
2250
+ /**
2251
+ * @see https://redis.io/commands/hkeys
2252
+ */
2253
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
2254
+ /**
2255
+ * @see https://redis.io/commands/hlen
2256
+ */
2257
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2258
+ /**
2259
+ * @see https://redis.io/commands/hmget
2260
+ */
2261
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2262
+ /**
2263
+ * @see https://redis.io/commands/hmset
2264
+ */
2265
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2266
+ /**
2267
+ * @see https://redis.io/commands/hrandfield
2268
+ */
2269
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
2270
+ /**
2271
+ * @see https://redis.io/commands/hscan
2272
+ */
2273
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2274
+ /**
2275
+ * @see https://redis.io/commands/hset
2276
+ */
2277
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2278
+ /**
2279
+ * @see https://redis.io/commands/hsetnx
2280
+ */
2281
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2282
+ /**
2283
+ * @see https://redis.io/commands/hstrlen
2284
+ */
2285
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
2286
+ /**
2287
+ * @see https://redis.io/commands/hvals
2288
+ */
2289
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
2290
+ /**
2291
+ * @see https://redis.io/commands/incr
2292
+ */
2293
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2294
+ /**
2295
+ * @see https://redis.io/commands/incrby
2296
+ */
2297
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
2298
+ /**
2299
+ * @see https://redis.io/commands/incrbyfloat
2300
+ */
2301
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
2302
+ /**
2303
+ * @see https://redis.io/commands/keys
2304
+ */
2305
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
2306
+ /**
2307
+ * @see https://redis.io/commands/lindex
2308
+ */
2309
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
2310
+ /**
2311
+ * @see https://redis.io/commands/linsert
2312
+ */
2313
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2314
+ /**
2315
+ * @see https://redis.io/commands/llen
2316
+ */
2317
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2318
+ /**
2319
+ * @see https://redis.io/commands/lmove
2320
+ */
2321
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
2322
+ /**
2323
+ * @see https://redis.io/commands/lpop
2324
+ */
2325
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2326
+ /**
2327
+ * @see https://redis.io/commands/lmpop
2328
+ */
2329
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
2330
+ /**
2331
+ * @see https://redis.io/commands/lpos
2332
+ */
2333
+ lpos: <TData>(key: string, element: unknown, opts?: {
2334
+ rank?: number;
2335
+ count?: number;
2336
+ maxLen?: number;
2337
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
2338
+ /**
2339
+ * @see https://redis.io/commands/lpush
2340
+ */
2341
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2342
+ /**
2343
+ * @see https://redis.io/commands/lpushx
2344
+ */
2345
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2346
+ /**
2347
+ * @see https://redis.io/commands/lrange
2348
+ */
2349
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
2350
+ /**
2351
+ * @see https://redis.io/commands/lrem
2352
+ */
2353
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2354
+ /**
2355
+ * @see https://redis.io/commands/lset
2356
+ */
2357
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2358
+ /**
2359
+ * @see https://redis.io/commands/ltrim
2360
+ */
2361
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
2362
+ /**
2363
+ * @see https://redis.io/commands/mget
2364
+ */
2365
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
2366
+ /**
2367
+ * @see https://redis.io/commands/mset
2368
+ */
2369
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2370
+ /**
2371
+ * @see https://redis.io/commands/msetnx
2372
+ */
2373
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2374
+ /**
2375
+ * @see https://redis.io/commands/persist
2376
+ */
2377
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2378
+ /**
2379
+ * @see https://redis.io/commands/pexpire
2380
+ */
2381
+ pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2382
+ /**
2383
+ * @see https://redis.io/commands/pexpireat
2384
+ */
2385
+ pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2386
+ /**
2387
+ * @see https://redis.io/commands/pfadd
2388
+ */
2389
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
2390
+ /**
2391
+ * @see https://redis.io/commands/pfcount
2392
+ */
2393
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2394
+ /**
2395
+ * @see https://redis.io/commands/pfmerge
2396
+ */
2397
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
2398
+ /**
2399
+ * @see https://redis.io/commands/ping
2400
+ */
2401
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
2402
+ /**
2403
+ * @see https://redis.io/commands/psetex
2404
+ */
2405
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
2406
+ /**
2407
+ * @see https://redis.io/commands/pttl
2408
+ */
2409
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2410
+ /**
2411
+ * @see https://redis.io/commands/publish
2412
+ */
2413
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
2414
+ /**
2415
+ * @see https://redis.io/commands/randomkey
2416
+ */
2417
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
2418
+ /**
2419
+ * @see https://redis.io/commands/rename
2420
+ */
2421
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
2422
+ /**
2423
+ * @see https://redis.io/commands/renamenx
2424
+ */
2425
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2426
+ /**
2427
+ * @see https://redis.io/commands/rpop
2428
+ */
2429
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2430
+ /**
2431
+ * @see https://redis.io/commands/rpush
2432
+ */
2433
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2434
+ /**
2435
+ * @see https://redis.io/commands/rpushx
2436
+ */
2437
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2438
+ /**
2439
+ * @see https://redis.io/commands/sadd
2440
+ */
2441
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2442
+ /**
2443
+ * @see https://redis.io/commands/scan
2444
+ */
2445
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2446
+ /**
2447
+ * @see https://redis.io/commands/scard
2448
+ */
2449
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2450
+ /**
2451
+ * @see https://redis.io/commands/script-exists
2452
+ */
2453
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
2454
+ /**
2455
+ * @see https://redis.io/commands/script-flush
2456
+ */
2457
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
2458
+ /**
2459
+ * @see https://redis.io/commands/script-load
2460
+ */
2461
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
2462
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2463
+ /**
2464
+ * @see https://redis.io/commands/sdiffstore
2465
+ */
2466
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2467
+ /**
2468
+ * @see https://redis.io/commands/set
2469
+ */
2470
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
2471
+ /**
2472
+ * @see https://redis.io/commands/setbit
2473
+ */
2474
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2475
+ /**
2476
+ * @see https://redis.io/commands/setex
2477
+ */
2478
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2479
+ /**
2480
+ * @see https://redis.io/commands/setnx
2481
+ */
2482
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2483
+ /**
2484
+ * @see https://redis.io/commands/setrange
2485
+ */
2486
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
2487
+ /**
2488
+ * @see https://redis.io/commands/sinter
2489
+ */
2490
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
2491
+ /**
2492
+ * @see https://redis.io/commands/sinterstore
2493
+ */
2494
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2495
+ /**
2496
+ * @see https://redis.io/commands/sismember
2497
+ */
2498
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2499
+ /**
2500
+ * @see https://redis.io/commands/smembers
2501
+ */
2502
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
2503
+ /**
2504
+ * @see https://redis.io/commands/smismember
2505
+ */
2506
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
2507
+ /**
2508
+ * @see https://redis.io/commands/smove
2509
+ */
2510
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2511
+ /**
2512
+ * @see https://redis.io/commands/spop
2513
+ */
2514
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2515
+ /**
2516
+ * @see https://redis.io/commands/srandmember
2517
+ */
2518
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2519
+ /**
2520
+ * @see https://redis.io/commands/srem
2521
+ */
2522
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2523
+ /**
2524
+ * @see https://redis.io/commands/sscan
2525
+ */
2526
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2527
+ /**
2528
+ * @see https://redis.io/commands/strlen
2529
+ */
2530
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2531
+ /**
2532
+ * @see https://redis.io/commands/sunion
2533
+ */
2534
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2535
+ /**
2536
+ * @see https://redis.io/commands/sunionstore
2537
+ */
2538
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2539
+ /**
2540
+ * @see https://redis.io/commands/time
2541
+ */
2542
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
2543
+ /**
2544
+ * @see https://redis.io/commands/touch
2545
+ */
2546
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2547
+ /**
2548
+ * @see https://redis.io/commands/ttl
2549
+ */
2550
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2551
+ /**
2552
+ * @see https://redis.io/commands/type
2553
+ */
2554
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
2555
+ /**
2556
+ * @see https://redis.io/commands/unlink
2557
+ */
2558
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2559
+ /**
2560
+ * @see https://redis.io/commands/zadd
2561
+ */
2562
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2563
+ /**
2564
+ * @see https://redis.io/commands/xadd
2565
+ */
2566
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2567
+ nomkStream?: boolean;
2568
+ trim?: ({
2569
+ type: "MAXLEN" | "maxlen";
2570
+ threshold: number;
2571
+ } | {
2572
+ type: "MINID" | "minid";
2573
+ threshold: string;
2574
+ }) & ({
2575
+ comparison: "~";
2576
+ limit?: number;
2577
+ } | {
2578
+ comparison: "=";
2579
+ limit?: never;
2580
+ });
2581
+ } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2582
+ /**
2583
+ * @see https://redis.io/commands/xack
2584
+ */
2585
+ xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2586
+ /**
2587
+ * @see https://redis.io/commands/xdel
2588
+ */
2589
+ xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2590
+ /**
2591
+ * @see https://redis.io/commands/xgroup
2592
+ */
2593
+ xgroup: (key: string, opts: {
2594
+ type: "CREATE";
2595
+ group: string;
2596
+ id: `$` | string;
2597
+ options?: {
2598
+ MKSTREAM?: boolean;
2599
+ ENTRIESREAD?: number;
2600
+ };
2601
+ } | {
2602
+ type: "CREATECONSUMER";
2603
+ group: string;
2604
+ consumer: string;
2605
+ } | {
2606
+ type: "DELCONSUMER";
2607
+ group: string;
2608
+ consumer: string;
2609
+ } | {
2610
+ type: "DESTROY";
2611
+ group: string;
2612
+ } | {
2613
+ type: "SETID";
2614
+ group: string;
2615
+ id: `$` | string;
2616
+ options?: {
2617
+ ENTRIESREAD?: number;
2618
+ };
2619
+ }) => Pipeline<[...TCommands, Command<any, never>]>;
2620
+ /**
2621
+ * @see https://redis.io/commands/xread
2622
+ */
2623
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2624
+ /**
2625
+ * @see https://redis.io/commands/xreadgroup
2626
+ */
2627
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2628
+ /**
2629
+ * @see https://redis.io/commands/xinfo
2630
+ */
2631
+ xinfo: (key: string, options: {
2632
+ type: "CONSUMERS";
2633
+ group: string;
2634
+ } | {
2635
+ type: "GROUPS";
2636
+ }) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2637
+ /**
2638
+ * @see https://redis.io/commands/xlen
2639
+ */
2640
+ xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2641
+ /**
2642
+ * @see https://redis.io/commands/xpending
2643
+ */
2644
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2645
+ idleTime?: number;
2646
+ consumer?: string | string[];
2647
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2648
+ /**
2649
+ * @see https://redis.io/commands/xclaim
2650
+ */
2651
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2652
+ idleMS?: number;
2653
+ timeMS?: number;
2654
+ retryCount?: number;
2655
+ force?: boolean;
2656
+ justId?: boolean;
2657
+ lastId?: number;
2658
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2659
+ /**
2660
+ * @see https://redis.io/commands/xautoclaim
2661
+ */
2662
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2663
+ count?: number;
2664
+ justId?: boolean;
2665
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2666
+ /**
2667
+ * @see https://redis.io/commands/xtrim
2668
+ */
2669
+ xtrim: (key: string, options: {
2670
+ strategy: "MAXLEN" | "MINID";
2671
+ exactness?: "~" | "=";
2672
+ threshold: number | string;
2673
+ limit?: number;
2674
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
2675
+ /**
2676
+ * @see https://redis.io/commands/xrange
2677
+ */
2678
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2679
+ /**
2680
+ * @see https://redis.io/commands/xrevrange
2681
+ */
2682
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2683
+ /**
2684
+ * @see https://redis.io/commands/zcard
2685
+ */
2686
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2687
+ /**
2688
+ * @see https://redis.io/commands/zcount
2689
+ */
2690
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
2691
+ /**
2692
+ * @see https://redis.io/commands/zincrby
2693
+ */
2694
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2695
+ /**
2696
+ * @see https://redis.io/commands/zinterstore
2697
+ */
2698
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2699
+ /**
2700
+ * @see https://redis.io/commands/zlexcount
2701
+ */
2702
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2703
+ /**
2704
+ * @see https://redis.io/commands/zmscore
2705
+ */
2706
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
2707
+ /**
2708
+ * @see https://redis.io/commands/zpopmax
2709
+ */
2710
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2711
+ /**
2712
+ * @see https://redis.io/commands/zpopmin
2713
+ */
2714
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2715
+ /**
2716
+ * @see https://redis.io/commands/zrange
2717
+ */
2718
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2719
+ byLex: true;
2720
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2721
+ byScore: true;
2722
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2723
+ /**
2724
+ * @see https://redis.io/commands/zrank
2725
+ */
2726
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2727
+ /**
2728
+ * @see https://redis.io/commands/zrem
2729
+ */
2730
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2731
+ /**
2732
+ * @see https://redis.io/commands/zremrangebylex
2733
+ */
2734
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2735
+ /**
2736
+ * @see https://redis.io/commands/zremrangebyrank
2737
+ */
2738
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
2739
+ /**
2740
+ * @see https://redis.io/commands/zremrangebyscore
2741
+ */
2742
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2743
+ /**
2744
+ * @see https://redis.io/commands/zrevrank
2745
+ */
2746
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2747
+ /**
2748
+ * @see https://redis.io/commands/zscan
2749
+ */
2750
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2751
+ /**
2752
+ * @see https://redis.io/commands/zscore
2753
+ */
2754
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2755
+ /**
2756
+ * @see https://redis.io/commands/zunionstore
2757
+ */
2758
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2759
+ /**
2760
+ * @see https://redis.io/commands/zunion
2761
+ */
2762
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2763
+ /**
2764
+ * @see https://redis.io/commands/?group=json
2765
+ */
2766
+ get json(): {
2767
+ /**
2768
+ * @see https://redis.io/commands/json.arrappend
2769
+ */
2770
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2771
+ /**
2772
+ * @see https://redis.io/commands/json.arrindex
2773
+ */
2774
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2775
+ /**
2776
+ * @see https://redis.io/commands/json.arrinsert
2777
+ */
2778
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2779
+ /**
2780
+ * @see https://redis.io/commands/json.arrlen
2781
+ */
2782
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2783
+ /**
2784
+ * @see https://redis.io/commands/json.arrpop
2785
+ */
2786
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2787
+ /**
2788
+ * @see https://redis.io/commands/json.arrtrim
2789
+ */
2790
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2791
+ /**
2792
+ * @see https://redis.io/commands/json.clear
2793
+ */
2794
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2795
+ /**
2796
+ * @see https://redis.io/commands/json.del
2797
+ */
2798
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2799
+ /**
2800
+ * @see https://redis.io/commands/json.forget
2801
+ */
2802
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2803
+ /**
2804
+ * @see https://redis.io/commands/json.get
2805
+ */
2806
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2807
+ /**
2808
+ * @see https://redis.io/commands/json.merge
2809
+ */
2810
+ merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2811
+ /**
2812
+ * @see https://redis.io/commands/json.mget
2813
+ */
2814
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2815
+ /**
2816
+ * @see https://redis.io/commands/json.mset
2817
+ */
2818
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2819
+ /**
2820
+ * @see https://redis.io/commands/json.numincrby
2821
+ */
2822
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2823
+ /**
2824
+ * @see https://redis.io/commands/json.nummultby
2825
+ */
2826
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2827
+ /**
2828
+ * @see https://redis.io/commands/json.objkeys
2829
+ */
2830
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
2831
+ /**
2832
+ * @see https://redis.io/commands/json.objlen
2833
+ */
2834
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2835
+ /**
2836
+ * @see https://redis.io/commands/json.resp
2837
+ */
2838
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2839
+ /**
2840
+ * @see https://redis.io/commands/json.set
2841
+ */
2842
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2843
+ nx: true;
2844
+ xx?: never;
2845
+ } | {
2846
+ nx?: never;
2847
+ xx: true;
2848
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2849
+ /**
2850
+ * @see https://redis.io/commands/json.strappend
2851
+ */
2852
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2853
+ /**
2854
+ * @see https://redis.io/commands/json.strlen
2855
+ */
2856
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2857
+ /**
2858
+ * @see https://redis.io/commands/json.toggle
2859
+ */
2860
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
2861
+ /**
2862
+ * @see https://redis.io/commands/json.type
2863
+ */
2864
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2865
+ };
2866
+ }
2867
+
2868
+ /**
2869
+ * Creates a new script.
2870
+ *
2871
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2872
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2873
+ * the entire script. Afterwards, the script is cached on the server.
2874
+ *
2875
+ * @example
2876
+ * ```ts
2877
+ * const redis = new Redis({...})
2878
+ *
2879
+ * const script = redis.createScript<string>("return ARGV[1];")
2880
+ * const arg1 = await script.eval([], ["Hello World"])
2881
+ * expect(arg1, "Hello World")
2882
+ * ```
2883
+ */
2884
+ declare class Script<TResult = unknown> {
2885
+ readonly script: string;
2886
+ /**
2887
+ * @deprecated This property is initialized to an empty string and will be set in the init method
2888
+ * asynchronously. Do not use this property immidiately after the constructor.
2889
+ *
2890
+ * This property is only exposed for backwards compatibility and will be removed in the
2891
+ * future major release.
2892
+ */
2893
+ sha1: string;
2894
+ private readonly redis;
2895
+ constructor(redis: Redis, script: string);
2896
+ /**
2897
+ * Initialize the script by computing its SHA-1 hash.
2898
+ */
2899
+ private init;
2900
+ /**
2901
+ * Send an `EVAL` command to redis.
2902
+ */
2903
+ eval(keys: string[], args: string[]): Promise<TResult>;
2904
+ /**
2905
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
2906
+ */
2907
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
2908
+ /**
2909
+ * Optimistically try to run `EVALSHA` first.
2910
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
2911
+ *
2912
+ * Following calls will be able to use the cached script
2913
+ */
2914
+ exec(keys: string[], args: string[]): Promise<TResult>;
2915
+ /**
2916
+ * Compute the sha1 hash of the script and return its hex representation.
2917
+ */
2918
+ private digest;
2919
+ }
2920
+
2921
+ /**
2922
+ * Creates a new script.
2923
+ *
2924
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2925
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2926
+ * the entire script. Afterwards, the script is cached on the server.
2927
+ *
2928
+ * @example
2929
+ * ```ts
2930
+ * const redis = new Redis({...})
2931
+ *
2932
+ * const script = redis.createScript<string>("return ARGV[1];", { readOnly: true })
2933
+ * const arg1 = await script.evalRo([], ["Hello World"])
2934
+ * expect(arg1, "Hello World")
2935
+ * ```
2936
+ */
2937
+ declare class ScriptRO<TResult = unknown> {
2938
+ readonly script: string;
2939
+ /**
2940
+ * @deprecated This property is initialized to an empty string and will be set in the init method
2941
+ * asynchronously. Do not use this property immidiately after the constructor.
2942
+ *
2943
+ * This property is only exposed for backwards compatibility and will be removed in the
2944
+ * future major release.
2945
+ */
2946
+ sha1: string;
2947
+ private readonly redis;
2948
+ constructor(redis: Redis, script: string);
2949
+ private init;
2950
+ /**
2951
+ * Send an `EVAL_RO` command to redis.
2952
+ */
2953
+ evalRo(keys: string[], args: string[]): Promise<TResult>;
2954
+ /**
2955
+ * Calculates the sha1 hash of the script and then calls `EVALSHA_RO`.
2956
+ */
2957
+ evalshaRo(keys: string[], args: string[]): Promise<TResult>;
2958
+ /**
2959
+ * Optimistically try to run `EVALSHA_RO` first.
2960
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL_RO`.
2961
+ *
2962
+ * Following calls will be able to use the cached script
2963
+ */
2964
+ exec(keys: string[], args: string[]): Promise<TResult>;
2965
+ /**
2966
+ * Compute the sha1 hash of the script and return its hex representation.
2967
+ */
2968
+ private digest;
2969
+ }
2970
+
2971
+ /**
2972
+ * Serverless redis client for upstash.
2973
+ */
2974
+ declare class Redis {
2975
+ protected client: Requester;
2976
+ protected opts?: CommandOptions<any, any>;
2977
+ protected enableTelemetry: boolean;
2978
+ protected enableAutoPipelining: boolean;
2979
+ /**
2980
+ * Create a new redis client
2981
+ *
2982
+ * @example
2983
+ * ```typescript
2984
+ * const redis = new Redis({
2985
+ * url: "<UPSTASH_REDIS_REST_URL>",
2986
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
2987
+ * });
2988
+ * ```
2989
+ */
2990
+ constructor(client: Requester, opts?: RedisOptions);
2991
+ get readYourWritesSyncToken(): string | undefined;
2992
+ set readYourWritesSyncToken(session: string | undefined);
2993
+ get json(): {
2994
+ /**
2995
+ * @see https://redis.io/commands/json.arrappend
2996
+ */
2997
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
2998
+ /**
2999
+ * @see https://redis.io/commands/json.arrindex
3000
+ */
3001
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
3002
+ /**
3003
+ * @see https://redis.io/commands/json.arrinsert
3004
+ */
3005
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
3006
+ /**
3007
+ * @see https://redis.io/commands/json.arrlen
3008
+ */
3009
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
3010
+ /**
3011
+ * @see https://redis.io/commands/json.arrpop
3012
+ */
3013
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
3014
+ /**
3015
+ * @see https://redis.io/commands/json.arrtrim
3016
+ */
3017
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
3018
+ /**
3019
+ * @see https://redis.io/commands/json.clear
3020
+ */
3021
+ clear: (key: string, path?: string | undefined) => Promise<number>;
3022
+ /**
3023
+ * @see https://redis.io/commands/json.del
3024
+ */
3025
+ del: (key: string, path?: string | undefined) => Promise<number>;
3026
+ /**
3027
+ * @see https://redis.io/commands/json.forget
3028
+ */
3029
+ forget: (key: string, path?: string | undefined) => Promise<number>;
3030
+ /**
3031
+ * @see https://redis.io/commands/json.get
3032
+ */
3033
+ get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
3034
+ /**
3035
+ * @see https://redis.io/commands/json.merge
3036
+ */
3037
+ merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Promise<"OK" | null>;
3038
+ /**
3039
+ * @see https://redis.io/commands/json.mget
3040
+ */
3041
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
3042
+ /**
3043
+ * @see https://redis.io/commands/json.mset
3044
+ */
3045
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
3046
+ /**
3047
+ * @see https://redis.io/commands/json.numincrby
3048
+ */
3049
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
3050
+ /**
3051
+ * @see https://redis.io/commands/json.nummultby
3052
+ */
3053
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
3054
+ /**
3055
+ * @see https://redis.io/commands/json.objkeys
3056
+ */
3057
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
3058
+ /**
3059
+ * @see https://redis.io/commands/json.objlen
3060
+ */
3061
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
3062
+ /**
3063
+ * @see https://redis.io/commands/json.resp
3064
+ */
3065
+ resp: (key: string, path?: string | undefined) => Promise<any>;
3066
+ /**
3067
+ * @see https://redis.io/commands/json.set
3068
+ */
3069
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
3070
+ nx: true;
3071
+ xx?: never;
3072
+ } | {
3073
+ nx?: never;
3074
+ xx: true;
3075
+ } | undefined) => Promise<"OK" | null>;
3076
+ /**
3077
+ * @see https://redis.io/commands/json.strappend
3078
+ */
3079
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
3080
+ /**
3081
+ * @see https://redis.io/commands/json.strlen
3082
+ */
3083
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
3084
+ /**
3085
+ * @see https://redis.io/commands/json.toggle
3086
+ */
3087
+ toggle: (key: string, path: string) => Promise<number[]>;
3088
+ /**
3089
+ * @see https://redis.io/commands/json.type
3090
+ */
3091
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
3092
+ };
3093
+ /**
3094
+ * Wrap a new middleware around the HTTP client.
3095
+ */
3096
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
3097
+ /**
3098
+ * Technically this is not private, we can hide it from intellisense by doing this
3099
+ */
3100
+ protected addTelemetry: (telemetry: Telemetry) => void;
3101
+ /**
3102
+ * Creates a new script.
3103
+ *
3104
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
3105
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
3106
+ * the entire script. Afterwards, the script is cached on the server.
3107
+ *
3108
+ * @param script - The script to create
3109
+ * @param opts - Optional options to pass to the script `{ readonly?: boolean }`
3110
+ * @returns A new script
3111
+ *
3112
+ * @example
3113
+ * ```ts
3114
+ * const redis = new Redis({...})
3115
+ *
3116
+ * const script = redis.createScript<string>("return ARGV[1];")
3117
+ * const arg1 = await script.eval([], ["Hello World"])
3118
+ * expect(arg1, "Hello World")
3119
+ * ```
3120
+ * @example
3121
+ * ```ts
3122
+ * const redis = new Redis({...})
3123
+ *
3124
+ * const script = redis.createScript<string>("return ARGV[1];", { readonly: true })
3125
+ * const arg1 = await script.evalRo([], ["Hello World"])
3126
+ * expect(arg1, "Hello World")
3127
+ * ```
3128
+ */
3129
+ createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
3130
+ readonly?: TReadonly;
3131
+ }): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
3132
+ /**
3133
+ * Create a new pipeline that allows you to send requests in bulk.
3134
+ *
3135
+ * @see {@link Pipeline}
3136
+ */
3137
+ pipeline: () => Pipeline<[]>;
3138
+ protected autoPipeline: () => Redis;
3139
+ /**
3140
+ * Create a new transaction to allow executing multiple steps atomically.
3141
+ *
3142
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
3143
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
3144
+ * guarantees that the commands are executed as a single isolated operation.
3145
+ *
3146
+ * @see {@link Pipeline}
3147
+ */
3148
+ multi: () => Pipeline<[]>;
3149
+ /**
3150
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
3151
+ *
3152
+ * @example
3153
+ * ```typescript
3154
+ * redis.set("mykey", 0);
3155
+ * const result = await redis.bitfield("mykey")
3156
+ * .set("u4", 0, 16)
3157
+ * .incr("u4", "#1", 1)
3158
+ * .exec();
3159
+ * console.log(result); // [0, 1]
3160
+ * ```
3161
+ *
3162
+ * @see https://redis.io/commands/bitfield
3163
+ */
3164
+ bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
3165
+ /**
3166
+ * @see https://redis.io/commands/append
3167
+ */
3168
+ append: (key: string, value: string) => Promise<number>;
3169
+ /**
3170
+ * @see https://redis.io/commands/bitcount
3171
+ */
3172
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
3173
+ /**
3174
+ * @see https://redis.io/commands/bitop
3175
+ */
3176
+ bitop: {
3177
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
3178
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
3179
+ };
3180
+ /**
3181
+ * @see https://redis.io/commands/bitpos
3182
+ */
3183
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
3184
+ /**
3185
+ * @see https://redis.io/commands/copy
3186
+ */
3187
+ copy: (key: string, destinationKey: string, opts?: {
3188
+ replace: boolean;
3189
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
3190
+ /**
3191
+ * @see https://redis.io/commands/dbsize
3192
+ */
3193
+ dbsize: () => Promise<number>;
3194
+ /**
3195
+ * @see https://redis.io/commands/decr
3196
+ */
3197
+ decr: (key: string) => Promise<number>;
3198
+ /**
3199
+ * @see https://redis.io/commands/decrby
3200
+ */
3201
+ decrby: (key: string, decrement: number) => Promise<number>;
3202
+ /**
3203
+ * @see https://redis.io/commands/del
3204
+ */
3205
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
3206
+ /**
3207
+ * @see https://redis.io/commands/echo
3208
+ */
3209
+ echo: (message: string) => Promise<string>;
3210
+ /**
3211
+ * @see https://redis.io/commands/eval_ro
3212
+ */
3213
+ evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
3214
+ /**
3215
+ * @see https://redis.io/commands/eval
3216
+ */
3217
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
3218
+ /**
3219
+ * @see https://redis.io/commands/evalsha_ro
3220
+ */
3221
+ evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
3222
+ /**
3223
+ * @see https://redis.io/commands/evalsha
3224
+ */
3225
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
3226
+ /**
3227
+ * Generic method to execute any Redis command.
3228
+ */
3229
+ exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
3230
+ /**
3231
+ * @see https://redis.io/commands/exists
3232
+ */
3233
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
3234
+ /**
3235
+ * @see https://redis.io/commands/expire
3236
+ */
3237
+ expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3238
+ /**
3239
+ * @see https://redis.io/commands/expireat
3240
+ */
3241
+ expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3242
+ /**
3243
+ * @see https://redis.io/commands/flushall
3244
+ */
3245
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
3246
+ /**
3247
+ * @see https://redis.io/commands/flushdb
3248
+ */
3249
+ flushdb: (opts?: {
3250
+ async?: boolean;
3251
+ } | undefined) => Promise<"OK">;
3252
+ /**
3253
+ * @see https://redis.io/commands/geoadd
3254
+ */
3255
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
3256
+ /**
3257
+ * @see https://redis.io/commands/geopos
3258
+ */
3259
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
3260
+ lng: number;
3261
+ lat: number;
3262
+ }[]>;
3263
+ /**
3264
+ * @see https://redis.io/commands/geodist
3265
+ */
3266
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
3267
+ /**
3268
+ * @see https://redis.io/commands/geohash
3269
+ */
3270
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
3271
+ /**
3272
+ * @see https://redis.io/commands/geosearch
3273
+ */
3274
+ geosearch: <TData>(key: string, centerPoint: {
3275
+ type: "FROMLONLAT" | "fromlonlat";
3276
+ coordinate: {
3277
+ lon: number;
3278
+ lat: number;
3279
+ };
3280
+ } | {
3281
+ type: "FROMMEMBER" | "frommember";
3282
+ member: TData;
3283
+ }, shape: {
3284
+ type: "BYRADIUS" | "byradius";
3285
+ radius: number;
3286
+ radiusType: "M" | "KM" | "FT" | "MI";
3287
+ } | {
3288
+ type: "BYBOX" | "bybox";
3289
+ rect: {
3290
+ width: number;
3291
+ height: number;
3292
+ };
3293
+ rectType: "M" | "KM" | "FT" | "MI";
3294
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
3295
+ count?: {
3296
+ limit: number;
3297
+ any?: boolean;
3298
+ };
3299
+ withCoord?: boolean;
3300
+ withDist?: boolean;
3301
+ withHash?: boolean;
3302
+ } | undefined) => Promise<({
3303
+ member: TData;
3304
+ } & {
3305
+ coord?: {
3306
+ long: number;
3307
+ lat: number;
3308
+ } | undefined;
3309
+ dist?: number | undefined;
3310
+ hash?: string | undefined;
3311
+ })[]>;
3312
+ /**
3313
+ * @see https://redis.io/commands/geosearchstore
3314
+ */
3315
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
3316
+ type: "FROMLONLAT" | "fromlonlat";
3317
+ coordinate: {
3318
+ lon: number;
3319
+ lat: number;
3320
+ };
3321
+ } | {
3322
+ type: "FROMMEMBER" | "frommember";
3323
+ member: TData;
3324
+ }, shape: {
3325
+ type: "BYRADIUS" | "byradius";
3326
+ radius: number;
3327
+ radiusType: "M" | "KM" | "FT" | "MI";
3328
+ } | {
3329
+ type: "BYBOX" | "bybox";
3330
+ rect: {
3331
+ width: number;
3332
+ height: number;
3333
+ };
3334
+ rectType: "M" | "KM" | "FT" | "MI";
3335
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
3336
+ count?: {
3337
+ limit: number;
3338
+ any?: boolean;
3339
+ };
3340
+ storeDist?: boolean;
3341
+ } | undefined) => Promise<number>;
3342
+ /**
3343
+ * @see https://redis.io/commands/get
3344
+ */
3345
+ get: <TData>(key: string) => Promise<TData | null>;
3346
+ /**
3347
+ * @see https://redis.io/commands/getbit
3348
+ */
3349
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
3350
+ /**
3351
+ * @see https://redis.io/commands/getdel
3352
+ */
3353
+ getdel: <TData>(key: string) => Promise<TData | null>;
3354
+ /**
3355
+ * @see https://redis.io/commands/getex
3356
+ */
3357
+ getex: <TData>(key: string, opts?: ({
3358
+ ex: number;
3359
+ px?: never;
3360
+ exat?: never;
3361
+ pxat?: never;
3362
+ persist?: never;
3363
+ } | {
3364
+ ex?: never;
3365
+ px: number;
3366
+ exat?: never;
3367
+ pxat?: never;
3368
+ persist?: never;
3369
+ } | {
3370
+ ex?: never;
3371
+ px?: never;
3372
+ exat: number;
3373
+ pxat?: never;
3374
+ persist?: never;
3375
+ } | {
3376
+ ex?: never;
3377
+ px?: never;
3378
+ exat?: never;
3379
+ pxat: number;
3380
+ persist?: never;
3381
+ } | {
3382
+ ex?: never;
3383
+ px?: never;
3384
+ exat?: never;
3385
+ pxat?: never;
3386
+ persist: true;
3387
+ } | {
3388
+ ex?: never;
3389
+ px?: never;
3390
+ exat?: never;
3391
+ pxat?: never;
3392
+ persist?: never;
3393
+ }) | undefined) => Promise<TData | null>;
3394
+ /**
3395
+ * @see https://redis.io/commands/getrange
3396
+ */
3397
+ getrange: (key: string, start: number, end: number) => Promise<string>;
3398
+ /**
3399
+ * @see https://redis.io/commands/getset
3400
+ */
3401
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
3402
+ /**
3403
+ * @see https://redis.io/commands/hdel
3404
+ */
3405
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
3406
+ /**
3407
+ * @see https://redis.io/commands/hexists
3408
+ */
3409
+ hexists: (key: string, field: string) => Promise<number>;
3410
+ /**
3411
+ * @see https://redis.io/commands/hexpire
3412
+ */
3413
+ hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3414
+ /**
3415
+ * @see https://redis.io/commands/hexpireat
3416
+ */
3417
+ hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3418
+ /**
3419
+ * @see https://redis.io/commands/hexpiretime
3420
+ */
3421
+ hexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3422
+ /**
3423
+ * @see https://redis.io/commands/httl
3424
+ */
3425
+ httl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3426
+ /**
3427
+ * @see https://redis.io/commands/hpexpire
3428
+ */
3429
+ hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3430
+ /**
3431
+ * @see https://redis.io/commands/hpexpireat
3432
+ */
3433
+ hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3434
+ /**
3435
+ * @see https://redis.io/commands/hpexpiretime
3436
+ */
3437
+ hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3438
+ /**
3439
+ * @see https://redis.io/commands/hpttl
3440
+ */
3441
+ hpttl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3442
+ /**
3443
+ * @see https://redis.io/commands/hpersist
3444
+ */
3445
+ hpersist: (key: string, fields: string | number | (string | number)[]) => Promise<(1 | -2 | -1)[]>;
3446
+ /**
3447
+ * @see https://redis.io/commands/hget
3448
+ */
3449
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
3450
+ /**
3451
+ * @see https://redis.io/commands/hgetall
3452
+ */
3453
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
3454
+ /**
3455
+ * @see https://redis.io/commands/hincrby
3456
+ */
3457
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
3458
+ /**
3459
+ * @see https://redis.io/commands/hincrbyfloat
3460
+ */
3461
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
3462
+ /**
3463
+ * @see https://redis.io/commands/hkeys
3464
+ */
3465
+ hkeys: (key: string) => Promise<string[]>;
3466
+ /**
3467
+ * @see https://redis.io/commands/hlen
3468
+ */
3469
+ hlen: (key: string) => Promise<number>;
3470
+ /**
3471
+ * @see https://redis.io/commands/hmget
3472
+ */
3473
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
3474
+ /**
3475
+ * @see https://redis.io/commands/hmset
3476
+ */
3477
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
3478
+ /**
3479
+ * @see https://redis.io/commands/hrandfield
3480
+ */
3481
+ hrandfield: {
3482
+ (key: string): Promise<string | null>;
3483
+ (key: string, count: number): Promise<string[]>;
3484
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
3485
+ };
3486
+ /**
3487
+ * @see https://redis.io/commands/hscan
3488
+ */
3489
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3490
+ /**
3491
+ * @see https://redis.io/commands/hset
3492
+ */
3493
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
3494
+ /**
3495
+ * @see https://redis.io/commands/hsetnx
3496
+ */
3497
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
3498
+ /**
3499
+ * @see https://redis.io/commands/hstrlen
3500
+ */
3501
+ hstrlen: (key: string, field: string) => Promise<number>;
3502
+ /**
3503
+ * @see https://redis.io/commands/hvals
3504
+ */
3505
+ hvals: (key: string) => Promise<any>;
3506
+ /**
3507
+ * @see https://redis.io/commands/incr
3508
+ */
3509
+ incr: (key: string) => Promise<number>;
3510
+ /**
3511
+ * @see https://redis.io/commands/incrby
3512
+ */
3513
+ incrby: (key: string, value: number) => Promise<number>;
3514
+ /**
3515
+ * @see https://redis.io/commands/incrbyfloat
3516
+ */
3517
+ incrbyfloat: (key: string, value: number) => Promise<number>;
3518
+ /**
3519
+ * @see https://redis.io/commands/keys
3520
+ */
3521
+ keys: (pattern: string) => Promise<string[]>;
3522
+ /**
3523
+ * @see https://redis.io/commands/lindex
3524
+ */
3525
+ lindex: (key: string, index: number) => Promise<any>;
3526
+ /**
3527
+ * @see https://redis.io/commands/linsert
3528
+ */
3529
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
3530
+ /**
3531
+ * @see https://redis.io/commands/llen
3532
+ */
3533
+ llen: (key: string) => Promise<number>;
3534
+ /**
3535
+ * @see https://redis.io/commands/lmove
3536
+ */
3537
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
3538
+ /**
3539
+ * @see https://redis.io/commands/lpop
3540
+ */
3541
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3542
+ /**
3543
+ * @see https://redis.io/commands/lmpop
3544
+ */
3545
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
3546
+ /**
3547
+ * @see https://redis.io/commands/lpos
3548
+ */
3549
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
3550
+ rank?: number;
3551
+ count?: number;
3552
+ maxLen?: number;
3553
+ } | undefined) => Promise<TData>;
3554
+ /**
3555
+ * @see https://redis.io/commands/lpush
3556
+ */
3557
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3558
+ /**
3559
+ * @see https://redis.io/commands/lpushx
3560
+ */
3561
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3562
+ /**
3563
+ * @see https://redis.io/commands/lrange
3564
+ */
3565
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
3566
+ /**
3567
+ * @see https://redis.io/commands/lrem
3568
+ */
3569
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
3570
+ /**
3571
+ * @see https://redis.io/commands/lset
3572
+ */
3573
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
3574
+ /**
3575
+ * @see https://redis.io/commands/ltrim
3576
+ */
3577
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
3578
+ /**
3579
+ * @see https://redis.io/commands/mget
3580
+ */
3581
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
3582
+ /**
3583
+ * @see https://redis.io/commands/mset
3584
+ */
3585
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3586
+ /**
3587
+ * @see https://redis.io/commands/msetnx
3588
+ */
3589
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3590
+ /**
3591
+ * @see https://redis.io/commands/persist
3592
+ */
3593
+ persist: (key: string) => Promise<0 | 1>;
3594
+ /**
3595
+ * @see https://redis.io/commands/pexpire
3596
+ */
3597
+ pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3598
+ /**
3599
+ * @see https://redis.io/commands/pexpireat
3600
+ */
3601
+ pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3602
+ /**
3603
+ * @see https://redis.io/commands/pfadd
3604
+ */
3605
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
3606
+ /**
3607
+ * @see https://redis.io/commands/pfcount
3608
+ */
3609
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
3610
+ /**
3611
+ * @see https://redis.io/commands/pfmerge
3612
+ */
3613
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
3614
+ /**
3615
+ * @see https://redis.io/commands/ping
3616
+ */
3617
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
3618
+ /**
3619
+ * @see https://redis.io/commands/psetex
3620
+ */
3621
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
3622
+ /**
3623
+ * @see https://redis.io/commands/psubscribe
3624
+ */
3625
+ psubscribe: <TMessage>(patterns: string | string[]) => Subscriber<TMessage>;
3626
+ /**
3627
+ * @see https://redis.io/commands/pttl
3628
+ */
3629
+ pttl: (key: string) => Promise<number>;
3630
+ /**
3631
+ * @see https://redis.io/commands/publish
3632
+ */
3633
+ publish: (channel: string, message: unknown) => Promise<number>;
3634
+ /**
3635
+ * @see https://redis.io/commands/randomkey
3636
+ */
3637
+ randomkey: () => Promise<string | null>;
3638
+ /**
3639
+ * @see https://redis.io/commands/rename
3640
+ */
3641
+ rename: (source: string, destination: string) => Promise<"OK">;
3642
+ /**
3643
+ * @see https://redis.io/commands/renamenx
3644
+ */
3645
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
3646
+ /**
3647
+ * @see https://redis.io/commands/rpop
3648
+ */
3649
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
3650
+ /**
3651
+ * @see https://redis.io/commands/rpush
3652
+ */
3653
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3654
+ /**
3655
+ * @see https://redis.io/commands/rpushx
3656
+ */
3657
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3658
+ /**
3659
+ * @see https://redis.io/commands/sadd
3660
+ */
3661
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
3662
+ /**
3663
+ * @see https://redis.io/commands/scan
3664
+ */
3665
+ scan(cursor: string | number): Promise<ScanResultStandard>;
3666
+ scan<TOptions extends ScanCommandOptions>(cursor: string | number, opts: TOptions): Promise<TOptions extends {
3667
+ withType: true;
3668
+ } ? ScanResultWithType : ScanResultStandard>;
3669
+ /**
3670
+ * @see https://redis.io/commands/scard
3671
+ */
3672
+ scard: (key: string) => Promise<number>;
3673
+ /**
3674
+ * @see https://redis.io/commands/script-exists
3675
+ */
3676
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
3677
+ /**
3678
+ * @see https://redis.io/commands/script-flush
3679
+ */
3680
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
3681
+ /**
3682
+ * @see https://redis.io/commands/script-load
3683
+ */
3684
+ scriptLoad: (script: string) => Promise<string>;
3685
+ /**
3686
+ * @see https://redis.io/commands/sdiff
3687
+ */
3688
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
3689
+ /**
3690
+ * @see https://redis.io/commands/sdiffstore
3691
+ */
3692
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
3693
+ /**
3694
+ * @see https://redis.io/commands/set
3695
+ */
3696
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
3697
+ /**
3698
+ * @see https://redis.io/commands/setbit
3699
+ */
3700
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
3701
+ /**
3702
+ * @see https://redis.io/commands/setex
3703
+ */
3704
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
3705
+ /**
3706
+ * @see https://redis.io/commands/setnx
3707
+ */
3708
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
3709
+ /**
3710
+ * @see https://redis.io/commands/setrange
3711
+ */
3712
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
3713
+ /**
3714
+ * @see https://redis.io/commands/sinter
3715
+ */
3716
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
3717
+ /**
3718
+ * @see https://redis.io/commands/sinterstore
3719
+ */
3720
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3721
+ /**
3722
+ * @see https://redis.io/commands/sismember
3723
+ */
3724
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
3725
+ /**
3726
+ * @see https://redis.io/commands/smismember
3727
+ */
3728
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
3729
+ /**
3730
+ * @see https://redis.io/commands/smembers
3731
+ */
3732
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
3733
+ /**
3734
+ * @see https://redis.io/commands/smove
3735
+ */
3736
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
3737
+ /**
3738
+ * @see https://redis.io/commands/spop
3739
+ */
3740
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3741
+ /**
3742
+ * @see https://redis.io/commands/srandmember
3743
+ */
3744
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3745
+ /**
3746
+ * @see https://redis.io/commands/srem
3747
+ */
3748
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3749
+ /**
3750
+ * @see https://redis.io/commands/sscan
3751
+ */
3752
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3753
+ /**
3754
+ * @see https://redis.io/commands/strlen
3755
+ */
3756
+ strlen: (key: string) => Promise<number>;
3757
+ /**
3758
+ * @see https://redis.io/commands/subscribe
3759
+ */
3760
+ subscribe: <TMessage>(channels: string | string[]) => Subscriber<TMessage>;
3761
+ /**
3762
+ * @see https://redis.io/commands/sunion
3763
+ */
3764
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
3765
+ /**
3766
+ * @see https://redis.io/commands/sunionstore
3767
+ */
3768
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3769
+ /**
3770
+ * @see https://redis.io/commands/time
3771
+ */
3772
+ time: () => Promise<[number, number]>;
3773
+ /**
3774
+ * @see https://redis.io/commands/touch
3775
+ */
3776
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
3777
+ /**
3778
+ * @see https://redis.io/commands/ttl
3779
+ */
3780
+ ttl: (key: string) => Promise<number>;
3781
+ /**
3782
+ * @see https://redis.io/commands/type
3783
+ */
3784
+ type: (key: string) => Promise<Type>;
3785
+ /**
3786
+ * @see https://redis.io/commands/unlink
3787
+ */
3788
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
3789
+ /**
3790
+ * @see https://redis.io/commands/xadd
3791
+ */
3792
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3793
+ nomkStream?: boolean;
3794
+ trim?: ({
3795
+ type: "MAXLEN" | "maxlen";
3796
+ threshold: number;
3797
+ } | {
3798
+ type: "MINID" | "minid";
3799
+ threshold: string;
3800
+ }) & ({
3801
+ comparison: "~";
3802
+ limit?: number;
3803
+ } | {
3804
+ comparison: "=";
3805
+ limit?: never;
3806
+ });
3807
+ } | undefined) => Promise<string>;
3808
+ /**
3809
+ * @see https://redis.io/commands/xack
3810
+ */
3811
+ xack: (key: string, group: string, id: string | string[]) => Promise<number>;
3812
+ /**
3813
+ * @see https://redis.io/commands/xdel
3814
+ */
3815
+ xdel: (key: string, ids: string | string[]) => Promise<number>;
3816
+ /**
3817
+ * @see https://redis.io/commands/xgroup
3818
+ */
3819
+ xgroup: (key: string, opts: {
3820
+ type: "CREATE";
3821
+ group: string;
3822
+ id: `$` | string;
3823
+ options?: {
3824
+ MKSTREAM?: boolean;
3825
+ ENTRIESREAD?: number;
3826
+ };
3827
+ } | {
3828
+ type: "CREATECONSUMER";
3829
+ group: string;
3830
+ consumer: string;
3831
+ } | {
3832
+ type: "DELCONSUMER";
3833
+ group: string;
3834
+ consumer: string;
3835
+ } | {
3836
+ type: "DESTROY";
3837
+ group: string;
3838
+ } | {
3839
+ type: "SETID";
3840
+ group: string;
3841
+ id: `$` | string;
3842
+ options?: {
3843
+ ENTRIESREAD?: number;
3844
+ };
3845
+ }) => Promise<never>;
3846
+ /**
3847
+ * @see https://redis.io/commands/xread
3848
+ */
3849
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
3850
+ /**
3851
+ * @see https://redis.io/commands/xreadgroup
3852
+ */
3853
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
3854
+ /**
3855
+ * @see https://redis.io/commands/xinfo
3856
+ */
3857
+ xinfo: (key: string, options: {
3858
+ type: "CONSUMERS";
3859
+ group: string;
3860
+ } | {
3861
+ type: "GROUPS";
3862
+ }) => Promise<unknown[]>;
3863
+ /**
3864
+ * @see https://redis.io/commands/xlen
3865
+ */
3866
+ xlen: (key: string) => Promise<number>;
3867
+ /**
3868
+ * @see https://redis.io/commands/xpending
3869
+ */
3870
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3871
+ idleTime?: number;
3872
+ consumer?: string | string[];
3873
+ } | undefined) => Promise<unknown[]>;
3874
+ /**
3875
+ * @see https://redis.io/commands/xclaim
3876
+ */
3877
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3878
+ idleMS?: number;
3879
+ timeMS?: number;
3880
+ retryCount?: number;
3881
+ force?: boolean;
3882
+ justId?: boolean;
3883
+ lastId?: number;
3884
+ } | undefined) => Promise<unknown[]>;
3885
+ /**
3886
+ * @see https://redis.io/commands/xautoclaim
3887
+ */
3888
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3889
+ count?: number;
3890
+ justId?: boolean;
3891
+ } | undefined) => Promise<unknown[]>;
3892
+ /**
3893
+ * @see https://redis.io/commands/xtrim
3894
+ */
3895
+ xtrim: (key: string, options: {
3896
+ strategy: "MAXLEN" | "MINID";
3897
+ exactness?: "~" | "=";
3898
+ threshold: number | string;
3899
+ limit?: number;
3900
+ }) => Promise<number>;
3901
+ /**
3902
+ * @see https://redis.io/commands/xrange
3903
+ */
3904
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3905
+ /**
3906
+ * @see https://redis.io/commands/xrevrange
3907
+ */
3908
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3909
+ /**
3910
+ * @see https://redis.io/commands/zadd
3911
+ */
3912
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3913
+ /**
3914
+ * @see https://redis.io/commands/zcard
3915
+ */
3916
+ zcard: (key: string) => Promise<number>;
3917
+ /**
3918
+ * @see https://redis.io/commands/zcount
3919
+ */
3920
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
3921
+ /**
3922
+ * @see https://redis.io/commands/zdiffstore
3923
+ */
3924
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
3925
+ /**
3926
+ * @see https://redis.io/commands/zincrby
3927
+ */
3928
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
3929
+ /**
3930
+ * @see https://redis.io/commands/zinterstore
3931
+ */
3932
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
3933
+ /**
3934
+ * @see https://redis.io/commands/zlexcount
3935
+ */
3936
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
3937
+ /**
3938
+ * @see https://redis.io/commands/zmscore
3939
+ */
3940
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
3941
+ /**
3942
+ * @see https://redis.io/commands/zpopmax
3943
+ */
3944
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3945
+ /**
3946
+ * @see https://redis.io/commands/zpopmin
3947
+ */
3948
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3949
+ /**
3950
+ * @see https://redis.io/commands/zrange
3951
+ */
3952
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
3953
+ byLex: true;
3954
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
3955
+ byScore: true;
3956
+ } & ZRangeCommandOptions]) => Promise<TData>;
3957
+ /**
3958
+ * @see https://redis.io/commands/zrank
3959
+ */
3960
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
3961
+ /**
3962
+ * @see https://redis.io/commands/zrem
3963
+ */
3964
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3965
+ /**
3966
+ * @see https://redis.io/commands/zremrangebylex
3967
+ */
3968
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
3969
+ /**
3970
+ * @see https://redis.io/commands/zremrangebyrank
3971
+ */
3972
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
3973
+ /**
3974
+ * @see https://redis.io/commands/zremrangebyscore
3975
+ */
3976
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
3977
+ /**
3978
+ * @see https://redis.io/commands/zrevrank
3979
+ */
3980
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
3981
+ /**
3982
+ * @see https://redis.io/commands/zscan
3983
+ */
3984
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3985
+ /**
3986
+ * @see https://redis.io/commands/zscore
3987
+ */
3988
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
3989
+ /**
3990
+ * @see https://redis.io/commands/zunion
3991
+ */
3992
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
3993
+ /**
3994
+ * @see https://redis.io/commands/zunionstore
3995
+ */
3996
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3997
+ }
3998
+
3999
+ /**
4000
+ * Result of a bad request to upstash
4001
+ */
4002
+ declare class UpstashError extends Error {
4003
+ constructor(message: string);
4004
+ }
4005
+ declare class UrlError extends Error {
4006
+ constructor(url: string);
4007
+ }
4008
+
4009
+ type error_UpstashError = UpstashError;
4010
+ declare const error_UpstashError: typeof UpstashError;
4011
+ type error_UrlError = UrlError;
4012
+ declare const error_UrlError: typeof UrlError;
4013
+ declare namespace error {
4014
+ export { error_UpstashError as UpstashError, error_UrlError as UrlError };
4015
+ }
4016
+
4017
+ /**
4018
+ * @see https://redis.io/commands/zdiffstore
4019
+ */
4020
+ declare class ZDiffStoreCommand extends Command<number, number> {
4021
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
4022
+ }
4023
+
4024
+ /**
4025
+ * @see https://redis.io/commands/zmscore
4026
+ */
4027
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
4028
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
4029
+ }
4030
+
4031
+ export { HPersistCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, type HttpClientConfig as H, GetCommand as I, GetBitCommand as J, GetDelCommand as K, GetExCommand as L, GetRangeCommand as M, GetSetCommand as N, HDelCommand as O, Pipeline as P, HExistsCommand as Q, type RedisOptions as R, HExpireCommand as S, HExpireAtCommand as T, type UpstashRequest as U, HExpireTimeCommand as V, HTtlCommand as W, HPExpireCommand as X, HPExpireAtCommand as Y, HPExpireTimeCommand as Z, HPTtlCommand as _, type RequesterConfig as a, RenameNXCommand as a$, HGetCommand as a0, HGetAllCommand as a1, HIncrByCommand as a2, HIncrByFloatCommand as a3, HKeysCommand as a4, HLenCommand as a5, HMGetCommand as a6, HMSetCommand as a7, HRandFieldCommand as a8, HScanCommand as a9, JsonStrLenCommand as aA, JsonToggleCommand as aB, JsonTypeCommand as aC, KeysCommand as aD, LIndexCommand as aE, LInsertCommand as aF, LLenCommand as aG, LMoveCommand as aH, LPopCommand as aI, LPushCommand as aJ, LPushXCommand as aK, LRangeCommand as aL, LRemCommand as aM, LSetCommand as aN, LTrimCommand as aO, MGetCommand as aP, MSetCommand as aQ, MSetNXCommand as aR, PersistCommand as aS, PExpireCommand as aT, PExpireAtCommand as aU, PingCommand as aV, PSetEXCommand as aW, PTtlCommand as aX, PublishCommand as aY, RandomKeyCommand as aZ, RenameCommand as a_, HSetCommand as aa, HSetNXCommand as ab, HStrLenCommand as ac, HValsCommand as ad, IncrCommand as ae, IncrByCommand as af, IncrByFloatCommand as ag, JsonArrAppendCommand as ah, JsonArrIndexCommand as ai, JsonArrInsertCommand as aj, JsonArrLenCommand as ak, JsonArrPopCommand as al, JsonArrTrimCommand as am, JsonClearCommand as an, JsonDelCommand as ao, JsonForgetCommand as ap, JsonGetCommand as aq, JsonMergeCommand as ar, JsonMGetCommand as as, JsonNumIncrByCommand as at, JsonNumMultByCommand as au, JsonObjKeysCommand as av, JsonObjLenCommand as aw, JsonRespCommand as ax, JsonSetCommand as ay, JsonStrAppendCommand as az, Redis as b, type ZUnionCommandOptions as b$, RPopCommand as b0, RPushCommand as b1, RPushXCommand as b2, SAddCommand as b3, ScanCommand as b4, type ScanCommandOptions as b5, SCardCommand as b6, ScriptExistsCommand as b7, ScriptFlushCommand as b8, ScriptLoadCommand as b9, UnlinkCommand as bA, XAddCommand as bB, XRangeCommand as bC, type ScoreMember as bD, type ZAddCommandOptions as bE, ZAddCommand as bF, ZCardCommand as bG, ZCountCommand as bH, ZDiffStoreCommand as bI, ZIncrByCommand as bJ, ZInterStoreCommand as bK, type ZInterStoreCommandOptions as bL, ZLexCountCommand as bM, ZMScoreCommand as bN, ZPopMaxCommand as bO, ZPopMinCommand as bP, ZRangeCommand as bQ, type ZRangeCommandOptions as bR, ZRankCommand as bS, ZRemCommand as bT, ZRemRangeByLexCommand as bU, ZRemRangeByRankCommand as bV, ZRemRangeByScoreCommand as bW, ZRevRankCommand as bX, ZScanCommand as bY, ZScoreCommand as bZ, ZUnionCommand as b_, SDiffCommand as ba, SDiffStoreCommand as bb, SetCommand as bc, type SetCommandOptions as bd, SetBitCommand as be, SetExCommand as bf, SetNxCommand as bg, SetRangeCommand as bh, SInterCommand as bi, SInterStoreCommand as bj, SIsMemberCommand as bk, SMembersCommand as bl, SMIsMemberCommand as bm, SMoveCommand as bn, SPopCommand as bo, SRandMemberCommand as bp, SRemCommand as bq, SScanCommand as br, StrLenCommand as bs, SUnionCommand as bt, SUnionStoreCommand as bu, TimeCommand as bv, TouchCommand as bw, TtlCommand as bx, type Type as by, TypeCommand as bz, type UpstashResponse as c, ZUnionStoreCommand as c0, type ZUnionStoreCommandOptions as c1, type Requester as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalROCommand as k, EvalCommand as l, EvalshaROCommand as m, EvalshaCommand as n, ExistsCommand as o, ExpireCommand as p, type ExpireOption as q, ExpireAtCommand as r, FlushDBCommand as s, type GeoAddCommandOptions as t, type GeoMember as u, GeoDistCommand as v, GeoHashCommand as w, GeoPosCommand as x, GeoSearchCommand as y, GeoSearchStoreCommand as z };