@upstash/redis 0.0.0-ci.d96841bb → 0.0.0-ci.d9c08accc3bdd7a1d21f3d860e54e9cb1570f23e-20231214113223

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 +52 -281
  2. package/chunk-OYFBHYRC.js +1 -0
  3. package/chunk-QR3OMNVI.mjs +1 -0
  4. package/cloudflare.d.mts +45 -0
  5. package/cloudflare.d.ts +45 -0
  6. package/cloudflare.js +1 -0
  7. package/cloudflare.mjs +1 -0
  8. package/fastly.d.mts +43 -0
  9. package/fastly.d.ts +43 -0
  10. package/fastly.js +1 -0
  11. package/fastly.mjs +1 -0
  12. package/nodejs.d.mts +80 -0
  13. package/nodejs.d.ts +80 -0
  14. package/nodejs.js +1 -0
  15. package/nodejs.mjs +1 -0
  16. package/package.json +1 -101
  17. package/zmscore-415f6c9f.d.ts +3159 -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 -12
  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 -77
  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 -62
  142. package/esm/platforms/fastly.js +0 -40
  143. package/esm/platforms/node_with_fetch.js +0 -60
  144. package/esm/platforms/nodejs.js +0 -59
  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 -16
  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 -81
  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 -89
  268. package/script/platforms/fastly.js +0 -67
  269. package/script/platforms/node_with_fetch.js +0 -87
  270. package/script/platforms/nodejs.js +0 -86
  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 -7
  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 -54
  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 -42
  393. package/types/platforms/fastly.d.ts +0 -45
  394. package/types/platforms/node_with_fetch.d.ts +0 -82
  395. package/types/platforms/nodejs.d.ts +0 -81
