-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.d.ts
32 lines (28 loc) · 830 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/// <reference types="node" />
import { EventEmitter } from 'events';
interface RedisOptions {
host: string;
port: number;
db: number;
auth: false | string;
maxRetries: number;
tryToReconnect: boolean;
reconnectTimeout: number;
autoConnect: boolean;
doNotSetClientName: boolean;
doNotRunQuitOnEnd: boolean;
}
type Callback<T = any> = (err: null | string, result: T) => void;
declare class Redis extends EventEmitter {
constructor(opts?: RedisOptions);
init(): void;
connect(): void;
processQueue(): void;
reconnect(): void;
selectDb(cb: Callback): void;
sendAuth(cb: Callback): void;
rawCall<T = any>(args: (string | Buffer)[], cb?: Callback<T>): void;
rawCallAsync<T = any>(args: (string | Buffer)[]): Promise<T>;
end(): void;
}
export = Redis;