diff --git a/lib/cluster/index.ts b/lib/cluster/index.ts index 511407f9..c383d652 100644 --- a/lib/cluster/index.ts +++ b/lib/cluster/index.ts @@ -48,6 +48,14 @@ type OfflineQueueItem = { node: unknown; }; +export type ClusterNode = + | string + | number + | { + host?: string | undefined; + port?: number | undefined; + }; + type ClusterStatus = | "end" | "close" @@ -106,10 +114,7 @@ class Cluster extends Commander { /** * Creates an instance of Cluster. */ - constructor( - startupNodes: (string | number | object)[], - options: ClusterOptions = {} - ) { + constructor(startupNodes: ClusterNode[], options: ClusterOptions = {}) { super(); EventEmitter.call(this); diff --git a/lib/index.ts b/lib/index.ts index e3d65993..233232b6 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -52,6 +52,9 @@ export { } from "./connectors/SentinelConnector"; export { StandaloneConnectionOptions } from "./connectors/StandaloneConnector"; export { RedisOptions, CommonRedisOptions } from "./redis/RedisOptions"; +export { ClusterNode } from "./cluster"; +export { ClusterOptions } from "./cluster/ClusterOptions"; +export { NodeRole } from "./cluster/util"; // No TS typings export const ReplyError = require("redis-errors").ReplyError;