@types/nodemailer 6.4.9 → 6.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. nodemailer/LICENSE +0 -0
  2. nodemailer/README.md +1 -1
  3. nodemailer/index.d.ts +16 -10
  4. nodemailer/lib/addressparser/index.d.ts +0 -0
  5. nodemailer/lib/base64/index.d.ts +1 -1
  6. nodemailer/lib/dkim/index.d.ts +1 -1
  7. nodemailer/lib/dkim/message-parser.d.ts +43 -43
  8. nodemailer/lib/dkim/relaxed-body.d.ts +43 -43
  9. nodemailer/lib/dkim/sign.d.ts +14 -4
  10. nodemailer/lib/fetch/cookies.d.ts +0 -0
  11. nodemailer/lib/fetch/index.d.ts +4 -4
  12. nodemailer/lib/json-transport/index.d.ts +10 -7
  13. nodemailer/lib/mail-composer/index.d.ts +12 -12
  14. nodemailer/lib/mailer/index.d.ts +82 -42
  15. nodemailer/lib/mailer/mail-message.d.ts +8 -4
  16. nodemailer/lib/mime-funcs/index.d.ts +2 -2
  17. nodemailer/lib/mime-funcs/mime-types.d.ts +0 -0
  18. nodemailer/lib/mime-node/index.d.ts +7 -7
  19. nodemailer/lib/mime-node/last-newline.d.ts +1 -1
  20. nodemailer/lib/qp/index.d.ts +1 -1
  21. nodemailer/lib/sendmail-transport/index.d.ts +5 -5
  22. nodemailer/lib/sendmail-transport/le-unix.d.ts +1 -1
  23. nodemailer/lib/sendmail-transport/le-windows.d.ts +1 -1
  24. nodemailer/lib/ses-transport/index.d.ts +38 -27
  25. nodemailer/lib/shared/index.d.ts +24 -17
  26. nodemailer/lib/smtp-connection/data-stream.d.ts +1 -1
  27. nodemailer/lib/smtp-connection/http-proxy-client.d.ts +8 -3
  28. nodemailer/lib/smtp-connection/index.d.ts +47 -37
  29. nodemailer/lib/smtp-pool/index.d.ts +18 -15
  30. nodemailer/lib/smtp-pool/pool-resource.d.ts +25 -25
  31. nodemailer/lib/smtp-transport/index.d.ts +27 -27
  32. nodemailer/lib/stream-transport/index.d.ts +11 -8
  33. nodemailer/lib/well-known/index.d.ts +1 -1
  34. nodemailer/lib/xoauth2/index.d.ts +24 -20
  35. nodemailer/package.json +3 -3
@@ -26,10 +26,10 @@ export function isPlainText(value: string): boolean;
26
26
  export function hasLongerLines(str: string, lineLength: number): boolean;
27
27
 
28
28
  /** Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047) */
29
- export function encodeWord(data: Buffer | string, mimeWordEncoding?: 'Q' | 'B', maxLength?: number): string;
29
+ export function encodeWord(data: Buffer | string, mimeWordEncoding?: "Q" | "B", maxLength?: number): string;
30
30
 
31
31
  /** Finds word sequences with non ascii text and converts these to mime words */
32
- export function encodeWords(value: string, mimeWordEncoding?: 'Q' | 'B', maxLength?: number): string;
32
+ export function encodeWords(value: string, mimeWordEncoding?: "Q" | "B", maxLength?: number): string;
33
33
 
34
34
  /**
35
35
  * Joins parsed header value together as 'value; param1=value1; param2=value2'
File without changes
@@ -1,15 +1,15 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Readable, ReadableOptions, Transform } from 'stream';
3
+ import { Readable, ReadableOptions, Transform } from "stream";
4
4
 
5
- import Mail = require('../mailer');
6
- import SMTPConnection = require('../smtp-connection');
5
+ import Mail = require("../mailer");
6
+ import SMTPConnection = require("../smtp-connection");
7
7
 
8
8
  declare namespace MimeNode {
9
9
  interface Addresses {
10
10
  from?: string[] | undefined;
11
11
  sender?: string[] | undefined;
12
- 'reply-to'?: string[] | undefined;
12
+ "reply-to"?: string[] | undefined;
13
13
  to?: string[] | undefined;
14
14
  cc?: string[] | undefined;
15
15
  bcc?: string[] | undefined;
@@ -34,7 +34,7 @@ declare namespace MimeNode {
34
34
  /** If true, do not exclude Bcc from the generated headers */
