mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
add redis add_command function
This commit is contained in:
6
types/redis/index.d.ts
vendored
6
types/redis/index.d.ts
vendored
@@ -5,6 +5,7 @@
|
||||
// TANAKA Koichi <https://github.com/MugeSo>
|
||||
// Stuart Schechter <https://github.com/UppaJung>
|
||||
// Junyoung Choi <https://github.com/Rokt33r>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Imported from: https://github.com/types/npm-redis
|
||||
@@ -43,7 +44,7 @@ export interface ClientOpts {
|
||||
password?: string;
|
||||
db?: string | number;
|
||||
family?: string;
|
||||
rename_commands?: { [command: string]: string };
|
||||
rename_commands?: { [command: string]: string } | null;
|
||||
tls?: any;
|
||||
prefix?: string;
|
||||
retry_strategy?: RetryStrategy;
|
||||
@@ -1202,6 +1203,9 @@ export interface RedisClient extends Commands<boolean>, EventEmitter {
|
||||
send_command(command: string, cb?: Callback<any>): boolean;
|
||||
send_command(command: string, args?: any[], cb?: Callback<any>): boolean;
|
||||
|
||||
addCommand(command: string): void;
|
||||
add_command(command: string): void;
|
||||
|
||||
/**
|
||||
* Mark the start of a transaction block.
|
||||
*/
|
||||
|
||||
@@ -6,10 +6,10 @@ const num = 0;
|
||||
const str = 'any string';
|
||||
const err: Error = new Error();
|
||||
const args: any[] = [];
|
||||
const resCallback: (err: Error, res: any) => void = () => null;
|
||||
const numCallback: (err: Error, res: number) => void = () => null;
|
||||
const strCallback: (err: Error, res: string) => void = () => null;
|
||||
const messageHandler: (channel: string, message: any) => void = () => null;
|
||||
const resCallback: (err: Error | null, res: any) => void = () => {};
|
||||
const numCallback: (err: Error | null, res: number) => void = () => {};
|
||||
const strCallback: (err: Error | null, res: string) => void = () => {};
|
||||
const messageHandler: (channel: string, message: any) => void = () => {};
|
||||
|
||||
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||
|
||||
@@ -117,3 +117,7 @@ client.cork();
|
||||
client.set("abc", "fff", strCallback);
|
||||
client.get("abc", resCallback);
|
||||
client.uncork();
|
||||
|
||||
// Add command
|
||||
client.add_command('my command');
|
||||
client.addCommand('my other command');
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"redis-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user