From 65fd5692243500beae19da694d15df747c2ace7a Mon Sep 17 00:00:00 2001 From: Manuel <2084639+tennox@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:07:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#65592=20[imap-simp?= =?UTF-8?q?le]=20expose=20imap=20field=20type=20by=20@tennox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [imap-simple] expose imap field type imap-simple allows to access the underlying `node-imap` instance, but the types were not including it. * [imap-simple] add test & remove illegal whitespace * whitespace fix index.d.ts --------- Co-authored-by: Manu [tennox] --- types/imap-simple/imap-simple-tests.ts | 1 + types/imap-simple/index.d.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/types/imap-simple/imap-simple-tests.ts b/types/imap-simple/imap-simple-tests.ts index 152d7f40fe..4362da9816 100644 --- a/types/imap-simple/imap-simple-tests.ts +++ b/types/imap-simple/imap-simple-tests.ts @@ -117,6 +117,7 @@ imaps.connect(config).then(connection => { imaps.connect(config).then(function (connection) { connection.openBox('INBOX').then(function () { + console.log("Connection state:", connection.imap.state); const searchCriteria = ['ALL']; const fetchOptions = { bodies: ['TEXT'], struct: true }; return connection.search(searchCriteria, fetchOptions); diff --git a/types/imap-simple/index.d.ts b/types/imap-simple/index.d.ts index fea127cea2..8780fb41cb 100644 --- a/types/imap-simple/index.d.ts +++ b/types/imap-simple/index.d.ts @@ -40,6 +40,9 @@ export interface Message { export class ImapSimple extends EventEmitter { constructor(imap: Imap); + /** Access underlying `node-imap` instance */ + imap: Imap; // https://github.com/chadxz/imap-simple/blob/master/lib/imapSimple.js#L22 + /** Open a mailbox, calling the provided callback with signature (err, boxName), or resolves the returned promise with boxName. */ openBox(boxName: string, callback: (err: Error, boxName: string) => void): void; openBox(boxName: string): Promise;