Skip to content

Commit 570643a

Browse files
committed
refactor: pattern ban-types between Connection and Pool
1 parent 744a49e commit 570643a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export interface Pool extends mysql.Connection {
160160
callback: (err: NodeJS.ErrnoException, connection: PoolConnection) => any
161161
): void;
162162
releaseConnection(connection: PoolConnection | PromisePoolConnection): void;
163+
on(event: string, listener: (args: any[]) => void): this;
163164
on(event: 'connection', listener: (connection: PoolConnection) => any): this;
164165
on(event: 'acquire', listener: (connection: PoolConnection) => any): this;
165166
on(event: 'release', listener: (connection: PoolConnection) => any): this;

typings/mysql/lib/Connection.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ declare class Connection extends EventEmitter {
375375

376376
format(sql: string, values?: any | any[] | { [param: string]: any }): string;
377377

378-
on(event: string, listener: Function): this;
378+
on(event: string, listener: (args: any[]) => void): this;
379379

380380
rollback(callback: (err: Query.QueryError | null) => void): void;
381381

typings/mysql/lib/Pool.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ declare class Pool extends EventEmitter {
200200
callback?: (err: NodeJS.ErrnoException | null, ...args: any[]) => any
201201
): void;
202202

203-
on(event: string, listener: Function): this;
203+
on(event: string, listener: (args: any[]) => void): this;
204204
on(event: 'connection', listener: (connection: PoolConnection) => any): this;
205205

206206
promise(promiseImpl?: PromiseConstructor): PromisePool;

0 commit comments

Comments
 (0)