Skip to content

Commit 5faa4b9

Browse files
authored
Merge pull request #1206 from kanyuga/patch-1
Add the authPlugins types to ConnectionOptions
2 parents ded092d + e63ce52 commit 5faa4b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ export interface Pool extends mysql.Connection {
142142
on(event: 'enqueue', listener: () => any): this;
143143
promise(promiseImpl?: PromiseConstructor): PromisePool;
144144
}
145-
145+
146+
type authPlugins =
147+
(pluginMetadata: { connection: Connection; command: string }) =>
148+
(pluginData: Buffer) => Promise<string>;
149+
146150
export interface ConnectionOptions extends mysql.ConnectionOptions {
147151
charsetNumber?: number;
148152
compress?: boolean;
@@ -162,6 +166,9 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
162166
Promise?: any;
163167
queueLimit?: number;
164168
waitForConnections?: boolean;
169+
authPlugins?: {
170+
[key: string]: authPlugins;
171+
};
165172
}
166173

167174
export interface PoolOptions extends mysql.PoolOptions, ConnectionOptions {}

0 commit comments

Comments
 (0)