@upstash/redis 0.0.0-ci.f407f833 → 0.0.0-ci.f52b150f2e17f627c36bc1dfa652992a3ede2b79-20231109104625

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