@upstash/redis 0.0.0-ci.fb6b986f-20221006 → 0.0.0-ci.fbead4fb2ed281bdc04ec90c263e6380eed1465b-20251021062126

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