11
2- import './promise' ;
2+ import { Connection as PromiseConnection , Pool as PromisePool , PoolConnection as PromisePoolConnection } from './promise' ;
33import * as mysql from 'mysql' ;
44export * from 'mysql' ;
55
@@ -9,9 +9,12 @@ export interface Connection extends mysql.Connection {
99 execute < T extends mysql . RowDataPacket [ ] [ ] | mysql . RowDataPacket [ ] | mysql . OkPacket | mysql . OkPacket [ ] > ( options : mysql . QueryOptions , callback ?: ( err : mysql . QueryError | null , result : T , fields ?: mysql . FieldPacket [ ] ) => any ) : mysql . Query ;
1010 execute < T extends mysql . RowDataPacket [ ] [ ] | mysql . RowDataPacket [ ] | mysql . OkPacket | mysql . OkPacket [ ] > ( options : mysql . QueryOptions , values : any | any [ ] | { [ param : string ] : any } , callback ?: ( err : mysql . QueryError | null , result : T , fields : mysql . FieldPacket [ ] ) => any ) : mysql . Query ;
1111 ping ( callback ?: ( err : mysql . QueryError | null ) => any ) : void ;
12+ promise ( promiseImpl ?: PromiseConstructor ) : PromiseConnection ;
1213}
1314
14- export interface PoolConnection extends mysql . PoolConnection , Connection { }
15+ export interface PoolConnection extends mysql . PoolConnection , Connection {
16+ promise ( promiseImpl ?: PromiseConstructor ) : PromisePoolConnection ;
17+ }
1518
1619export interface Pool extends mysql . Connection {
1720 execute < T extends mysql . RowDataPacket [ ] [ ] | mysql . RowDataPacket [ ] | mysql . OkPacket | mysql . OkPacket [ ] > ( sql : string , callback ?: ( err : mysql . QueryError | null , result : T , fields : mysql . FieldPacket [ ] ) => any ) : mysql . Query ;
@@ -23,6 +26,7 @@ export interface Pool extends mysql.Connection {
2326 on ( event : 'acquire' , listener : ( connection : PoolConnection ) => any ) : this;
2427 on ( event : 'release' , listener : ( connection : PoolConnection ) => any ) : this;
2528 on ( event : 'enqueue' , listener : ( ) => any ) : this;
29+ promise ( promiseImpl ?: PromiseConstructor ) : PromisePool ;
2630}
2731
2832export interface ConnectionOptions extends mysql . ConnectionOptions {
0 commit comments