// Загрузка категорий продукта const pool = require("./connect"); interface definitionInterface{ (message:string):void; } export default function Select(sql, callback: definitionInterface) { pool.getConnection(function(err, conn) { // Do something with the connection conn.query(sql , function(err, rows) { callback(rows); }); // Don't forget to release the connection when finished! pool.releaseConnection(conn); }) }