You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
WIP
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
transformArguments(key: RedisArgument, iterator: number) {
|
||||
return ['BF.SCANDUMP', key, iterator.toString()];
|
||||
},
|
||||
transformReply(reply: TuplesReply<[NumberReply, BlobStringReply]>) {
|
||||
transformReply(reply: UnwrapReply<TuplesReply<[NumberReply, BlobStringReply]>>) {
|
||||
return {
|
||||
iterator: reply[0],
|
||||
chunk: reply[1]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, UnwrapReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
|
||||
export type BfInfoReply = TuplesToMapReply<[
|
||||
[BlobStringReply<'width'>, NumberReply],
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
return ['CMS.INFO', key];
|
||||
},
|
||||
transformReply: {
|
||||
2: (reply: Resp2Reply<BfInfoReply>) => ({
|
||||
2: (reply: UnwrapReply<Resp2Reply<BfInfoReply>>) => ({
|
||||
width: reply[1],
|
||||
depth: reply[3],
|
||||
count: reply[5]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, NullReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, NullReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
transformArguments(key: RedisArgument, iterator: number) {
|
||||
return ['CF.SCANDUMP', key, iterator.toString()];
|
||||
},
|
||||
transformReply(reply: TuplesReply<[NumberReply, BlobStringReply | NullReply]>) {
|
||||
transformReply(reply: UnwrapReply<TuplesReply<[NumberReply, BlobStringReply | NullReply]>>) {
|
||||
return {
|
||||
iterator: reply[0],
|
||||
chunk: reply[1]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, DoubleReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
|
||||
export type TopKInfoReply = TuplesToMapReply<[
|
||||
[BlobStringReply<'k'>, NumberReply],
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
return ['TOPK.INFO', key];
|
||||
},
|
||||
transformReply: {
|
||||
2: (reply: Resp2Reply<TopKInfoReply>) => ({
|
||||
2: (reply: UnwrapReply<Resp2Reply<TopKInfoReply>>) => ({
|
||||
k: reply[1],
|
||||
width: reply[3],
|
||||
depth: reply[5],
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, ArrayReply, SimpleStringReply, NumberReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, ArrayReply, SimpleStringReply, NumberReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
@@ -6,11 +6,11 @@ export default {
|
||||
transformArguments(key: RedisArgument) {
|
||||
return ['TOPK.LIST', key, 'WITHCOUNT'];
|
||||
},
|
||||
transformReply(rawReply: ArrayReply<SimpleStringReply | NumberReply>) {
|
||||
const reply = [] as unknown as ArrayReply<{
|
||||
transformReply(rawReply: UnwrapReply<ArrayReply<SimpleStringReply | NumberReply>>) {
|
||||
const reply: Array<{
|
||||
item: SimpleStringReply;
|
||||
count: NumberReply;
|
||||
}>;
|
||||
}> = [];
|
||||
|
||||
for (let i = 0; i < rawReply.length; i++) {
|
||||
reply.push({
|
||||
|
Reference in New Issue
Block a user