Skip to content

Commit

Permalink
fix: add missing declaration for callBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Mar 19, 2022
1 parent 6942cec commit 08c9072
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 575 deletions.
19 changes: 19 additions & 0 deletions bin/generateRedisCommander/template.ts
Expand Up @@ -50,6 +50,25 @@ interface RedisCommander<Context extends ClientContext = { type: "default" }> {
call(
...args: [command: string, ...args: (string | Buffer | number)[]]
): Result<unknown, Context>;
callBuffer(
command: string,
callback?: Callback<unknown>
): Result<unknown, Context>;
callBuffer(
command: string,
args: (string | Buffer | number)[],
callback?: Callback<unknown>
): Result<unknown, Context>;
callBuffer(
...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback<unknown>
]
): Result<unknown, Context>;
callBuffer(
...args: [command: string, ...args: (string | Buffer | number)[]]
): Result<unknown, Context>;

////
}
Expand Down
1 change: 0 additions & 1 deletion lib/utils/Commander.ts
Expand Up @@ -111,7 +111,6 @@ commands.forEach(function (commandName) {
});

Commander.prototype.call = generateFunction("call", "utf8");
// @ts-expect-error
Commander.prototype.callBuffer = generateFunction("callBuffer", null);
// @ts-expect-error
Commander.prototype.send_command = Commander.prototype.call;
Expand Down
19 changes: 19 additions & 0 deletions lib/utils/RedisCommander.ts
Expand Up @@ -50,6 +50,25 @@ interface RedisCommander<Context extends ClientContext = { type: "default" }> {
call(
...args: [command: string, ...args: (string | Buffer | number)[]]
): Result<unknown, Context>;
callBuffer(
command: string,
callback?: Callback<unknown>
): Result<unknown, Context>;
callBuffer(
command: string,
args: (string | Buffer | number)[],
callback?: Callback<unknown>
): Result<unknown, Context>;
callBuffer(
...args: [
command: string,
...args: (string | Buffer | number)[],
callback: Callback<unknown>
]
): Result<unknown, Context>;
callBuffer(
...args: [command: string, ...args: (string | Buffer | number)[]]
): Result<unknown, Context>;

/**
* List the ACL categories or the commands inside a category
Expand Down

0 comments on commit 08c9072

Please sign in to comment.