From bdbd1efbd057d407c4816c8b5135b5be534e7f90 Mon Sep 17 00:00:00 2001 From: satoshun00 Date: Tue, 11 Apr 2017 19:12:27 +0900 Subject: [PATCH] fix(mysql): Add definition for PoolCluster.end with callback --- types/mysql/index.d.ts | 1 + types/mysql/mysql-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/mysql/index.d.ts b/types/mysql/index.d.ts index 8df59f3d6b..ab3f8009ac 100644 --- a/types/mysql/index.d.ts +++ b/types/mysql/index.d.ts @@ -101,6 +101,7 @@ interface IPoolCluster { add(group: string, config: IPoolConfig): void; end(): void; + end(callback: (err: IError, ...args: any[]) => void): void; getConnection(callback: (err: IError, connection: IConnection) => void): void; getConnection(group: string, callback: (err: IError, connection: IConnection) => void): void; diff --git a/types/mysql/mysql-tests.ts b/types/mysql/mysql-tests.ts index 84c501e147..a6d9afc07e 100644 --- a/types/mysql/mysql-tests.ts +++ b/types/mysql/mysql-tests.ts @@ -17,7 +17,7 @@ connection.query('SELECT 1 + 1 AS solution', function (err, rows, fields) { console.log('The solution is: ', rows[0].solution); }); -connection.end(); +connection.end(function (err) {}); connection = mysql.createConnection({ host: 'example.org', @@ -396,4 +396,4 @@ connection = mysql.createConnection({ debug: ['ComQueryPacket', 'RowDataPacket'] var type: mysql.FieldType = mysql.FieldType.SHORT; var info: mysql.IFieldInfo; -info.type = type; \ No newline at end of file +info.type = type;