@upstash/redis 0.0.0-ci.e256825f-20221010 → 0.0.0-ci.e324d5dd9db98bf4611f7190776163206dd8603d-20231214093347

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