@upstash/redis 0.0.0-ci.ec2c4106-20221122 → 0.0.0-ci.ec86feafac6d95eed4e9c9d8a5ff13b74ed84a74-20240709145745

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