🤖 Merge PR #45853 @types/ioredis - Add ClusterOptions and status to Cluster interface by @JeffreyCA

* Add ClusterOptions and status to Cluster interface

* Make properties readonly
This commit is contained in:
Jeffrey 2020-07-10 16:39:24 -04:00 committed by GitHub
parent 8c81e77bba
commit 93cc323acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -921,8 +921,8 @@ declare namespace IORedis {
interface Redis extends EventEmitter, Commander, Commands {
Promise: typeof Promise;
options: RedisOptions;
status: string;
readonly options: RedisOptions;
readonly status: string;
connect(callback?: () => void): Promise<void>;
disconnect(): void;
duplicate(): Redis;
@ -1400,6 +1400,8 @@ declare namespace IORedis {
type Ok = 'OK';
interface Cluster extends EventEmitter, Commander, Commands {
readonly options: ClusterOptions;
readonly status: string;
connect(): Promise<void>;
disconnect(): void;
nodes(role?: NodeRole): Redis[];

View File

@ -661,4 +661,7 @@ redis.pipeline()
// do something with res or err
});
const { port, host } = redis.options;
redis.options.host;
redis.status;
cluster.options.maxRedirections;
cluster.status;