35
35
  keepBcc?: boolean | undefined;
36
36
  /** either 'Q' (the default) or 'B' */
37
- textEncoding?: 'B' | 'Q' | undefined;
37
+ textEncoding?: "B" | "Q" | undefined;
38
38
  /** method to normalize header keys for custom caseing */
39
39
  normalizeHeaderKey?(key: string): string;
40
40
  }
@@ -66,7 +66,7 @@ declare class MimeNode {
66
66
  * {key: 'value'} as the first argument.
67
67
  */
68
68
  setHeader(key: string, value: string | string[]): this;
69
- setHeader(headers: { [key: string]: string } | Array<{ key: string, value: string }>): this;
69
+ setHeader(headers: { [key: string]: string } | Array<{ key: string; value: string }>): this;
70
70
 
71
71
  /**
72
72
  * Adds a header value. If the value for selected key exists, the value is appended
@@ -75,7 +75,7 @@ declare class MimeNode {
75
75
  * {key: 'value'} as the first argument.
76
76
  */
77
77
  addHeader(key: string, value: string): this;
78
- addHeader(headers: { [key: string]: string } | Array<{ key: string, value: string }>): this;
78
+ addHeader(headers: { [key: string]: string } | Array<{ key: string; value: string }>): this;
79
79
 
80
80
  /** Retrieves the first mathcing value of a selected key */
81
81
  getHeader(key: string): string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transform } from 'stream';
3
+ import { Transform } from "stream";
4
4
 
5
5
  declare class LastNewline extends Transform {
6
6
  lastByte: boolean;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transform, TransformOptions } from 'stream';
3
+ import { Transform, TransformOptions } from "stream";
4
4
 
5
5
  /** Encodes a Buffer into a Quoted-Printable encoded string */
6
6
  export function encode(buffer: Buffer | string): string;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transport, TransportOptions } from '../..';
3
+ import { Transport, TransportOptions } from "../..";
4
4
 
5
- import * as shared from '../shared';
5
+ import * as shared from "../shared";
6
6
 
7
- import Mail = require('../mailer');
8
- import MailMessage = require('../mailer/mail-message');
9
- import MimeNode = require('../mime-node');
7
+ import Mail = require("../mailer");
8
+ import MailMessage = require("../mailer/mail-message");
9
+ import MimeNode = require("../mime-node");
10
10
 
11
11
  declare namespace SendmailTransport {
12
12
  type MailOptions = Mail.Options;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transform } from 'stream';
3
+ import { Transform } from "stream";
4
4
 
5
5
  declare class LeUnix extends Transform {}
6
6
 
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transform } from 'stream';
3
+ import { Transform } from "stream";
4
4
 
5
5
  declare class LeWindows extends Transform {}
6
6
 
@@ -1,14 +1,14 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { EventEmitter } from 'events';
3
+ import { EventEmitter } from "events";
4
4
 
5
- import { Transport, TransportOptions } from '../..';
5
+ import { Transport, TransportOptions } from "../..";
6
6
 
7
- import * as shared from '../shared';
7
+ import * as shared from "../shared";
8
8
 
9
- import Mail = require('../mailer');
10
- import MailMessage = require('../mailer/mail-message');
11
- import MimeNode = require('../mime-node');
9
+ import Mail = require("../mailer");
10
+ import MailMessage = require("../mailer/mail-message");
11
+ import MimeNode = require("../mime-node");
12
12
 
