From 4ff87c1a38c599fec8d3e81baa2b2998ea408ff6 Mon Sep 17 00:00:00 2001 From: David Uzumeri Date: Thu, 5 Dec 2019 22:18:43 -0500 Subject: [PATCH] Updated View root to be optional (default is even specified in comments) (#40827) --- types/email-templates/index.d.ts | 34 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/types/email-templates/index.d.ts b/types/email-templates/index.d.ts index 69b607717d..de77932b45 100644 --- a/types/email-templates/index.d.ts +++ b/types/email-templates/index.d.ts @@ -22,14 +22,20 @@ import StreamTransport = require('nodemailer/lib/stream-transport'); // too and calls createTransport if given a non-function, thus a lot // of different types accepted for transport type NodeMailerTransportOptions = - Mail | - SMTPPool | SMTPPool.Options | - SendmailTransport | SendmailTransport.Options | - StreamTransport | StreamTransport.Options | - JSONTransport | JSONTransport.Options | - SESTransport | SESTransport.Options | - SMTPTransport | SMTPTransport.Options | - string; + | Mail + | SMTPPool + | SMTPPool.Options + | SendmailTransport + | SendmailTransport.Options + | StreamTransport + | StreamTransport.Options + | JSONTransport + | JSONTransport.Options + | SESTransport + | SESTransport.Options + | SMTPTransport + | SMTPTransport.Options + | string; // No typedef for https://github.com/niftylettuce/preview-email interface PreviewEmailOpts { @@ -76,7 +82,7 @@ interface View { /** * View root. Defaults to the current working directory's "emails" folder via path.resolve('emails') */ - root: string; + root?: string; options?: ViewOptions; } @@ -101,7 +107,7 @@ interface EmailConfig { /** * Preview the email */ - preview?: boolean|PreviewEmailOpts; + preview?: boolean | PreviewEmailOpts; /** * Set to object to configure and Enable */ @@ -119,12 +125,12 @@ interface EmailConfig { * * configuration object for html-to-text */ - htmlToText?: HtmlToTextOptions|false; + htmlToText?: HtmlToTextOptions | false; /** * You can pass an option to prefix subject lines with a string * env === 'production' ? false : `[${env.toUpperCase()}] `; // <--- HERE */ - subjectPrefix?: string|false; + subjectPrefix?: string | false; /** * */ @@ -158,7 +164,7 @@ declare class EmailTemplate { * shorthand use of `juiceResources` with the config * mainly for custom renders like from a database). */ - juiceResources(html: string): Promise ; + juiceResources(html: string): Promise; /** * * @param view The Html pug to render @@ -176,7 +182,7 @@ declare namespace EmailTemplate { * shorthand use of `juiceResources` with the config * mainly for custom renders like from a database). */ - function juiceResources(html: string): Promise ; + function juiceResources(html: string): Promise; /** *