UNPKG

trash-cleaner

Version:

Finds and deletes trash email in the mailbox

48 lines (40 loc) 1.13 kB
/** * Base class for reporting progress of cleanup. */ class ProgressReporter { /** * An event that fires when cleaning has started. * * @param {boolean} dryRun Do a dry-run cleanup without deleting emails. */ onStart(dryRun) { } /** * An event that fires when unread emails are being retrieved. */ onRetrievingUnreadEmails() { }; /** * An event that fires when unread emails are retrieved. * * @param {Email[]} emails The list of unread emails. */ onUnreadEmailsRetrieved(emails) { }; /** * An event that fires when trash emails are identified. * * @param {Email[]} emails The list of trash emails. */ onTrashEmailsIdentified(emails) { }; /** * An event that fires when trash emails are being deleted. */ onDeletingTrash() { } /** * An event that fires when trash emails are deleted. */ onTrashDeleted() { } /** * An event that fires when cleaning has stopped. */ onStop() { } } module.exports = { ProgressReporter }