13
13
  declare namespace SESTransport {
14
14
  interface MailOptions extends Mail.Options {
@@ -32,7 +32,7 @@ declare namespace SESTransport {
32
32
  /**
33
33
  * The raw data of the message. This data needs to base64-encoded if you are accessing Amazon SES directly through the HTTPS interface. If you are accessing Amazon SES using an AWS SDK, the SDK takes care of the base 64-encoding for you. In all cases, the client must ensure that the message format complies with Internet email standards regarding email header fields, MIME types, and MIME encoding. The To:, CC:, and BCC: headers in the raw message can contain a group list. If you are using SendRawEmail with sending authorization, you can include X-headers in the raw message to specify the "Source," "From," and "Return-Path" addresses. For more information, see the documentation for SendRawEmail. Do not include these X-headers in the DKIM signature, because they are removed by Amazon SES before sending the email. For more information, go to the Amazon SES Developer Guide.
34
34
  */
35
- Data: Buffer|Uint8Array|{}|string;
35
+ Data: Buffer | Uint8Array | {} | string;
36
36
  } | undefined;
37
37
  /**
38
38
  * This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to specify a particular "From" address in the header of the raw email. Instead of using this parameter, you can use the X-header X-SES-FROM-ARN in the raw message of the email. If you use both the FromArn parameter and the corresponding X-header, Amazon SES uses the value of the FromArn parameter. For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.
@@ -49,16 +49,18 @@ declare namespace SESTransport {
49
49
  /**
50
50
  * A list of tags, in the form of name/value pairs, to apply to an email that you send using SendRawEmail. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.
51
51
  */
52
- Tags?: Array<{
53
- /**
54
- * The name of the tag. The name must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
55
- */
56
- Name: string;
57
- /**
58
- * The value of the tag. The value must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
59
- */
60
- Value: string;
61
- }> | undefined;
52
+ Tags?:
53
+ | Array<{
54
+ /**
55
+ * The name of the tag. The name must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
56
+ */
57
+ Name: string;
58
+ /**
59
+ * The value of the tag. The value must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
60
+ */
61
+ Value: string;
62
+ }>
63
+ | undefined;
62
64
  /**
63
65
  * The name of the configuration set to use when you send an email using SendRawEmail.
64
66
  */
@@ -83,6 +85,7 @@ declare namespace SESTransport {
83
85
  accepted: Array<string | Mail.Address>;
84
86
  rejected: Array<string | Mail.Address>;
85
87
  pending: Array<string | Mail.Address>;
88
+ raw: Buffer;
86
89
  }
87
90
  }
88
91
 
@@ -102,14 +105,22 @@ declare class SESTransport extends EventEmitter implements Transport<SESTranspor
102
105
  sendingRate: number;
103
106
  sendingRateTTL: number | null;
104
107
  rateInterval: number;
105
- rateMessages: Array<{ ts: number, pending: boolean }>;
106
- pending: Array<{ mail: Mail<SESTransport.SentMessageInfo>; callback(err: Error | null, info: SESTransport.SentMessageInfo): void; }>;
108
+ rateMessages: Array<{ ts: number; pending: boolean }>;
109
+ pending: Array<
110
+ {
111
+ mail: Mail<SESTransport.SentMessageInfo>;
112
+ callback(err: Error | null, info: SESTransport.SentMessageInfo): void;
113
+ }
114
+ >;
107
115
  idling: boolean;
108
116
 
109
117
  constructor(options: SESTransport.Options);
110
118
 
111
119
  /** Schedules a sending of a message */
112
- send(mail: MailMessage<SESTransport.SentMessageInfo>, callback: (err: Error | null, info: SESTransport.SentMessageInfo) => void): void;
120
+ send(
121
+ mail: MailMessage<SESTransport.SentMessageInfo>,
122
+ callback: (err: Error | null, info: SESTransport.SentMessageInfo) => void,
123
+ ): void;
113
124
 
114
125
  /** Returns true if there are free slots in the queue */
115
126
  isIdle(): boolean;
@@ -118,19 +129,19 @@ declare class SESTransport extends EventEmitter implements Transport<SESTranspor
118
129
  verify(callback: (err: Error | null, success: true) => void): void;
119
130
  verify(): Promise<true>;
120
131
 
121
- addListener(event: 'idle', listener: () => void): this;
132
+ addListener(event: "idle", listener: () => void): this;
122
133
 
123
- emit(event: 'idle'): boolean;
134
+ emit(event: "idle"): boolean;
124
135
 
125
- on(event: 'idle', listener: () => void): this;
136
+ on(event: "idle", listener: () => void): this;
126
137
 
127
- once(event: 'idle', listener: () => void): this;
138
+ once(event: "idle", listener: () => void): this;
128
139
 
129
- prependListener(event: 'idle', listener: () => void): this;
140
+ prependListener(event: "idle", listener: () => void): this;
130
141
 
131
- prependOnceListener(event: 'idle', listener: () => void): this;
142
+ prependOnceListener(event: "idle", listener: () => void): this;
132
143
 
133
- listeners(event: 'idle'): Array<() => void>;
144
+ listeners(event: "idle"): Array<() => void>;
134
145
  }