@@ -0,0 +1,3159 @@
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
+ incr?: true;
1361
+ };
1362
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
1363
+ type ScoreMember<TData> = {
1364
+ score: number;
1365
+ member: TData;
1366
+ };
1367
+ /**
1368
+ * @see https://redis.io/commands/zadd
1369
+ */
1370
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1371
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1372
+ }
1373
+
1374
+ /**
1375
+ * @see https://redis.io/commands/zcard
1376
+ */
1377
+ declare class ZCardCommand extends Command<number, number> {
1378
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1379
+ }
1380
+
1381
+ /**
1382
+ * @see https://redis.io/commands/zcount
1383
+ */
1384
+ declare class ZCountCommand extends Command<number, number> {
1385
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1386
+ }
1387
+
1388
+ /**
1389
+ * @see https://redis.io/commands/zincrby
1390
+ */
1391
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1392
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1393
+ }
1394
+
1395
+ /**
1396
+ * @see https://redis.io/commands/zlexcount
1397
+ */
1398
+ declare class ZLexCountCommand extends Command<number, number> {
1399
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1400
+ }
1401
+
1402
+ /**
1403
+ * @see https://redis.io/commands/zpopmax
1404
+ */
1405
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1406
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1407
+ }
1408
+
1409
+ /**
1410
+ * @see https://redis.io/commands/zpopmin
1411
+ */
1412
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1413
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1414
+ }
1415
+
1416
+ type ZRangeCommandOptions = {
1417
+ withScores?: boolean;
1418
+ rev?: boolean;
1419
+ } & ({
1420
+ byScore: true;
1421
+ byLex?: never;
1422
+ } | {
1423
+ byScore?: never;
1424
+ byLex: true;
1425
+ } | {
1426
+ byScore?: never;
1427
+ byLex?: never;
1428
+ }) & ({
1429
+ offset: number;
1430
+ count: number;
1431
+ } | {
1432
+ offset?: never;
1433
+ count?: never;
1434
+ });
1435
+ /**
1436
+ * @see https://redis.io/commands/zrange
1437
+ */
1438
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1439
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1440
+ constructor(cmd: [
1441
+ key: string,
1442
+ min: `(${string}` | `[${string}` | "-" | "+",
1443
+ max: `(${string}` | `[${string}` | "-" | "+",
1444
+ opts: {
1445
+ byLex: true;
1446
+ } & ZRangeCommandOptions
1447
+ ], cmdOpts?: CommandOptions<string[], TData>);
1448
+ constructor(cmd: [
1449
+ key: string,
1450
+ min: number | `(${number}` | "-inf" | "+inf",
1451
+ max: number | `(${number}` | "-inf" | "+inf",
1452
+ opts: {
1453
+ byScore: true;
1454
+ } & ZRangeCommandOptions
1455
+ ], cmdOpts?: CommandOptions<string[], TData>);
1456
+ }
1457
+
1458
+ /**
1459
+ * @see https://redis.io/commands/zrank
1460
+ */
1461
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1462
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1463
+ }
1464
+
1465
+ /**
1466
+ * @see https://redis.io/commands/zrem
1467
+ */
1468
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1469
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1470
+ }
1471
+
1472
+ /**
1473
+ * @see https://redis.io/commands/zremrangebylex
1474
+ */
1475
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1476
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1477
+ }
1478
+
1479
+ /**
1480
+ * @see https://redis.io/commands/zremrangebyrank
1481
+ */
1482
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1483
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1484
+ }
1485
+
1486
+ /**
1487
+ * @see https://redis.io/commands/zremrangebyscore
1488
+ */
1489
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1490
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1491
+ }
1492
+
1493
+ /**
1494
+ * @see https://redis.io/commands/zrevrank
1495
+ */
1496
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1497
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1498
+ }
1499
+
1500
+ /**
1501
+ * @see https://redis.io/commands/zscan
1502
+ */
1503
+ declare class ZScanCommand extends Command<[
1504
+ number,
1505
+ (string | number)[]
1506
+ ], [
1507
+ number,
1508
+ (string | number)[]
1509
+ ]> {
1510
+ constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1511
+ }
1512
+
1513
+ /**
1514
+ * @see https://redis.io/commands/zscore
1515
+ */
1516
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1517
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1518
+ }
1519
+
1520
+ type InferResponseData<T extends unknown[]> = {
1521
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1522
+ };
1523
+ /**
1524
+ * Upstash REST API supports command pipelining to send multiple commands in
1525
+ * batch, instead of sending each command one by one and waiting for a response.
1526
+ * When using pipelines, several commands are sent using a single HTTP request,
1527
+ * and a single JSON array response is returned. Each item in the response array
1528
+ * corresponds to the command in the same order within the pipeline.
1529
+ *
1530
+ * **NOTE:**
1531
+ *
1532
+ * Execution of the pipeline is not atomic. Even though each command in
1533
+ * the pipeline will be executed in order, commands sent by other clients can
1534
+ * interleave with the pipeline.
1535
+ *
1536
+ * **Examples:**
1537
+ *
1538
+ * ```ts
1539
+ * const p = redis.pipeline() // or redis.multi()
1540
+ * p.set("key","value")
1541
+ * p.get("key")
1542
+ * const res = await p.exec()
1543
+ * ```
1544
+ *
1545
+ * You can also chain commands together
1546
+ * ```ts
1547
+ * const p = redis.pipeline()
1548
+ * const res = await p.set("key","value").get("key").exec()
1549
+ * ```
1550
+ *
1551
+ * Return types are inferred if all commands are chained, but you can still
1552
+ * override the response type manually:
1553
+ * ```ts
1554
+ * redis.pipeline()
1555
+ * .set("key", { greeting: "hello"})
1556
+ * .get("key")
1557
+ * .exec<["OK", { greeting: string } ]>()
1558
+ *
1559
+ * ```
1560
+ */
1561
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1562
+ private client;
1563
+ private commands;
1564
+ private commandOptions?;
1565
+ private multiExec;
1566
+ constructor(opts: {
1567
+ client: Requester;
1568
+ commandOptions?: CommandOptions<any, any>;
1569
+ multiExec?: boolean;
1570
+ });
1571
+ /**
1572
+ * Send the pipeline request to upstash.
1573
+ *
1574
+ * Returns an array with the results of all pipelined commands.
1575
+ *
1576
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1577
+ * ```ts
1578
+ * const p = redis.pipeline()
1579
+ * p.get("key")
1580
+ * const result = p.exec<[{ greeting: string }]>()
1581
+ * ```
1582
+ */
1583
+ exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
1584
+ /**
1585
+ * Returns the length of pipeline before the execution
1586
+ */
1587
+ length(): number;
1588
+ /**
1589
+ * Pushes a command into the pipeline and returns a chainable instance of the
1590
+ * pipeline
1591
+ */
1592
+ private chain;
1593
+ /**
1594
+ * @see https://redis.io/commands/append
1595
+ */
1596
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1597
+ /**
1598
+ * @see https://redis.io/commands/bitcount
1599
+ */
1600
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
1601
+ /**
1602
+ * @see https://redis.io/commands/bitop
1603
+ */
1604
+ bitop: {
1605
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
1606
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[
1607
+ ...TCommands,
1608
+ BitOpCommand
1609
+ ]>;
1610
+ };
1611
+ /**
1612
+ * @see https://redis.io/commands/bitpos
1613
+ */
1614
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1615
+ /**
1616
+ * @see https://redis.io/commands/copy
1617
+ */
1618
+ copy: (key: string, destinationKey: string, opts?: {
1619
+ replace: boolean;
1620
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
1621
+ /**
1622
+ * @see https://redis.io/commands/zdiffstore
1623
+ */
1624
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1625
+ /**
1626
+ * @see https://redis.io/commands/dbsize
1627
+ */
1628
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
1629
+ /**
1630
+ * @see https://redis.io/commands/decr
1631
+ */
1632
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1633
+ /**
1634
+ * @see https://redis.io/commands/decrby
1635
+ */
1636
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
1637
+ /**
1638
+ * @see https://redis.io/commands/del
1639
+ */
1640
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1641
+ /**
1642
+ * @see https://redis.io/commands/echo
1643
+ */
1644
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
1645
+ /**
1646
+ * @see https://redis.io/commands/eval
1647
+ */
1648
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1649
+ /**
1650
+ * @see https://redis.io/commands/evalsha
1651
+ */
1652
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1653
+ /**
1654
+ * @see https://redis.io/commands/exists
1655
+ */
1656
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1657
+ /**
1658
+ * @see https://redis.io/commands/expire
1659
+ */
1660
+ expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1661
+ /**
1662
+ * @see https://redis.io/commands/expireat
1663
+ */
1664
+ expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1665
+ /**
1666
+ * @see https://redis.io/commands/flushall
1667
+ */
1668
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1669
+ /**
1670
+ * @see https://redis.io/commands/flushdb
1671
+ */
1672
+ flushdb: (opts?: {
1673
+ async?: boolean | undefined;
1674
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1675
+ /**
1676
+ * @see https://redis.io/commands/get
1677
+ */
1678
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1679
+ /**
1680
+ * @see https://redis.io/commands/getbit
1681
+ */
1682
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1683
+ /**
1684
+ * @see https://redis.io/commands/getdel
1685
+ */
1686
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1687
+ /**
1688
+ * @see https://redis.io/commands/getrange
1689
+ */
1690
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
1691
+ /**
1692
+ * @see https://redis.io/commands/getset
1693
+ */
1694
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1695
+ /**
1696
+ * @see https://redis.io/commands/hdel
1697
+ */
1698
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1699
+ /**
1700
+ * @see https://redis.io/commands/hexists
1701
+ */
1702
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1703
+ /**
1704
+ * @see https://redis.io/commands/hget
1705
+ */
1706
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1707
+ /**
1708
+ * @see https://redis.io/commands/hgetall
1709
+ */
1710
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1711
+ /**
1712
+ * @see https://redis.io/commands/hincrby
1713
+ */
1714
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1715
+ /**
1716
+ * @see https://redis.io/commands/hincrbyfloat
1717
+ */
1718
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1719
+ /**
1720
+ * @see https://redis.io/commands/hkeys
1721
+ */
1722
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1723
+ /**
1724
+ * @see https://redis.io/commands/hlen
1725
+ */
1726
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1727
+ /**
1728
+ * @see https://redis.io/commands/hmget
1729
+ */
1730
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1731
+ /**
1732
+ * @see https://redis.io/commands/hmset
1733
+ */
1734
+ hmset: <TData>(key: string, kv: {
1735
+ [field: string]: TData;
1736
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1737
+ /**
1738
+ * @see https://redis.io/commands/hrandfield
1739
+ */
1740
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1741
+ /**
1742
+ * @see https://redis.io/commands/hscan
1743
+ */
1744
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
1745
+ /**
1746
+ * @see https://redis.io/commands/hset
1747
+ */
1748
+ hset: <TData>(key: string, kv: {
1749
+ [field: string]: TData;
1750
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
1751
+ /**
1752
+ * @see https://redis.io/commands/hsetnx
1753
+ */
1754
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1755
+ /**
1756
+ * @see https://redis.io/commands/hstrlen
1757
+ */
1758
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1759
+ /**
1760
+ * @see https://redis.io/commands/hvals
1761
+ */
1762
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
1763
+ /**
1764
+ * @see https://redis.io/commands/incr
1765
+ */
1766
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1767
+ /**
1768
+ * @see https://redis.io/commands/incrby
1769
+ */
1770
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1771
+ /**
1772
+ * @see https://redis.io/commands/incrbyfloat
1773
+ */
1774
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1775
+ /**
1776
+ * @see https://redis.io/commands/keys
1777
+ */
1778
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1779
+ /**
1780
+ * @see https://redis.io/commands/lindex
1781
+ */
1782
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
1783
+ /**
1784
+ * @see https://redis.io/commands/linsert
1785
+ */
1786
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1787
+ /**
1788
+ * @see https://redis.io/commands/llen
1789
+ */
1790
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1791
+ /**
1792
+ * @see https://redis.io/commands/lmove
1793
+ */
1794
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
1795
+ /**
1796
+ * @see https://redis.io/commands/lpop
1797
+ */
1798
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1799
+ /**
1800
+ * @see https://redis.io/commands/lpos
1801
+ */
1802
+ lpos: <TData>(key: string, element: unknown, opts?: {
1803
+ rank?: number | undefined;
1804
+ count?: number | undefined;
1805
+ maxLen?: number | undefined;
1806
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1807
+ /**
1808
+ * @see https://redis.io/commands/lpush
1809
+ */
1810
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1811
+ /**
1812
+ * @see https://redis.io/commands/lpushx
1813
+ */
1814
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1815
+ /**
1816
+ * @see https://redis.io/commands/lrange
1817
+ */
1818
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
1819
+ /**
1820
+ * @see https://redis.io/commands/lrem
1821
+ */
1822
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1823
+ /**
1824
+ * @see https://redis.io/commands/lset
1825
+ */
1826
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
1827
+ /**
1828
+ * @see https://redis.io/commands/ltrim
1829
+ */
1830
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
1831
+ /**
1832
+ * @see https://redis.io/commands/mget
1833
+ */
1834
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
1835
+ /**
1836
+ * @see https://redis.io/commands/mset
1837
+ */
1838
+ mset: <TData>(kv: {
1839
+ [key: string]: TData;
1840
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1841
+ /**
1842
+ * @see https://redis.io/commands/msetnx
1843
+ */
1844
+ msetnx: <TData>(kv: {
1845
+ [key: string]: TData;
1846
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
1847
+ /**
1848
+ * @see https://redis.io/commands/persist
1849
+ */
1850
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1851
+ /**
1852
+ * @see https://redis.io/commands/pexpire
1853
+ */
1854
+ pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1855
+ /**
1856
+ * @see https://redis.io/commands/pexpireat
1857
+ */
1858
+ pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1859
+ /**
1860
+ * @see https://redis.io/commands/pfadd
1861
+ */
1862
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
1863
+ /**
1864
+ * @see https://redis.io/commands/pfcount
1865
+ */
1866
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1867
+ /**
1868
+ * @see https://redis.io/commands/pfmerge
1869
+ */
1870
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
1871
+ /**
1872
+ * @see https://redis.io/commands/ping
1873
+ */
1874
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
1875
+ /**
1876
+ * @see https://redis.io/commands/psetex
1877
+ */
1878
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
1879
+ /**
1880
+ * @see https://redis.io/commands/pttl
1881
+ */
1882
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1883
+ /**
1884
+ * @see https://redis.io/commands/publish
1885
+ */
1886
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
1887
+ /**
1888
+ * @see https://redis.io/commands/randomkey
1889
+ */
1890
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
1891
+ /**
1892
+ * @see https://redis.io/commands/rename
1893
+ */
1894
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
1895
+ /**
1896
+ * @see https://redis.io/commands/renamenx
1897
+ */
1898
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1899
+ /**
1900
+ * @see https://redis.io/commands/rpop
1901
+ */
1902
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1903
+ /**
1904
+ * @see https://redis.io/commands/rpush
1905
+ */
1906
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1907
+ /**
1908
+ * @see https://redis.io/commands/rpushx
1909
+ */
1910
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1911
+ /**
1912
+ * @see https://redis.io/commands/sadd
1913
+ */
1914
+ sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1915
+ /**
1916
+ * @see https://redis.io/commands/scan
1917
+ */
1918
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
1919
+ /**
1920
+ * @see https://redis.io/commands/scard
1921
+ */
1922
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1923
+ /**
1924
+ * @see https://redis.io/commands/script-exists
1925
+ */
1926
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
1927
+ /**
1928
+ * @see https://redis.io/commands/script-flush
1929
+ */
1930
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1931
+ /**
1932
+ * @see https://redis.io/commands/script-load
1933
+ */
1934
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
1935
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
1936
+ /**
1937
+ * @see https://redis.io/commands/sdiffstore
1938
+ */
1939
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1940
+ /**
1941
+ * @see https://redis.io/commands/set
1942
+ */
1943
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
1944
+ /**
1945
+ * @see https://redis.io/commands/setbit
1946
+ */
1947
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1948
+ /**
1949
+ * @see https://redis.io/commands/setex
1950
+ */
1951
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
1952
+ /**
1953
+ * @see https://redis.io/commands/setnx
1954
+ */
1955
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1956
+ /**
1957
+ * @see https://redis.io/commands/setrange
1958
+ */
1959
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1960
+ /**
1961
+ * @see https://redis.io/commands/sinter
1962
+ */
1963
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
1964
+ /**
1965
+ * @see https://redis.io/commands/sinterstore
1966
+ */
1967
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1968
+ /**
1969
+ * @see https://redis.io/commands/sismember
1970
+ */
1971
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1972
+ /**
1973
+ * @see https://redis.io/commands/smembers
1974
+ */
1975
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
1976
+ /**
1977
+ * @see https://redis.io/commands/smismember
1978
+ */
1979
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
1980
+ /**
1981
+ * @see https://redis.io/commands/smove
1982
+ */
1983
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1984
+ /**
1985
+ * @see https://redis.io/commands/spop
1986
+ */
1987
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1988
+ /**
1989
+ * @see https://redis.io/commands/srandmember
1990
+ */
1991
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1992
+ /**
1993
+ * @see https://redis.io/commands/srem
1994
+ */
1995
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1996
+ /**
1997
+ * @see https://redis.io/commands/sscan
1998
+ */
1999
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
2000
+ /**
2001
+ * @see https://redis.io/commands/strlen
2002
+ */
2003
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2004
+ /**
2005
+ * @see https://redis.io/commands/sunion
2006
+ */
2007
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2008
+ /**
2009
+ * @see https://redis.io/commands/sunionstore
2010
+ */
2011
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2012
+ /**
2013
+ * @see https://redis.io/commands/time
2014
+ */
2015
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
2016
+ /**
2017
+ * @see https://redis.io/commands/touch
2018
+ */
2019
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2020
+ /**
2021
+ * @see https://redis.io/commands/ttl
2022
+ */
2023
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2024
+ /**
2025
+ * @see https://redis.io/commands/type
2026
+ */
2027
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
2028
+ /**
2029
+ * @see https://redis.io/commands/unlink
2030
+ */
2031
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2032
+ /**
2033
+ * @see https://redis.io/commands/zadd
2034
+ */
2035
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2036
+ /**
2037
+ * @see https://redis.io/commands/zcard
2038
+ */
2039
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2040
+ /**
2041
+ * @see https://redis.io/commands/zcount
2042
+ */
2043
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
2044
+ /**
2045
+ * @see https://redis.io/commands/zincrby
2046
+ */
2047
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2048
+ /**
2049
+ * @see https://redis.io/commands/zinterstore
2050
+ */
2051
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2052
+ /**
2053
+ * @see https://redis.io/commands/zlexcount
2054
+ */
2055
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2056
+ /**
2057
+ * @see https://redis.io/commands/zmscore
2058
+ */
2059
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
2060
+ /**
2061
+ * @see https://redis.io/commands/zpopmax
2062
+ */
2063
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2064
+ /**
2065
+ * @see https://redis.io/commands/zpopmin
2066
+ */
2067
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2068
+ /**
2069
+ * @see https://redis.io/commands/zrange
2070
+ */
2071
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2072
+ key: string,
2073
+ min: `(${string}` | `[${string}` | "-" | "+",
2074
+ max: `(${string}` | `[${string}` | "-" | "+",
2075
+ opts: {
2076
+ byLex: true;
2077
+ } & ZRangeCommandOptions
2078
+ ] | [
2079
+ key: string,
2080
+ min: number | `(${number}` | "-inf" | "+inf",
2081
+ max: number | `(${number}` | "-inf" | "+inf",
2082
+ opts: {
2083
+ byScore: true;
2084
+ } & ZRangeCommandOptions
2085
+ ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2086
+ /**
2087
+ * @see https://redis.io/commands/zrank
2088
+ */
2089
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2090
+ /**
2091
+ * @see https://redis.io/commands/zrem
2092
+ */
2093
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2094
+ /**
2095
+ * @see https://redis.io/commands/zremrangebylex
2096
+ */
2097
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2098
+ /**
2099
+ * @see https://redis.io/commands/zremrangebyrank
2100
+ */
2101
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
2102
+ /**
2103
+ * @see https://redis.io/commands/zremrangebyscore
2104
+ */
2105
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2106
+ /**
2107
+ * @see https://redis.io/commands/zrevrank
2108
+ */
2109
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2110
+ /**
2111
+ * @see https://redis.io/commands/zscan
2112
+ */
2113
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
2114
+ /**
2115
+ * @see https://redis.io/commands/zscore
2116
+ */
2117
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2118
+ /**
2119
+ * @see https://redis.io/commands/zunionstore
2120
+ */
2121
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2122
+ /**
2123
+ * @see https://redis.io/commands/zunion
2124
+ */
2125
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2126
+ /**
2127
+ * @see https://redis.io/commands/?group=json
2128
+ */
2129
+ get json(): {
2130
+ /**
2131
+ * @see https://redis.io/commands/json.arrappend
2132
+ */
2133
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2134
+ /**
2135
+ * @see https://redis.io/commands/json.arrindex
2136
+ */
2137
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2138
+ /**
2139
+ * @see https://redis.io/commands/json.arrinsert
2140
+ */
2141
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2142
+ /**
2143
+ * @see https://redis.io/commands/json.arrlen
2144
+ */
2145
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2146
+ /**
2147
+ * @see https://redis.io/commands/json.arrpop
2148
+ */
2149
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2150
+ /**
2151
+ * @see https://redis.io/commands/json.arrtrim
2152
+ */
2153
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2154
+ /**
2155
+ * @see https://redis.io/commands/json.clear
2156
+ */
2157
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2158
+ /**
2159
+ * @see https://redis.io/commands/json.del
2160
+ */
2161
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2162
+ /**
2163
+ * @see https://redis.io/commands/json.forget
2164
+ */
2165
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2166
+ /**
2167
+ * @see https://redis.io/commands/geoadd
2168
+ */
2169
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2170
+ /**
2171
+ * @see https://redis.io/commands/geodist
2172
+ */
2173
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
2174
+ /**
2175
+ * @see https://redis.io/commands/geopos
2176
+ */
2177
+ geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
2178
+ lng: number;
2179
+ lat: number;
2180
+ }[]>]>;
2181
+ /**
2182
+ * @see https://redis.io/commands/geohash
2183
+ */
2184
+ geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
2185
+ /**
2186
+ * @see https://redis.io/commands/geosearch
2187
+ */
2188
+ geosearch: (key: string, centerPoint: {
2189
+ type: "FROMLONLAT" | "fromlonlat";
2190
+ coordinate: {
2191
+ lon: number;
2192
+ lat: number;
2193
+ };
2194
+ } | {
2195
+ type: "FROMMEMBER" | "frommember";
2196
+ member: unknown;
2197
+ }, shape: {
2198
+ type: "BYRADIUS" | "byradius";
2199
+ radius: number;
2200
+ radiusType: "M" | "KM" | "FT" | "MI";
2201
+ } | {
2202
+ type: "BYBOX" | "bybox";
2203
+ rect: {
2204
+ width: number;
2205
+ height: number;
2206
+ };
2207
+ rectType: "M" | "KM" | "FT" | "MI";
2208
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2209
+ count?: {
2210
+ limit: number;
2211
+ any?: boolean | undefined;
2212
+ } | undefined;
2213
+ withCoord?: boolean | undefined;
2214
+ withDist?: boolean | undefined;
2215
+ withHash?: boolean | undefined;
2216
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
2217
+ member: unknown;
2218
+ } & {
2219
+ coord?: {
2220
+ long: number;
2221
+ lat: number;
2222
+ } | undefined;
2223
+ dist?: number | undefined;
2224
+ hash?: string | undefined;
2225
+ })[]>]>;
2226
+ /**
2227
+ * @see https://redis.io/commands/geosearchstore
2228
+ */
2229
+ geosearchstore: (destination: string, key: string, centerPoint: {
2230
+ type: "FROMLONLAT" | "fromlonlat";
2231
+ coordinate: {
2232
+ lon: number;
2233
+ lat: number;
2234
+ };
2235
+ } | {
2236
+ type: "FROMMEMBER" | "frommember";
2237
+ member: unknown;
2238
+ }, shape: {
2239
+ type: "BYRADIUS" | "byradius";
2240
+ radius: number;
2241
+ radiusType: "M" | "KM" | "FT" | "MI";
2242
+ } | {
2243
+ type: "BYBOX" | "bybox";
2244
+ rect: {
2245
+ width: number;
2246
+ height: number;
2247
+ };
2248
+ rectType: "M" | "KM" | "FT" | "MI";
2249
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2250
+ count?: {
2251
+ limit: number;
2252
+ any?: boolean | undefined;
2253
+ } | undefined;
2254
+ storeDist?: boolean | undefined;
2255
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2256
+ /**
2257
+ * @see https://redis.io/commands/json.get
2258
+ */
2259
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2260
+ /**
2261
+ * @see https://redis.io/commands/json.mget
2262
+ */
2263
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2264
+ /**
2265
+ * @see https://redis.io/commands/json.numincrby
2266
+ */
2267
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2268
+ /**
2269
+ * @see https://redis.io/commands/json.nummultby
2270
+ */
2271
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2272
+ /**
2273
+ * @see https://redis.io/commands/json.objkeys
2274
+ */
2275
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
2276
+ /**
2277
+ * @see https://redis.io/commands/json.objlen
2278
+ */
2279
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2280
+ /**
2281
+ * @see https://redis.io/commands/json.resp
2282
+ */
2283
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2284
+ /**
2285
+ * @see https://redis.io/commands/json.set
2286
+ */
2287
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2288
+ nx: true;
2289
+ xx?: undefined;
2290
+ } | {
2291
+ nx?: undefined;
2292
+ xx: true;
2293
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2294
+ /**
2295
+ * @see https://redis.io/commands/json.strappend
2296
+ */
2297
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2298
+ /**
2299
+ * @see https://redis.io/commands/json.strlen
2300
+ */
2301
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2302
+ /**
2303
+ * @see https://redis.io/commands/json.toggle
2304
+ */
2305
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
2306
+ /**
2307
+ * @see https://redis.io/commands/json.type
2308
+ */
2309
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2310
+ };
2311
+ }
2312
+
2313
+ /**
2314
+ * Creates a new script.
2315
+ *
2316
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2317
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2318
+ * the entire script. Afterwards, the script is cached on the server.
2319
+ *
2320
+ * @example
2321
+ * ```ts
2322
+ * const redis = new Redis({...})
2323
+ *
2324
+ * const script = redis.createScript<string>("return ARGV[1];")
2325
+ * const arg1 = await script.eval([], ["Hello World"])
2326
+ * expect(arg1, "Hello World")
2327
+ * ```
2328
+ */
2329
+ declare class Script<TResult = unknown> {
2330
+ readonly script: string;
2331
+ readonly sha1: string;
2332
+ private readonly redis;
2333
+ constructor(redis: Redis, script: string);
2334
+ /**
2335
+ * Send an `EVAL` command to redis.
2336
+ */
2337
+ eval(keys: string[], args: string[]): Promise<TResult>;
2338
+ /**
2339
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
2340
+ */
2341
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
2342
+ /**
2343
+ * Optimistically try to run `EVALSHA` first.
2344
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
2345
+ *
2346
+ * Following calls will be able to use the cached script
2347
+ */
2348
+ exec(keys: string[], args: string[]): Promise<TResult>;
2349
+ /**
2350
+ * Compute the sha1 hash of the script and return its hex representation.
2351
+ */
2352
+ private digest;
2353
+ }
2354
+
2355
+ /**
2356
+ * Serverless redis client for upstash.
2357
+ */
2358
+ declare class Redis {
2359
+ protected client: Requester;
2360
+ protected opts?: CommandOptions<any, any>;
2361
+ protected enableTelemetry: boolean;
2362
+ /**
2363
+ * Create a new redis client
2364
+ *
2365
+ * @example
2366
+ * ```typescript
2367
+ * const redis = new Redis({
2368
+ * url: "<UPSTASH_REDIS_REST_URL>",
2369
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
2370
+ * });
2371
+ * ```
2372
+ */
2373
+ constructor(client: Requester, opts?: RedisOptions);
2374
+ get json(): {
2375
+ /**
2376
+ * @see https://redis.io/commands/json.arrappend
2377
+ */
2378
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
2379
+ /**
2380
+ * @see https://redis.io/commands/json.arrindex
2381
+ */
2382
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2383
+ /**
2384
+ * @see https://redis.io/commands/json.arrinsert
2385
+ */
2386
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
2387
+ /**
2388
+ * @see https://redis.io/commands/json.arrlen
2389
+ */
2390
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2391
+ /**
2392
+ * @see https://redis.io/commands/json.arrpop
2393
+ */
2394
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
2395
+ /**
2396
+ * @see https://redis.io/commands/json.arrtrim
2397
+ */
2398
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2399
+ /**
2400
+ * @see https://redis.io/commands/json.clear
2401
+ */
2402
+ clear: (key: string, path?: string | undefined) => Promise<number>;
2403
+ /**
2404
+ * @see https://redis.io/commands/json.del
2405
+ */
2406
+ del: (key: string, path?: string | undefined) => Promise<number>;
2407
+ /**
2408
+ * @see https://redis.io/commands/json.forget
2409
+ */
2410
+ forget: (key: string, path?: string | undefined) => Promise<number>;
2411
+ /**
2412
+ * @see https://redis.io/commands/geoadd
2413
+ */
2414
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
2415
+ /**
2416
+ * @see https://redis.io/commands/geopos
2417
+ */
2418
+ geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
2419
+ lng: number;
2420
+ lat: number;
2421
+ }[]>;
2422
+ /**
2423
+ * @see https://redis.io/commands/geodist
2424
+ */
2425
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2426
+ /**
2427
+ * @see https://redis.io/commands/geohash
2428
+ */
2429
+ geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
2430
+ /**
2431
+ * @see https://redis.io/commands/geosearch
2432
+ */
2433
+ geosearch: (key: string, centerPoint: {
2434
+ type: "FROMLONLAT" | "fromlonlat";
2435
+ coordinate: {
2436
+ lon: number;
2437
+ lat: number;
2438
+ };
2439
+ } | {
2440
+ type: "FROMMEMBER" | "frommember";
2441
+ member: unknown;
2442
+ }, shape: {
2443
+ type: "BYRADIUS" | "byradius";
2444
+ radius: number;
2445
+ radiusType: "M" | "KM" | "FT" | "MI";
2446
+ } | {
2447
+ type: "BYBOX" | "bybox";
2448
+ rect: {
2449
+ width: number;
2450
+ height: number;
2451
+ };
2452
+ rectType: "M" | "KM" | "FT" | "MI";
2453
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2454
+ count?: {
2455
+ limit: number;
2456
+ any?: boolean | undefined;
2457
+ } | undefined;
2458
+ withCoord?: boolean | undefined;
2459
+ withDist?: boolean | undefined;
2460
+ withHash?: boolean | undefined;
2461
+ } | undefined) => Promise<({
2462
+ member: unknown;
2463
+ } & {
2464
+ coord?: {
2465
+ long: number;
2466
+ lat: number;
2467
+ } | undefined;
2468
+ dist?: number | undefined;
2469
+ hash?: string | undefined;
2470
+ })[]>;
2471
+ /**
2472
+ * @see https://redis.io/commands/geosearchstore
2473
+ */
2474
+ geosearchstore: (destination: string, key: string, centerPoint: {
2475
+ type: "FROMLONLAT" | "fromlonlat";
2476
+ coordinate: {
2477
+ lon: number;
2478
+ lat: number;
2479
+ };
2480
+ } | {
2481
+ type: "FROMMEMBER" | "frommember";
2482
+ member: unknown;
2483
+ }, shape: {
2484
+ type: "BYRADIUS" | "byradius";
2485
+ radius: number;
2486
+ radiusType: "M" | "KM" | "FT" | "MI";
2487
+ } | {
2488
+ type: "BYBOX" | "bybox";
2489
+ rect: {
2490
+ width: number;
2491
+ height: number;
2492
+ };
2493
+ rectType: "M" | "KM" | "FT" | "MI";
2494
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2495
+ count?: {
2496
+ limit: number;
2497
+ any?: boolean | undefined;
2498
+ } | undefined;
2499
+ storeDist?: boolean | undefined;
2500
+ } | undefined) => Promise<number>;
2501
+ /**
2502
+ * @see https://redis.io/commands/json.get
2503
+ */
2504
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
2505
+ /**
2506
+ * @see https://redis.io/commands/json.mget
2507
+ */
2508
+ mget: (keys: string[], path: string) => Promise<any>;
2509
+ /**
2510
+ * @see https://redis.io/commands/json.numincrby
2511
+ */
2512
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2513
+ /**
2514
+ * @see https://redis.io/commands/json.nummultby
2515
+ */
2516
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2517
+ /**
2518
+ * @see https://redis.io/commands/json.objkeys
2519
+ */
2520
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
2521
+ /**
2522
+ * @see https://redis.io/commands/json.objlen
2523
+ */
2524
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2525
+ /**
2526
+ * @see https://redis.io/commands/json.resp
2527
+ */
2528
+ resp: (key: string, path?: string | undefined) => Promise<any>;
2529
+ /**
2530
+ * @see https://redis.io/commands/json.set
2531
+ */
2532
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2533
+ nx: true;
2534
+ xx?: undefined;
2535
+ } | {
2536
+ nx?: undefined;
2537
+ xx: true;
2538
+ } | undefined) => Promise<"OK" | null>;
2539
+ /**
2540
+ * @see https://redis.io/commands/json.strappend
2541
+ */
2542
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
2543
+ /**
2544
+ * @see https://redis.io/commands/json.strlen
2545
+ */
2546
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2547
+ /**
2548
+ * @see https://redis.io/commands/json.toggle
2549
+ */
2550
+ toggle: (key: string, path: string) => Promise<number[]>;
2551
+ /**
2552
+ * @see https://redis.io/commands/json.type
2553
+ */
2554
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
2555
+ };
2556
+ /**
2557
+ * Wrap a new middleware around the HTTP client.
2558
+ */
2559
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
2560
+ /**
2561
+ * Technically this is not private, we can hide it from intellisense by doing this
2562
+ */
2563
+ protected addTelemetry: (telemetry: Telemetry) => void;
2564
+ createScript(script: string): Script;
2565
+ /**
2566
+ * Create a new pipeline that allows you to send requests in bulk.
2567
+ *
2568
+ * @see {@link Pipeline}
2569
+ */
2570
+ pipeline: () => Pipeline<[]>;
2571
+ /**
2572
+ * Create a new transaction to allow executing multiple steps atomically.
2573
+ *
2574
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
2575
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
2576
+ * guarantees that the commands are executed as a single isolated operation.
2577
+ *
2578
+ * @see {@link Pipeline}
2579
+ */
2580
+ multi: () => Pipeline<[]>;
2581
+ /**
2582
+ * @see https://redis.io/commands/append
2583
+ */
2584
+ append: (key: string, value: string) => Promise<number>;
2585
+ /**
2586
+ * @see https://redis.io/commands/bitcount
2587
+ */
2588
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
2589
+ /**
2590
+ * @see https://redis.io/commands/bitop
2591
+ */
2592
+ bitop: {
2593
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
2594
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
2595
+ };
2596
+ /**
2597
+ * @see https://redis.io/commands/bitpos
2598
+ */
2599
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
2600
+ /**
2601
+ * @see https://redis.io/commands/copy
2602
+ */
2603
+ copy: (key: string, destinationKey: string, opts?: {
2604
+ replace: boolean;
2605
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
2606
+ /**
2607
+ * @see https://redis.io/commands/dbsize
2608
+ */
2609
+ dbsize: () => Promise<number>;
2610
+ /**
2611
+ * @see https://redis.io/commands/decr
2612
+ */
2613
+ decr: (key: string) => Promise<number>;
2614
+ /**
2615
+ * @see https://redis.io/commands/decrby
2616
+ */
2617
+ decrby: (key: string, decrement: number) => Promise<number>;
2618
+ /**
2619
+ * @see https://redis.io/commands/del
2620
+ */
2621
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
2622
+ /**
2623
+ * @see https://redis.io/commands/echo
2624
+ */
2625
+ echo: (message: string) => Promise<string>;
2626
+ /**
2627
+ * @see https://redis.io/commands/eval
2628
+ */
2629
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
2630
+ /**
2631
+ * @see https://redis.io/commands/evalsha
2632
+ */
2633
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2634
+ /**
2635
+ * @see https://redis.io/commands/exists
2636
+ */
2637
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
2638
+ /**
2639
+ * @see https://redis.io/commands/expire
2640
+ */
2641
+ expire: (key: string, seconds: number) => Promise<0 | 1>;
2642
+ /**
2643
+ * @see https://redis.io/commands/expireat
2644
+ */
2645
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
2646
+ /**
2647
+ * @see https://redis.io/commands/flushall
2648
+ */
2649
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
2650
+ /**
2651
+ * @see https://redis.io/commands/flushdb
2652
+ */
2653
+ flushdb: (opts?: {
2654
+ async?: boolean | undefined;
2655
+ } | undefined) => Promise<"OK">;
2656
+ /**
2657
+ * @see https://redis.io/commands/get
2658
+ */
2659
+ get: <TData>(key: string) => Promise<TData | null>;
2660
+ /**
2661
+ * @see https://redis.io/commands/getbit
2662
+ */
2663
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
2664
+ /**
2665
+ * @see https://redis.io/commands/getdel
2666
+ */
2667
+ getdel: <TData>(key: string) => Promise<TData | null>;
2668
+ /**
2669
+ * @see https://redis.io/commands/getrange
2670
+ */
2671
+ getrange: (key: string, start: number, end: number) => Promise<string>;
2672
+ /**
2673
+ * @see https://redis.io/commands/getset
2674
+ */
2675
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
2676
+ /**
2677
+ * @see https://redis.io/commands/hdel
2678
+ */
2679
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
2680
+ /**
2681
+ * @see https://redis.io/commands/hexists
2682
+ */
2683
+ hexists: (key: string, field: string) => Promise<number>;
2684
+ /**
2685
+ * @see https://redis.io/commands/hget
2686
+ */
2687
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
2688
+ /**
2689
+ * @see https://redis.io/commands/hgetall
2690
+ */
2691
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
2692
+ /**
2693
+ * @see https://redis.io/commands/hincrby
2694
+ */
2695
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
2696
+ /**
2697
+ * @see https://redis.io/commands/hincrbyfloat
2698
+ */
2699
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
2700
+ /**
2701
+ * @see https://redis.io/commands/hkeys
2702
+ */
2703
+ hkeys: (key: string) => Promise<string[]>;
2704
+ /**
2705
+ * @see https://redis.io/commands/hlen
2706
+ */
2707
+ hlen: (key: string) => Promise<number>;
2708
+ /**
2709
+ * @see https://redis.io/commands/hmget
2710
+ */
2711
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
2712
+ /**
2713
+ * @see https://redis.io/commands/hmset
2714
+ */
2715
+ hmset: <TData>(key: string, kv: {
2716
+ [field: string]: TData;
2717
+ }) => Promise<"OK">;
2718
+ /**
2719
+ * @see https://redis.io/commands/hrandfield
2720
+ */
2721
+ hrandfield: {
2722
+ (key: string): Promise<string>;
2723
+ (key: string, count: number): Promise<string[]>;
2724
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
2725
+ };
2726
+ /**
2727
+ * @see https://redis.io/commands/hscan
2728
+ */
2729
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
2730
+ /**
2731
+ * @see https://redis.io/commands/hset
2732
+ */
2733
+ hset: <TData>(key: string, kv: {
2734
+ [field: string]: TData;
2735
+ }) => Promise<number>;
2736
+ /**
2737
+ * @see https://redis.io/commands/hsetnx
2738
+ */
2739
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
2740
+ /**
2741
+ * @see https://redis.io/commands/hstrlen
2742
+ */
2743
+ hstrlen: (key: string, field: string) => Promise<number>;
2744
+ /**
2745
+ * @see https://redis.io/commands/hvals
2746
+ */
2747
+ hvals: (key: string) => Promise<any>;
2748
+ /**
2749
+ * @see https://redis.io/commands/incr
2750
+ */
2751
+ incr: (key: string) => Promise<number>;
2752
+ /**
2753
+ * @see https://redis.io/commands/incrby
2754
+ */
2755
+ incrby: (key: string, value: number) => Promise<number>;
2756
+ /**
2757
+ * @see https://redis.io/commands/incrbyfloat
2758
+ */
2759
+ incrbyfloat: (key: string, value: number) => Promise<number>;
2760
+ /**
2761
+ * @see https://redis.io/commands/keys
2762
+ */
2763
+ keys: (pattern: string) => Promise<string[]>;
2764
+ /**
2765
+ * @see https://redis.io/commands/lindex
2766
+ */
2767
+ lindex: (key: string, index: number) => Promise<any>;
2768
+ /**
2769
+ * @see https://redis.io/commands/linsert
2770
+ */
2771
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
2772
+ /**
2773
+ * @see https://redis.io/commands/llen
2774
+ */
2775
+ llen: (key: string) => Promise<number>;
2776
+ /**
2777
+ * @see https://redis.io/commands/lmove
2778
+ */
2779
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
2780
+ /**
2781
+ * @see https://redis.io/commands/lpop
2782
+ */
2783
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2784
+ /**
2785
+ * @see https://redis.io/commands/lpos
2786
+ */
2787
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
2788
+ rank?: number | undefined;
2789
+ count?: number | undefined;
2790
+ maxLen?: number | undefined;
2791
+ } | undefined) => Promise<TData>;
2792
+ /**
2793
+ * @see https://redis.io/commands/lpush
2794
+ */
2795
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2796
+ /**
2797
+ * @see https://redis.io/commands/lpushx
2798
+ */
2799
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2800
+ /**
2801
+ * @see https://redis.io/commands/lrange
2802
+ */
2803
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
2804
+ /**
2805
+ * @see https://redis.io/commands/lrem
2806
+ */
2807
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
2808
+ /**
2809
+ * @see https://redis.io/commands/lset
2810
+ */
2811
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
2812
+ /**
2813
+ * @see https://redis.io/commands/ltrim
2814
+ */
2815
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
2816
+ /**
2817
+ * @see https://redis.io/commands/mget
2818
+ */
2819
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
2820
+ /**
2821
+ * @see https://redis.io/commands/mset
2822
+ */
2823
+ mset: <TData>(kv: {
2824
+ [key: string]: TData;
2825
+ }) => Promise<"OK">;
2826
+ /**
2827
+ * @see https://redis.io/commands/msetnx
2828
+ */
2829
+ msetnx: <TData>(kv: {
2830
+ [key: string]: TData;
2831
+ }) => Promise<number>;
2832
+ /**
2833
+ * @see https://redis.io/commands/persist
2834
+ */
2835
+ persist: (key: string) => Promise<0 | 1>;
2836
+ /**
2837
+ * @see https://redis.io/commands/pexpire
2838
+ */
2839
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
2840
+ /**
2841
+ * @see https://redis.io/commands/pexpireat
2842
+ */
2843
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
2844
+ /**
2845
+ * @see https://redis.io/commands/pfadd
2846
+ */
2847
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
2848
+ /**
2849
+ * @see https://redis.io/commands/pfcount
2850
+ */
2851
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
2852
+ /**
2853
+ * @see https://redis.io/commands/pfmerge
2854
+ */
2855
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
2856
+ /**
2857
+ * @see https://redis.io/commands/ping
2858
+ */
2859
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
2860
+ /**
2861
+ * @see https://redis.io/commands/psetex
2862
+ */
2863
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
2864
+ /**
2865
+ * @see https://redis.io/commands/pttl
2866
+ */
2867
+ pttl: (key: string) => Promise<number>;
2868
+ /**
2869
+ * @see https://redis.io/commands/publish
2870
+ */
2871
+ publish: (channel: string, message: unknown) => Promise<number>;
2872
+ /**
2873
+ * @see https://redis.io/commands/randomkey
2874
+ */
2875
+ randomkey: () => Promise<string | null>;
2876
+ /**
2877
+ * @see https://redis.io/commands/rename
2878
+ */
2879
+ rename: (source: string, destination: string) => Promise<"OK">;
2880
+ /**
2881
+ * @see https://redis.io/commands/renamenx
2882
+ */
2883
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
2884
+ /**
2885
+ * @see https://redis.io/commands/rpop
2886
+ */
2887
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
2888
+ /**
2889
+ * @see https://redis.io/commands/rpush
2890
+ */
2891
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2892
+ /**
2893
+ * @see https://redis.io/commands/rpushx
2894
+ */
2895
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
2896
+ /**
2897
+ * @see https://redis.io/commands/sadd
2898
+ */
2899
+ sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
2900
+ /**
2901
+ * @see https://redis.io/commands/scan
2902
+ */
2903
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
2904
+ /**
2905
+ * @see https://redis.io/commands/scard
2906
+ */
2907
+ scard: (key: string) => Promise<number>;
2908
+ /**
2909
+ * @see https://redis.io/commands/script-exists
2910
+ */
2911
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
2912
+ /**
2913
+ * @see https://redis.io/commands/script-flush
2914
+ */
2915
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
2916
+ /**
2917
+ * @see https://redis.io/commands/script-load
2918
+ */
2919
+ scriptLoad: (script: string) => Promise<string>;
2920
+ /**
2921
+ * @see https://redis.io/commands/sdiff
2922
+ */
2923
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
2924
+ /**
2925
+ * @see https://redis.io/commands/sdiffstore
2926
+ */
2927
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
2928
+ /**
2929
+ * @see https://redis.io/commands/set
2930
+ */
2931
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
2932
+ /**
2933
+ * @see https://redis.io/commands/setbit
2934
+ */
2935
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
2936
+ /**
2937
+ * @see https://redis.io/commands/setex
2938
+ */
2939
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
2940
+ /**
2941
+ * @see https://redis.io/commands/setnx
2942
+ */
2943
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
2944
+ /**
2945
+ * @see https://redis.io/commands/setrange
2946
+ */
2947
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
2948
+ /**
2949
+ * @see https://redis.io/commands/sinter
2950
+ */
2951
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
2952
+ /**
2953
+ * @see https://redis.io/commands/sinterstore
2954
+ */
2955
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
2956
+ /**
2957
+ * @see https://redis.io/commands/sismember
2958
+ */
2959
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
2960
+ /**
2961
+ * @see https://redis.io/commands/smismember
2962
+ */
2963
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
2964
+ /**
2965
+ * @see https://redis.io/commands/smembers
2966
+ */
2967
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
2968
+ /**
2969
+ * @see https://redis.io/commands/smove
2970
+ */
2971
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
2972
+ /**
2973
+ * @see https://redis.io/commands/spop
2974
+ */
2975
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2976
+ /**
2977
+ * @see https://redis.io/commands/srandmember
2978
+ */
2979
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2980
+ /**
2981
+ * @see https://redis.io/commands/srem
2982
+ */
2983
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
2984
+ /**
2985
+ * @see https://redis.io/commands/sscan
2986
+ */
2987
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
2988
+ /**
2989
+ * @see https://redis.io/commands/strlen
2990
+ */
2991
+ strlen: (key: string) => Promise<number>;
2992
+ /**
2993
+ * @see https://redis.io/commands/sunion
2994
+ */
2995
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
2996
+ /**
2997
+ * @see https://redis.io/commands/sunionstore
2998
+ */
2999
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3000
+ /**
3001
+ * @see https://redis.io/commands/time
3002
+ */
3003
+ time: () => Promise<[number, number]>;
3004
+ /**
3005
+ * @see https://redis.io/commands/touch
3006
+ */
3007
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
3008
+ /**
3009
+ * @see https://redis.io/commands/ttl
3010
+ */
3011
+ ttl: (key: string) => Promise<number>;
3012
+ /**
3013
+ * @see https://redis.io/commands/type
3014
+ */
3015
+ type: (key: string) => Promise<Type>;
3016
+ /**
3017
+ * @see https://redis.io/commands/unlink
3018
+ */
3019
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
3020
+ /**
3021
+ * @see https://redis.io/commands/xadd
3022
+ */
3023
+ xadd: (key: string, id: string, entries: {
3024
+ [field: string]: unknown;
3025
+ }, opts?: {
3026
+ nomkStream?: boolean | undefined;
3027
+ trim?: (({
3028
+ type: "MAXLEN" | "maxlen";
3029
+ threshold: number;
3030
+ } | {
3031
+ type: "MINID" | "minid";
3032
+ threshold: string;
3033
+ }) & ({
3034
+ comparison: "~";
3035
+ limit?: number | undefined;
3036
+ } | {
3037
+ comparison: "=";
3038
+ limit?: undefined;
3039
+ })) | undefined;
3040
+ } | undefined) => Promise<string>;
3041
+ /**
3042
+ * @see https://redis.io/commands/xrange
3043
+ */
3044
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3045
+ /**
3046
+ * @see https://redis.io/commands/zadd
3047
+ */
3048
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
3049
+ /**
3050
+ * @see https://redis.io/commands/zcard
3051
+ */
3052
+ zcard: (key: string) => Promise<number>;
3053
+ /**
3054
+ * @see https://redis.io/commands/zcount
3055
+ */
3056
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
3057
+ /**
3058
+ * @see https://redis.io/commands/zdiffstore
3059
+ */
3060
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
3061
+ /**
3062
+ * @see https://redis.io/commands/zincrby
3063
+ */
3064
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
3065
+ /**
3066
+ * @see https://redis.io/commands/zinterstore
3067
+ */
3068
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
3069
+ /**
3070
+ * @see https://redis.io/commands/zlexcount
3071
+ */
3072
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
3073
+ /**
3074
+ * @see https://redis.io/commands/zmscore
3075
+ */
3076
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
3077
+ /**
3078
+ * @see https://redis.io/commands/zpopmax
3079
+ */
3080
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3081
+ /**
3082
+ * @see https://redis.io/commands/zpopmin
3083
+ */
3084
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3085
+ /**
3086
+ * @see https://redis.io/commands/zrange
3087
+ */
3088
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3089
+ key: string,
3090
+ min: `(${string}` | `[${string}` | "-" | "+",
3091
+ max: `(${string}` | `[${string}` | "-" | "+",
3092
+ opts: {
3093
+ byLex: true;
3094
+ } & ZRangeCommandOptions
3095
+ ] | [
3096
+ key: string,
3097
+ min: number | `(${number}` | "-inf" | "+inf",
3098
+ max: number | `(${number}` | "-inf" | "+inf",
3099
+ opts: {
3100
+ byScore: true;
3101
+ } & ZRangeCommandOptions
3102
+ ]) => Promise<TData>;
3103
+ /**
3104
+ * @see https://redis.io/commands/zrank
3105
+ */
3106
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
3107
+ /**
3108
+ * @see https://redis.io/commands/zrem
3109
+ */
3110
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3111
+ /**
3112
+ * @see https://redis.io/commands/zremrangebylex
3113
+ */
3114
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
3115
+ /**
3116
+ * @see https://redis.io/commands/zremrangebyrank
3117
+ */
3118
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
3119
+ /**
3120
+ * @see https://redis.io/commands/zremrangebyscore
3121
+ */
3122
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
3123
+ /**
3124
+ * @see https://redis.io/commands/zrevrank
3125
+ */
3126
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
3127
+ /**
3128
+ * @see https://redis.io/commands/zscan
3129
+ */
3130
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
3131
+ /**
3132
+ * @see https://redis.io/commands/zscore
3133
+ */
3134
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
3135
+ /**
3136
+ * @see https://redis.io/commands/zunion
3137
+ */
3138
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
3139
+ /**
3140
+ * @see https://redis.io/commands/zunionstore
3141
+ */
3142
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3143
+ }
3144
+
3145
+ /**
3146
+ * @see https://redis.io/commands/zdiffstore
3147
+ */
3148
+ declare class ZDiffStoreCommand extends Command<number, number> {
3149
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3150
+ }
3151
+
3152
+ /**
3153
+ * @see https://redis.io/commands/zmscore
3154
+ */
3155
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3156
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3157
+ }
3158
+
3159
+ export { IncrByCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetSetCommand as H, HDelCommand as I, HExistsCommand as J, HGetCommand as K, HGetAllCommand as L, HIncrByCommand as M, HIncrByFloatCommand as N, HKeysCommand as O, HLenCommand as P, HMGetCommand as Q, RedisOptions as R, HMSetCommand as S, HRandFieldCommand as T, UpstashRequest as U, HScanCommand as V, HSetCommand as W, HSetNXCommand as X, HStrLenCommand as Y, HValsCommand as Z, IncrCommand as _, RequesterConfig as a, SetNxCommand as a$, IncrByFloatCommand as a0, JsonArrAppendCommand as a1, JsonArrIndexCommand as a2, JsonArrInsertCommand as a3, JsonArrLenCommand as a4, JsonArrPopCommand as a5, JsonArrTrimCommand as a6, JsonClearCommand as a7, JsonDelCommand as a8, JsonForgetCommand as a9, MSetNXCommand as aA, PersistCommand as aB, PExpireCommand as aC, PExpireAtCommand as aD, PingCommand as aE, PSetEXCommand as aF, PTtlCommand as aG, PublishCommand as aH, RandomKeyCommand as aI, RenameCommand as aJ, RenameNXCommand as aK, RPopCommand as aL, RPushCommand as aM, RPushXCommand as aN, SAddCommand as aO, ScanCommand as aP, ScanCommandOptions as aQ, SCardCommand as aR, ScriptExistsCommand as aS, ScriptFlushCommand as aT, ScriptLoadCommand as aU, SDiffCommand as aV, SDiffStoreCommand as aW, SetCommand as aX, SetCommandOptions as aY, SetBitCommand as aZ, SetExCommand as a_, JsonGetCommand as aa, JsonMGetCommand as ab, JsonNumIncrByCommand as ac, JsonNumMultByCommand as ad, JsonObjKeysCommand as ae, JsonObjLenCommand as af, JsonRespCommand as ag, JsonSetCommand as ah, JsonStrAppendCommand as ai, JsonStrLenCommand as aj, JsonToggleCommand as ak, JsonTypeCommand as al, KeysCommand as am, LIndexCommand as an, LInsertCommand as ao, LLenCommand as ap, LMoveCommand as aq, LPopCommand as ar, LPushCommand as as, LPushXCommand as at, LRangeCommand as au, LRemCommand as av, LSetCommand as aw, LTrimCommand as ax, MGetCommand as ay, MSetCommand as az, Redis as b, SetRangeCommand as b0, SInterCommand as b1, SInterStoreCommand as b2, SIsMemberCommand as b3, SMembersCommand as b4, SMIsMemberCommand as b5, SMoveCommand as b6, SPopCommand as b7, SRandMemberCommand as b8, SRemCommand as b9, ZRangeCommandOptions as bA, ZRankCommand as bB, ZRemCommand as bC, ZRemRangeByLexCommand as bD, ZRemRangeByRankCommand as bE, ZRemRangeByScoreCommand as bF, ZRevRankCommand as bG, ZScanCommand as bH, ZScoreCommand as bI, ZUnionCommand as bJ, ZUnionCommandOptions as bK, ZUnionStoreCommand as bL, ZUnionStoreCommandOptions as bM, SScanCommand as ba, StrLenCommand as bb, SUnionCommand as bc, SUnionStoreCommand as bd, TimeCommand as be, TouchCommand as bf, TtlCommand as bg, Type as bh, TypeCommand as bi, UnlinkCommand as bj, XAddCommand as bk, XRangeCommand as bl, ScoreMember as bm, ZAddCommandOptions as bn, ZAddCommand as bo, ZCardCommand as bp, ZCountCommand as bq, ZDiffStoreCommand as br, ZIncrByCommand as bs, ZInterStoreCommand as bt, ZInterStoreCommandOptions as bu, ZLexCountCommand as bv, ZMScoreCommand as bw, ZPopMaxCommand as bx, ZPopMinCommand as by, ZRangeCommand as bz, Requester as c, UpstashResponse as d, BitOpCommand as e, BitPosCommand as f, DecrCommand as g, DecrByCommand as h, DelCommand as i, EvalCommand as j, EvalshaCommand as k, ExistsCommand as l, ExpireCommand as m, ExpireAtCommand as n, FlushDBCommand as o, GeoAddCommandOptions as p, GeoMember as q, GeoDistCommand as r, GeoHashCommand as s, GeoPosCommand as t, GeoSearchCommand as u, GeoSearchStoreCommand as v, GetCommand as w, GetBitCommand as x, GetDelCommand as y, GetRangeCommand as z };