mongoose: Fix ConnectionOptionsBase.

- Fix type for keepAlive: should be boolean instead of number.
- Add optional field keepAliveInitialDelay.
- Fix numbers in comment.
This commit is contained in:
Ming
2019-01-30 17:09:14 -08:00
parent e52455539d
commit 6471e30652
+17 -4
View File
@@ -16,6 +16,7 @@
// Dan Manastireanu <https://github.com/danmana>
// stablio <https://github.com/stablio>
// Emmanuel Gautier <https://github.com/emmanuelgautier>
// Ming Chen <https://github.com/mingchen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -316,6 +317,16 @@ declare module "mongoose" {
readyState: number;
}
/**
* Connection optional settings.
*
* see
* https://mongoosejs.com/docs/api.html#mongoose_Mongoose-connect
* and
* http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html
* for all available options.
*
*/
interface ConnectionOptionsBase {
/** database Name for Mongodb Atlas Connection */
dbName?: string;
@@ -339,11 +350,13 @@ declare module "mongoose" {
poolSize?: number;
/** Reconnect on error (default: true) */
autoReconnect?: boolean;
/** TCP KeepAlive on the socket with a X ms delay before start (default: 0). */
keepAlive?: number;
/** TCP Connection timeout setting (default: 0) */
/** TCP Connection keep alive enabled (default: true) */
keepAlive?: boolean;
/** The number of milliseconds to wait before initiating keepAlive on the TCP socket (default 30000) */
keepAliveInitialDelay?: number;
/** TCP Connection timeout setting (default: 30000) */
connectTimeoutMS?: number;
/** TCP Socket timeout setting (default: 0) */
/** TCP Socket timeout setting (default: 360000) */
socketTimeoutMS?: number;
/** If the database authentication is dependent on another databaseName. */
authSource?: string;