Skip to content

Commit a80d2ca

Browse files
authored
Merge pull request #1222 from tomoima525/patch-authPlugin-support-string-type
mysql_clear_password can have string type
2 parents d74a7d9 + 3526352 commit a80d2ca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

index.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,12 @@ export interface Pool extends mysql.Connection {
151151
promise(promiseImpl?: PromiseConstructor): PromisePool;
152152
}
153153

154-
type authPlugins =
155-
(pluginMetadata: { connection: Connection; command: string }) =>
156-
(pluginData: Buffer) => Promise<string>;
154+
type authPlugins = (pluginMetadata: {
155+
connection: Connection;
156+
command: string;
157+
}) => (
158+
pluginData: Buffer
159+
) => Promise<string> | string | Buffer | Promise<Buffer> | null;
157160

158161
export interface ConnectionOptions extends mysql.ConnectionOptions {
159162
charsetNumber?: number;
@@ -175,7 +178,7 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
175178
queueLimit?: number;
176179
waitForConnections?: boolean;
177180
authPlugins?: {
178-
[key: string]: authPlugins;
181+
[key: string]: authPlugins;
179182
};
180183
}
181184

0 commit comments

Comments
 (0)