Files
DefinitelyTyped/types/mjml/index.d.ts
Andrew Houghton fd5742930d (new definition) add mjml (mjml.io) types (#25217)
* add mjml (mjml.io) types

* update mjml definition, actually verify linter runs, be more explicit in re: error types

* mjml: int -> number.  why does lint pass w/ 'int'? ah well.

* per @plantain-00 CR
2018-04-24 16:21:17 -07:00

30 lines
729 B
TypeScript

// Type definitions for mjml 4.0
// Project: https://github.com/mjmlio/mjml
// Definitions by: aahoughton <https://github.com/aahoughton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface MJMLParsingOpts {
fonts?: { [key: string]: string; };
keepComments?: boolean;
beautify?: boolean;
minify?: boolean;
validationLevel?: 'strict' | 'soft' | 'skip';
filePath?: boolean;
}
interface MJMLParseError {
line: number;
message: string;
tagName: string;
formattedMessage: string;
}
interface MJMLParseResults {
html: string;
errors: MJMLParseError[];
}
declare function mjml2html(inp: string, opts?: MJMLParsingOpts): MJMLParseResults;
export = mjml2html;