mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
* 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
30 lines
729 B
TypeScript
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;
|