From b549352cda0b83fe8c4f4c11a1b4beb0b0cb0f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20Sj=C3=B6berg?= Date: Mon, 16 Mar 2020 19:41:51 +0100 Subject: [PATCH] Add missing authPlugins property to ConnectionOptions and PoolOptions (#38) --- index.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.d.ts b/index.d.ts index be5cc4b..c90f91b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -59,6 +59,22 @@ export interface FieldPacket extends mysql.FieldPacket { characterSet: number } +type authPlugins = + (pluginMetadata: { connection: Connection; command: string }) => + (pluginData: Buffer) => Promise; + +export interface ConnectionOptions extends mysql.ConnectionOptions { + authPlugins?: { + [key: string]: authPlugins; + }; +} + +export interface PoolOptions extends mysql.PoolOptions { + authPlugins?: { + [key: string]: authPlugins; + }; +} + export function createConnection(connectionUri: string): Connection; export function createConnection(config: ConnectionOptions): Connection; export function createPool(config: PoolOptions): Pool;