1
1
import * as crypto from 'crypto' ;
2
-
3
- import BaseConnection = require( './lib/Connection' ) ;
2
+ import * as BasePool from './lib/Pool' ;
3
+ import * as BaseConnection from './lib/Connection' ;
4
+ import {
5
+ PoolCluster as BasePoolCluster ,
6
+ PoolClusterOptions ,
7
+ } from './lib/PoolCluster' ;
4
8
import { ConnectionOptions , SslOptions } from './lib/Connection' ;
5
9
import BasePoolConnection = require( './lib/PoolConnection' ) ;
6
- import BasePool = require( './lib/Pool' ) ;
7
10
import { PoolOptions } from './lib/Pool' ;
8
- import BasePoolCluster = require( './lib/PoolCluster' ) ;
9
- import { PoolClusterOptions } from './lib/PoolCluster' ;
10
11
import BaseQuery = require( './lib/protocol/sequences/Query' ) ;
11
12
import BasePrepare = require( './lib/protocol/sequences/Prepare' ) ;
12
13
import { QueryOptions , QueryError } from './lib/protocol/sequences/Query' ;
13
14
import { PrepareStatementInfo } from './lib/protocol/sequences/Prepare' ;
14
15
import Server = require( './lib/Server' ) ;
15
16
import { Connection as PromiseConnection } from '../../promise' ;
16
17
17
- export function createConnection ( connectionUri : string ) : Connection ;
18
- export function createConnection (
19
- config : BaseConnection . ConnectionOptions
20
- ) : Connection ;
21
- export function createPool ( config : BasePool . PoolOptions ) : BasePool ;
22
- export function createPoolCluster (
23
- config ?: BasePoolCluster . PoolClusterOptions
24
- ) : PoolCluster ;
25
- export function escape ( value : any ) : string ;
26
- export function escapeId ( value : any ) : string ;
27
- export function format ( sql : string ) : string ;
28
- export function format (
29
- sql : string ,
30
- values : any [ ] ,
31
- stringifyObjects ?: boolean ,
32
- timeZone ?: string
33
- ) : string ;
34
- export function format (
35
- sql : string ,
36
- values : any ,
37
- stringifyObjects ?: boolean ,
38
- timeZone ?: string
39
- ) : string ;
40
- export function raw ( sql : string ) : {
41
- toSqlString : ( ) => string ;
42
- } ;
43
- export function createServer ( handler : ( conn : BaseConnection ) => any ) : Server ;
44
-
45
18
export {
46
19
ConnectionOptions ,
47
20
SslOptions ,
@@ -51,14 +24,15 @@ export {
51
24
QueryError ,
52
25
PrepareStatementInfo ,
53
26
} ;
27
+
54
28
export * from './lib/protocol/packets/index' ;
55
29
56
30
// Expose class interfaces
57
- export interface Connection extends BaseConnection {
31
+ export interface Connection extends BaseConnection . Connection {
58
32
promise ( promiseImpl ?: PromiseConstructor ) : PromiseConnection ;
59
33
}
34
+ export interface Pool extends BasePool . Pool { }
60
35
export interface PoolConnection extends BasePoolConnection { }
61
- export interface Pool extends BasePool { }
62
36
export interface PoolCluster extends BasePoolCluster { }
63
37
export interface Query extends BaseQuery { }
64
38
export interface Prepare extends BasePrepare { }
@@ -96,3 +70,39 @@ export const authPlugins: {
96
70
joinServerPublicKey ?: ( data : Buffer ) => void ;
97
71
} > ;
98
72
} ;
73
+
74
+ export function createConnection ( connectionUri : string ) : Connection ;
75
+ export function createConnection (
76
+ config : BaseConnection . ConnectionOptions
77
+ ) : Connection ;
78
+
79
+ export function createPool ( config : BasePool . PoolOptions ) : BasePool . Pool ;
80
+
81
+ export function createPoolCluster ( config ?: PoolClusterOptions ) : PoolCluster ;
82
+
83
+ export function escape ( value : any ) : string ;
84
+
85
+ export function escapeId ( value : any ) : string ;
86
+
87
+ export function format ( sql : string ) : string ;
88
+ export function format (
89
+ sql : string ,
90
+ values : any [ ] ,
91
+ stringifyObjects ?: boolean ,
92
+ timeZone ?: string
93
+ ) : string ;
94
+
95
+ export function format (
96
+ sql : string ,
97
+ values : any ,
98
+ stringifyObjects ?: boolean ,
99
+ timeZone ?: string
100
+ ) : string ;
101
+
102
+ export function raw ( sql : string ) : {
103
+ toSqlString : ( ) => string ;
104
+ } ;
105
+
106
+ export function createServer (
107
+ handler : ( conn : BaseConnection . Connection ) => any
108
+ ) : Server ;
0 commit comments