@types/nodemailer 6.4.1 → 6.4.2

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.
nodemailer/LICENSE CHANGED
File without changes
nodemailer/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Nodemailer (https://github.com/nodema
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 12 Mar 2021 19:14:06 GMT
11
+ * Last updated: Mon, 24 May 2021 12:32:37 GMT
12
12
  * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
13
13
  * Global values: none
14
14
 
nodemailer/index.d.ts CHANGED
@@ -19,17 +19,17 @@ import StreamTransport = require('./lib/stream-transport');
19
19
 
20
20
  export type SendMailOptions = Mail.Options;
21
21
 
22
- export type SentMessageInfo = any;
22
+ export type Transporter<T = any> = Mail<T>;
23
23
 
24
- export type Transporter = Mail;
24
+ export type SentMessageInfo = any;
25
25
 
26
- export interface Transport {
27
- mailer?: Transporter;
26
+ export interface Transport<T = any> {
27
+ mailer?: Transporter<T>;
28
28
 
29
29
  name: string;
30
30
  version: string;
31
31
 
32
- send(mail: MailMessage, callback: (err: Error | null, info: SentMessageInfo) => void): void;
32
+ send(mail: MailMessage<T>, callback: (err: Error | null, info: T) => void): void;
33
33
 
34
34
  verify?(callback: (err: Error | null, success: true) => void): void;
35
35
  verify?(): Promise<true>;
@@ -53,25 +53,25 @@ export interface TestAccount {
53
53
  export function createTransport(
54
54
  transport?: SMTPTransport | SMTPTransport.Options | string,
55
55
  defaults?: SMTPTransport.Options,
56
- ): Transporter;
57
- export function createTransport(transport: SMTPPool | SMTPPool.Options, defaults?: SMTPPool.Options): Transporter;
56
+ ): Transporter<SMTPTransport.SentMessageInfo>;
57
+ export function createTransport(transport: SMTPPool | SMTPPool.Options, defaults?: SMTPPool.Options): Transporter<SMTPPool.SentMessageInfo>;
58
58
  export function createTransport(
59
59
  transport: SendmailTransport | SendmailTransport.Options,
60
60
  defaults?: SendmailTransport.Options,
61
- ): Transporter;
61
+ ): Transporter<SendmailTransport.SentMessageInfo>;
62
62
  export function createTransport(
63
63
  transport: StreamTransport | StreamTransport.Options,
64
64
  defaults?: StreamTransport.Options,
65
- ): Transporter;
65
+ ): Transporter<StreamTransport.SentMessageInfo>;
66
66
  export function createTransport(
67
67
  transport: JSONTransport | JSONTransport.Options,
68
68
  defaults?: JSONTransport.Options,
69
- ): Transporter;
69
+ ): Transporter<JSONTransport.SentMessageInfo>;
70
70
  export function createTransport(
71
71
  transport: SESTransport | SESTransport.Options,
72
72
  defaults?: SESTransport.Options,
73
- ): Transporter;
74
- export function createTransport(transport: Transport | TransportOptions, defaults?: TransportOptions): Transporter;
73
+ ): Transporter<SESTransport.SentMessageInfo>;
74
+ export function createTransport<T>(transport: Transport<T> | TransportOptions, defaults?: TransportOptions): Transporter<T>;
75
75
 
76
76
  export function createTestAccount(
77
77
  apiUrl: string,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -28,11 +28,11 @@ declare namespace JSONTransport {
28
28
  }
29
29
  }
30
30
 
