@upstash/redis 1.0.0 → 1.0.3

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,976 @@
1
+ import { HttpClient } from './http';
2
+ import { S as ScanCommandOptions, a as SetCommandOptions, C as CommandArgs, U as UnlinkCommand, b as ScoreMember, Z as ZAddCommandOptions, c as ZAddCommandOptionsWithIncr, d as ZInterStoreCommandOptions, e as ZRangeCommandOptions, f as ZUnionStoreCommandOptions, T as Type } from './zunionstore-e1cc0e90';
3
+
4
+ /**
5
+ * Upstash REST API supports command pipelining to send multiple commands in
6
+ * batch, instead of sending each command one by one and waiting for a response.
7
+ * When using pipelines, several commands are sent using a single HTTP request,
8
+ * and a single JSON array response is returned. Each item in the response array
9
+ * corresponds to the command in the same order within the pipeline.
10
+ *
11
+ * **NOTE:**
12
+ *
13
+ * Execution of the pipeline is not atomic. Even though each command in
14
+ * the pipeline will be executed in order, commands sent by other clients can
15
+ * interleave with the pipeline.
16
+ *
17
+ *
18
+ * **Examples:**
19
+ *
20
+ * ```ts
21
+ * const p = redis.pipeline()
22
+ * p.set("key","value")
23
+ * p.get("key")
24
+ * const res = await p.exec()
25
+ * ```
26
+ *
27
+ * You can also chain commands together
28
+ * ```ts
29
+ * const p = redis.pipeline()
30
+ * const res = await p.set("key","value").get("key").exec()
31
+ * ```
32
+ *
33
+ * It's not possible to infer correct types with a dynamic pipeline, so you can
34
+ * override the response type manually:
35
+ * ```ts
36
+ * redis.pipeline()
37
+ * .set("key", { greeting: "hello"})
38
+ * .get("key")
39
+ * .exec<["OK", { greeting: string } ]>()
40
+ *
41
+ * ```
42
+ */
43
+ declare class Pipeline {
44
+ private client;
45
+ private commands;
46
+ constructor(client: HttpClient);
47
+ /**
48
+ * Send the pipeline request to upstash.
49
+ *
50
+ * Returns an array with the results of all pipelined commands.
51
+ *
52
+ * You can define a return type manually to make working in typescript easier
53
+ * ```ts
54
+ * redis.pipeline().get("key").exec<[{ greeting: string }]>()
55
+ * ```
56
+ */
57
+ exec: <TCommandResults extends unknown[] = unknown[]>() => Promise<TCommandResults>;
58
+ /**
59
+ * Pushes a command into the pipelien and returns a chainable instance of the
60
+ * pipeline
61
+ */
62
+ private chain;
63
+ /**
64
+ * @see https://redis.io/commands/append
65
+ */
66
+ append: (key: string, value: string) => this;
67
+ /**
68
+ * @see https://redis.io/commands/bitcount
69
+ */
70
+ bitcount: (key: string, start: number, end: number) => this;
71
+ /**
72
+ * @see https://redis.io/commands/bitop
73
+ */
74
+ bitop: {
75
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline;
76
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline;
77
+ };
78
+ /**
79
+ * @see https://redis.io/commands/bitpos
80
+ */
81
+ bitpos: (key: string, start: number, end: number) => this;
82
+ /**
83
+ * @see https://redis.io/commands/dbsize
84
+ */
85
+ dbsize: () => this;
86
+ /**
87
+ * @see https://redis.io/commands/decr
88
+ */
89
+ decr: (key: string) => this;
90
+ /**
91
+ * @see https://redis.io/commands/decrby
92
+ */
93
+ decrby: (key: string, decrement: number) => this;
94
+ /**
95
+ * @see https://redis.io/commands/del
96
+ */
97
+ del: (args_0: string, ...args_1: string[]) => this;
98
+ /**
99
+ * @see https://redis.io/commands/echo
100
+ */
101
+ echo: (message: string) => this;
102
+ /**
103
+ * @see https://redis.io/commands/exists
104
+ */
105
+ exists: (args_0: string, ...args_1: string[]) => this;
106
+ /**
107
+ * @see https://redis.io/commands/expire
108
+ */
109
+ expire: (key: string, seconds: number) => this;
110
+ /**
111
+ * @see https://redis.io/commands/expireat
112
+ */
113
+ expireat: (key: string, unix: number) => this;
114
+ /**
115
+ * @see https://redis.io/commands/flushall
116
+ */
117
+ flushall: (opts?: {
118
+ async?: boolean | undefined;
119
+ } | undefined) => this;
120
+ /**
121
+ * @see https://redis.io/commands/flushdb
122
+ */
123
+ flushdb: (opts?: {
124
+ async?: boolean | undefined;
125
+ } | undefined) => this;
126
+ /**
127
+ * @see https://redis.io/commands/get
128
+ */
129
+ get: <TData>(key: string) => this;
130
+ /**
131
+ * @see https://redis.io/commands/getbit
132
+ */
133
+ getbit: (key: string, offset: number) => this;
134
+ /**
135
+ * @see https://redis.io/commands/getrange
136
+ */
137
+ getrange: (key: string, start: number, end: number) => this;
138
+ /**
139
+ * @see https://redis.io/commands/getset
140
+ */
141
+ getset: <TData>(key: string, value: TData) => this;
142
+ /**
143
+ * @see https://redis.io/commands/hdel
144
+ */
145
+ hdel: (key: string, field: string) => this;
146
+ /**
147
+ * @see https://redis.io/commands/hexists
148
+ */
149
+ hexists: (key: string, field: string) => this;
150
+ /**
151
+ * @see https://redis.io/commands/hget
152
+ */
153
+ hget: <TData>(key: string, field: string) => this;
154
+ /**
155
+ * @see https://redis.io/commands/hgetall
156
+ */
157
+ hgetall: <TData extends Record<string, unknown>>(key: string) => this;
158
+ /**
159
+ * @see https://redis.io/commands/hincrby
160
+ */
161
+ hincrby: (key: string, field: string, increment: number) => this;
162
+ /**
163
+ * @see https://redis.io/commands/hincrbyfloat
164
+ */
165
+ hincrbyfloat: (key: string, field: string, increment: number) => this;
166
+ /**
167
+ * @see https://redis.io/commands/hkeys
168
+ */
169
+ hkeys: (key: string) => this;
170
+ /**
171
+ * @see https://redis.io/commands/hlen
172
+ */
173
+ hlen: (key: string) => this;
174
+ /**
175
+ * @see https://redis.io/commands/hmget
176
+ */
177
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => this;
178
+ /**
179
+ * @see https://redis.io/commands/hmset
180
+ */
181
+ hmset: <TData>(key: string, kv: {
182
+ [field: string]: TData;
183
+ }) => this;
184
+ /**
185
+ * @see https://redis.io/commands/hscan
186
+ */
187
+ hscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
188
+ /**
189
+ * @see https://redis.io/commands/hset
190
+ */
191
+ hset: <TData>(key: string, kv: {
192
+ [field: string]: TData;
193
+ }) => this;
194
+ /**
195
+ * @see https://redis.io/commands/hsetnx
196
+ */
197
+ hsetnx: <TData>(key: string, field: string, value: TData) => this;
198
+ /**
199
+ * @see https://redis.io/commands/hstrlen
200
+ */
201
+ hstrlen: (key: string, field: string) => this;
202
+ /**
203
+ * @see https://redis.io/commands/hvals
204
+ */
205
+ hvals: (key: string) => this;
206
+ /**
207
+ * @see https://redis.io/commands/incr
208
+ */
209
+ incr: (key: string) => this;
210
+ /**
211
+ * @see https://redis.io/commands/incrby
212
+ */
213
+ incrby: (key: string, value: number) => this;
214
+ /**
215
+ * @see https://redis.io/commands/incrbyfloat
216
+ */
217
+ incrbyfloat: (key: string, value: number) => this;
218
+ /**
219
+ * @see https://redis.io/commands/keys
220
+ */
221
+ keys: (pattern: string) => this;
222
+ /**
223
+ * @see https://redis.io/commands/lindex
224
+ */
225
+ lindex: (key: string, index: number) => this;
226
+ /**
227
+ * @see https://redis.io/commands/linsert
228
+ */
229
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => this;
230
+ /**
231
+ * @see https://redis.io/commands/llen
232
+ */
233
+ llen: (key: string) => this;
234
+ /**
235
+ * @see https://redis.io/commands/lpop
236
+ */
237
+ lpop: <TData>(key: string) => this;
238
+ /**
239
+ * @see https://redis.io/commands/lpush
240
+ */
241
+ lpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
242
+ /**
243
+ * @see https://redis.io/commands/lpushx
244
+ */
245
+ lpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
246
+ /**
247
+ * @see https://redis.io/commands/lrange
248
+ */
249
+ lrange: <TResult = string>(key: string, start: number, end: number) => this;
250
+ /**
251
+ * @see https://redis.io/commands/lrem
252
+ */
253
+ lrem: <TData>(key: string, count: number, value: TData) => this;
254
+ /**
255
+ * @see https://redis.io/commands/lset
256
+ */
257
+ lset: <TData>(key: string, value: TData, index: number) => this;
258
+ /**
259
+ * @see https://redis.io/commands/ltrim
260
+ */
261
+ ltrim: (key: string, start: number, end: number) => this;
262
+ /**
263
+ * @see https://redis.io/commands/mget
264
+ */
265
+ mget: <TData extends unknown[]>(args_0: string, ...args_1: string[]) => this;
266
+ /**
267
+ * @see https://redis.io/commands/mset
268
+ */
269
+ mset: <TData>(kv: {
270
+ [key: string]: TData;
271
+ }) => this;
272
+ /**
273
+ * @see https://redis.io/commands/msetnx
274
+ */
275
+ msetnx: <TData>(kv: {
276
+ [key: string]: TData;
277
+ }) => this;
278
+ /**
279
+ * @see https://redis.io/commands/persist
280
+ */
281
+ persist: (key: string) => this;
282
+ /**
283
+ * @see https://redis.io/commands/pexpire
284
+ */
285
+ pexpire: (key: string, milliseconds: number) => this;
286
+ /**
287
+ * @see https://redis.io/commands/pexpireat
288
+ */
289
+ pexpireat: (key: string, unix: number) => this;
290
+ /**
291
+ * @see https://redis.io/commands/ping
292
+ */
293
+ ping: (message?: string | undefined) => this;
294
+ /**
295
+ * @see https://redis.io/commands/psetex
296
+ */
297
+ psetex: <TData>(key: string, ttl: number, value: TData) => this;
298
+ /**
299
+ * @see https://redis.io/commands/pttl
300
+ */
301
+ pttl: (key: string) => this;
302
+ /**
303
+ * @see https://redis.io/commands/randomkey
304
+ */
305
+ randomkey: () => this;
306
+ /**
307
+ * @see https://redis.io/commands/rename
308
+ */
309
+ rename: (source: string, destination: string) => this;
310
+ /**
311
+ * @see https://redis.io/commands/renamenx
312
+ */
313
+ renamenx: (source: string, destination: string) => this;
314
+ /**
315
+ * @see https://redis.io/commands/rpop
316
+ */
317
+ rpop: <TData = string>(key: string) => this;
318
+ /**
319
+ * @see https://redis.io/commands/rpush
320
+ */
321
+ rpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
322
+ /**
323
+ * @see https://redis.io/commands/rpushx
324
+ */
325
+ rpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
326
+ /**
327
+ * @see https://redis.io/commands/sadd
328
+ */
329
+ sadd: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
330
+ /**
331
+ * @see https://redis.io/commands/scan
332
+ */
333
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => this;
334
+ /**
335
+ * @see https://redis.io/commands/scard
336
+ */
337
+ scard: (key: string) => this;
338
+ /**
339
+ * @see https://redis.io/commands/sdiff
340
+ */
341
+ sdiff: (key: string, ...keys: string[]) => this;
342
+ /**
343
+ * @see https://redis.io/commands/sdiffstore
344
+ */
345
+ sdiffstore: (args_0: string, args_1: string, ...args_2: string[]) => this;
346
+ /**
347
+ * @see https://redis.io/commands/set
348
+ */
349
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions | undefined) => this;
350
+ /**
351
+ * @see https://redis.io/commands/setbit
352
+ */
353
+ setbit: (key: string, offset: number, value: 0 | 1) => this;
354
+ /**
355
+ * @see https://redis.io/commands/setex
356
+ */
357
+ setex: <TData>(key: string, ttl: number, value: TData) => this;
358
+ /**
359
+ * @see https://redis.io/commands/setnx
360
+ */
361
+ setnx: <TData>(key: string, value: TData) => this;
362
+ /**
363
+ * @see https://redis.io/commands/setrange
364
+ */
365
+ setrange: (key: string, offset: number, value: string) => this;
366
+ /**
367
+ * @see https://redis.io/commands/sinter
368
+ */
369
+ sinter: (key: string, ...keys: string[]) => this;
370
+ /**
371
+ * @see https://redis.io/commands/sinterstore
372
+ */
373
+ sinterstore: (destination: string, key: string, ...keys: string[]) => this;
374
+ /**
375
+ * @see https://redis.io/commands/sismember
376
+ */
377
+ sismember: <TData>(key: string, member: TData) => this;
378
+ /**
379
+ * @see https://redis.io/commands/smembers
380
+ */
381
+ smembers: (key: string) => this;
382
+ /**
383
+ * @see https://redis.io/commands/smove
384
+ */
385
+ smove: <TData>(source: string, destination: string, member: TData) => this;
386
+ /**
387
+ * @see https://redis.io/commands/spop
388
+ */
389
+ spop: <TData>(key: string, count?: number | undefined) => this;
390
+ /**
391
+ * @see https://redis.io/commands/srandmember
392
+ */
393
+ srandmember: <TData>(key: string, count?: number | undefined) => this;
394
+ /**
395
+ * @see https://redis.io/commands/srem
396
+ */
397
+ srem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
398
+ /**
399
+ * @see https://redis.io/commands/sscan
400
+ */
401
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
402
+ /**
403
+ * @see https://redis.io/commands/strlen
404
+ */
405
+ strlen: (key: string) => this;
406
+ /**
407
+ * @see https://redis.io/commands/sunion
408
+ */
409
+ sunion: (key: string, ...keys: string[]) => this;
410
+ /**
411
+ * @see https://redis.io/commands/sunionstore
412
+ */
413
+ sunionstore: (destination: string, key: string, ...keys: string[]) => this;
414
+ /**
415
+ * @see https://redis.io/commands/time
416
+ */
417
+ time: () => this;
418
+ /**
419
+ * @see https://redis.io/commands/touch
420
+ */
421
+ touch: (args_0: string, ...args_1: string[]) => this;
422
+ /**
423
+ * @see https://redis.io/commands/ttl
424
+ */
425
+ ttl: (key: string) => this;
426
+ /**
427
+ * @see https://redis.io/commands/type
428
+ */
429
+ type: (key: string) => this;
430
+ /**
431
+ * @see https://redis.io/commands/unlink
432
+ */
433
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => this;
434
+ /**
435
+ * @see https://redis.io/commands/zadd
436
+ */
437
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => this;
438
+ /**
439
+ * @see https://redis.io/commands/zcard
440
+ */
441
+ zcard: (key: string) => this;
442
+ /**
443
+ * @see https://redis.io/commands/zcount
444
+ */
445
+ zcount: (key: string, min: string | number, max: string | number) => this;
446
+ /**
447
+ * @see https://redis.io/commands/zincrby
448
+ */
449
+ zincrby: <TData>(key: string, increment: number, member: TData) => this;
450
+ /**
451
+ * @see https://redis.io/commands/zinterstore
452
+ */
453
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => this;
454
+ /**
455
+ * @see https://redis.io/commands/zlexcount
456
+ */
457
+ zlexcount: (key: string, min: string, max: string) => this;
458
+ /**
459
+ * @see https://redis.io/commands/zpopmax
460
+ */
461
+ zpopmax: <TData>(key: string, count?: number | undefined) => this;
462
+ /**
463
+ * @see https://redis.io/commands/zpopmin
464
+ */
465
+ zpopmin: <TData>(key: string, count?: number | undefined) => this;
466
+ /**
467
+ * @see https://redis.io/commands/zrange
468
+ */
469
+ zrange: <TData extends unknown[]>(key: string, min: number | `(${number}`, max: number | `(${number}`, opts?: ZRangeCommandOptions | undefined) => this;
470
+ /**
471
+ * @see https://redis.io/commands/zrank
472
+ */
473
+ zrank: <TData>(key: string, member: TData) => this;
474
+ /**
475
+ * @see https://redis.io/commands/zrem
476
+ */
477
+ zrem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
478
+ /**
479
+ * @see https://redis.io/commands/zremrangebylex
480
+ */
481
+ zremrangebylex: (key: string, min: string, max: string) => this;
482
+ /**
483
+ * @see https://redis.io/commands/zremrangebyrank
484
+ */
485
+ zremrangebyrank: (key: string, start: number, stop: number) => this;
486
+ /**
487
+ * @see https://redis.io/commands/zremrangebyscore
488
+ */
489
+ zremrangebyscore: (key: string, min: number, max: number) => this;
490
+ /**
491
+ * @see https://redis.io/commands/zrevrank
492
+ */
493
+ zrevrank: <TData>(key: string, member: TData) => this;
494
+ /**
495
+ * @see https://redis.io/commands/zscan
496
+ */
497
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
498
+ /**
499
+ * @see https://redis.io/commands/zscore
500
+ */
501
+ zscore: <TData>(key: string, member: TData) => this;
502
+ /**
503
+ * @see https://redis.io/commands/zunionstore
504
+ */
505
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => this;
506
+ }
507
+
508
+ /**
509
+ * Serverless redis client for upstash.
510
+ */
511
+ declare class Redis {
512
+ private readonly client;
513
+ /**
514
+ * Create a new redis client
515
+ *
516
+ * @example
517
+ * ```typescript
518
+ * const redis = new Redis({
519
+ * url: "<UPSTASH_REDIS_REST_URL>",
520
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
521
+ * });
522
+ * ```
523
+ */
524
+ constructor(client: HttpClient);
525
+ /**
526
+ * Create a new pipeline that allows you to send requests in bulk.
527
+ *
528
+ * @see {@link Pipeline}
529
+ */
530
+ pipeline: () => Pipeline;
531
+ /**
532
+ * @see https://redis.io/commands/append
533
+ */
534
+ append: (key: string, value: string) => Promise<number>;
535
+ /**
536
+ * @see https://redis.io/commands/bitcount
537
+ */
538
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
539
+ /**
540
+ * @see https://redis.io/commands/bitop
541
+ */
542
+ bitop: {
543
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
544
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
545
+ };
546
+ /**
547
+ * @see https://redis.io/commands/bitpos
548
+ */
549
+ bitpos: (key: string, start: number, end: number) => Promise<number>;
550
+ /**
551
+ * @see https://redis.io/commands/dbsize
552
+ */
553
+ dbsize: () => Promise<number>;
554
+ /**
555
+ * @see https://redis.io/commands/decr
556
+ */
557
+ decr: (key: string) => Promise<number>;
558
+ /**
559
+ * @see https://redis.io/commands/decrby
560
+ */
561
+ decrby: (key: string, decrement: number) => Promise<number>;
562
+ /**
563
+ * @see https://redis.io/commands/del
564
+ */
565
+ del: (args_0: string, ...args_1: string[]) => Promise<number>;
566
+ /**
567
+ * @see https://redis.io/commands/echo
568
+ */
569
+ echo: (message: string) => Promise<string>;
570
+ /**
571
+ * @see https://redis.io/commands/exists
572
+ */
573
+ exists: (args_0: string, ...args_1: string[]) => Promise<number>;
574
+ /**
575
+ * @see https://redis.io/commands/expire
576
+ */
577
+ expire: (key: string, seconds: number) => Promise<0 | 1>;
578
+ /**
579
+ * @see https://redis.io/commands/expireat
580
+ */
581
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
582
+ /**
583
+ * @see https://redis.io/commands/flushall
584
+ */
585
+ flushall: (opts?: {
586
+ async?: boolean | undefined;
587
+ } | undefined) => Promise<"OK">;
588
+ /**
589
+ * @see https://redis.io/commands/flushdb
590
+ */
591
+ flushdb: (opts?: {
592
+ async?: boolean | undefined;
593
+ } | undefined) => Promise<"OK">;
594
+ /**
595
+ * @see https://redis.io/commands/get
596
+ */
597
+ get: <TData>(key: string) => Promise<TData | null>;
598
+ /**
599
+ * @see https://redis.io/commands/getbit
600
+ */
601
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
602
+ /**
603
+ * @see https://redis.io/commands/getrange
604
+ */
605
+ getrange: (key: string, start: number, end: number) => Promise<string>;
606
+ /**
607
+ * @see https://redis.io/commands/getset
608
+ */
609
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
610
+ /**
611
+ * @see https://redis.io/commands/hdel
612
+ */
613
+ hdel: (key: string, field: string) => Promise<0 | 1>;
614
+ /**
615
+ * @see https://redis.io/commands/hexists
616
+ */
617
+ hexists: (key: string, field: string) => Promise<number>;
618
+ /**
619
+ * @see https://redis.io/commands/hget
620
+ */
621
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
622
+ /**
623
+ * @see https://redis.io/commands/hgetall
624
+ */
625
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
626
+ /**
627
+ * @see https://redis.io/commands/hincrby
628
+ */
629
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
630
+ /**
631
+ * @see https://redis.io/commands/hincrbyfloat
632
+ */
633
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
634
+ /**
635
+ * @see https://redis.io/commands/hkeys
636
+ */
637
+ hkeys: (key: string) => Promise<string[]>;
638
+ /**
639
+ * @see https://redis.io/commands/hlen
640
+ */
641
+ hlen: (key: string) => Promise<number>;
642
+ /**
643
+ * @see https://redis.io/commands/hmget
644
+ */
645
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
646
+ /**
647
+ * @see https://redis.io/commands/hmset
648
+ */
649
+ hmset: <TData>(key: string, kv: {
650
+ [field: string]: TData;
651
+ }) => Promise<number>;
652
+ /**
653
+ * @see https://redis.io/commands/hscan
654
+ */
655
+ hscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
656
+ /**
657
+ * @see https://redis.io/commands/hset
658
+ */
659
+ hset: <TData>(key: string, kv: {
660
+ [field: string]: TData;
661
+ }) => Promise<number>;
662
+ /**
663
+ * @see https://redis.io/commands/hsetnx
664
+ */
665
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
666
+ /**
667
+ * @see https://redis.io/commands/hstrlen
668
+ */
669
+ hstrlen: (key: string, field: string) => Promise<number>;
670
+ /**
671
+ * @see https://redis.io/commands/hvals
672
+ */
673
+ hvals: (key: string) => Promise<unknown[]>;
674
+ /**
675
+ * @see https://redis.io/commands/incr
676
+ */
677
+ incr: (key: string) => Promise<number>;
678
+ /**
679
+ * @see https://redis.io/commands/incrby
680
+ */
681
+ incrby: (key: string, value: number) => Promise<number>;
682
+ /**
683
+ * @see https://redis.io/commands/incrbyfloat
684
+ */
685
+ incrbyfloat: (key: string, value: number) => Promise<number>;
686
+ /**
687
+ * @see https://redis.io/commands/keys
688
+ */
689
+ keys: (pattern: string) => Promise<string[]>;
690
+ /**
691
+ * @see https://redis.io/commands/lindex
692
+ */
693
+ lindex: (key: string, index: number) => Promise<string | null>;
694
+ /**
695
+ * @see https://redis.io/commands/linsert
696
+ */
697
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
698
+ /**
699
+ * @see https://redis.io/commands/llen
700
+ */
701
+ llen: (key: string) => Promise<number>;
702
+ /**
703
+ * @see https://redis.io/commands/lpop
704
+ */
705
+ lpop: <TData>(key: string) => Promise<TData | null>;
706
+ /**
707
+ * @see https://redis.io/commands/lpush
708
+ */
709
+ lpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
710
+ /**
711
+ * @see https://redis.io/commands/lpushx
712
+ */
713
+ lpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
714
+ /**
715
+ * @see https://redis.io/commands/lrange
716
+ */
717
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
718
+ /**
719
+ * @see https://redis.io/commands/lrem
720
+ */
721
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
722
+ /**
723
+ * @see https://redis.io/commands/lset
724
+ */
725
+ lset: <TData>(key: string, value: TData, index: number) => Promise<"OK">;
726
+ /**
727
+ * @see https://redis.io/commands/ltrim
728
+ */
729
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
730
+ /**
731
+ * @see https://redis.io/commands/mget
732
+ */
733
+ mget: <TData extends unknown[]>(args_0: string, ...args_1: string[]) => Promise<TData>;
734
+ /**
735
+ * @see https://redis.io/commands/mset
736
+ */
737
+ mset: <TData>(kv: {
738
+ [key: string]: TData;
739
+ }) => Promise<"OK">;
740
+ /**
741
+ * @see https://redis.io/commands/msetnx
742
+ */
743
+ msetnx: <TData>(kv: {
744
+ [key: string]: TData;
745
+ }) => Promise<number>;
746
+ /**
747
+ * @see https://redis.io/commands/persist
748
+ */
749
+ persist: (key: string) => Promise<0 | 1>;
750
+ /**
751
+ * @see https://redis.io/commands/pexpire
752
+ */
753
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
754
+ /**
755
+ * @see https://redis.io/commands/pexpireat
756
+ */
757
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
758
+ /**
759
+ * @see https://redis.io/commands/ping
760
+ */
761
+ ping: (message?: string | undefined) => Promise<string>;
762
+ /**
763
+ * @see https://redis.io/commands/psetex
764
+ */
765
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
766
+ /**
767
+ * @see https://redis.io/commands/pttl
768
+ */
769
+ pttl: (key: string) => Promise<number>;
770
+ /**
771
+ * @see https://redis.io/commands/randomkey
772
+ */
773
+ randomkey: () => Promise<string | null>;
774
+ /**
775
+ * @see https://redis.io/commands/rename
776
+ */
777
+ rename: (source: string, destination: string) => Promise<"OK">;
778
+ /**
779
+ * @see https://redis.io/commands/renamenx
780
+ */
781
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
782
+ /**
783
+ * @see https://redis.io/commands/rpop
784
+ */
785
+ rpop: <TData = string>(key: string) => Promise<TData | null>;
786
+ /**
787
+ * @see https://redis.io/commands/rpush
788
+ */
789
+ rpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
790
+ /**
791
+ * @see https://redis.io/commands/rpushx
792
+ */
793
+ rpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
794
+ /**
795
+ * @see https://redis.io/commands/sadd
796
+ */
797
+ sadd: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
798
+ /**
799
+ * @see https://redis.io/commands/scan
800
+ */
801
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
802
+ /**
803
+ * @see https://redis.io/commands/scard
804
+ */
805
+ scard: (key: string) => Promise<number>;
806
+ /**
807
+ * @see https://redis.io/commands/sdiff
808
+ */
809
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
810
+ /**
811
+ * @see https://redis.io/commands/sdiffstore
812
+ */
813
+ sdiffstore: (args_0: string, args_1: string, ...args_2: string[]) => Promise<number>;
814
+ /**
815
+ * @see https://redis.io/commands/set
816
+ */
817
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions | undefined) => Promise<TData>;
818
+ /**
819
+ * @see https://redis.io/commands/setbit
820
+ */
821
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
822
+ /**
823
+ * @see https://redis.io/commands/setex
824
+ */
825
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
826
+ /**
827
+ * @see https://redis.io/commands/setnx
828
+ */
829
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
830
+ /**
831
+ * @see https://redis.io/commands/setrange
832
+ */
833
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
834
+ /**
835
+ * @see https://redis.io/commands/sinter
836
+ */
837
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
838
+ /**
839
+ * @see https://redis.io/commands/sinterstore
840
+ */
841
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<string[]>;
842
+ /**
843
+ * @see https://redis.io/commands/sismember
844
+ */
845
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
846
+ /**
847
+ * @see https://redis.io/commands/smembers
848
+ */
849
+ smembers: (key: string) => Promise<string[]>;
850
+ /**
851
+ * @see https://redis.io/commands/smove
852
+ */
853
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
854
+ /**
855
+ * @see https://redis.io/commands/spop
856
+ */
857
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
858
+ /**
859
+ * @see https://redis.io/commands/srandmember
860
+ */
861
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
862
+ /**
863
+ * @see https://redis.io/commands/srem
864
+ */
865
+ srem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
866
+ /**
867
+ * @see https://redis.io/commands/sscan
868
+ */
869
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
870
+ /**
871
+ * @see https://redis.io/commands/strlen
872
+ */
873
+ strlen: (key: string) => Promise<number>;
874
+ /**
875
+ * @see https://redis.io/commands/sunion
876
+ */
877
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
878
+ /**
879
+ * @see https://redis.io/commands/sunionstore
880
+ */
881
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
882
+ /**
883
+ * @see https://redis.io/commands/time
884
+ */
885
+ time: () => Promise<[number, number]>;
886
+ /**
887
+ * @see https://redis.io/commands/touch
888
+ */
889
+ touch: (args_0: string, ...args_1: string[]) => Promise<number>;
890
+ /**
891
+ * @see https://redis.io/commands/ttl
892
+ */
893
+ ttl: (key: string) => Promise<number>;
894
+ /**
895
+ * @see https://redis.io/commands/type
896
+ */
897
+ type: (key: string) => Promise<Type>;
898
+ /**
899
+ * @see https://redis.io/commands/unlink
900
+ */
901
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
902
+ /**
903
+ * @see https://redis.io/commands/zadd
904
+ */
905
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
906
+ /**
907
+ * @see https://redis.io/commands/zcard
908
+ */
909
+ zcard: (key: string) => Promise<number>;
910
+ /**
911
+ * @see https://redis.io/commands/zcount
912
+ */
913
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
914
+ /**
915
+ * @see https://redis.io/commands/zincrby
916
+ */
917
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
918
+ /**
919
+ * @see https://redis.io/commands/zinterstore
920
+ */
921
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
922
+ /**
923
+ * @see https://redis.io/commands/zlexcount
924
+ */
925
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
926
+ /**
927
+ * @see https://redis.io/commands/zpopmax
928
+ */
929
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
930
+ /**
931
+ * @see https://redis.io/commands/zpopmin
932
+ */
933
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
934
+ /**
935
+ * @see https://redis.io/commands/zrange
936
+ */
937
+ zrange: <TData extends unknown[]>(key: string, min: number | `(${number}`, max: number | `(${number}`, opts?: ZRangeCommandOptions | undefined) => Promise<TData>;
938
+ /**
939
+ * @see https://redis.io/commands/zrank
940
+ */
941
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
942
+ /**
943
+ * @see https://redis.io/commands/zrem
944
+ */
945
+ zrem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
946
+ /**
947
+ * @see https://redis.io/commands/zremrangebylex
948
+ */
949
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
950
+ /**
951
+ * @see https://redis.io/commands/zremrangebyrank
952
+ */
953
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
954
+ /**
955
+ * @see https://redis.io/commands/zremrangebyscore
956
+ */
957
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
958
+ /**
959
+ * @see https://redis.io/commands/zrevrank
960
+ */
961
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
962
+ /**
963
+ * @see https://redis.io/commands/zscan
964
+ */
965
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
966
+ /**
967
+ * @see https://redis.io/commands/zscore
968
+ */
969
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
970
+ /**
971
+ * @see https://redis.io/commands/zunionstore
972
+ */
973
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
974
+ }
975
+
976
+ export { Redis as R };