1
- // Type definitions for mailparser v2.0.0
2
- // Project: https://www.npmjs. com/package /mailparser
1
+ // Type definitions for mailparser 2.4
2
+ // Project: https://github. com/nodemailer /mailparser
3
3
// Definitions by: Peter Snider <https://github.com/psnider>
4
- // Andrey Volynkin <https://github.com/Avol-V/ >
4
+ // Andrey Volynkin <https://github.com/Avol-V>
5
5
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
6
7
7
/// <reference types="node" />
@@ -289,6 +289,13 @@ export class MailParser extends StreamModule.Transform {
289
289
*/
290
290
export type Source = Buffer | Stream | string ;
291
291
292
+ /**
293
+ * Options object for simpleParser.
294
+ */
295
+ export interface SimpleParserOptions extends StreamModule . TransformOptions {
296
+ keepCidLinks ?: boolean ;
297
+ }
298
+
292
299
/**
293
300
* Parse email message to structure object.
294
301
*
@@ -301,5 +308,16 @@ export function simpleParser(source: Source, callback: (err: any, mail: ParsedMa
301
308
* Parse email message to structure object.
302
309
*
303
310
* @param source A message source.
311
+ * @param options Transform options passed to MailParser's constructor
312
+ * @param callback Function to get a structured email object.
313
+ */
314
+ export function simpleParser ( source : Source , options : SimpleParserOptions , callback : ( err : any , mail : ParsedMail ) => void ) : void ;
315
+
316
+
317
+ /**
318
+ * Parse email message to structure object.
319
+ *
320
+ * @param source A message source.
321
+ * @param options Transform options passed to MailParser's constructor
304
322
*/
305
- export function simpleParser ( source : Source ) : Promise < ParsedMail > ;
323
+ export function simpleParser ( source : Source , options ?: SimpleParserOptions ) : Promise < ParsedMail > ;
0 commit comments