From 0f31a41dcfe65d2953447c7f1a8b5c892f2ceed9 Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:38:24 -0300 Subject: [PATCH] fix: add `ProcedureCallPacket` to promise-based `query` overloads --- .../sequences/promise/QueryableBase.d.ts | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts b/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts index b10f68f510..ff49f97d89 100644 --- a/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts @@ -3,6 +3,7 @@ import { FieldPacket, RowDataPacket, ResultSetHeader, + ProcedureCallPacket, } from '../../packets/index.js'; import { QueryOptions, QueryableConstructor } from '../Query.js'; @@ -17,40 +18,68 @@ export declare function QueryableBase( | RowDataPacket[] | RowDataPacket[][] | OkPacket[] + | ProcedureCallPacket< + | OkPacket + | ResultSetHeader + | RowDataPacket[] + | RowDataPacket[][] + | OkPacket[] + > >( sql: string ): Promise<[T, FieldPacket[]]>; query< - T_1 extends + T extends | OkPacket | ResultSetHeader | RowDataPacket[] | RowDataPacket[][] | OkPacket[] + | ProcedureCallPacket< + | OkPacket + | ResultSetHeader + | RowDataPacket[] + | RowDataPacket[][] + | OkPacket[] + > >( sql: string, values: any - ): Promise<[T_1, FieldPacket[]]>; + ): Promise<[T, FieldPacket[]]>; query< - T_2 extends + T extends | OkPacket | ResultSetHeader | RowDataPacket[] | RowDataPacket[][] | OkPacket[] + | ProcedureCallPacket< + | OkPacket + | ResultSetHeader + | RowDataPacket[] + | RowDataPacket[][] + | OkPacket[] + > >( options: QueryOptions - ): Promise<[T_2, FieldPacket[]]>; + ): Promise<[T, FieldPacket[]]>; query< - T_3 extends + T extends | OkPacket | ResultSetHeader | RowDataPacket[] | RowDataPacket[][] | OkPacket[] + | ProcedureCallPacket< + | OkPacket + | ResultSetHeader + | RowDataPacket[] + | RowDataPacket[][] + | OkPacket[] + > >( options: QueryOptions, values: any - ): Promise<[T_3, FieldPacket[]]>; + ): Promise<[T, FieldPacket[]]>; }; } & T;