Skip to content

Commit b314acb

Browse files
committed
Accept Buffer and Buffer[] in typings for key, cert, and ca
These options are passed directly to `tls.createSecureContext`, which supports `Buffer` and `Buffer[]` as argument types. This makes the 'Connecting over encrypted connection' example compile with TypeScript (since it uses a Buffer from 'fs.readFileSync')
1 parent d8de3ca commit b314acb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

typings/mysql/lib/Connection.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,24 @@ declare namespace Connection {
188188
pfx?: string;
189189

190190
/**
191-
* A string holding the PEM encoded private key
191+
* Either a string/buffer or list of strings/Buffers holding the PEM encoded private key(s) to use
192192
*/
193-
key?: string;
193+
key?: string | string[] | Buffer | Buffer[];
194194

195195
/**
196196
* A string of passphrase for the private key or pfx
197197
*/
198198
passphrase?: string;
199199

200200
/**
201-
* A string holding the PEM encoded certificate
201+
* A string/buffer or list of strings/Buffers holding the PEM encoded certificate(s)
202202
*/
203-
cert?: string;
203+
cert?: string | string[] | Buffer | Buffer[];
204204

205205
/**
206-
* Either a string or list of strings of PEM encoded CA certificates to trust.
206+
* Either a string/Buffer or list of strings/Buffers of PEM encoded CA certificates to trust.
207207
*/
208-
ca?: string | string[];
208+
ca?: string | string[] | Buffer | Buffer[];
209209

210210
/**
211211
* Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)

0 commit comments

Comments
 (0)