1
- import * as crypto from 'crypto' ;
2
- import * as BasePool from './lib/Pool' ;
3
- import * as BaseConnection from './lib/Connection' ;
1
+ import { RsaPublicKey , RsaPrivateKey , KeyLike } from 'crypto' ;
2
+ import { Pool as BasePool , PoolOptions } from './lib/Pool' ;
3
+ import {
4
+ Connection as BaseConnection ,
5
+ ConnectionOptions ,
6
+ SslOptions ,
7
+ } from './lib/Connection' ;
8
+ import {
9
+ Query as BaseQuery ,
10
+ QueryOptions ,
11
+ QueryError ,
12
+ } from './lib/protocol/sequences/Query' ;
4
13
import {
5
14
PoolCluster as BasePoolCluster ,
6
15
PoolClusterOptions ,
7
16
} from './lib/PoolCluster' ;
8
- import { ConnectionOptions , SslOptions } from './lib/Connection' ;
9
- import BasePoolConnection = require( './lib/PoolConnection' ) ;
10
- import { PoolOptions } from './lib/Pool' ;
11
- import BaseQuery = require( './lib/protocol/sequences/Query' ) ;
12
- import BasePrepare = require( './lib/protocol/sequences/Prepare' ) ;
13
- import { QueryOptions , QueryError } from './lib/protocol/sequences/Query' ;
14
- import { PrepareStatementInfo } from './lib/protocol/sequences/Prepare' ;
15
- import Server = require( './lib/Server' ) ;
17
+ import { PoolConnection as BasePoolConnection } from './lib/PoolConnection' ;
18
+ import {
19
+ Prepare as BasePrepare ,
20
+ PrepareStatementInfo ,
21
+ } from './lib/protocol/sequences/Prepare' ;
22
+ import { Server } from './lib/Server' ;
16
23
import { Connection as PromiseConnection } from '../../promise' ;
17
24
18
25
export {
@@ -28,10 +35,10 @@ export {
28
35
export * from './lib/protocol/packets/index' ;
29
36
30
37
// Expose class interfaces
31
- export interface Connection extends BaseConnection . Connection {
38
+ export interface Connection extends BaseConnection {
32
39
promise ( promiseImpl ?: PromiseConstructor ) : PromiseConnection ;
33
40
}
34
- export interface Pool extends BasePool . Pool { }
41
+ export interface Pool extends BasePool { }
35
42
export interface PoolConnection extends BasePoolConnection { }
36
43
export interface PoolCluster extends BasePoolCluster { }
37
44
export interface Query extends BaseQuery { }
@@ -49,10 +56,7 @@ type AuthPluginDefinition<T> = (pluginOptions?: T) => AuthPlugin;
49
56
export const authPlugins : {
50
57
caching_sha2_password : AuthPluginDefinition < {
51
58
overrideIsSecure ?: boolean ;
52
- serverPublicKey ?:
53
- | crypto . RsaPublicKey
54
- | crypto . RsaPrivateKey
55
- | crypto . KeyLike ;
59
+ serverPublicKey ?: RsaPublicKey | RsaPrivateKey | KeyLike ;
56
60
jonServerPublicKey ?: ( data : Buffer ) => void ;
57
61
} > ;
58
62
mysql_clear_password : AuthPluginDefinition < {
@@ -63,20 +67,15 @@ export const authPlugins: {
63
67
passwordSha1 ?: string ;
64
68
} > ;
65
69
sha256_password : AuthPluginDefinition < {
66
- serverPublicKey ?:
67
- | crypto . RsaPublicKey
68
- | crypto . RsaPrivateKey
69
- | crypto . KeyLike ;
70
+ serverPublicKey ?: RsaPublicKey | RsaPrivateKey | KeyLike ;
70
71
joinServerPublicKey ?: ( data : Buffer ) => void ;
71
72
} > ;
72
73
} ;
73
74
74
75
export function createConnection ( connectionUri : string ) : Connection ;
75
- export function createConnection (
76
- config : BaseConnection . ConnectionOptions
77
- ) : Connection ;
76
+ export function createConnection ( config : ConnectionOptions ) : Connection ;
78
77
79
- export function createPool ( config : BasePool . PoolOptions ) : BasePool . Pool ;
78
+ export function createPool ( config : PoolOptions ) : BasePool ;
80
79
81
80
export function createPoolCluster ( config ?: PoolClusterOptions ) : PoolCluster ;
82
81
@@ -103,6 +102,4 @@ export function raw(sql: string): {
103
102
toSqlString : ( ) => string ;
104
103
} ;
105
104
106
- export function createServer (
107
- handler : ( conn : BaseConnection . Connection ) => any
108
- ) : Server ;
105
+ export function createServer ( handler : ( conn : BaseConnection ) => any ) : Server ;
0 commit comments