@upstash/redis 0.0.0-ci.e730ad54-20220901 → 0.0.0-ci.ea9f0853d6a86e6b7809a21bff609de1b6e9291d-20250414063537

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