11import { EventEmitter } from 'events' ;
22import { PoolConnection } from './PoolConnection.js' ;
33import { PoolOptions } from './Pool.js' ;
4+ import { ExecutableBase as ExecutableBaseClass } from './protocol/sequences/ExecutableBase.js' ;
5+ import { QueryableBase as QueryableBaseClass } from './protocol/sequences/QueryableBase.js' ;
6+
7+ // Expose class interfaces
8+ declare class QueryableAndExecutableBase extends QueryableBaseClass (
9+ ExecutableBaseClass ( EventEmitter )
10+ ) { }
411
512export interface PoolClusterOptions {
613 /**
@@ -29,10 +36,20 @@ export interface PoolClusterOptions {
2936 defaultSelector ?: string ;
3037}
3138
39+ export interface PoolNamespace extends QueryableAndExecutableBase {
40+ getConnection (
41+ callback : (
42+ err : NodeJS . ErrnoException | null ,
43+ connection : PoolConnection
44+ ) => any
45+ ) : void ;
46+ }
47+
3248declare class PoolCluster extends EventEmitter {
3349 config : PoolClusterOptions ;
3450
3551 add ( config : PoolOptions ) : void ;
52+ add ( group : string , connectionUri : string ) : void ;
3653 add ( group : string , config : PoolOptions ) : void ;
3754
3855 end ( ) : void ;
@@ -59,7 +76,7 @@ declare class PoolCluster extends EventEmitter {
5976 ) => void
6077 ) : void ;
6178
62- of ( pattern : string , selector ?: string ) : PoolCluster ;
79+ of ( pattern : string , selector ?: string ) : PoolNamespace ;
6380
6481 on ( event : string , listener : ( args : any [ ] ) => void ) : this;
6582 on ( event : 'remove' , listener : ( nodeId : number ) => void ) : this;
0 commit comments