31
- declare class JSONTransport implements Transport {
31
+ declare class JSONTransport implements Transport<JSONTransport.SentMessageInfo> {
32
32
  options: JSONTransport.Options;
33
33
 
34
34
  logger: shared.Logger;
35
- mailer: Mail;
35
+ mailer: Mail<JSONTransport.SentMessageInfo>;
36
36
 
37
37
  name: string;
38
38
  version: string;
@@ -40,7 +40,7 @@ declare class JSONTransport implements Transport {
40
40
  constructor(options: JSONTransport.Options);
41
41
 
42
42
  /** Compiles a mailcomposer message and forwards it to handler that sends it */
43
- send(mail: MailMessage, callback: (err: Error | null, info: JSONTransport.SentMessageInfo) => void): void;
43
+ send(mail: MailMessage<JSONTransport.SentMessageInfo>, callback: (err: Error | null, info: JSONTransport.SentMessageInfo) => void): void;
44
44
  }
45
45
 
46
46
  export = JSONTransport;
File without changes
@@ -5,7 +5,7 @@ import { Socket } from 'net';
5
5
  import { Readable } from 'stream';
6
6
  import { Url } from 'url';
7
7
 
8
- import { SentMessageInfo, Transport, TransportOptions } from '../..';
8
+ import { Transport, TransportOptions } from '../..';
9
9
  import * as shared from '../shared';
10
10
 
11
11
  import DKIM = require('../dkim');
@@ -153,21 +153,21 @@ declare namespace Mail {
153
153
  priority?: "high"|"normal"|"low";
154
154
  }
155
155
 
156
- type PluginFunction = (mail: MailMessage, callback: (err?: Error | null) => void) => void;
156
+ type PluginFunction<T = any> = (mail: MailMessage<T>, callback: (err?: Error | null) => void) => void;
157
157
  }
158
158
 
159
159
  /** Creates an object for exposing the Mail API */
160
- declare class Mail extends EventEmitter {
160
+ declare class Mail<T = any> extends EventEmitter {
161
161
  options: Mail.Options;
162
162
  meta: Map<string, any>;
163
163
  dkim: DKIM;
164
- transporter: Transport;
164
+ transporter: Transport<T>;
165
165
  logger: shared.Logger;
166
166
 
167
167
  /** Usage: typeof transporter.MailMessage */
168
- MailMessage: MailMessage;
168
+ MailMessage: MailMessage<T>;
169
169
 
170
- constructor(transporter: Transport, options?: TransportOptions, defaults?: TransportOptions);
170
+ constructor(transporter: Transport<T>, options?: TransportOptions, defaults?: TransportOptions);
171
171
 
172
172
  /** Closes all connections in the pool. If there is a message being sent, the connection is closed later */
173
173
  close(): void;
@@ -179,11 +179,11 @@ declare class Mail extends EventEmitter {
179
179
  verify(callback: (err: Error | null, success: true) => void): void;
180
180
  verify(): Promise<true>;
181
181
 
182
- use(step: string, plugin: Mail.PluginFunction): this;
182
+ use(step: string, plugin: Mail.PluginFunction<T>): this;
183
183
 
184
184
  /** Sends an email using the preselected transport object */
185
- sendMail(mailOptions: Mail.Options, callback: (err: Error | null, info: SentMessageInfo) => void): void;
186
- sendMail(mailOptions: Mail.Options): Promise<SentMessageInfo>;
185
+ sendMail(mailOptions: Mail.Options, callback: (err: Error | null, info: T) => void): void;
186
+ sendMail(mailOptions: Mail.Options): Promise<T>;
187
187
 
188
188
  getVersionString(): string;
189
189
 
@@ -5,12 +5,12 @@ import { Readable } from 'stream';
5
5
  import Mail = require('.');
6
6
  import MimeNode = require('../mime-node');
7
7
 
8
- declare class MailMessage {
9
- mailer: Mail;
8
+ declare class MailMessage<T = any> {
9
+ mailer: Mail<T>;
10
10
  data: Mail.Options;
11
11
  message: MimeNode;
12
12
 
13
- constructor(mailer: Mail, data: Mail.Options);
13
+ constructor(mailer: Mail<T>, data: Mail.Options);
14
14
 
15
15
  resolveContent(data: object | any[], key: string | number, callback: (err: Error | null, value?: any) => any): Promise<any>;
16
16
 
File without changes
File without changes
File without changes
File without changes
nodemailer/lib/qp.d.ts CHANGED
File without changes
@@ -28,10 +28,10 @@ declare namespace SendmailTransport {
28
28
  }
29
29
  }
30
30
 
31
- declare class SendmailTransport implements Transport {
31
+ declare class SendmailTransport implements Transport<SendmailTransport.SentMessageInfo> {
32
32
  options: SendmailTransport.Options;
33
33
  logger: shared.Logger;
34
- mailer: Mail;
34
+ mailer: Mail<SendmailTransport.SentMessageInfo>;
35
35
  name: string;
36
36
  version: string;
37
37
  path: string;
@@ -41,7 +41,7 @@ declare class SendmailTransport implements Transport {
41
41
  constructor(options: SendmailTransport.Options);
42
42
 
43
43
  /** Compiles a mailcomposer message and forwards it to handler that sends it */
44
- send(mail: MailMessage, callback: (err: Error | null, info: SendmailTransport.SentMessageInfo) => void): void;
44
+ send(mail: MailMessage<SendmailTransport.SentMessageInfo>, callback: (err: Error | null, info: SendmailTransport.SentMessageInfo) => void): void;
45
45
  }
46
46
 
47
47
  export = SendmailTransport;
File without changes
File without changes
@@ -83,11 +83,11 @@ declare namespace SESTransport {
83
83
  }
84
84
  }
85
85
 
86
- declare class SESTransport extends EventEmitter implements Transport {
86
+ declare class SESTransport extends EventEmitter implements Transport<SESTransport.SentMessageInfo> {
87
87
  options: SESTransport.Options;
88
88
 
89
89
  logger: shared.Logger;
90
- mailer: Mail;
90
+ mailer: Mail<SESTransport.SentMessageInfo>;
91
91
 
92
92
  name: string;
93
93
  version: string;
@@ -100,13 +100,13 @@ declare class SESTransport extends EventEmitter implements Transport {
100
100
  sendingRateTTL: number | null;
101
101
  rateInterval: number;
102
102
  rateMessages: Array<{ ts: number, pending: boolean }>;
103
- pending: Array<{ mail: Mail; callback(err: Error | null, info: SESTransport.SentMessageInfo): void; }>;
103
+ pending: Array<{ mail: Mail<SESTransport.SentMessageInfo>; callback(err: Error | null, info: SESTransport.SentMessageInfo): void; }>;
104
104
  idling: boolean;
105
105
 
106
106
  constructor(options: SESTransport.Options);
107
107
 
108
108
  /** Schedules a sending of a message */
109
- send(mail: MailMessage, callback: (err: Error | null, info: SESTransport.SentMessageInfo) => void): void;
109
+ send(mail: MailMessage<SESTransport.SentMessageInfo>, callback: (err: Error | null, info: SESTransport.SentMessageInfo) => void): void;
110
110
 
111
111
  /** Returns true if there are free slots in the queue */
112
112
  isIdle(): boolean;
File without changes
File without changes
File without changes
File without changes
@@ -43,10 +43,10 @@ declare namespace SMTPPool {
43
43
  /**
44
44
  * Creates a SMTP pool transport object for Nodemailer
45
45
  */
46
- declare class SMTPPool extends EventEmitter implements Transport {
46
+ declare class SMTPPool extends EventEmitter implements Transport<SMTPPool.SentMessageInfo> {
47
47
  options: SMTPPool.Options;
48
48
 
49
- mailer: Mail;
49
+ mailer: Mail<SMTPPool.SentMessageInfo>;
50
50
  logger: shared.Logger;
51
51
 
52
52
  name: string;
@@ -60,7 +60,7 @@ declare class SMTPPool extends EventEmitter implements Transport {
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, callback: (err: Error | null, info: SMTPPool.SentMessageInfo) => void): void;
63
+ send(mail: MailMessage<SMTPPool.SentMessageInfo>, callback: (err: Error | null, info: SMTPPool.SentMessageInfo) => void): void;
64
64
 
65
65
  /** Closes all connections in the pool. If there is a message being sent, the connection is closed later */
66
66
  close(): void;
File without changes
@@ -53,10 +53,10 @@ declare namespace SMTPTransport {
53
53
  }
54
54
  }
55
55
 
56
- declare class SMTPTransport extends EventEmitter implements Transport {
56
+ declare class SMTPTransport extends EventEmitter implements Transport<SMTPTransport.SentMessageInfo> {
57
57
  options: SMTPTransport.Options;
58
58
 
59
- mailer: Mail;
59
+ mailer: Mail<SMTPTransport.SentMessageInfo>;
60
60
  logger: shared.Logger;
61
61
 
62
62
  name: string;
@@ -72,7 +72,7 @@ declare class SMTPTransport extends EventEmitter implements Transport {
72
72
  getAuth(authOpts: SMTPConnection.AuthenticationTypeLogin | SMTPConnection.AuthenticationTypeOAuth2): SMTPTransport.AuthenticationType;
73
73
 
74
74
  /** Sends an e-mail using the selected settings */
75
- send(mail: MailMessage, callback: (err: Error | null, info: SMTPTransport.SentMessageInfo) => void): void;
75
+ send(mail: MailMessage<SMTPTransport.SentMessageInfo>, callback: (err: Error | null, info: SMTPTransport.SentMessageInfo) => void): void;
76
76
 
77
77
  /** Verifies SMTP configuration */
78
78
  verify(callback: (err: Error | null, success: true) => void): void;
@@ -32,11 +32,11 @@ declare namespace StreamTransport {
32
32
  }
33
33
  }
34
34
 
35
- declare class StreamTransport implements Transport {
35
+ declare class StreamTransport implements Transport<StreamTransport.SentMessageInfo> {
36
36
  options: StreamTransport.Options;
37
37
 
38
38
  logger: shared.Logger;
39
- mailer: Mail;
39
+ mailer: Mail<StreamTransport.SentMessageInfo>;
40
40
 
41
41
  name: string;
42
42
  version: string;
@@ -46,7 +46,7 @@ declare class StreamTransport implements Transport {
46
46
  constructor(options: StreamTransport.Options);
47
47
 
48
48
  /** Compiles a mailcomposer message and forwards it to handler that sends it */
49
- send(mail: MailMessage, callback: (err: Error | null, info: StreamTransport.SentMessageInfo) => void): void;
49
+ send(mail: MailMessage<StreamTransport.SentMessageInfo>, callback: (err: Error | null, info: StreamTransport.SentMessageInfo) => void): void;
50
50
  }
51
51
 
52
52
  export = StreamTransport;
File without changes
File without changes
nodemailer/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/nodemailer",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "TypeScript definitions for Nodemailer",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -31,6 +31,6 @@
31
31
  "dependencies": {
32
32
  "@types/node": "*"
33
33
  },
34
- "typesPublisherContentHash": "bed126e5ff05dce39c1dc555eb5c910094ffc65169009f58ef5f41326de1a7a6",
34
+ "typesPublisherContentHash": "d82eae001ee70595c034fcffdcc5c37fd64ef3bcbd31451a0d2479d57fee0233",
35
35
  "typeScriptVersion": "3.5"
36
36
  }