135
146
 
136
147
  export = SESTransport;
@@ -1,33 +1,36 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import SMTPConnection = require('../smtp-connection');
3
+ import SMTPConnection = require("../smtp-connection");
4
4
 
5
- import * as stream from 'stream';
5
+ import * as stream from "stream";
6
6
 
7
- export type LoggerLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
7
+ export type LoggerLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal";
8
8
 
9
9
  export interface Logger {
10
- level(level: LoggerLevel): void;
11
- trace(...params: any[]): void;
12
- debug(...params: any[]): void;
13
- info(...params: any[]): void;
14
- warn(...params: any[]): void;
15
- error(...params: any[]): void;
16
- fatal(...params: any[]): void;
10
+ level(level: LoggerLevel): void;
11
+ trace(...params: any[]): void;
12
+ debug(...params: any[]): void;
13
+ info(...params: any[]): void;
14
+ warn(...params: any[]): void;
15
+ error(...params: any[]): void;
16
+ fatal(...params: any[]): void;
17
17
  }
18
18
 
19
19
  export interface ResolveHostnameOptions {
20
- host?: string | undefined;
21
- servername?: string | false | undefined;
20
+ host?: string | undefined;
21
+ servername?: string | false | undefined;
22
22
  }
23
23
 
24
24
  export interface ResolveHostnameValue {
25
- host: string;
26
- servername: string | false;
27
- _cached?: true | undefined;
25
+ host: string;
26
+ servername: string | false;
27
+ _cached?: true | undefined;
28
28
  }
29
29
 
30
- export function resolveHostname(options: ResolveHostnameOptions | null | undefined, callback: (err: Error | null, value: ResolveHostnameValue) => void): void;
30
+ export function resolveHostname(
31
+ options: ResolveHostnameOptions | null | undefined,
32
+ callback: (err: Error | null, value: ResolveHostnameValue) => void,
33
+ ): void;
31
34
 
32
35
  /** Parses connection url to a structured configuration object */
33
36
  export function parseConnectionUrl(url: string): SMTPConnection.Options;
