@upstash/redis 0.0.0-ci.d6b2e753-20220903 → 0.0.0-ci.d8fb1ea41777a410b4cc4d3c1600060c679011e5-20240222001521

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