@upstash/redis 0.0.0-ci.5cd8bd7f → 0.0.0-ci.5da71b2bbb6ee7025e3f1db712c4585b61626ce8-20231213092254

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 (395) hide show
  1. package/README.md +54 -283
  2. package/chunk-6W57BHS3.mjs +1 -0
  3. package/chunk-OZYIILNU.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 -90
  17. package/zmscore-69ffc39c.d.ts +3157 -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/lpush.js +0 -9
  65. package/esm/pkg/commands/lpushx.js +0 -9
  66. package/esm/pkg/commands/lrange.js +0 -6
  67. package/esm/pkg/commands/lrem.js +0 -6
  68. package/esm/pkg/commands/lset.js +0 -6
  69. package/esm/pkg/commands/ltrim.js +0 -6
  70. package/esm/pkg/commands/mget.js +0 -9
  71. package/esm/pkg/commands/mod.js +0 -114
  72. package/esm/pkg/commands/mset.js +0 -12
  73. package/esm/pkg/commands/msetnx.js +0 -9
  74. package/esm/pkg/commands/persist.js +0 -9
  75. package/esm/pkg/commands/pexpire.js +0 -9
  76. package/esm/pkg/commands/pexpireat.js +0 -9
  77. package/esm/pkg/commands/ping.js +0 -13
  78. package/esm/pkg/commands/psetex.js +0 -9
  79. package/esm/pkg/commands/pttl.js +0 -9
  80. package/esm/pkg/commands/publish.js +0 -9
  81. package/esm/pkg/commands/randomkey.js +0 -9
  82. package/esm/pkg/commands/rename.js +0 -9
  83. package/esm/pkg/commands/renamenx.js +0 -9
  84. package/esm/pkg/commands/rpop.js +0 -9
  85. package/esm/pkg/commands/rpush.js +0 -9
  86. package/esm/pkg/commands/rpushx.js +0 -9
  87. package/esm/pkg/commands/sadd.js +0 -9
  88. package/esm/pkg/commands/scan.js +0 -16
  89. package/esm/pkg/commands/scard.js +0 -9
  90. package/esm/pkg/commands/script_exists.js +0 -21
  91. package/esm/pkg/commands/script_flush.js +0 -16
  92. package/esm/pkg/commands/script_load.js +0 -9
  93. package/esm/pkg/commands/sdiff.js +0 -9
  94. package/esm/pkg/commands/sdiffstore.js +0 -9
  95. package/esm/pkg/commands/set.js +0 -24
  96. package/esm/pkg/commands/setbit.js +0 -9
  97. package/esm/pkg/commands/setex.js +0 -9
  98. package/esm/pkg/commands/setnx.js +0 -9
  99. package/esm/pkg/commands/setrange.js +0 -9
  100. package/esm/pkg/commands/sinter.js +0 -9
  101. package/esm/pkg/commands/sinterstore.js +0 -9
  102. package/esm/pkg/commands/sismember.js +0 -9
  103. package/esm/pkg/commands/smembers.js +0 -9
  104. package/esm/pkg/commands/smove.js +0 -9
  105. package/esm/pkg/commands/spop.js +0 -13
  106. package/esm/pkg/commands/srandmember.js +0 -13
  107. package/esm/pkg/commands/srem.js +0 -9
  108. package/esm/pkg/commands/sscan.js +0 -16
  109. package/esm/pkg/commands/strlen.js +0 -9
  110. package/esm/pkg/commands/sunion.js +0 -9
  111. package/esm/pkg/commands/sunionstore.js +0 -9
  112. package/esm/pkg/commands/time.js +0 -9
  113. package/esm/pkg/commands/touch.js +0 -9
  114. package/esm/pkg/commands/ttl.js +0 -9
  115. package/esm/pkg/commands/type.js +0 -9
  116. package/esm/pkg/commands/unlink.js +0 -9
  117. package/esm/pkg/commands/zadd.js +0 -26
  118. package/esm/pkg/commands/zcard.js +0 -9
  119. package/esm/pkg/commands/zcount.js +0 -9
  120. package/esm/pkg/commands/zincrby.js +0 -9
  121. package/esm/pkg/commands/zinterstore.js +0 -27
  122. package/esm/pkg/commands/zlexcount.js +0 -9
  123. package/esm/pkg/commands/zpopmax.js +0 -13
  124. package/esm/pkg/commands/zpopmin.js +0 -13
  125. package/esm/pkg/commands/zrange.js +0 -20
  126. package/esm/pkg/commands/zrank.js +0 -9
  127. package/esm/pkg/commands/zrem.js +0 -9
  128. package/esm/pkg/commands/zremrangebylex.js +0 -9
  129. package/esm/pkg/commands/zremrangebyrank.js +0 -9
  130. package/esm/pkg/commands/zremrangebyscore.js +0 -9
  131. package/esm/pkg/commands/zrevrank.js +0 -9
  132. package/esm/pkg/commands/zscan.js +0 -16
  133. package/esm/pkg/commands/zscore.js +0 -9
  134. package/esm/pkg/commands/zunionstore.js +0 -27
  135. package/esm/pkg/error.js +0 -9
  136. package/esm/pkg/http.js +0 -49
  137. package/esm/pkg/pipeline.js +0 -1125
  138. package/esm/pkg/redis.js +0 -1067
  139. package/esm/pkg/types.js +0 -1
  140. package/esm/pkg/util.js +0 -31
  141. package/esm/platforms/cloudflare.js +0 -82
  142. package/esm/platforms/fastly.js +0 -61
  143. package/esm/platforms/node_with_fetch.js +0 -81
  144. package/esm/platforms/nodejs.js +0 -80
  145. package/script/package.json +0 -3
  146. package/script/pkg/commands/append.js +0 -13
  147. package/script/pkg/commands/bitcount.js +0 -20
  148. package/script/pkg/commands/bitop.js +0 -13
  149. package/script/pkg/commands/bitpos.js +0 -13
  150. package/script/pkg/commands/command.js +0 -61
  151. package/script/pkg/commands/dbsize.js +0 -13
  152. package/script/pkg/commands/decr.js +0 -13
  153. package/script/pkg/commands/decrby.js +0 -13
  154. package/script/pkg/commands/del.js +0 -13
  155. package/script/pkg/commands/echo.js +0 -13
  156. package/script/pkg/commands/eval.js +0 -13
  157. package/script/pkg/commands/evalsha.js +0 -13
  158. package/script/pkg/commands/exists.js +0 -13
  159. package/script/pkg/commands/expire.js +0 -13
  160. package/script/pkg/commands/expireat.js +0 -13
  161. package/script/pkg/commands/flushall.js +0 -17
  162. package/script/pkg/commands/flushdb.js +0 -17
  163. package/script/pkg/commands/get.js +0 -13
  164. package/script/pkg/commands/getbit.js +0 -13
  165. package/script/pkg/commands/getrange.js +0 -13
  166. package/script/pkg/commands/getset.js +0 -13
  167. package/script/pkg/commands/hdel.js +0 -13
  168. package/script/pkg/commands/hexists.js +0 -13
  169. package/script/pkg/commands/hget.js +0 -13
  170. package/script/pkg/commands/hgetall.js +0 -37
  171. package/script/pkg/commands/hincrby.js +0 -13
  172. package/script/pkg/commands/hincrbyfloat.js +0 -13
  173. package/script/pkg/commands/hkeys.js +0 -13
  174. package/script/pkg/commands/hlen.js +0 -13
  175. package/script/pkg/commands/hmget.js +0 -39
  176. package/script/pkg/commands/hmset.js +0 -17
  177. package/script/pkg/commands/hscan.js +0 -20
  178. package/script/pkg/commands/hset.js +0 -17
  179. package/script/pkg/commands/hsetnx.js +0 -13
  180. package/script/pkg/commands/hstrlen.js +0 -13
  181. package/script/pkg/commands/hvals.js +0 -13
  182. package/script/pkg/commands/incr.js +0 -13
  183. package/script/pkg/commands/incrby.js +0 -13
  184. package/script/pkg/commands/incrbyfloat.js +0 -13
  185. package/script/pkg/commands/keys.js +0 -13
  186. package/script/pkg/commands/lindex.js +0 -10
  187. package/script/pkg/commands/linsert.js +0 -10
  188. package/script/pkg/commands/llen.js +0 -13
  189. package/script/pkg/commands/lpop.js +0 -13
  190. package/script/pkg/commands/lpush.js +0 -13
  191. package/script/pkg/commands/lpushx.js +0 -13
  192. package/script/pkg/commands/lrange.js +0 -10
  193. package/script/pkg/commands/lrem.js +0 -10
  194. package/script/pkg/commands/lset.js +0 -10
  195. package/script/pkg/commands/ltrim.js +0 -10
  196. package/script/pkg/commands/mget.js +0 -13
  197. package/script/pkg/commands/mod.js +0 -130
  198. package/script/pkg/commands/mset.js +0 -16
  199. package/script/pkg/commands/msetnx.js +0 -13
  200. package/script/pkg/commands/persist.js +0 -13
  201. package/script/pkg/commands/pexpire.js +0 -13
  202. package/script/pkg/commands/pexpireat.js +0 -13
  203. package/script/pkg/commands/ping.js +0 -17
  204. package/script/pkg/commands/psetex.js +0 -13
  205. package/script/pkg/commands/pttl.js +0 -13
  206. package/script/pkg/commands/publish.js +0 -13
  207. package/script/pkg/commands/randomkey.js +0 -13
  208. package/script/pkg/commands/rename.js +0 -13
  209. package/script/pkg/commands/renamenx.js +0 -13
  210. package/script/pkg/commands/rpop.js +0 -13
  211. package/script/pkg/commands/rpush.js +0 -13
  212. package/script/pkg/commands/rpushx.js +0 -13
  213. package/script/pkg/commands/sadd.js +0 -13
  214. package/script/pkg/commands/scan.js +0 -20
  215. package/script/pkg/commands/scard.js +0 -13
  216. package/script/pkg/commands/script_exists.js +0 -25
  217. package/script/pkg/commands/script_flush.js +0 -20
  218. package/script/pkg/commands/script_load.js +0 -13
  219. package/script/pkg/commands/sdiff.js +0 -13
  220. package/script/pkg/commands/sdiffstore.js +0 -13
  221. package/script/pkg/commands/set.js +0 -28
  222. package/script/pkg/commands/setbit.js +0 -13
  223. package/script/pkg/commands/setex.js +0 -13
  224. package/script/pkg/commands/setnx.js +0 -13
  225. package/script/pkg/commands/setrange.js +0 -13
  226. package/script/pkg/commands/sinter.js +0 -13
  227. package/script/pkg/commands/sinterstore.js +0 -13
  228. package/script/pkg/commands/sismember.js +0 -13
  229. package/script/pkg/commands/smembers.js +0 -13
  230. package/script/pkg/commands/smove.js +0 -13
  231. package/script/pkg/commands/spop.js +0 -17
  232. package/script/pkg/commands/srandmember.js +0 -17
  233. package/script/pkg/commands/srem.js +0 -13
  234. package/script/pkg/commands/sscan.js +0 -20
  235. package/script/pkg/commands/strlen.js +0 -13
  236. package/script/pkg/commands/sunion.js +0 -13
  237. package/script/pkg/commands/sunionstore.js +0 -13
  238. package/script/pkg/commands/time.js +0 -13
  239. package/script/pkg/commands/touch.js +0 -13
  240. package/script/pkg/commands/ttl.js +0 -13
  241. package/script/pkg/commands/type.js +0 -13
  242. package/script/pkg/commands/unlink.js +0 -13
  243. package/script/pkg/commands/zadd.js +0 -30
  244. package/script/pkg/commands/zcard.js +0 -13
  245. package/script/pkg/commands/zcount.js +0 -13
  246. package/script/pkg/commands/zincrby.js +0 -13
  247. package/script/pkg/commands/zinterstore.js +0 -31
  248. package/script/pkg/commands/zlexcount.js +0 -13
  249. package/script/pkg/commands/zpopmax.js +0 -17
  250. package/script/pkg/commands/zpopmin.js +0 -17
  251. package/script/pkg/commands/zrange.js +0 -24
  252. package/script/pkg/commands/zrank.js +0 -13
  253. package/script/pkg/commands/zrem.js +0 -13
  254. package/script/pkg/commands/zremrangebylex.js +0 -13
  255. package/script/pkg/commands/zremrangebyrank.js +0 -13
  256. package/script/pkg/commands/zremrangebyscore.js +0 -13
  257. package/script/pkg/commands/zrevrank.js +0 -13
  258. package/script/pkg/commands/zscan.js +0 -20
  259. package/script/pkg/commands/zscore.js +0 -13
  260. package/script/pkg/commands/zunionstore.js +0 -31
  261. package/script/pkg/error.js +0 -13
  262. package/script/pkg/http.js +0 -53
  263. package/script/pkg/pipeline.js +0 -1129
  264. package/script/pkg/redis.js +0 -1071
  265. package/script/pkg/types.js +0 -2
  266. package/script/pkg/util.js +0 -35
  267. package/script/platforms/cloudflare.js +0 -109
  268. package/script/platforms/fastly.js +0 -88
  269. package/script/platforms/node_with_fetch.js +0 -108
  270. package/script/platforms/nodejs.js +0 -107
  271. package/types/pkg/commands/append.d.ts +0 -7
  272. package/types/pkg/commands/bitcount.d.ts +0 -8
  273. package/types/pkg/commands/bitop.d.ts +0 -13
  274. package/types/pkg/commands/bitpos.d.ts +0 -7
  275. package/types/pkg/commands/command.d.ts +0 -37
  276. package/types/pkg/commands/dbsize.d.ts +0 -7
  277. package/types/pkg/commands/decr.d.ts +0 -7
  278. package/types/pkg/commands/decrby.d.ts +0 -7
  279. package/types/pkg/commands/del.d.ts +0 -7
  280. package/types/pkg/commands/echo.d.ts +0 -7
  281. package/types/pkg/commands/eval.d.ts +0 -7
  282. package/types/pkg/commands/evalsha.d.ts +0 -7
  283. package/types/pkg/commands/exists.d.ts +0 -7
  284. package/types/pkg/commands/expire.d.ts +0 -7
  285. package/types/pkg/commands/expireat.d.ts +0 -7
  286. package/types/pkg/commands/flushall.d.ts +0 -9
  287. package/types/pkg/commands/flushdb.d.ts +0 -9
  288. package/types/pkg/commands/get.d.ts +0 -7
  289. package/types/pkg/commands/getbit.d.ts +0 -7
  290. package/types/pkg/commands/getrange.d.ts +0 -7
  291. package/types/pkg/commands/getset.d.ts +0 -7
  292. package/types/pkg/commands/hdel.d.ts +0 -7
  293. package/types/pkg/commands/hexists.d.ts +0 -7
  294. package/types/pkg/commands/hget.d.ts +0 -7
  295. package/types/pkg/commands/hgetall.d.ts +0 -7
  296. package/types/pkg/commands/hincrby.d.ts +0 -7
  297. package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
  298. package/types/pkg/commands/hkeys.d.ts +0 -7
  299. package/types/pkg/commands/hlen.d.ts +0 -7
  300. package/types/pkg/commands/hmget.d.ts +0 -15
  301. package/types/pkg/commands/hmset.d.ts +0 -9
  302. package/types/pkg/commands/hscan.d.ts +0 -24
  303. package/types/pkg/commands/hset.d.ts +0 -9
  304. package/types/pkg/commands/hsetnx.d.ts +0 -7
  305. package/types/pkg/commands/hstrlen.d.ts +0 -7
  306. package/types/pkg/commands/hvals.d.ts +0 -7
  307. package/types/pkg/commands/incr.d.ts +0 -7
  308. package/types/pkg/commands/incrby.d.ts +0 -7
  309. package/types/pkg/commands/incrbyfloat.d.ts +0 -7
  310. package/types/pkg/commands/keys.d.ts +0 -7
  311. package/types/pkg/commands/lindex.d.ts +0 -4
  312. package/types/pkg/commands/linsert.d.ts +0 -9
  313. package/types/pkg/commands/llen.d.ts +0 -7
  314. package/types/pkg/commands/lpop.d.ts +0 -7
  315. package/types/pkg/commands/lpush.d.ts +0 -7
  316. package/types/pkg/commands/lpushx.d.ts +0 -7
  317. package/types/pkg/commands/lrange.d.ts +0 -4
  318. package/types/pkg/commands/lrem.d.ts +0 -4
  319. package/types/pkg/commands/lset.d.ts +0 -4
  320. package/types/pkg/commands/ltrim.d.ts +0 -4
  321. package/types/pkg/commands/mget.d.ts +0 -7
  322. package/types/pkg/commands/mod.d.ts +0 -114
  323. package/types/pkg/commands/mset.d.ts +0 -9
  324. package/types/pkg/commands/msetnx.d.ts +0 -9
  325. package/types/pkg/commands/persist.d.ts +0 -7
  326. package/types/pkg/commands/pexpire.d.ts +0 -7
  327. package/types/pkg/commands/pexpireat.d.ts +0 -7
  328. package/types/pkg/commands/ping.d.ts +0 -7
  329. package/types/pkg/commands/psetex.d.ts +0 -7
  330. package/types/pkg/commands/pttl.d.ts +0 -7
  331. package/types/pkg/commands/publish.d.ts +0 -7
  332. package/types/pkg/commands/randomkey.d.ts +0 -7
  333. package/types/pkg/commands/rename.d.ts +0 -7
  334. package/types/pkg/commands/renamenx.d.ts +0 -7
  335. package/types/pkg/commands/rpop.d.ts +0 -7
  336. package/types/pkg/commands/rpush.d.ts +0 -7
  337. package/types/pkg/commands/rpushx.d.ts +0 -7
  338. package/types/pkg/commands/sadd.d.ts +0 -7
  339. package/types/pkg/commands/scan.d.ts +0 -17
  340. package/types/pkg/commands/scard.d.ts +0 -7
  341. package/types/pkg/commands/script_exists.d.ts +0 -9
  342. package/types/pkg/commands/script_flush.d.ts +0 -14
  343. package/types/pkg/commands/script_load.d.ts +0 -7
  344. package/types/pkg/commands/sdiff.d.ts +0 -7
  345. package/types/pkg/commands/sdiffstore.d.ts +0 -7
  346. package/types/pkg/commands/set.d.ts +0 -26
  347. package/types/pkg/commands/setbit.d.ts +0 -7
  348. package/types/pkg/commands/setex.d.ts +0 -7
  349. package/types/pkg/commands/setnx.d.ts +0 -7
  350. package/types/pkg/commands/setrange.d.ts +0 -7
  351. package/types/pkg/commands/sinter.d.ts +0 -7
  352. package/types/pkg/commands/sinterstore.d.ts +0 -7
  353. package/types/pkg/commands/sismember.d.ts +0 -7
  354. package/types/pkg/commands/smembers.d.ts +0 -7
  355. package/types/pkg/commands/smove.d.ts +0 -7
  356. package/types/pkg/commands/spop.d.ts +0 -7
  357. package/types/pkg/commands/srandmember.d.ts +0 -7
  358. package/types/pkg/commands/srem.d.ts +0 -7
  359. package/types/pkg/commands/sscan.d.ts +0 -24
  360. package/types/pkg/commands/strlen.d.ts +0 -7
  361. package/types/pkg/commands/sunion.d.ts +0 -7
  362. package/types/pkg/commands/sunionstore.d.ts +0 -7
  363. package/types/pkg/commands/time.d.ts +0 -7
  364. package/types/pkg/commands/touch.d.ts +0 -7
  365. package/types/pkg/commands/ttl.d.ts +0 -7
  366. package/types/pkg/commands/type.d.ts +0 -8
  367. package/types/pkg/commands/unlink.d.ts +0 -7
  368. package/types/pkg/commands/zadd.d.ts +0 -35
  369. package/types/pkg/commands/zcard.d.ts +0 -7
  370. package/types/pkg/commands/zcount.d.ts +0 -7
  371. package/types/pkg/commands/zincrby.d.ts +0 -7
  372. package/types/pkg/commands/zinterstore.d.ts +0 -30
  373. package/types/pkg/commands/zlexcount.d.ts +0 -7
  374. package/types/pkg/commands/zpopmax.d.ts +0 -7
  375. package/types/pkg/commands/zpopmin.d.ts +0 -7
  376. package/types/pkg/commands/zrange.d.ts +0 -35
  377. package/types/pkg/commands/zrank.d.ts +0 -7
  378. package/types/pkg/commands/zrem.d.ts +0 -7
  379. package/types/pkg/commands/zremrangebylex.d.ts +0 -7
  380. package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
  381. package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
  382. package/types/pkg/commands/zrevrank.d.ts +0 -7
  383. package/types/pkg/commands/zscan.d.ts +0 -24
  384. package/types/pkg/commands/zscore.d.ts +0 -7
  385. package/types/pkg/commands/zunionstore.d.ts +0 -30
  386. package/types/pkg/error.d.ts +0 -6
  387. package/types/pkg/http.d.ts +0 -30
  388. package/types/pkg/pipeline.d.ts +0 -540
  389. package/types/pkg/redis.d.ts +0 -516
  390. package/types/pkg/types.d.ts +0 -1
  391. package/types/pkg/util.d.ts +0 -1
  392. package/types/platforms/cloudflare.d.ts +0 -38
  393. package/types/platforms/fastly.d.ts +0 -41
  394. package/types/platforms/node_with_fetch.d.ts +0 -63
  395. package/types/platforms/nodejs.d.ts +0 -62
