@upstash/redis 1.0.0-alpha.7 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,966 +0,0 @@
1
- import { C as CommandArgs, A as AppendCommand, B as BitCountCommand, a as BitPosCommand, D as DecrCommand, b as DecrByCommand, c as DelCommand, E as EchoCommand, d as ExistsCommand, e as ExpireCommand, f as ExpireAtCommand, F as FlushAllCommand, g as FlushDBCommand, G as GetCommand, h as GetBitCommand, i as GetRangeCommand, H as HDelCommand, j as HExistsCommand, k as HGetCommand, l as HGetAllCommand, m as HIncrByCommand, n as HIncrByFloatCommand, o as HKeysCommand, p as HLenCommand, q as HMGetCommand, r as HScanCommand, s as HStrLenCommand, t as HValsCommand, I as IncrCommand, u as IncrByCommand, v as IncrByFloatCommand, K as KeysCommand, L as LIndexCommand, w as LLenCommand, x as LPopCommand, N as NonEmptyArray, y as LRangeCommand, z as LTrimCommand, M as MGetCommand, P as PersistCommand, J as PExpireCommand, O as PExpireAtCommand, Q as PingCommand, R as PTtlCommand, S as RenameCommand, T as RenameNXCommand, U as RPopCommand, V as ScanCommand, W as SCardCommand, X as SDiffCommand, Y as SDiffStoreCommand, Z as SetCommandOptions, _ as SetBitCommand, $ as SetRangeCommand, a0 as SInterCommand, a1 as SInterStoreCommand, a2 as SMembersCommand, a3 as SPopCommand, a4 as SRandMemberCommand, a5 as SScanCommand, a6 as StrLenCommand, a7 as SUnionCommand, a8 as SUnionStoreCommand, a9 as TouchCommand, aa as TtlCommand, ab as TypeCommand, ac as UnlinkCommand, ad as ScoreMember, ae as ZAddCommandOptions, af as ZAddCommandOptionsWithIncr, ag as ZCardCommand, ah as ZCountCommand, ai as ZInterStoreCommand, aj as ZLexCountCommand, ak as ZPopMaxCommand, al as ZPopMinCommand, am as ZRangeCommand, an as ZRemRangeByLexCommand, ao as ZRemRangeByRankCommand, ap as ZRemRangeByScoreCommand, aq as ZScanCommand, ar as ZUnionStoreCommand, as as Type } from './zunionstore-b38007ba';
2
- import { HttpClient } from './http';
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(...args: CommandArgs<typeof AppendCommand>): this;
67
- /**
68
- * @see https://redis.io/commands/bitcount
69
- */
70
- bitcount(...args: CommandArgs<typeof BitCountCommand>): this;
71
- /**
72
- * @see https://redis.io/commands/bitop
73
- */
74
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): this;
75
- bitop(op: "not", destinationKey: string, sourceKey: string): this;
76
- /**
77
- * @see https://redis.io/commands/bitpos
78
- */
79
- bitpos(...args: CommandArgs<typeof BitPosCommand>): this;
80
- /**
81
- * @see https://redis.io/commands/dbsize
82
- */
83
- dbsize(): this;
84
- /**
85
- * @see https://redis.io/commands/decr
86
- */
87
- decr(...args: CommandArgs<typeof DecrCommand>): this;
88
- /**
89
- * @see https://redis.io/commands/decrby
90
- */
91
- decrby(...args: CommandArgs<typeof DecrByCommand>): this;
92
- /**
93
- * @see https://redis.io/commands/del
94
- */
95
- del(...args: CommandArgs<typeof DelCommand>): this;
96
- /**
97
- * @see https://redis.io/commands/echo
98
- */
99
- echo(...args: CommandArgs<typeof EchoCommand>): this;
100
- /**
101
- * @see https://redis.io/commands/exists
102
- */
103
- exists(...args: CommandArgs<typeof ExistsCommand>): this;
104
- /**
105
- * @see https://redis.io/commands/expire
106
- */
107
- expire(...args: CommandArgs<typeof ExpireCommand>): this;
108
- /**
109
- * @see https://redis.io/commands/expireat
110
- */
111
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): this;
112
- /**
113
- * @see https://redis.io/commands/flushall
114
- */
115
- flushall(...args: CommandArgs<typeof FlushAllCommand>): this;
116
- /**
117
- * @see https://redis.io/commands/flushdb
118
- */
119
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): this;
120
- /**
121
- * @see https://redis.io/commands/get
122
- */
123
- get<TData>(...args: CommandArgs<typeof GetCommand>): this;
124
- /**
125
- * @see https://redis.io/commands/getbit
126
- */
127
- getbit(...args: CommandArgs<typeof GetBitCommand>): this;
128
- /**
129
- * @see https://redis.io/commands/getrange
130
- */
131
- getrange(...args: CommandArgs<typeof GetRangeCommand>): this;
132
- /**
133
- * @see https://redis.io/commands/getset
134
- */
135
- getset<TData>(key: string, value: TData): this;
136
- /**
137
- * @see https://redis.io/commands/hdel
138
- */
139
- hdel(...args: CommandArgs<typeof HDelCommand>): this;
140
- /**
141
- * @see https://redis.io/commands/hexists
142
- */
143
- hexists(...args: CommandArgs<typeof HExistsCommand>): this;
144
- /**
145
- * @see https://redis.io/commands/hget
146
- */
147
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): this;
148
- /**
149
- * @see https://redis.io/commands/hgetall
150
- */
151
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): this;
152
- /**
153
- * @see https://redis.io/commands/hincrby
154
- */
155
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): this;
156
- /**
157
- * @see https://redis.io/commands/hincrbyfloat
158
- */
159
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): this;
160
- /**
161
- * @see https://redis.io/commands/hkeys
162
- */
163
- hkeys(...args: CommandArgs<typeof HKeysCommand>): this;
164
- /**
165
- * @see https://redis.io/commands/hlen
166
- */
167
- hlen(...args: CommandArgs<typeof HLenCommand>): this;
168
- /**
169
- * @see https://redis.io/commands/hmget
170
- */
171
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): this;
172
- /**
173
- * @see https://redis.io/commands/hmset
174
- */
175
- hmset<TData>(key: string, kv: {
176
- [field: string]: TData;
177
- }): this;
178
- /**
179
- * @see https://redis.io/commands/hscan
180
- */
181
- hscan(...args: CommandArgs<typeof HScanCommand>): this;
182
- /**
183
- * @see https://redis.io/commands/hset
184
- */
185
- hset<TData>(key: string, kv: {
186
- [field: string]: TData;
187
- }): this;
188
- /**
189
- * @see https://redis.io/commands/hsetnx
190
- */
191
- hsetnx<TData>(key: string, field: string, value: TData): this;
192
- /**
193
- * @see https://redis.io/commands/hstrlen
194
- */
195
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): this;
196
- /**
197
- * @see https://redis.io/commands/hvals
198
- */
199
- hvals(...args: CommandArgs<typeof HValsCommand>): this;
200
- /**
201
- * @see https://redis.io/commands/incr
202
- */
203
- incr(...args: CommandArgs<typeof IncrCommand>): this;
204
- /**
205
- * @see https://redis.io/commands/incrby
206
- */
207
- incrby(...args: CommandArgs<typeof IncrByCommand>): this;
208
- /**
209
- * @see https://redis.io/commands/incrbyfloat
210
- */
211
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): this;
212
- /**
213
- * @see https://redis.io/commands/keys
214
- */
215
- keys(...args: CommandArgs<typeof KeysCommand>): this;
216
- /**
217
- * @see https://redis.io/commands/lindex
218
- */
219
- lindex(...args: CommandArgs<typeof LIndexCommand>): this;
220
- /**
221
- * @see https://redis.io/commands/linsert
222
- */
223
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): this;
224
- /**
225
- * @see https://redis.io/commands/llen
226
- */
227
- llen(...args: CommandArgs<typeof LLenCommand>): this;
228
- /**
229
- * @see https://redis.io/commands/lpop
230
- */
231
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): this;
232
- /**
233
- * @see https://redis.io/commands/lpush
234
- */
235
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
236
- /**
237
- * @see https://redis.io/commands/lpushx
238
- */
239
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
240
- /**
241
- * @see https://redis.io/commands/lrange
242
- */
243
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): this;
244
- /**
245
- * @see https://redis.io/commands/lrem
246
- */
247
- lrem<TData>(key: string, count: number, value: TData): this;
248
- /**
249
- * @see https://redis.io/commands/lset
250
- */
251
- lset<TData>(key: string, value: TData, index: number): this;
252
- /**
253
- * @see https://redis.io/commands/ltrim
254
- */
255
- ltrim(...args: CommandArgs<typeof LTrimCommand>): this;
256
- /**
257
- * @see https://redis.io/commands/mget
258
- */
259
- mget<TData extends [unknown, ...unknown[]]>(...args: CommandArgs<typeof MGetCommand>): this;
260
- /**
261
- * @see https://redis.io/commands/mset
262
- */
263
- mset<TData>(kv: {
264
- [key: string]: TData;
265
- }): this;
266
- /**
267
- * @see https://redis.io/commands/msetnx
268
- */
269
- msetnx<TData>(kv: {
270
- [key: string]: TData;
271
- }): this;
272
- /**
273
- * @see https://redis.io/commands/persist
274
- */
275
- persist(...args: CommandArgs<typeof PersistCommand>): this;
276
- /**
277
- * @see https://redis.io/commands/pexpire
278
- */
279
- pexpire(...args: CommandArgs<typeof PExpireCommand>): this;
280
- /**
281
- * @see https://redis.io/commands/pexpireat
282
- */
283
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): this;
284
- /**
285
- * @see https://redis.io/commands/ping
286
- */
287
- ping(...args: CommandArgs<typeof PingCommand>): this;
288
- /**
289
- * @see https://redis.io/commands/psetex
290
- */
291
- psetex<TData>(key: string, ttl: number, value: TData): this;
292
- /**
293
- * @see https://redis.io/commands/pttl
294
- */
295
- pttl(...args: CommandArgs<typeof PTtlCommand>): this;
296
- /**
297
- * @see https://redis.io/commands/randomkey
298
- */
299
- randomkey(): this;
300
- /**
301
- * @see https://redis.io/commands/rename
302
- */
303
- rename(...args: CommandArgs<typeof RenameCommand>): this;
304
- /**
305
- * @see https://redis.io/commands/renamenx
306
- */
307
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): this;
308
- /**
309
- * @see https://redis.io/commands/rpop
310
- */
311
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): this;
312
- /**
313
- * @see https://redis.io/commands/rpush
314
- */
315
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
316
- /**
317
- * @see https://redis.io/commands/rpushx
318
- */
319
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
320
- /**
321
- * @see https://redis.io/commands/sadd
322
- */
323
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): this;
324
- /**
325
- * @see https://redis.io/commands/scan
326
- */
327
- scan(...args: CommandArgs<typeof ScanCommand>): this;
328
- /**
329
- * @see https://redis.io/commands/scard
330
- */
331
- scard(...args: CommandArgs<typeof SCardCommand>): this;
332
- /**
333
- * @see https://redis.io/commands/sdiff
334
- */
335
- sdiff(...args: CommandArgs<typeof SDiffCommand>): this;
336
- /**
337
- * @see https://redis.io/commands/sdiffstore
338
- */
339
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): this;
340
- /**
341
- * @see https://redis.io/commands/set
342
- */
343
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): this;
344
- /**
345
- * @see https://redis.io/commands/setbit
346
- */
347
- setbit(...args: CommandArgs<typeof SetBitCommand>): this;
348
- /**
349
- * @see https://redis.io/commands/setex
350
- */
351
- setex<TData>(key: string, ttl: number, value: TData): this;
352
- /**
353
- * @see https://redis.io/commands/setnx
354
- */
355
- setnx<TData>(key: string, value: TData): this;
356
- /**
357
- * @see https://redis.io/commands/setrange
358
- */
359
- setrange(...args: CommandArgs<typeof SetRangeCommand>): this;
360
- /**
361
- * @see https://redis.io/commands/sinter
362
- */
363
- sinter(...args: CommandArgs<typeof SInterCommand>): this;
364
- /**
365
- * @see https://redis.io/commands/sinterstore
366
- */
367
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): this;
368
- /**
369
- * @see https://redis.io/commands/sismember
370
- */
371
- sismember<TData>(key: string, member: TData): this;
372
- /**
373
- * @see https://redis.io/commands/smembers
374
- */
375
- smembers(...args: CommandArgs<typeof SMembersCommand>): this;
376
- /**
377
- * @see https://redis.io/commands/smove
378
- */
379
- smove<TData>(source: string, destination: string, member: TData): this;
380
- /**
381
- * @see https://redis.io/commands/spop
382
- */
383
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): this;
384
- /**
385
- * @see https://redis.io/commands/srandmember
386
- */
387
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): this;
388
- /**
389
- * @see https://redis.io/commands/srem
390
- */
391
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
392
- /**
393
- * @see https://redis.io/commands/sscan
394
- */
395
- sscan(...args: CommandArgs<typeof SScanCommand>): this;
396
- /**
397
- * @see https://redis.io/commands/strlen
398
- */
399
- strlen(...args: CommandArgs<typeof StrLenCommand>): this;
400
- /**
401
- * @see https://redis.io/commands/sunion
402
- */
403
- sunion(...args: CommandArgs<typeof SUnionCommand>): this;
404
- /**
405
- * @see https://redis.io/commands/sunionstore
406
- */
407
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): this;
408
- /**
409
- * @see https://redis.io/commands/time
410
- */
411
- time(): this;
412
- /**
413
- * @see https://redis.io/commands/touch
414
- */
415
- touch(...args: CommandArgs<typeof TouchCommand>): this;
416
- /**
417
- * @see https://redis.io/commands/ttl
418
- */
419
- ttl(...args: CommandArgs<typeof TtlCommand>): this;
420
- /**
421
- * @see https://redis.io/commands/type
422
- */
423
- type(...args: CommandArgs<typeof TypeCommand>): this;
424
- /**
425
- * @see https://redis.io/commands/unlink
426
- */
427
- unlink(...args: CommandArgs<typeof UnlinkCommand>): this;
428
- /**
429
- * @see https://redis.io/commands/zadd
430
- */
431
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): this;
432
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): this;
433
- /**
434
- * @see https://redis.io/commands/zcard
435
- */
436
- zcard(...args: CommandArgs<typeof ZCardCommand>): this;
437
- /**
438
- * @see https://redis.io/commands/zcount
439
- */
440
- zcount(...args: CommandArgs<typeof ZCountCommand>): this;
441
- /**
442
- * @see https://redis.io/commands/zincrby
443
- */
444
- zincrby<TData>(key: string, increment: number, member: TData): this;
445
- /**
446
- * @see https://redis.io/commands/zinterstore
447
- */
448
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): this;
449
- /**
450
- * @see https://redis.io/commands/zlexcount
451
- */
452
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): this;
453
- /**
454
- * @see https://redis.io/commands/zpopmax
455
- */
456
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): this;
457
- /**
458
- * @see https://redis.io/commands/zpopmin
459
- */
460
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): this;
461
- /**
462
- * @see https://redis.io/commands/zrange
463
- */
464
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): this;
465
- /**
466
- * @see https://redis.io/commands/zrank
467
- */
468
- zrank<TData>(key: string, member: TData): this;
469
- /**
470
- * @see https://redis.io/commands/zrem
471
- */
472
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
473
- /**
474
- * @see https://redis.io/commands/zremrangebylex
475
- */
476
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): this;
477
- /**
478
- * @see https://redis.io/commands/zremrangebyrank
479
- */
480
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): this;
481
- /**
482
- * @see https://redis.io/commands/zremrangebyscore
483
- */
484
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): this;
485
- /**
486
- * @see https://redis.io/commands/zrevrank
487
- */
488
- zrevrank<TData>(key: string, member: TData): this;
489
- /**
490
- * @see https://redis.io/commands/zscan
491
- */
492
- zscan(...args: CommandArgs<typeof ZScanCommand>): this;
493
- /**
494
- * @see https://redis.io/commands/zscore
495
- */
496
- zscore<TData>(key: string, member: TData): this;
497
- /**
498
- * @see https://redis.io/commands/zunionstore
499
- */
500
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): this;
501
- }
502
-
503
- /**
504
- * Serverless redis client for upstash.
505
- */
506
- declare class Redis {
507
- private readonly client;
508
- /**
509
- * Create a new redis client
510
- *
511
- * @example
512
- * ```typescript
513
- * const redis = new Redis({
514
- * url: "<UPSTASH_REDIS_REST_URL>",
515
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
516
- * });
517
- * ```
518
- */
519
- constructor(client: HttpClient);
520
- /**
521
- * Create a new pipeline that allows you to send requests in bulk.
522
- *
523
- * @see {@link Pipeline}
524
- */
525
- pipeline(): Pipeline;
526
- /**
527
- * @see https://redis.io/commands/append
528
- */
529
- append(...args: CommandArgs<typeof AppendCommand>): Promise<number>;
530
- /**
531
- * @see https://redis.io/commands/bitcount
532
- */
533
- bitcount(...args: CommandArgs<typeof BitCountCommand>): Promise<number>;
534
- /**
535
- * @see https://redis.io/commands/bitop
536
- */
537
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
538
- bitop(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
539
- /**
540
- * @see https://redis.io/commands/bitpos
541
- */
542
- bitpos(...args: CommandArgs<typeof BitPosCommand>): Promise<number>;
543
- /**
544
- * @see https://redis.io/commands/dbsize
545
- */
546
- dbsize(): Promise<number>;
547
- /**
548
- * @see https://redis.io/commands/decr
549
- */
550
- decr(...args: CommandArgs<typeof DecrCommand>): Promise<number>;
551
- /**
552
- * @see https://redis.io/commands/decrby
553
- */
554
- decrby(...args: CommandArgs<typeof DecrByCommand>): Promise<number>;
555
- /**
556
- * @see https://redis.io/commands/del
557
- */
558
- del(...args: CommandArgs<typeof DelCommand>): Promise<number>;
559
- /**
560
- * @see https://redis.io/commands/echo
561
- */
562
- echo(...args: CommandArgs<typeof EchoCommand>): Promise<string>;
563
- /**
564
- * @see https://redis.io/commands/exists
565
- */
566
- exists(...args: CommandArgs<typeof ExistsCommand>): Promise<0 | 1>;
567
- /**
568
- * @see https://redis.io/commands/expire
569
- */
570
- expire(...args: CommandArgs<typeof ExpireCommand>): Promise<0 | 1>;
571
- /**
572
- * @see https://redis.io/commands/expireat
573
- */
574
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): Promise<0 | 1>;
575
- /**
576
- * @see https://redis.io/commands/flushall
577
- */
578
- flushall(...args: CommandArgs<typeof FlushAllCommand>): Promise<"OK">;
579
- /**
580
- * @see https://redis.io/commands/flushdb
581
- */
582
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): Promise<"OK">;
583
- /**
584
- * @see https://redis.io/commands/get
585
- */
586
- get<TData>(...args: CommandArgs<typeof GetCommand>): Promise<TData | null>;
587
- /**
588
- * @see https://redis.io/commands/getbit
589
- */
590
- getbit(...args: CommandArgs<typeof GetBitCommand>): Promise<0 | 1>;
591
- /**
592
- * @see https://redis.io/commands/getrange
593
- */
594
- getrange(...args: CommandArgs<typeof GetRangeCommand>): Promise<string>;
595
- /**
596
- * @see https://redis.io/commands/getset
597
- */
598
- getset<TData>(key: string, value: TData): Promise<TData | null>;
599
- /**
600
- * @see https://redis.io/commands/hdel
601
- */
602
- hdel(...args: CommandArgs<typeof HDelCommand>): Promise<0 | 1>;
603
- /**
604
- * @see https://redis.io/commands/hexists
605
- */
606
- hexists(...args: CommandArgs<typeof HExistsCommand>): Promise<number>;
607
- /**
608
- * @see https://redis.io/commands/hget
609
- */
610
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): Promise<TData | null>;
611
- /**
612
- * @see https://redis.io/commands/hgetall
613
- */
614
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): Promise<TData | null>;
615
- /**
616
- * @see https://redis.io/commands/hincrby
617
- */
618
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): Promise<number>;
619
- /**
620
- * @see https://redis.io/commands/hincrbyfloat
621
- */
622
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): Promise<number>;
623
- /**
624
- * @see https://redis.io/commands/hkeys
625
- */
626
- hkeys(...args: CommandArgs<typeof HKeysCommand>): Promise<string[]>;
627
- /**
628
- * @see https://redis.io/commands/hlen
629
- */
630
- hlen(...args: CommandArgs<typeof HLenCommand>): Promise<number>;
631
- /**
632
- * @see https://redis.io/commands/hmget
633
- */
634
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): Promise<TData | null>;
635
- /**
636
- * @see https://redis.io/commands/hmset
637
- */
638
- hmset<TData>(key: string, kv: {
639
- [field: string]: TData;
640
- }): Promise<number>;
641
- /**
642
- * @see https://redis.io/commands/hscan
643
- */
644
- hscan(...args: CommandArgs<typeof HScanCommand>): Promise<[number, (string | number)[]]>;
645
- /**
646
- * @see https://redis.io/commands/hset
647
- */
648
- hset<TData>(key: string, kv: {
649
- [field: string]: TData;
650
- }): Promise<number>;
651
- /**
652
- * @see https://redis.io/commands/hsetnx
653
- */
654
- hsetnx<TData>(key: string, field: string, value: TData): Promise<0 | 1>;
655
- /**
656
- * @see https://redis.io/commands/hstrlen
657
- */
658
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): Promise<number>;
659
- /**
660
- * @see https://redis.io/commands/hvals
661
- */
662
- hvals(...args: CommandArgs<typeof HValsCommand>): Promise<unknown[]>;
663
- /**
664
- * @see https://redis.io/commands/incr
665
- */
666
- incr(...args: CommandArgs<typeof IncrCommand>): Promise<number>;
667
- /**
668
- * @see https://redis.io/commands/incrby
669
- */
670
- incrby(...args: CommandArgs<typeof IncrByCommand>): Promise<number>;
671
- /**
672
- * @see https://redis.io/commands/incrbyfloat
673
- */
674
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): Promise<number>;
675
- /**
676
- * @see https://redis.io/commands/keys
677
- */
678
- keys(...args: CommandArgs<typeof KeysCommand>): Promise<string[]>;
679
- /**
680
- * @see https://redis.io/commands/lindex
681
- */
682
- lindex(...args: CommandArgs<typeof LIndexCommand>): Promise<string | null>;
683
- /**
684
- * @see https://redis.io/commands/linsert
685
- */
686
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): Promise<number>;
687
- /**
688
- * @see https://redis.io/commands/llen
689
- */
690
- llen(...args: CommandArgs<typeof LLenCommand>): Promise<number>;
691
- /**
692
- * @see https://redis.io/commands/lpop
693
- */
694
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): Promise<TData | null>;
695
- /**
696
- * @see https://redis.io/commands/lpush
697
- */
698
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
699
- /**
700
- * @see https://redis.io/commands/lpushx
701
- */
702
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
703
- /**
704
- * @see https://redis.io/commands/lrange
705
- */
706
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): Promise<TResult[]>;
707
- /**
708
- * @see https://redis.io/commands/lrem
709
- */
710
- lrem<TData>(key: string, count: number, value: TData): Promise<number>;
711
- /**
712
- * @see https://redis.io/commands/lset
713
- */
714
- lset<TData>(key: string, value: TData, index: number): Promise<"OK">;
715
- /**
716
- * @see https://redis.io/commands/ltrim
717
- */
718
- ltrim(...args: CommandArgs<typeof LTrimCommand>): Promise<"OK">;
719
- /**
720
- * @see https://redis.io/commands/mget
721
- */
722
- mget<TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>): Promise<TData>;
723
- /**
724
- * @see https://redis.io/commands/mset
725
- */
726
- mset<TData>(kv: {
727
- [key: string]: TData;
728
- }): Promise<"OK">;
729
- /**
730
- * @see https://redis.io/commands/msetnx
731
- */
732
- msetnx<TData>(kv: {
733
- [key: string]: TData;
734
- }): Promise<number>;
735
- /**
736
- * @see https://redis.io/commands/persist
737
- */
738
- persist(...args: CommandArgs<typeof PersistCommand>): Promise<0 | 1>;
739
- /**
740
- * @see https://redis.io/commands/pexpire
741
- */
742
- pexpire(...args: CommandArgs<typeof PExpireCommand>): Promise<0 | 1>;
743
- /**
744
- * @see https://redis.io/commands/pexpireat
745
- */
746
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): Promise<0 | 1>;
747
- /**
748
- * @see https://redis.io/commands/ping
749
- */
750
- ping(...args: CommandArgs<typeof PingCommand>): Promise<string>;
751
- /**
752
- * @see https://redis.io/commands/psetex
753
- */
754
- psetex<TData>(key: string, ttl: number, value: TData): Promise<string>;
755
- /**
756
- * @see https://redis.io/commands/pttl
757
- */
758
- pttl(...args: CommandArgs<typeof PTtlCommand>): Promise<number>;
759
- /**
760
- * @see https://redis.io/commands/randomkey
761
- */
762
- randomkey(): Promise<string | null>;
763
- /**
764
- * @see https://redis.io/commands/rename
765
- */
766
- rename(...args: CommandArgs<typeof RenameCommand>): Promise<"OK">;
767
- /**
768
- * @see https://redis.io/commands/renamenx
769
- */
770
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): Promise<0 | 1>;
771
- /**
772
- * @see https://redis.io/commands/rpop
773
- */
774
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): Promise<TData | null>;
775
- /**
776
- * @see https://redis.io/commands/rpush
777
- */
778
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
779
- /**
780
- * @see https://redis.io/commands/rpushx
781
- */
782
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
783
- /**
784
- * @see https://redis.io/commands/sadd
785
- */
786
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
787
- /**
788
- * @see https://redis.io/commands/scan
789
- */
790
- scan(...args: CommandArgs<typeof ScanCommand>): Promise<[number, string[]]>;
791
- /**
792
- * @see https://redis.io/commands/scard
793
- */
794
- scard(...args: CommandArgs<typeof SCardCommand>): Promise<number>;
795
- /**
796
- * @see https://redis.io/commands/sdiff
797
- */
798
- sdiff(...args: CommandArgs<typeof SDiffCommand>): Promise<unknown[]>;
799
- /**
800
- * @see https://redis.io/commands/sdiffstore
801
- */
802
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): Promise<number>;
803
- /**
804
- * @see https://redis.io/commands/set
805
- */
806
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): Promise<TData>;
807
- /**
808
- * @see https://redis.io/commands/setbit
809
- */
810
- setbit(...args: CommandArgs<typeof SetBitCommand>): Promise<0 | 1>;
811
- /**
812
- * @see https://redis.io/commands/setex
813
- */
814
- setex<TData>(key: string, ttl: number, value: TData): Promise<"OK">;
815
- /**
816
- * @see https://redis.io/commands/setnx
817
- */
818
- setnx<TData>(key: string, value: TData): Promise<number>;
819
- /**
820
- * @see https://redis.io/commands/setrange
821
- */
822
- setrange(...args: CommandArgs<typeof SetRangeCommand>): Promise<number>;
823
- /**
824
- * @see https://redis.io/commands/sinter
825
- */
826
- sinter(...args: CommandArgs<typeof SInterCommand>): Promise<string[]>;
827
- /**
828
- * @see https://redis.io/commands/sinterstore
829
- */
830
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): Promise<string[]>;
831
- /**
832
- * @see https://redis.io/commands/sismember
833
- */
834
- sismember<TData>(key: string, member: TData): Promise<0 | 1>;
835
- /**
836
- * @see https://redis.io/commands/smembers
837
- */
838
- smembers(...args: CommandArgs<typeof SMembersCommand>): Promise<string[]>;
839
- /**
840
- * @see https://redis.io/commands/smove
841
- */
842
- smove<TData>(source: string, destination: string, member: TData): Promise<0 | 1>;
843
- /**
844
- * @see https://redis.io/commands/spop
845
- */
846
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): Promise<TData | null>;
847
- /**
848
- * @see https://redis.io/commands/srandmember
849
- */
850
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): Promise<TData | null>;
851
- /**
852
- * @see https://redis.io/commands/srem
853
- */
854
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
855
- /**
856
- * @see https://redis.io/commands/sscan
857
- */
858
- sscan(...args: CommandArgs<typeof SScanCommand>): Promise<[number, (string | number)[]]>;
859
- /**
860
- * @see https://redis.io/commands/strlen
861
- */
862
- strlen(...args: CommandArgs<typeof StrLenCommand>): Promise<number>;
863
- /**
864
- * @see https://redis.io/commands/sunion
865
- */
866
- sunion(...args: CommandArgs<typeof SUnionCommand>): Promise<unknown[]>;
867
- /**
868
- * @see https://redis.io/commands/sunionstore
869
- */
870
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): Promise<number>;
871
- /**
872
- * @see https://redis.io/commands/time
873
- */
874
- time(): Promise<[number, number]>;
875
- /**
876
- * @see https://redis.io/commands/touch
877
- */
878
- touch(...args: CommandArgs<typeof TouchCommand>): Promise<number>;
879
- /**
880
- * @see https://redis.io/commands/ttl
881
- */
882
- ttl(...args: CommandArgs<typeof TtlCommand>): Promise<number>;
883
- /**
884
- * @see https://redis.io/commands/type
885
- */
886
- type(...args: CommandArgs<typeof TypeCommand>): Promise<Type>;
887
- /**
888
- * @see https://redis.io/commands/unlink
889
- */
890
- unlink(...args: CommandArgs<typeof UnlinkCommand>): Promise<number>;
891
- /**
892
- * @see https://redis.io/commands/zadd
893
- */
894
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): Promise<number | null>;
895
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): Promise<number | null>;
896
- /**
897
- * @see https://redis.io/commands/zcard
898
- */
899
- zcard(...args: CommandArgs<typeof ZCardCommand>): Promise<number>;
900
- /**
901
- * @see https://redis.io/commands/zcount
902
- */
903
- zcount(...args: CommandArgs<typeof ZCountCommand>): Promise<number>;
904
- /**
905
- * @see https://redis.io/commands/zincrby
906
- */
907
- zincrby<TData>(key: string, increment: number, member: TData): Promise<number>;
908
- /**
909
- * @see https://redis.io/commands/zinterstore
910
- */
911
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): Promise<number>;
912
- /**
913
- * @see https://redis.io/commands/zlexcount
914
- */
915
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): Promise<number>;
916
- /**
917
- * @see https://redis.io/commands/zpopmax
918
- */
919
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): Promise<TData[]>;
920
- /**
921
- * @see https://redis.io/commands/zpopmin
922
- */
923
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): Promise<TData[]>;
924
- /**
925
- * @see https://redis.io/commands/zrange
926
- */
927
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): Promise<TData>;
928
- /**
929
- * @see https://redis.io/commands/zrank
930
- */
931
- zrank<TData>(key: string, member: TData): Promise<number | null>;
932
- /**
933
- * @see https://redis.io/commands/zrem
934
- */
935
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
936
- /**
937
- * @see https://redis.io/commands/zremrangebylex
938
- */
939
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): Promise<number>;
940
- /**
941
- * @see https://redis.io/commands/zremrangebyrank
942
- */
943
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): Promise<number>;
944
- /**
945
- * @see https://redis.io/commands/zremrangebyscore
946
- */
947
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): Promise<number>;
948
- /**
949
- * @see https://redis.io/commands/zrevrank
950
- */
951
- zrevrank<TData>(key: string, member: TData): Promise<number | null>;
952
- /**
953
- * @see https://redis.io/commands/zscan
954
- */
955
- zscan(...args: CommandArgs<typeof ZScanCommand>): Promise<[number, (string | number)[]]>;
956
- /**
957
- * @see https://redis.io/commands/zscore
958
- */
959
- zscore<TData>(key: string, member: TData): Promise<number | null>;
960
- /**
961
- * @see https://redis.io/commands/zunionstore
962
- */
963
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): Promise<number>;
964
- }
965
-
966
- export { Redis as R };