@@ -44,7 +47,11 @@ export function callbackPromise(resolve: (...args: any[]) => void, reject: (err:
44
47
  * for example the `html` or `text` value as a String or a Buffer but not as
45
48
  * a file path or an URL.
46
49
  */
47
- export function resolveContent(data: object | any[], key: string | number, callback: (err: Error | null, value: Buffer | string) => void): void;
50
+ export function resolveContent(
51
+ data: object | any[],
52
+ key: string | number,
53
+ callback: (err: Error | null, value: Buffer | string) => void,
54
+ ): void;
48
55
  export function resolveContent(data: object | any[], key: string | number): Promise<Buffer | string>;
49
56
  /** Copies properties from source objects to target objects */
50
57
  export function assign(target: object, ...sources: object[]): object;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Transform } from 'stream';
3
+ import { Transform } from "stream";
4
4
 
5
5
  /**
6
6
  * Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>
@@ -1,11 +1,16 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { Socket } from 'net';
4
- import { TLSSocket } from 'tls';
3
+ import { Socket } from "net";
4
+ import { TLSSocket } from "tls";
5
5
 
6
6
  /**
7
7
  * Establishes proxied connection to destinationPort
8
8
  */
9
- declare function httpProxyClient(proxyUrl: string, destinationPort: number, destinationHost: string, callback: (err: Error | null, socket: TLSSocket | Socket) => void): void;
9
+ declare function httpProxyClient(
10
+ proxyUrl: string,
11
+ destinationPort: number,
12
+ destinationHost: string,
13
+ callback: (err: Error | null, socket: TLSSocket | Socket) => void,
14
+ ): void;
10
15
 
11
16
  export = httpProxyClient;
@@ -1,14 +1,14 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { EventEmitter } from 'events';
4
- import * as net from 'net';
5
- import { Readable } from 'stream';
6
- import * as tls from 'tls';
3
+ import { EventEmitter } from "events";
4
+ import * as net from "net";
5
+ import { Readable } from "stream";
6
+ import * as tls from "tls";
7
7
 
8
- import * as shared from '../shared';
8
+ import * as shared from "../shared";
9
9
 
10
- import MimeNode = require('../mime-node');
11
- import XOAuth2 = require('../xoauth2');
10
+ import MimeNode = require("../mime-node");
11
+ import XOAuth2 = require("../xoauth2");
12
12
 
13
13
  type ms = number;
14
14
 
@@ -24,18 +24,18 @@ declare namespace SMTPConnection {
24
24
 
25
25
  interface AuthenticationTypeCustom extends Credentials {
26
26
  /** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
27
- type: 'custom' | 'Custom' | 'CUSTOM';
27
+ type: "custom" | "Custom" | "CUSTOM";
28
28
  method: string;
29
29
  }
30
30
 
31
31
  interface AuthenticationTypeLogin extends Credentials {
32
32
  /** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
33
- type?: 'login' | 'Login' | 'LOGIN' | undefined;
33
+ type?: "login" | "Login" | "LOGIN" | undefined;
34
34
  }
35
35
 
36
36
  interface AuthenticationTypeOAuth2 extends OAuth2 {
37
37
  /** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
38
- type?: 'oauth2' | 'OAuth2' | 'OAUTH2' | undefined;
38
+ type?: "oauth2" | "OAuth2" | "OAUTH2" | undefined;
39
39
  }
40
40
 
41
41
  type AuthenticationType = AuthenticationTypeCustom | AuthenticationTypeLogin | AuthenticationTypeOAuth2;
@@ -74,11 +74,11 @@ declare namespace SMTPConnection {
74
74
  [method: string]: (ctx: CustomAuthenticationContext) => Promise<boolean> | unknown;
75
75
  }
76
76
 
77
- type DSNOption = 'NEVER' | 'SUCCESS' | 'FAILURE' | 'DELAY';
77
+ type DSNOption = "NEVER" | "SUCCESS" | "FAILURE" | "DELAY";
78
78
 
79
79
  interface DSNOptions {
80
80
  /** return either the full message ‘FULL’ or only headers ‘HDRS’ */
81
- ret?: 'Full' | 'HDRS' | undefined;
81
+ ret?: "Full" | "HDRS" | undefined;
82
82
  /** sender’s ‘envelope identifier’ for tracking */
83
83
  envid?: string | undefined;
84
84
  /** when to send a DSN. Multiple options are OK - array or comma delimited. NEVER must appear by itself. */
@@ -181,7 +181,7 @@ declare class SMTPConnection extends EventEmitter {
181
181
  logger: shared.Logger;
182
182
 
183
183
  id: string;
184
- stage: 'init' | 'connected';
184
+ stage: "init" | "connected";
185
185
 
186
186
  secureConnection: boolean;
187
187
  alreadySecured: boolean;
@@ -214,45 +214,55 @@ declare class SMTPConnection extends EventEmitter {
214
214
  /** Closes the connection to the server */
215
215
  close(): void;
216
216
  /** Authenticate user */
217
- login(auth: SMTPConnection.AuthenticationCredentials | SMTPConnection.AuthenticationOAuth2 | SMTPConnection.Credentials, callback: (err?: SMTPConnection.SMTPError) => void): void;
217
+ login(
218
+ auth:
219
+ | SMTPConnection.AuthenticationCredentials
220
+ | SMTPConnection.AuthenticationOAuth2
221
+ | SMTPConnection.Credentials,
222
+ callback: (err?: SMTPConnection.SMTPError) => void,
223
+ ): void;
218
224
  /** Sends a message */
219
- send(envelope: SMTPConnection.Envelope, message: string | Buffer | Readable, callback: (err: SMTPConnection.SMTPError | null, info: SMTPConnection.SentMessageInfo) => void): void;
225
+ send(
226
+ envelope: SMTPConnection.Envelope,
227
+ message: string | Buffer | Readable,
228
+ callback: (err: SMTPConnection.SMTPError | null, info: SMTPConnection.SentMessageInfo) => void,
229
+ ): void;
220
230
  /** Resets connection state */
221
231
  reset(callback: (err?: SMTPConnection.SMTPError) => void): void;
222
232
 
223
- addListener(event: 'connect' | 'end', listener: () => void): this;
224
- addListener(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
233
+ addListener(event: "connect" | "end", listener: () => void): this;
234
+ addListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
225
235
 
226
- emit(event: 'connect' | 'end'): boolean;
227
- emit(event: 'error', error: Error): boolean;
236
+ emit(event: "connect" | "end"): boolean;
237
+ emit(event: "error", error: Error): boolean;
228
238
 
229
- listenerCount(event: 'connect' | 'end' | 'error'): number;
239
+ listenerCount(event: "connect" | "end" | "error"): number;
230
240
 
231
- listeners(event: 'connect' | 'end'): Array<() => void>;
232
- listeners(event: 'error'): Array<(err: SMTPConnection.SMTPError) => void>;
241
+ listeners(event: "connect" | "end"): Array<() => void>;
242
+ listeners(event: "error"): Array<(err: SMTPConnection.SMTPError) => void>;
233
243
 
234
- off(event: 'connect' | 'end', listener: () => void): this;
235
- off(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
244
+ off(event: "connect" | "end", listener: () => void): this;
245
+ off(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
236
246
 
237
- on(event: 'connect' | 'end', listener: () => void): this;
238
- on(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
247
+ on(event: "connect" | "end", listener: () => void): this;
248
+ on(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
239
249
 
240
- once(event: 'connect' | 'end', listener: () => void): this;
241
- once(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
250
+ once(event: "connect" | "end", listener: () => void): this;
251
+ once(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
242
252
 
243
- prependListener(event: 'connect' | 'end', listener: () => void): this;
244
- prependListener(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
253
+ prependListener(event: "connect" | "end", listener: () => void): this;
254
+ prependListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
245
255
 
246
- prependOnceListener(event: 'connect' | 'end', listener: () => void): this;
247
- prependOnceListener(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
256
+ prependOnceListener(event: "connect" | "end", listener: () => void): this;
257
+ prependOnceListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
248
258
 
249
- rawListeners(event: 'connect' | 'end'): Array<() => void>;
250
- rawListeners(event: 'error'): Array<(err: SMTPConnection.SMTPError) => void>;
259
+ rawListeners(event: "connect" | "end"): Array<() => void>;
260
+ rawListeners(event: "error"): Array<(err: SMTPConnection.SMTPError) => void>;
251
261
 
252
- removeAllListener(event: 'connect' | 'end' | 'error'): this;
262
+ removeAllListener(event: "connect" | "end" | "error"): this;
253
263
 
254
- removeListener(event: 'connect' | 'end', listener: () => void): this;
255
- removeListener(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this;
264
+ removeListener(event: "connect" | "end", listener: () => void): this;
265
+ removeListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
256
266
  }
257
267
 
258
268
  export = SMTPConnection;
@@ -1,14 +1,14 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { EventEmitter } from 'events';
3
+ import { EventEmitter } from "events";
4
4
 
5
- import { Transport, TransportOptions } from '../..';
6
- import * as shared from '../shared';
5
+ import { Transport, TransportOptions } from "../..";
6
+ import * as shared from "../shared";
7
7
 
8
- import Mail = require('../mailer');
9
- import MailMessage = require('../mailer/mail-message');
10
- import MimeNode = require('../mime-node');
11
- import SMTPConnection = require('../smtp-connection');
8
+ import Mail = require("../mailer");
9
+ import MailMessage = require("../mailer/mail-message");
10
+ import MimeNode = require("../mime-node");
11
+ import SMTPConnection = require("../smtp-connection");
12
12
 
13
13
  declare namespace SMTPPool {
14
14
  interface MailOptions extends Mail.Options {
@@ -60,7 +60,10 @@ declare class SMTPPool extends EventEmitter implements Transport<SMTPPool.SentMe
60
60
  getSocket(options: SMTPPool.Options, callback: (err: Error | null, socketOptions: any) => void): void;
61
61
 
62
62
  /** Sends an e-mail using the selected settings */
63
- send(mail: MailMessage<SMTPPool.SentMessageInfo>, callback: (err: Error | null, info: SMTPPool.SentMessageInfo) => void): void;
63
+ send(
64
+ mail: MailMessage<SMTPPool.SentMessageInfo>,
65
+ callback: (err: Error | null, info: SMTPPool.SentMessageInfo) => void,
66
+ ): void;
64
67
 
65
68
  /** Closes all connections in the pool. If there is a message being sent, the connection is closed later */
66
69
  close(): void;
@@ -72,19 +75,19 @@ declare class SMTPPool extends EventEmitter implements Transport<SMTPPool.SentMe
72
75
  verify(callback: (err: Error | null, success: true) => void): void;
73
76
  verify(): Promise<true>;
74
77
 
75
- addListener(event: 'idle', listener: () => void): this;
78
+ addListener(event: "idle", listener: () => void): this;
76
79
 
77
- emit(event: 'idle'): boolean;
80
+ emit(event: "idle"): boolean;
78
81
 
79
- on(event: 'idle', listener: () => void): this;
82
+ on(event: "idle", listener: () => void): this;
80
83
 
81
- once(event: 'idle', listener: () => void): this;
84
+ once(event: "idle", listener: () => void): this;
82
85
 
83
- prependListener(event: 'idle', listener: () => void): this;
86
+ prependListener(event: "idle", listener: () => void): this;
84
87
 
85
- prependOnceListener(event: 'idle', listener: () => void): this;
88
+ prependOnceListener(event: "idle", listener: () => void): this;
86
89
 
87
- listeners(event: 'idle'): Array<() => void>;
90
+ listeners(event: "idle"): Array<() => void>;
88
91
  }
89
92
 
90
93
  export = SMTPPool;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import { EventEmitter } from 'events';
3
+ import { EventEmitter } from "events";
4
4
 
5
- import MailMessage = require('../mailer/mail-message');
6
- import * as shared from '../shared';
5
+ import MailMessage = require("../mailer/mail-message");
6
+ import * as shared from "../shared";
7
7
 
8
- import SMTPPool = require('.');
8
+ import SMTPPool = require(".");
9
9
 
10
10
  /**
11
11
  * Creates an element for the pool
@@ -27,39 +27,39 @@ declare class PoolResource extends EventEmitter {
27
27
  /** Closes the connection */
28
28
  close(): void;
29
29
 
30
- addListener(event: 'available', listener: () => void): this;
31
- addListener(event: 'close', listener: () => void): this;
32
- addListener(event: 'error', listener: (err: Error) => void): this;
30
+ addListener(event: "available", listener: () => void): this;
31
+ addListener(event: "close", listener: () => void): this;
32
+ addListener(event: "error", listener: (err: Error) => void): this;
33
33
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
34
34
 
35
- emit(event: 'available'): boolean;
36
- emit(event: 'close'): boolean;
37
- emit(event: 'error', err: Error): boolean;
35
+ emit(event: "available"): boolean;
36
+ emit(event: "close"): boolean;
37
+ emit(event: "error", err: Error): boolean;
38
38
  emit(event: string | symbol, ...args: any[]): boolean;
39
39
 
40
- on(event: 'available', listener: () => void): this;
41
- on(event: 'close', listener: () => void): this;
42
- on(event: 'error', listener: (err: Error) => void): this;
40
+ on(event: "available", listener: () => void): this;
41
+ on(event: "close", listener: () => void): this;
42
+ on(event: "error", listener: (err: Error) => void): this;
43
43
  on(event: string | symbol, listener: (...args: any[]) => void): this;
44
44
 
45
- once(event: 'available', listener: () => void): this;
46
- once(event: 'close', listener: () => void): this;
47
- once(event: 'error', listener: (err: Error) => void): this;
45
+ once(event: "available", listener: () => void): this;
46
+ once(event: "close", listener: () => void): this;
47
+ once(event: "error", listener: (err: Error) => void): this;
48
48
  once(event: string | symbol, listener: (...args: any[]) => void): this;
49
49
 
50
- prependListener(event: 'available', listener: () => void): this;
51
- prependListener(event: 'close', listener: () => void): this;
52
- prependListener(event: 'error', listener: (err: Error) => void): this;
50
+ prependListener(event: "available", listener: () => void): this;
51
+ prependListener(event: "close", listener: () => void): this;
52
+ prependListener(event: "error", listener: (err: Error) => void): this;
53
53
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
54
54
 
55
- prependOnceListener(event: 'available', listener: () => void): this;
56
- prependOnceListener(event: 'close', listener: () => void): this;
57
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
55
+ prependOnceListener(event: "available", listener: () => void): this;
56
+ prependOnceListener(event: "close", listener: () => void): this;
57
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
58
58
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
59
59
 
60
- removeListener(event: 'available', listener: () => void): this;
61
- removeListener(event: 'close', listener: () => void): this;
62
- removeListener(event: 'error', listener: (err: Error) => void): this;
60
+ removeListener(event: "available", listener: () => void): this;
61
+ removeListener(event: "close", listener: () => void): this;
62
+ removeListener(event: "error", listener: (err: Error) => void): this;
63
63
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
64
64
  }
65
65