1
0
mirror of https://github.com/eleith/emailjs.git synced 2024-07-05 20:10:37 +00:00

strongly type SMPTState enum

This commit is contained in:
Zack Schuster 2018-07-12 09:47:25 -07:00
parent 1dad23e285
commit 082c99ffa3

View File

@ -51,6 +51,16 @@ const AUTH_METHODS = {
XOAUTH2: /** @type {'XOAUTH2'} */ ('XOAUTH2'),
};
/**
* @readonly
* @enum
*/
const SMTPState = {
NOTCONNECTED: /** @type {0} */ (0),
CONNECTING: /** @type {1} */ (1),
CONNECTED: /** @type {2} */ (2),
};
/**
* @type {0 | 1}
*/
@ -85,12 +95,6 @@ const caller = (callback, ...args) => {
}
};
const SMTPState = {
NOTCONNECTED: 0,
CONNECTING: 1,
CONNECTED: 2,
};
class SMTP extends EventEmitter {
/**
* @typedef {Object} SMTPSocketOptions