@@ -0,0 +1,3157 @@
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 NXAndXXOptions = {
1338
+ nx: true;
1339
+ xx?: never;
1340
+ } | {
1341
+ nx?: never;
1342
+ xx: true;
1343
+ } | {
1344
+ nx?: never;
1345
+ xx?: never;
1346
+ };
1347
+ type LTAndGTOptions = {
1348
+ lt: true;
1349
+ gt?: never;
1350
+ } | {
1351
+ lt?: never;
1352
+ gt: true;
1353
+ } | {
1354
+ lt?: never;
1355
+ gt?: never;
1356
+ };
1357
+ type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
1358
+ ch?: true;
1359
+ };
1360
+ type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
1361
+ incr: true;
1362
+ };
1363
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions | ZAddCommandOptionsWithIncr;
1364
+ type ScoreMember<TData> = {
1365
+ score: number;
1366
+ member: TData;
1367
+ };
1368
+ /**
1369
+ * @see https://redis.io/commands/zadd
1370
+ */
1371
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1372
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1373
+ }
1374
+
1375
+ /**
1376
+ * @see https://redis.io/commands/zcard
1377
+ */
1378
+ declare class ZCardCommand extends Command<number, number> {
1379
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1380
+ }
1381
+
1382
+ /**
1383
+ * @see https://redis.io/commands/zcount
1384
+ */
1385
+ declare class ZCountCommand extends Command<number, number> {
1386
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1387
+ }
1388
+
1389
+ /**
1390
+ * @see https://redis.io/commands/zincrby
1391
+ */
1392
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1393
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1394
+ }
1395
+
1396
+ /**
1397
+ * @see https://redis.io/commands/zlexcount
1398
+ */
1399
+ declare class ZLexCountCommand extends Command<number, number> {
1400
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1401
+ }
1402
+
1403
+ /**
1404
+ * @see https://redis.io/commands/zpopmax
1405
+ */
1406
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1407
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1408
+ }
1409
+
1410
+ /**
1411
+ * @see https://redis.io/commands/zpopmin
1412
+ */
1413
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1414
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1415
+ }
1416
+
1417
+ type ZRangeCommandOptions = {
1418
+ withScores?: boolean;
1419
+ rev?: boolean;
1420
+ } & ({
1421
+ byScore: true;
1422
+ byLex?: never;
1423
+ } | {
1424
+ byScore?: never;
1425
+ byLex: true;
1426
+ } | {
1427
+ byScore?: never;
1428
+ byLex?: never;
1429
+ }) & ({
1430
+ offset: number;
1431
+ count: number;
1432
+ } | {
1433
+ offset?: never;
1434
+ count?: never;
1435
+ });
1436
+ /**
1437
+ * @see https://redis.io/commands/zrange
1438
+ */
1439
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1440
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1441
+ constructor(cmd: [
1442
+ key: string,
1443
+ min: `(${string}` | `[${string}` | "-" | "+",
1444
+ max: `(${string}` | `[${string}` | "-" | "+",
1445
+ opts: {
1446
+ byLex: true;
1447
+ } & ZRangeCommandOptions
1448
+ ], cmdOpts?: CommandOptions<string[], TData>);
1449
+ constructor(cmd: [
1450
+ key: string,
1451
+ min: number | `(${number}` | "-inf" | "+inf",
1452
+ max: number | `(${number}` | "-inf" | "+inf",
1453
+ opts: {
1454
+ byScore: true;
1455
+ } & ZRangeCommandOptions
1456
+ ], cmdOpts?: CommandOptions<string[], TData>);
1457
+ }
1458
+
1459
+ /**
1460
+ * @see https://redis.io/commands/zrank
1461
+ */
1462
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1463
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1464
+ }
1465
+
1466
+ /**
1467
+ * @see https://redis.io/commands/zrem
1468
+ */
1469
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1470
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1471
+ }
1472
+
1473
+ /**
1474
+ * @see https://redis.io/commands/zremrangebylex
1475
+ */
1476
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1477
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1478
+ }
1479
+
1480
+ /**
1481
+ * @see https://redis.io/commands/zremrangebyrank
1482
+ */
1483
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1484
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1485
+ }
1486
+
1487
+ /**
1488
+ * @see https://redis.io/commands/zremrangebyscore
1489
+ */
1490
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1491
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1492
+ }
1493
+
1494
+ /**
1495
+ * @see https://redis.io/commands/zrevrank
1496
+ */
1497
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1498
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1499
+ }
1500
+
1501
+ /**
1502
+ * @see https://redis.io/commands/zscan
1503
+ */
1504
+ declare class ZScanCommand extends Command<[
1505
+ number,
1506
+ (string | number)[]
1507
+ ], [
1508
+ number,
1509
+ (string | number)[]
1510
+ ]> {
1511
+ constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1512
+ }
1513
+
1514
+ /**
1515
+ * @see https://redis.io/commands/zscore
1516
+ */
1517
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1518
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1519
+ }
1520
+
1521
+ type InferResponseData<T extends unknown[]> = {
1522
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1523
+ };
1524
+ /**
1525
+ * Upstash REST API supports command pipelining to send multiple commands in
1526
+ * batch, instead of sending each command one by one and waiting for a response.
1527
+ * When using pipelines, several commands are sent using a single HTTP request,
1528
+ * and a single JSON array response is returned. Each item in the response array
1529
+ * corresponds to the command in the same order within the pipeline.
1530
+ *
1531
+ * **NOTE:**
1532
+ *
1533
+ * Execution of the pipeline is not atomic. Even though each command in
1534
+ * the pipeline will be executed in order, commands sent by other clients can
1535
+ * interleave with the pipeline.
1536
+ *
1537
+ * **Examples:**
1538
+ *
1539
+ * ```ts
1540
+ * const p = redis.pipeline() // or redis.multi()
1541
+ * p.set("key","value")
1542
+ * p.get("key")
1543
+ * const res = await p.exec()
1544
+ * ```
1545
+ *
1546
+ * You can also chain commands together
1547
+ * ```ts
1548
+ * const p = redis.pipeline()
1549
+ * const res = await p.set("key","value").get("key").exec()
1550
+ * ```
1551
+ *
1552
+ * Return types are inferred if all commands are chained, but you can still
1553
+ * override the response type manually:
1554
+ * ```ts
1555
+ * redis.pipeline()
1556
+ * .set("key", { greeting: "hello"})
1557
+ * .get("key")
1558
+ * .exec<["OK", { greeting: string } ]>()
1559
+ *
1560
+ * ```
1561
+ */
1562
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1563
+ private client;
1564
+ private commands;
1565
+ private commandOptions?;
1566
+ private multiExec;
1567
+ constructor(opts: {
1568
+ client: Requester;
1569
+ commandOptions?: CommandOptions<any, any>;
1570
+ multiExec?: boolean;
1571
+ });
1572
+ /**
1573
+ * Send the pipeline request to upstash.
1574
+ *
1575
+ * Returns an array with the results of all pipelined commands.
1576
+ *
1577
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1578
+ * ```ts
1579
+ * const p = redis.pipeline()
1580
+ * p.get("key")
1581
+ * const result = p.exec<[{ greeting: string }]>()
1582
+ * ```
1583
+ */
1584
+ exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
1585
+ /**
1586
+ * Returns the length of pipeline before the execution
1587
+ */
1588
+ length(): number;
1589
+ /**
1590
+ * Pushes a command into the pipeline and returns a chainable instance of the
1591
+ * pipeline
1592
+ */
1593
+ private chain;
1594
+ /**
1595
+ * @see https://redis.io/commands/append
1596
+ */
1597
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1598
+ /**
1599
+ * @see https://redis.io/commands/bitcount
1600
+ */
1601
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
1602
+ /**
1603
+ * @see https://redis.io/commands/bitop
1604
+ */
1605
+ bitop: {
1606
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
1607
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
1608
+ };
1609
+ /**
1610
+ * @see https://redis.io/commands/bitpos
1611
+ */
1612
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1613
+ /**
1614
+ * @see https://redis.io/commands/copy
1615
+ */
1616
+ copy: (key: string, destinationKey: string, opts?: {
1617
+ replace: boolean;
1618
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
1619
+ /**
1620
+ * @see https://redis.io/commands/zdiffstore
1621
+ */
1622
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1623
+ /**
1624
+ * @see https://redis.io/commands/dbsize
1625
+ */
1626
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
1627
+ /**
1628
+ * @see https://redis.io/commands/decr
1629
+ */
1630
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1631
+ /**
1632
+ * @see https://redis.io/commands/decrby
1633
+ */
1634
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
1635
+ /**
1636
+ * @see https://redis.io/commands/del
1637
+ */
1638
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1639
+ /**
1640
+ * @see https://redis.io/commands/echo
1641
+ */
1642
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
1643
+ /**
1644
+ * @see https://redis.io/commands/eval
1645
+ */
1646
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1647
+ /**
1648
+ * @see https://redis.io/commands/evalsha
1649
+ */
1650
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1651
+ /**
1652
+ * @see https://redis.io/commands/exists
1653
+ */
1654
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1655
+ /**
1656
+ * @see https://redis.io/commands/expire
1657
+ */
1658
+ expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1659
+ /**
1660
+ * @see https://redis.io/commands/expireat
1661
+ */
1662
+ expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1663
+ /**
1664
+ * @see https://redis.io/commands/flushall
1665
+ */
1666
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1667
+ /**
1668
+ * @see https://redis.io/commands/flushdb
1669
+ */
1670
+ flushdb: (opts?: {
1671
+ async?: boolean | undefined;
1672
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1673
+ /**
1674
+ * @see https://redis.io/commands/get
1675
+ */
1676
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1677
+ /**
1678
+ * @see https://redis.io/commands/getbit
1679
+ */
1680
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1681
+ /**
1682
+ * @see https://redis.io/commands/getdel
1683
+ */
1684
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1685
+ /**
1686
+ * @see https://redis.io/commands/getrange
1687
+ */
1688
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
1689
+ /**
1690
+ * @see https://redis.io/commands/getset
1691
+ */
1692
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1693
+ /**
1694
+ * @see https://redis.io/commands/hdel
1695
+ */
1696
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1697
+ /**
1698
+ * @see https://redis.io/commands/hexists
1699
+ */
1700
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1701
+ /**
1702
+ * @see https://redis.io/commands/hget
1703
+ */
1704
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1705
+ /**
1706
+ * @see https://redis.io/commands/hgetall
1707
+ */
1708
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1709
+ /**
1710
+ * @see https://redis.io/commands/hincrby
1711
+ */
1712
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1713
+ /**
1714
+ * @see https://redis.io/commands/hincrbyfloat
1715
+ */
1716
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1717
+ /**
1718
+ * @see https://redis.io/commands/hkeys
1719
+ */
1720
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1721
+ /**
1722
+ * @see https://redis.io/commands/hlen
1723
+ */
1724
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1725
+ /**
1726
+ * @see https://redis.io/commands/hmget
1727
+ */
1728
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1729
+ /**
1730
+ * @see https://redis.io/commands/hmset
1731
+ */
1732
+ hmset: <TData>(key: string, kv: {
1733
+ [field: string]: TData;
1734
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1735
+ /**
1736
+ * @see https://redis.io/commands/hrandfield
1737
+ */
1738
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1739
+ /**
1740
+ * @see https://redis.io/commands/hscan
1741
+ */
1742
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
1743
+ /**
1744
+ * @see https://redis.io/commands/hset
1745
+ */
1746
+ hset: <TData>(key: string, kv: {
1747
+ [field: string]: TData;
1748
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
1749
+ /**
1750
+ * @see https://redis.io/commands/hsetnx
1751
+ */
1752
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1753
+ /**
1754
+ * @see https://redis.io/commands/hstrlen
1755
+ */
1756
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1757
+ /**
1758
+ * @see https://redis.io/commands/hvals
1759
+ */
1760
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
1761
+ /**
1762
+ * @see https://redis.io/commands/incr
1763
+ */
1764
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1765
+ /**
1766
+ * @see https://redis.io/commands/incrby
1767
+ */
1768
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1769
+ /**
1770
+ * @see https://redis.io/commands/incrbyfloat
1771
+ */
1772
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1773
+ /**
1774
+ * @see https://redis.io/commands/keys
1775
+ */
1776
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1777
+ /**
1778
+ * @see https://redis.io/commands/lindex
1779
+ */
1780
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
1781
+ /**
1782
+ * @see https://redis.io/commands/linsert
1783
+ */
1784
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1785
+ /**
1786
+ * @see https://redis.io/commands/llen
1787
+ */
1788
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1789
+ /**
1790
+ * @see https://redis.io/commands/lmove
1791
+ */
1792
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
1793
+ /**
1794
+ * @see https://redis.io/commands/lpop
1795
+ */
1796
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1797
+ /**
1798
+ * @see https://redis.io/commands/lpos
1799
+ */
1800
+ lpos: <TData>(key: string, element: unknown, opts?: {
1801
+ rank?: number | undefined;
1802
+ count?: number | undefined;
1803
+ maxLen?: number | undefined;
1804
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1805
+ /**
1806
+ * @see https://redis.io/commands/lpush
1807
+ */
1808
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1809
+ /**
1810
+ * @see https://redis.io/commands/lpushx
1811
+ */
1812
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1813
+ /**
1814
+ * @see https://redis.io/commands/lrange
1815
+ */
1816
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
1817
+ /**
1818
+ * @see https://redis.io/commands/lrem
1819
+ */
1820
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1821
+ /**
1822
+ * @see https://redis.io/commands/lset
1823
+ */
1824
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
1825
+ /**
1826
+ * @see https://redis.io/commands/ltrim
1827
+ */
1828
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
1829
+ /**
1830
+ * @see https://redis.io/commands/mget
1831
+ */
1832
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
1833
+ /**
1834
+ * @see https://redis.io/commands/mset
1835
+ */
1836
+ mset: <TData>(kv: {
1837
+ [key: string]: TData;
1838
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1839
+ /**
1840
+ * @see https://redis.io/commands/msetnx
1841
+ */
1842
+ msetnx: <TData>(kv: {
1843
+ [key: string]: TData;
1844
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
1845
+ /**
1846
+ * @see https://redis.io/commands/persist
1847
+ */
1848
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1849
+ /**
1850
+ * @see https://redis.io/commands/pexpire
1851
+ */
1852
+ pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1853
+ /**
1854
+ * @see https://redis.io/commands/pexpireat
1855
+ */
1856
+ pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1857
+ /**
1858
+ * @see https://redis.io/commands/pfadd
1859
+ */
1860
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
1861
+ /**
1862
+ * @see https://redis.io/commands/pfcount
1863
+ */
1864
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1865
+ /**
1866
+ * @see https://redis.io/commands/pfmerge
1867
+ */
1868
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
1869
+ /**
1870
+ * @see https://redis.io/commands/ping
1871
+ */
1872
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
1873
+ /**
1874
+ * @see https://redis.io/commands/psetex
1875
+ */
1876
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
1877
+ /**
1878
+ * @see https://redis.io/commands/pttl
1879
+ */
1880
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1881
+ /**
1882
+ * @see https://redis.io/commands/publish
1883
+ */
1884
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
1885
+ /**
1886
+ * @see https://redis.io/commands/randomkey
1887
+ */
1888
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
1889
+ /**
1890
+ * @see https://redis.io/commands/rename
1891
+ */
1892
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
1893
+ /**
1894
+ * @see https://redis.io/commands/renamenx
1895
+ */
1896
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1897
+ /**
1898
+ * @see https://redis.io/commands/rpop
1899
+ */
1900
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1901
+ /**
1902
+ * @see https://redis.io/commands/rpush
1903
+ */
1904
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1905
+ /**
1906
+ * @see https://redis.io/commands/rpushx
1907
+ */
1908
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1909
+ /**
1910
+ * @see https://redis.io/commands/sadd
1911
+ */
1912
+ sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1913
+ /**
1914
+ * @see https://redis.io/commands/scan
1915
+ */
1916
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
1917
+ /**
1918
+ * @see https://redis.io/commands/scard
1919
+ */
1920
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1921
+ /**
1922
+ * @see https://redis.io/commands/script-exists
1923
+ */
1924
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
1925
+ /**
1926
+ * @see https://redis.io/commands/script-flush
1927
+ */
1928
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1929
+ /**
1930
+ * @see https://redis.io/commands/script-load
1931
+ */
1932
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
1933
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
1934
+ /**
1935
+ * @see https://redis.io/commands/sdiffstore
1936
+ */
1937
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1938
+ /**
1939
+ * @see https://redis.io/commands/set
1940
+ */
1941
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
1942
+ /**
1943
+ * @see https://redis.io/commands/setbit
1944
+ */
1945
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1946
+ /**
1947
+ * @see https://redis.io/commands/setex
1948
+ */
1949
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
1950
+ /**
1951
+ * @see https://redis.io/commands/setnx
1952
+ */
1953
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1954
+ /**
1955
+ * @see https://redis.io/commands/setrange
1956
+ */
1957
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1958
+ /**
1959
+ * @see https://redis.io/commands/sinter
1960
+ */
1961
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
1962
+ /**
1963
+ * @see https://redis.io/commands/sinterstore
1964
+ */
1965
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1966
+ /**
1967
+ * @see https://redis.io/commands/sismember
1968
+ */
1969
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1970
+ /**
1971
+ * @see https://redis.io/commands/smembers
1972
+ */
1973
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
1974
+ /**
1975
+ * @see https://redis.io/commands/smismember
1976
+ */
1977
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
1978
+ /**
1979
+ * @see https://redis.io/commands/smove
1980
+ */
1981
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1982
+ /**
1983
+ * @see https://redis.io/commands/spop
1984
+ */
1985
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1986
+ /**
1987
+ * @see https://redis.io/commands/srandmember
1988
+ */
1989
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1990
+ /**
1991
+ * @see https://redis.io/commands/srem
1992
+ */
1993
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1994
+ /**
1995
+ * @see https://redis.io/commands/sscan
1996
+ */
1997
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
1998
+ /**
1999
+ * @see https://redis.io/commands/strlen
2000
+ */
2001
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2002
+ /**
2003
+ * @see https://redis.io/commands/sunion
2004
+ */
2005
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2006
+ /**
2007
+ * @see https://redis.io/commands/sunionstore
2008
+ */
2009
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2010
+ /**
2011
+ * @see https://redis.io/commands/time
2012
+ */
2013
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
2014
+ /**
2015
+ * @see https://redis.io/commands/touch
2016
+ */
2017
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2018
+ /**
2019
+ * @see https://redis.io/commands/ttl
2020
+ */
2021
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2022
+ /**
2023
+ * @see https://redis.io/commands/type
2024
+ */
2025
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
2026
+ /**
2027
+ * @see https://redis.io/commands/unlink
2028
+ */
2029
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2030
+ /**
2031
+ * @see https://redis.io/commands/zadd
2032
+ */
2033
+ 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>]>;
2034
+ /**
2035
+ * @see https://redis.io/commands/zcard
2036
+ */
2037
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2038
+ /**
2039
+ * @see https://redis.io/commands/zcount
2040
+ */
2041
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
2042
+ /**
2043
+ * @see https://redis.io/commands/zincrby
2044
+ */
2045
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2046
+ /**
2047
+ * @see https://redis.io/commands/zinterstore
2048
+ */
2049
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2050
+ /**
2051
+ * @see https://redis.io/commands/zlexcount
2052
+ */
2053
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2054
+ /**
2055
+ * @see https://redis.io/commands/zmscore
2056
+ */
2057
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
2058
+ /**
2059
+ * @see https://redis.io/commands/zpopmax
2060
+ */
2061
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2062
+ /**
2063
+ * @see https://redis.io/commands/zpopmin
2064
+ */
2065
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2066
+ /**
2067
+ * @see https://redis.io/commands/zrange
2068
+ */
2069
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2070
+ key: string,
2071
+ min: `(${string}` | `[${string}` | "-" | "+",
2072
+ max: `(${string}` | `[${string}` | "-" | "+",
2073
+ opts: {
2074
+ byLex: true;
2075
+ } & ZRangeCommandOptions
2076
+ ] | [
2077
+ key: string,
2078
+ min: number | `(${number}` | "-inf" | "+inf",
2079
+ max: number | `(${number}` | "-inf" | "+inf",
2080
+ opts: {
2081
+ byScore: true;
2082
+ } & ZRangeCommandOptions
2083
+ ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2084
+ /**
2085
+ * @see https://redis.io/commands/zrank
2086
+ */
2087
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2088
+ /**
2089
+ * @see https://redis.io/commands/zrem
2090
+ */
2091
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2092
+ /**
2093
+ * @see https://redis.io/commands/zremrangebylex
2094
+ */
2095
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2096
+ /**
2097
+ * @see https://redis.io/commands/zremrangebyrank
2098
+ */
2099
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
2100
+ /**
2101
+ * @see https://redis.io/commands/zremrangebyscore
2102
+ */
2103
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2104
+ /**
2105
+ * @see https://redis.io/commands/zrevrank
2106
+ */
2107
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2108
+ /**
2109
+ * @see https://redis.io/commands/zscan
2110
+ */
2111
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
2112
+ /**
2113
+ * @see https://redis.io/commands/zscore
2114
+ */
2115
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2116
+ /**
2117
+ * @see https://redis.io/commands/zunionstore
2118
+ */
2119
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2120
+ /**
2121
+ * @see https://redis.io/commands/zunion
2122
+ */
2123
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2124
+ /**
2125
+ * @see https://redis.io/commands/?group=json
2126
+ */
2127
+ get json(): {
2128
+ /**
2129
+ * @see https://redis.io/commands/json.arrappend
2130
+ */
2131
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2132
+ /**
2133
+ * @see https://redis.io/commands/json.arrindex
2134
+ */
2135
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2136
+ /**
2137
+ * @see https://redis.io/commands/json.arrinsert
2138
+ */
2139
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2140
+ /**
2141
+ * @see https://redis.io/commands/json.arrlen
2142
+ */
2143
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2144
+ /**
2145
+ * @see https://redis.io/commands/json.arrpop
2146
+ */
2147
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2148
+ /**
2149
+ * @see https://redis.io/commands/json.arrtrim
2150
+ */
2151
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2152
+ /**
2153
+ * @see https://redis.io/commands/json.clear
2154
+ */
2155
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2156
+ /**
2157
+ * @see https://redis.io/commands/json.del
2158
+ */
2159
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2160
+ /**
2161
+ * @see https://redis.io/commands/json.forget
2162
+ */
2163
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2164
+ /**
2165
+ * @see https://redis.io/commands/geoadd
2166
+ */
2167
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2168
+ /**
2169
+ * @see https://redis.io/commands/geodist
2170
+ */
2171
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
2172
+ /**
2173
+ * @see https://redis.io/commands/geopos
2174
+ */
2175
+ geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
2176
+ lng: number;
2177
+ lat: number;
2178
+ }[]>]>;
2179
+ /**
2180
+ * @see https://redis.io/commands/geohash
2181
+ */
2182
+ geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
2183
+ /**
2184
+ * @see https://redis.io/commands/geosearch
2185
+ */
2186
+ geosearch: (key: string, centerPoint: {
2187
+ type: "FROMLONLAT" | "fromlonlat";
2188
+ coordinate: {
2189
+ lon: number;
2190
+ lat: number;
2191
+ };
2192
+ } | {
2193
+ type: "FROMMEMBER" | "frommember";
2194
+ member: unknown;
2195
+ }, shape: {
2196
+ type: "BYRADIUS" | "byradius";
2197
+ radius: number;
2198
+ radiusType: "M" | "KM" | "FT" | "MI";
2199
+ } | {
2200
+ type: "BYBOX" | "bybox";
2201
+ rect: {
2202
+ width: number;
2203
+ height: number;
2204
+ };
2205
+ rectType: "M" | "KM" | "FT" | "MI";
2206
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2207
+ count?: {
2208
+ limit: number;
2209
+ any?: boolean | undefined;
2210
+ } | undefined;
2211
+ withCoord?: boolean | undefined;
2212
+ withDist?: boolean | undefined;
2213
+ withHash?: boolean | undefined;
2214
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
2215
+ member: unknown;
2216
+ } & {
2217
+ coord?: {
2218
+ long: number;
2219
+ lat: number;
2220
+ } | undefined;
2221
+ dist?: number | undefined;
2222
+ hash?: string | undefined;
2223
+ })[]>]>;
2224
+ /**
2225
+ * @see https://redis.io/commands/geosearchstore
2226
+ */
2227
+ geosearchstore: (destination: string, key: string, centerPoint: {
2228
+ type: "FROMLONLAT" | "fromlonlat";
2229
+ coordinate: {
2230
+ lon: number;
2231
+ lat: number;
2232
+ };
2233
+ } | {
2234
+ type: "FROMMEMBER" | "frommember";
2235
+ member: unknown;
2236
+ }, shape: {
2237
+ type: "BYRADIUS" | "byradius";
2238
+ radius: number;
2239
+ radiusType: "M" | "KM" | "FT" | "MI";
2240
+ } | {
2241
+ type: "BYBOX" | "bybox";
2242
+ rect: {
2243
+ width: number;
2244
+ height: number;
2245
+ };
2246
+ rectType: "M" | "KM" | "FT" | "MI";
2247
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2248
+ count?: {
2249
+ limit: number;
2250
+ any?: boolean | undefined;
2251
+ } | undefined;
2252
+ storeDist?: boolean | undefined;
2253
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2254
+ /**
2255
+ * @see https://redis.io/commands/json.get
2256
+ */
2257
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2258
+ /**
2259
+ * @see https://redis.io/commands/json.mget
2260
+ */
2261
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2262
+ /**
2263
+ * @see https://redis.io/commands/json.numincrby
2264
+ */
2265
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2266
+ /**
2267
+ * @see https://redis.io/commands/json.nummultby
2268
+ */
2269
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2270
+ /**
2271
+ * @see https://redis.io/commands/json.objkeys
2272
+ */
2273
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
2274
+ /**
2275
+ * @see https://redis.io/commands/json.objlen
2276
+ */
2277
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2278
+ /**
2279
+ * @see https://redis.io/commands/json.resp
2280
+ */
2281
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2282
+ /**
2283
+ * @see https://redis.io/commands/json.set
2284
+ */
2285
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2286
+ nx: true;
2287
+ xx?: undefined;
2288
+ } | {
2289
+ nx?: undefined;
2290
+ xx: true;
2291
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2292
+ /**
2293
+ * @see https://redis.io/commands/json.strappend
2294
+ */
2295
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2296
+ /**
2297
+ * @see https://redis.io/commands/json.strlen
2298
+ */
2299
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2300
+ /**
2301
+ * @see https://redis.io/commands/json.toggle
2302
+ */
2303
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
2304
+ /**
2305
+ * @see https://redis.io/commands/json.type
2306
+ */
2307
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2308
+ };
2309
+ }
2310
+
2311
+ /**
2312
+ * Creates a new script.
2313
+ *
2314
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2315
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2316
+ * the entire script. Afterwards, the script is cached on the server.
2317
+ *
2318
+ * @example
2319
+ * ```ts
2320
+ * const redis = new Redis({...})
2321
+ *
2322
+ * const script = redis.createScript<string>("return ARGV[1];")
2323
+ * const arg1 = await script.eval([], ["Hello World"])
2324
+ * expect(arg1, "Hello World")
2325
+ * ```
2326
+ */
2327
+ declare class Script<TResult = unknown> {
2328
+ readonly script: string;
2329
+ readonly sha1: string;
2330
+ private readonly redis;
2331
+ constructor(redis: Redis, script: string);
2332
+ /**
2333
+ * Send an `EVAL` command to redis.
2334
+ */
2335
+ eval(keys: string[], args: string[]): Promise<TResult>;
2336
+ /**
2337
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
2338
+ */
2339
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
2340
+ /**
2341
+ * Optimistically try to run `EVALSHA` first.
2342
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
2343
+ *
2344
+ * Following calls will be able to use the cached script
2345
+ */
2346
+ exec(keys: string[], args: string[]): Promise<TResult>;
2347
+ /**
2348
+ * Compute the sha1 hash of the script and return its hex representation.
2349
+ */
2350
+ private digest;
2351
+ }
2352
+
2353
+ /**
2354
+ * Serverless redis client for upstash.
2355
+ */
2356
+ declare class Redis {
2357
+ protected client: Requester;
2358
+ protected opts?: CommandOptions<any, any>;
2359
+ protected enableTelemetry: boolean;
2360
+ /**
2361
+ * Create a new redis client
2362
+ *
2363
+ * @example
2364
+ * ```typescript
2365
+ * const redis = new Redis({
2366
+ * url: "<UPSTASH_REDIS_REST_URL>",
2367
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
2368
+ * });
2369
+ * ```
2370
+ */
2371
+ constructor(client: Requester, opts?: RedisOptions);
2372
+ get json(): {
2373
+ /**
2374
+ * @see https://redis.io/commands/json.arrappend
2375
+ */
2376
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
2377
+ /**
2378
+ * @see https://redis.io/commands/json.arrindex
2379
+ */
2380
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2381
+ /**
2382
+ * @see https://redis.io/commands/json.arrinsert
2383
+ */
2384
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
2385
+ /**
2386
+ * @see https://redis.io/commands/json.arrlen
2387
+ */
2388
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2389
+ /**
2390
+ * @see https://redis.io/commands/json.arrpop
2391
+ */
2392
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
2393
+ /**
2394
+ * @see https://redis.io/commands/json.arrtrim
2395
+ */
2396
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2397
+ /**
2398
+ * @see https://redis.io/commands/json.clear
2399
+ */
2400
+ clear: (key: string, path?: string | undefined) => Promise<number>;
2401
+ /**
2402
+ * @see https://redis.io/commands/json.del
2403
+ */
2404
+ del: (key: string, path?: string | undefined) => Promise<number>;
2405
+ /**
2406
+ * @see https://redis.io/commands/json.forget
2407
+ */
2408
+ forget: (key: string, path?: string | undefined) => Promise<number>;
2409
+ /**
2410
+ * @see https://redis.io/commands/geoadd
2411
+ */
2412
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
2413
+ /**
2414
+ * @see https://redis.io/commands/geopos
2415
+ */
2416
+ geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
2417
+ lng: number;
2418
+ lat: number;
2419
+ }[]>;
2420
+ /**
2421
+ * @see https://redis.io/commands/geodist
2422
+ */
2423
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2424
+ /**
2425
+ * @see https://redis.io/commands/geohash
2426
+ */
2427
+ geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
2428
+ /**
2429
+ * @see https://redis.io/commands/geosearch
2430
+ */
2431
+ geosearch: (key: string, centerPoint: {
2432
+ type: "FROMLONLAT" | "fromlonlat";
2433
+ coordinate: {
2434
+ lon: number;
2435
+ lat: number;
2436
+ };
2437
+ } | {
2438
+ type: "FROMMEMBER" | "frommember";
2439
+ member: unknown;
2440
+ }, shape: {
2441
+ type: "BYRADIUS" | "byradius";
2442
+ radius: number;
2443
+ radiusType: "M" | "KM" | "FT" | "MI";
2444
+ } | {
2445
+ type: "BYBOX" | "bybox";
2446
+ rect: {
2447
+ width: number;
2448
+ height: number;
2449
+ };
2450
+ rectType: "M" | "KM" | "FT" | "MI";
2451
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2452
+ count?: {
2453
+ limit: number;
2454
+ any?: boolean | undefined;
2455
+ } | undefined;
2456
+ withCoord?: boolean | undefined;
2457
+ withDist?: boolean | undefined;
2458
+ withHash?: boolean | undefined;
2459
+ } | undefined) => Promise<({
2460
+ member: unknown;
2461
+ } & {
2462
+ coord?: {
2463
+ long: number;
2464
+ lat: number;
2465
+ } | undefined;
2466
+ dist?: number | undefined;
2467
+ hash?: string | undefined;
2468
+ })[]>;
2469
+ /**
2470
+ * @see https://redis.io/commands/geosearchstore
2471
+ */
2472
+ geosearchstore: (destination: string, key: string, centerPoint: {
2473
+ type: "FROMLONLAT" | "fromlonlat";
2474
+ coordinate: {
2475
+ lon: number;
2476
+ lat: number;
2477
+ };
2478
+ } | {
2479
+ type: "FROMMEMBER" | "frommember";
2480
+ member: unknown;
2481
+ }, shape: {
2482
+ type: "BYRADIUS" | "byradius";
2483
+ radius: number;
2484
+ radiusType: "M" | "KM" | "FT" | "MI";
2485
+ } | {
2486
+ type: "BYBOX" | "bybox";
2487
+ rect: {
2488
+ width: number;
2489
+ height: number;
2490
+ };
2491
+ rectType: "M" | "KM" | "FT" | "MI";
2492
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2493
+ count?: {
2494
+ limit: number;
2495
+ any?: boolean | undefined;
2496
+ } | undefined;
2497
+ storeDist?: boolean | undefined;
2498
+ } | undefined) => Promise<number>;
2499
+ /**
2500
+ * @see https://redis.io/commands/json.get
2501
+ */
2502
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
2503
+ /**
2504
+ * @see https://redis.io/commands/json.mget
2505
+ */
2506
+ mget: (keys: string[], path: string) => Promise<any>;
2507
+ /**
2508
+ * @see https://redis.io/commands/json.numincrby
2509
+ */
2510
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2511
+ /**
2512
+ * @see https://redis.io/commands/json.nummultby
2513
+ */
2514
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2515
+ /**
2516
+ * @see https://redis.io/commands/json.objkeys
2517
+ */
2518
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
2519
+ /**
2520
+ * @see https://redis.io/commands/json.objlen
2521
+ */
2522
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2523
+ /**
2524
+ * @see https://redis.io/commands/json.resp
2525
+ */
2526
+ resp: (key: string, path?: string | undefined) => Promise<any>;
2527
+ /**
2528
+ * @see https://redis.io/commands/json.set
2529
+ */
2530
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2531
+ nx: true;
2532
+ xx?: undefined;
2533
+ } | {
2534
+ nx?: undefined;
2535
+ xx: true;
2536
+ } | undefined) => Promise<"OK" | null>;
2537
+ /**
2538
+ * @see https://redis.io/commands/json.strappend
2539
+ */
2540
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
2541
+ /**
2542
+ * @see https://redis.io/commands/json.strlen
2543
+ */
2544
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2545
+ /**
2546
+ * @see https://redis.io/commands/json.toggle
2547
+ */
2548
+ toggle: (key: string, path: string) => Promise<number[]>;
2549
+ /**
2550
+ * @see https://redis.io/commands/json.type
2551
+ */
2552
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
2553
+ };
2554
+ /**
2555
+ * Wrap a new middleware around the HTTP client.
2556
+ */
2557
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
2558
+ /**
2559
+ * Technically this is not private, we can hide it from intellisense by doing this
2560
+ */
2561
+ protected addTelemetry: (telemetry: Telemetry) => void;
2562
+ createScript(script: string): Script;
2563
+ /**
2564
+ * Create a new pipeline that allows you to send requests in bulk.
2565
+ *
2566
+ * @see {@link Pipeline}
2567
+ */
2568
+ pipeline: () => Pipeline<[]>;
2569
+ /**
2570
+ * Create a new transaction to allow executing multiple steps atomically.
2571
+ *
2572
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
2573
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
2574
+ * guarantees that the commands are executed as a single isolated operation.
2575
+ *
2576
+ * @see {@link Pipeline}
2577
+ */
2578
+ multi: () => Pipeline<[]>;
2579
+ /**
2580
+ * @see https://redis.io/commands/append
2581
+ */
2582
+ append: (key: string, value: string) => Promise<number>;
2583
+ /**
2584
+ * @see https://redis.io/commands/bitcount
2585
+ */
2586
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
2587
+ /**
2588
+ * @see https://redis.io/commands/bitop
2589
+ */
2590
+ bitop: {
2591
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
2592
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
2593
+ };
2594
+ /**
2595
+ * @see https://redis.io/commands/bitpos
2596
+ */
2597
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
2598
+ /**
2599
+ * @see https://redis.io/commands/copy
2600
+ */
2601
+ copy: (key: string, destinationKey: string, opts?: {
2602
+ replace: boolean;
2603
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
2604
+ /**
2605
+ * @see https://redis.io/commands/dbsize
2606
+ */
2607
+ dbsize: () => Promise<number>;
2608
+ /**
2609
+ * @see https://redis.io/commands/decr
2610
+ */
2611
+ decr: (key: string) => Promise<number>;
2612
+ /**
2613
+ * @see https://redis.io/commands/decrby
2614
+ */
2615
+ decrby: (key: string, decrement: number) => Promise<number>;
2616
+ /**
2617
+ * @see https://redis.io/commands/del
2618
+ */
2619
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
2620
+ /**
2621
+ * @see https://redis.io/commands/echo
2622
+ */
2623
+ echo: (message: string) => Promise<string>;
2624
+ /**
2625
+ * @see https://redis.io/commands/eval
2626
+ */
2627
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
2628
+ /**
2629
+ * @see https://redis.io/commands/evalsha
2630
+ */
2631
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2632
+ /**
2633
+ * @see https://redis.io/commands/exists
2634
+ */
2635
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
2636
+ /**
2637
+ * @see https://redis.io/commands/expire
2638
+ */
2639
+ expire: (key: string, seconds: number) => Promise<0 | 1>;
2640
+ /**
2641
+ * @see https://redis.io/commands/expireat
2642
+ */
2643
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
2644
+ /**
2645
+ * @see https://redis.io/commands/flushall
2646
+ */
2647
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
2648
+ /**
2649
+ * @see https://redis.io/commands/flushdb
2650
+ */
2651
+ flushdb: (opts?: {
2652
+ async?: boolean | undefined;
2653
+ } | undefined) => Promise<"OK">;
2654
+ /**
2655
+ * @see https://redis.io/commands/get
2656
+ */
2657
+ get: <TData>(key: string) => Promise<TData | null>;
2658
+ /**
2659
+ * @see https://redis.io/commands/getbit
2660
+ */
2661
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
2662
+ /**
2663
+ * @see https://redis.io/commands/getdel
2664
+ */
2665
+ getdel: <TData>(key: string) => Promise<TData | null>;
2666
+ /**
2667
+ * @see https://redis.io/commands/getrange
2668
+ */
2669
+ getrange: (key: string, start: number, end: number) => Promise<string>;
2670
+ /**
2671
+ * @see https://redis.io/commands/getset
2672
+ */
2673
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
2674
+ /**
2675
+ * @see https://redis.io/commands/hdel
2676
+ */
2677
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
2678
+ /**
2679
+ * @see https://redis.io/commands/hexists
2680
+ */
2681
+ hexists: (key: string, field: string) => Promise<number>;
2682
+ /**
2683
+ * @see https://redis.io/commands/hget
2684
+ */
2685
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
2686
+ /**
2687
+ * @see https://redis.io/commands/hgetall
2688
+ */
2689
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
2690
+ /**
2691
+ * @see https://redis.io/commands/hincrby
2692
+ */
2693
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
2694
+ /**
2695
+ * @see https://redis.io/commands/hincrbyfloat
2696
+ */
2697
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
2698
+ /**
2699
+ * @see https://redis.io/commands/hkeys
2700
+ */
2701
+ hkeys: (key: string) => Promise<string[]>;
2702
+ /**
2703
+ * @see https://redis.io/commands/hlen
2704
+ */
2705
+ hlen: (key: string) => Promise<number>;
2706
+ /**
2707
+ * @see https://redis.io/commands/hmget
2708
+ */
2709
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
2710
+ /**
2711
+ * @see https://redis.io/commands/hmset
2712
+ */
2713
+ hmset: <TData>(key: string, kv: {
2714
+ [field: string]: TData;
2715
+ }) => Promise<"OK">;
2716
+ /**
2717
+ * @see https://redis.io/commands/hrandfield
2718
+ */
2719
+ hrandfield: {
2720
+ (key: string): Promise<string>;
2721
+ (key: string, count: number): Promise<string[]>;
2722
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
2723
+ };
2724
+ /**
2725
+ * @see https://redis.io/commands/hscan
2726
+ */
2727
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
2728
+ /**
2729
+ * @see https://redis.io/commands/hset
2730
+ */
2731
+ hset: <TData>(key: string, kv: {
2732
+ [field: string]: TData;
2733
+ }) => Promise<number>;
2734
+ /**
2735
+ * @see https://redis.io/commands/hsetnx
2736
+ */
2737
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
2738
+ /**
2739
+ * @see https://redis.io/commands/hstrlen
2740
+ */
2741
+ hstrlen: (key: string, field: string) => Promise<number>;
2742
+ /**
2743
+ * @see https://redis.io/commands/hvals
2744
+ */
2745
+ hvals: (key: string) => Promise<any>;
2746
+ /**
2747
+ * @see https://redis.io/commands/incr
2748
+ */
2749
+ incr: (key: string) => Promise<number>;
2750
+ /**
2751
+ * @see https://redis.io/commands/incrby
2752
+ */
2753
+ incrby: (key: string, value: number) => Promise<number>;
2754
+ /**
2755
+ * @see https://redis.io/commands/incrbyfloat
2756
+ */
2757
+ incrbyfloat: (key: string, value: number) => Promise<number>;
2758
+ /**
2759
+ * @see https://redis.io/commands/keys
2760
+ */
2761
+ keys: (pattern: string) => Promise<string[]>;
2762
+ /**
2763
+ * @see https://redis.io/commands/lindex
2764
+ */
2765
+ lindex: (key: string, index: number) => Promise<any>;
2766
+ /**
2767
+ * @see https://redis.io/commands/linsert
2768
+ */
2769
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
2770
+ /**
2771
+ * @see https://redis.io/commands/llen
2772
+ */
2773
+ llen: (key: string) => Promise<number>;
2774
+ /**
2775
+ * @see https://redis.io/commands/lmove
2776
+ */
2777
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
2778
+ /**
2779
+ * @see https://redis.io/commands/lpop
2780
+ */
2781
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2782
+ /**
2783
+ * @see https://redis.io/commands/lpos
2784
+ */
2785
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
2786
+ rank?: number | undefined;
2787
+ count?: number | undefined;
2788
+ maxLen?: number | undefined;
2789
+ } | undefined) => Promise<TData>;
2790
+ /**
2791
+ * @see https://redis.io/commands/lpush
2792
+ */
2793
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2794
+ /**
2795
+ * @see https://redis.io/commands/lpushx
2796
+ */
2797
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2798
+ /**
2799
+ * @see https://redis.io/commands/lrange
2800
+ */
2801
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
2802
+ /**
2803
+ * @see https://redis.io/commands/lrem
2804
+ */
2805
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
2806
+ /**
2807
+ * @see https://redis.io/commands/lset
2808
+ */
2809
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
2810
+ /**
2811
+ * @see https://redis.io/commands/ltrim
2812
+ */
2813
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
2814
+ /**
2815
+ * @see https://redis.io/commands/mget
2816
+ */
2817
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
2818
+ /**
2819
+ * @see https://redis.io/commands/mset
2820
+ */
2821
+ mset: <TData>(kv: {
2822
+ [key: string]: TData;
2823
+ }) => Promise<"OK">;
2824
+ /**
2825
+ * @see https://redis.io/commands/msetnx
2826
+ */
2827
+ msetnx: <TData>(kv: {
2828
+ [key: string]: TData;
2829
+ }) => Promise<number>;
2830
+ /**
2831
+ * @see https://redis.io/commands/persist
2832
+ */
2833
+ persist: (key: string) => Promise<0 | 1>;
2834
+ /**
2835
+ * @see https://redis.io/commands/pexpire
2836
+ */
2837
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
2838
+ /**
2839
+ * @see https://redis.io/commands/pexpireat
2840
+ */
2841
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
2842
+ /**
2843
+ * @see https://redis.io/commands/pfadd
2844
+ */
2845
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
2846
+ /**
2847
+ * @see https://redis.io/commands/pfcount
2848
+ */
2849
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
2850
+ /**
2851
+ * @see https://redis.io/commands/pfmerge
2852
+ */
2853
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
2854
+ /**
2855
+ * @see https://redis.io/commands/ping
2856
+ */
2857
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
2858
+ /**
2859
+ * @see https://redis.io/commands/psetex
2860
+ */
2861
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
2862
+ /**
2863
+ * @see https://redis.io/commands/pttl
2864
+ */
2865
+ pttl: (key: string) => Promise<number>;
2866
+ /**
2867
+ * @see https://redis.io/commands/publish
2868
+ */
2869
+ publish: (channel: string, message: unknown) => Promise<number>;
2870
+ /**
2871
+ * @see https://redis.io/commands/randomkey
2872
+ */
2873
+ randomkey: () => Promise<string | null>;
2874
+ /**
2875
+ * @see https://redis.io/commands/rename
2876
+ */
2877
+ rename: (source: string, destination: string) => Promise<"OK">;
2878
+ /**
2879
+ * @see https://redis.io/commands/renamenx
2880
+ */
2881
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
2882
+ /**
2883
+ * @see https://redis.io/commands/rpop
2884
+ */
2885
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
2886
+ /**
2887
+ * @see https://redis.io/commands/rpush
2888
+ */
2889
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2890
+ /**
2891
+ * @see https://redis.io/commands/rpushx
2892
+ */
2893
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2894
+ /**
2895
+ * @see https://redis.io/commands/sadd
2896
+ */
2897
+ sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
2898
+ /**
2899
+ * @see https://redis.io/commands/scan
2900
+ */
2901
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
2902
+ /**
2903
+ * @see https://redis.io/commands/scard
2904
+ */
2905
+ scard: (key: string) => Promise<number>;
2906
+ /**
2907
+ * @see https://redis.io/commands/script-exists
2908
+ */
2909
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
2910
+ /**
2911
+ * @see https://redis.io/commands/script-flush
2912
+ */
2913
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
2914
+ /**
2915
+ * @see https://redis.io/commands/script-load
2916
+ */
2917
+ scriptLoad: (script: string) => Promise<string>;
2918
+ /**
2919
+ * @see https://redis.io/commands/sdiff
2920
+ */
2921
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
2922
+ /**
2923
+ * @see https://redis.io/commands/sdiffstore
2924
+ */
2925
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
2926
+ /**
2927
+ * @see https://redis.io/commands/set
2928
+ */
2929
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
2930
+ /**
2931
+ * @see https://redis.io/commands/setbit
2932
+ */
2933
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
2934
+ /**
2935
+ * @see https://redis.io/commands/setex
2936
+ */
2937
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
2938
+ /**
2939
+ * @see https://redis.io/commands/setnx
2940
+ */
2941
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
2942
+ /**
2943
+ * @see https://redis.io/commands/setrange
2944
+ */
2945
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
2946
+ /**
2947
+ * @see https://redis.io/commands/sinter
2948
+ */
2949
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
2950
+ /**
2951
+ * @see https://redis.io/commands/sinterstore
2952
+ */
2953
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
2954
+ /**
2955
+ * @see https://redis.io/commands/sismember
2956
+ */
2957
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
2958
+ /**
2959
+ * @see https://redis.io/commands/smismember
2960
+ */
2961
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
2962
+ /**
2963
+ * @see https://redis.io/commands/smembers
2964
+ */
2965
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
2966
+ /**
2967
+ * @see https://redis.io/commands/smove
2968
+ */
2969
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
2970
+ /**
2971
+ * @see https://redis.io/commands/spop
2972
+ */
2973
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2974
+ /**
2975
+ * @see https://redis.io/commands/srandmember
2976
+ */
2977
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2978
+ /**
2979
+ * @see https://redis.io/commands/srem
2980
+ */
2981
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
2982
+ /**
2983
+ * @see https://redis.io/commands/sscan
2984
+ */
2985
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
2986
+ /**
2987
+ * @see https://redis.io/commands/strlen
2988
+ */
2989
+ strlen: (key: string) => Promise<number>;
2990
+ /**
2991
+ * @see https://redis.io/commands/sunion
2992
+ */
2993
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
2994
+ /**
2995
+ * @see https://redis.io/commands/sunionstore
2996
+ */
2997
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
2998
+ /**
2999
+ * @see https://redis.io/commands/time
3000
+ */
3001
+ time: () => Promise<[number, number]>;
3002
+ /**
3003
+ * @see https://redis.io/commands/touch
3004
+ */
3005
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
3006
+ /**
3007
+ * @see https://redis.io/commands/ttl
3008
+ */
3009
+ ttl: (key: string) => Promise<number>;
3010
+ /**
3011
+ * @see https://redis.io/commands/type
3012
+ */
3013
+ type: (key: string) => Promise<Type>;
3014
+ /**
3015
+ * @see https://redis.io/commands/unlink
3016
+ */
3017
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
3018
+ /**
3019
+ * @see https://redis.io/commands/xadd
3020
+ */
3021
+ xadd: (key: string, id: string, entries: {
3022
+ [field: string]: unknown;
3023
+ }, opts?: {
3024
+ nomkStream?: boolean | undefined;
3025
+ trim?: (({
3026
+ type: "MAXLEN" | "maxlen";
3027
+ threshold: number;
3028
+ } | {
3029
+ type: "MINID" | "minid";
3030
+ threshold: string;
3031
+ }) & ({
3032
+ comparison: "~";
3033
+ limit?: number | undefined;
3034
+ } | {
3035
+ comparison: "=";
3036
+ limit?: undefined;
3037
+ })) | undefined;
3038
+ } | undefined) => Promise<string>;
3039
+ /**
3040
+ * @see https://redis.io/commands/xrange
3041
+ */
3042
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3043
+ /**
3044
+ * @see https://redis.io/commands/zadd
3045
+ */
3046
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
3047
+ /**
3048
+ * @see https://redis.io/commands/zcard
3049
+ */
3050
+ zcard: (key: string) => Promise<number>;
3051
+ /**
3052
+ * @see https://redis.io/commands/zcount
3053
+ */
3054
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
3055
+ /**
3056
+ * @see https://redis.io/commands/zdiffstore
3057
+ */
3058
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
3059
+ /**
3060
+ * @see https://redis.io/commands/zincrby
3061
+ */
3062
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
3063
+ /**
3064
+ * @see https://redis.io/commands/zinterstore
3065
+ */
3066
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
3067
+ /**
3068
+ * @see https://redis.io/commands/zlexcount
3069
+ */
3070
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
3071
+ /**
3072
+ * @see https://redis.io/commands/zmscore
3073
+ */
3074
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
3075
+ /**
3076
+ * @see https://redis.io/commands/zpopmax
3077
+ */
3078
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3079
+ /**
3080
+ * @see https://redis.io/commands/zpopmin
3081
+ */
3082
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3083
+ /**
3084
+ * @see https://redis.io/commands/zrange
3085
+ */
3086
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3087
+ key: string,
3088
+ min: `(${string}` | `[${string}` | "-" | "+",
3089
+ max: `(${string}` | `[${string}` | "-" | "+",
3090
+ opts: {
3091
+ byLex: true;
3092
+ } & ZRangeCommandOptions
3093
+ ] | [
3094
+ key: string,
3095
+ min: number | `(${number}` | "-inf" | "+inf",
3096
+ max: number | `(${number}` | "-inf" | "+inf",
3097
+ opts: {
3098
+ byScore: true;
3099
+ } & ZRangeCommandOptions
3100
+ ]) => Promise<TData>;
3101
+ /**
3102
+ * @see https://redis.io/commands/zrank
3103
+ */
3104
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
3105
+ /**
3106
+ * @see https://redis.io/commands/zrem
3107
+ */
3108
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3109
+ /**
3110
+ * @see https://redis.io/commands/zremrangebylex
3111
+ */
3112
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
3113
+ /**
3114
+ * @see https://redis.io/commands/zremrangebyrank
3115
+ */
3116
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
3117
+ /**
3118
+ * @see https://redis.io/commands/zremrangebyscore
3119
+ */
3120
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
3121
+ /**
3122
+ * @see https://redis.io/commands/zrevrank
3123
+ */
3124
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
3125
+ /**
3126
+ * @see https://redis.io/commands/zscan
3127
+ */
3128
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
3129
+ /**
3130
+ * @see https://redis.io/commands/zscore
3131
+ */
3132
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
3133
+ /**
3134
+ * @see https://redis.io/commands/zunion
3135
+ */
3136
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
3137
+ /**
3138
+ * @see https://redis.io/commands/zunionstore
3139
+ */
3140
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3141
+ }
3142
+
3143
+ /**
3144
+ * @see https://redis.io/commands/zdiffstore
3145
+ */
3146
+ declare class ZDiffStoreCommand extends Command<number, number> {
3147
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3148
+ }
3149
+
3150
+ /**
3151
+ * @see https://redis.io/commands/zmscore
3152
+ */
3153
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3154
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3155
+ }
3156
+
3157
+ 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 };