Skip to content

Commit

Permalink
refactor: naming of callback functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rrhodes committed Nov 1, 2024
1 parent 854ab49 commit 43bba34
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/mysql/test-d/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,22 @@ const mysql2 = captureMySQL(MySQL2);

const config = {};

const connectionMySQL: captureMySQL.PatchedConnection = mysql.createConnection(config);
const poolMySQL: captureMySQL.PatchedPool = mysql.createPool(config);
const poolClusterMySQL: captureMySQL.PatchedPoolCluster = mysql.createPoolCluster(config);

const queryCallback: MySQL.queryCallback = function (err: MySQL.MysqlError | null, rows: any) {
};

const queryCallbackMySQL2: captureMySQL.MySQL2QueryCallback | undefined = function () { };

const getConnectionCallback = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedConnection) {
};

const getConnectionCallbackMySQL2 = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedMySQL2Connection) {
};

const connectionMySQL: captureMySQL.PatchedConnection = mysql.createConnection(config);
const poolMySQL: captureMySQL.PatchedPool = mysql.createPool(config);
const poolClusterMySQL: captureMySQL.PatchedPoolCluster = mysql.createPoolCluster(config);

const connectionMySQL2: captureMySQL.PatchedMySQL2Connection = mysql2.createConnection(config);
const poolMySQL2: captureMySQL.PatchedMySQL2Pool = mysql2.createPool(config);
const poolClusterMySQL2: captureMySQL.PatchedMySQL2PoolCluster = mysql2.createPoolCluster(config);

const queryCallbackMySQL2: captureMySQL.MySQL2QueryCallback | undefined = function () { };

expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallback));
expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallback, segment));

Expand Down

0 comments on commit 43bba34

Please sign in to comment.