1
1
import { EventEmitter } from 'events' ;
2
2
import { PoolConnection } from './PoolConnection.js' ;
3
3
import { 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
+ ) { }
4
11
5
12
export interface PoolClusterOptions {
6
13
/**
@@ -29,10 +36,20 @@ export interface PoolClusterOptions {
29
36
defaultSelector ?: string ;
30
37
}
31
38
39
+ export interface PoolNamespace extends QueryableAndExecutableBase {
40
+ getConnection (
41
+ callback : (
42
+ err : NodeJS . ErrnoException | null ,
43
+ connection : PoolConnection
44
+ ) => any
45
+ ) : void ;
46
+ }
47
+
32
48
declare class PoolCluster extends EventEmitter {
33
49
config : PoolClusterOptions ;
34
50
35
51
add ( config : PoolOptions ) : void ;
52
+ add ( group : string , connectionUri : string ) : void ;
36
53
add ( group : string , config : PoolOptions ) : void ;
37
54
38
55
end ( ) : void ;
@@ -59,7 +76,7 @@ declare class PoolCluster extends EventEmitter {
59
76
) => void
60
77
) : void ;
61
78
62
- of ( pattern : string , selector ?: string ) : PoolCluster ;
79
+ of ( pattern : string , selector ?: string ) : PoolNamespace ;
63
80
64
81
on ( event : string , listener : ( args : any [ ] ) => void ) : this;
65
82
on ( event : 'remove' , listener : ( nodeId : number ) => void ) : this;
0 commit comments