nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

[typescript] SMTPServerAddress.args: Property 'SIZE' does not exist on type 'object' #163

Closed dylan-hart closed 3 years ago

dylan-hart commented 3 years ago

I'm using smtp-server along with its type definitions @types/smtp-server. The SMTPServerAddress type appears to declare its args property as type object:

(taken from https://nodemailer.com/extras/smtp-server/#using-size-extension)

// Linter problem: Property 'SIZE' does not exist on type 'object'.
let expectedSize = Number(session.envelope.mailFrom.args.SIZE) || 0;

Declaring SMTPServerAddress.args as type any or { [key: string]: string } would fix the issue for me.

For now, I'm working around the linter:

let expectedSize = Number(session.envelope.mailFrom.args["SIZE"]) || 0;
andris9 commented 3 years ago

Types are managed by 3rd party, you need to contact the maintainer directly