From fbd92b2d234a28038c9b4c354d2c9326ff3a5114 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 4 May 2026 09:03:06 +0100 Subject: [PATCH] chore: use lf eol --- types/index.d.ts | 168 +++++++++++++++++++++++------------------------ 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 829155e..2947bec 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,84 +1,84 @@ -import { FastifyPluginCallback } from 'fastify' -import { - Connection, - ConnectionOptions, - escape, - format, - Pool, - PoolOptions, - ProcedureCallPacket, - ResultSetHeader, - RowDataPacket, -} from 'mysql2' -import { - Connection as PromiseConnection, - Pool as PromisePool, -} from 'mysql2/promise' - -type FastifyMysql = FastifyPluginCallback - -declare namespace fastifyMysql { - - type MySQLPoolConnection = MySQLPool | MySQLConnection | MySQLPromisePool | MySQLPromiseConnection - export function isMySQLPool (obj: MySQLPoolConnection): obj is MySQLPool - export function isMySQLPromisePool (obj: MySQLPoolConnection): obj is MySQLPromisePool - export function isMySQLConnection (obj: MySQLPoolConnection): obj is MySQLConnection - export function isMySQLPromiseConnection (obj: MySQLPoolConnection): obj is MySQLPromiseConnection - - // upstream package missed type - type escapeId = (val: any, forbidQualified?: boolean) => string - - interface BaseClient { - format: typeof format; - escape: typeof escape; - escapeId: escapeId; - } - - export type MySQLConnection = Pick & { - connection: Connection; - } & BaseClient - - export type MySQLPool = Pick & { - pool: Pool; - } & BaseClient - - export type MySQLPromiseConnection = Pick< - PromiseConnection, - 'query' | 'execute' - > & { - connection: PromiseConnection; - } & BaseClient - - export type MySQLPromisePool = Pick< - PromisePool, - 'query' | 'execute' | 'getConnection' - > & { - pool: PromisePool; - } & BaseClient - - export type ConnectionType = 'connection' | 'pool' - - export interface FastifyMySQLOptions extends PoolOptions, ConnectionOptions { - type?: ConnectionType; - name?: string; - promise?: boolean; - connectionString?: string; - } - - export type MySQLProcedureCallPacket< - T = [MySQLRowDataPacket[], MySQLResultSetHeader] | MySQLResultSetHeader - > = ProcedureCallPacket - export type MySQLResultSetHeader = ResultSetHeader - export type MySQLRowDataPacket = RowDataPacket - - export const fastifyMysql: FastifyMysql - export { fastifyMysql as default } - - export { - ResultSetHeader, - RowDataPacket, - } -} - -declare function fastifyMysql (...params: Parameters): ReturnType -export = fastifyMysql +import { FastifyPluginCallback } from 'fastify' +import { + Connection, + ConnectionOptions, + escape, + format, + Pool, + PoolOptions, + ProcedureCallPacket, + ResultSetHeader, + RowDataPacket, +} from 'mysql2' +import { + Connection as PromiseConnection, + Pool as PromisePool, +} from 'mysql2/promise' + +type FastifyMysql = FastifyPluginCallback + +declare namespace fastifyMysql { + + type MySQLPoolConnection = MySQLPool | MySQLConnection | MySQLPromisePool | MySQLPromiseConnection + export function isMySQLPool (obj: MySQLPoolConnection): obj is MySQLPool + export function isMySQLPromisePool (obj: MySQLPoolConnection): obj is MySQLPromisePool + export function isMySQLConnection (obj: MySQLPoolConnection): obj is MySQLConnection + export function isMySQLPromiseConnection (obj: MySQLPoolConnection): obj is MySQLPromiseConnection + + // upstream package missed type + type escapeId = (val: any, forbidQualified?: boolean) => string + + interface BaseClient { + format: typeof format; + escape: typeof escape; + escapeId: escapeId; + } + + export type MySQLConnection = Pick & { + connection: Connection; + } & BaseClient + + export type MySQLPool = Pick & { + pool: Pool; + } & BaseClient + + export type MySQLPromiseConnection = Pick< + PromiseConnection, + 'query' | 'execute' + > & { + connection: PromiseConnection; + } & BaseClient + + export type MySQLPromisePool = Pick< + PromisePool, + 'query' | 'execute' | 'getConnection' + > & { + pool: PromisePool; + } & BaseClient + + export type ConnectionType = 'connection' | 'pool' + + export interface FastifyMySQLOptions extends PoolOptions, ConnectionOptions { + type?: ConnectionType; + name?: string; + promise?: boolean; + connectionString?: string; + } + + export type MySQLProcedureCallPacket< + T = [MySQLRowDataPacket[], MySQLResultSetHeader] | MySQLResultSetHeader + > = ProcedureCallPacket + export type MySQLResultSetHeader = ResultSetHeader + export type MySQLRowDataPacket = RowDataPacket + + export const fastifyMysql: FastifyMysql + export { fastifyMysql as default } + + export { + ResultSetHeader, + RowDataPacket, + } +} + +declare function fastifyMysql (...params: Parameters): ReturnType +export = fastifyMysql