22 * The main parser for MJML.
33 * This version doesn't contain any of the core components registered in the 'mjml' package.
44 */
5- export default function mjml2html ( input : string | MJMLJsonObject , options ?: MJMLParsingOptions ) : MJMLParseResults ;
5+ export default function mjml2html (
6+ input : string | MJMLJsonObject ,
7+ options ?: MJMLParsingOptions ,
8+ ) : Promise < MJMLParseResults > ;
69
710/**
811 * Options passed as an object to the mjml2html function
@@ -25,28 +28,24 @@ export interface MJMLParsingOptions {
2528 keepComments ?: boolean | undefined ;
2629
2730 /**
28- * @deprecated use js-beautify directly after processing the MJML
29- *
30- * Option to beautify the HTML output
31+ * Beautify the HTML output using prettier (parser: 'html', printWidth: 240).
32+ * Mutually exclusive with minify — if minify is true, beautify is skipped.
33+ * Note: the CLI defaults this to true; the programmatic API defaults to false.
3134 * default: false
3235 */
3336 beautify ?: boolean | undefined ;
3437
3538 /**
36- * @deprecated use html-minifier directly after processing the MJML
37- *
38- * Option to minify the HTML output
39- *
39+ * Minify the HTML output using htmlnano (with cssnano-preset-lite for CSS).
40+ * Takes priority over beautify when both are true.
4041 * default: false
4142 */
4243 minify ?: boolean | undefined ;
44+
4345 /**
44- * @deprecated @see minify
45- *
46- * Options for html minifier, see mjml-cli documentation for more info
47- * Passed directly to html-minifier as options
48- *
49- * default: @see htmlMinify usage in mjml-core/src/index.js
46+ * Options passed to htmlnano when minify is true.
47+ * The minifyCss field accepts false, true, 'lite', or a cssnano options object.
48+ * All htmlnano v3 options are accepted.
5049 */
5150 minifyOptions ?: MJMLMinifyOptions | undefined ;
5251
@@ -113,8 +112,17 @@ export interface MJMLParsingOptions {
113112
114113export interface MJMLMinifyOptions {
115114 collapseWhitespace ?: boolean | undefined ;
115+ /**
116+ * CSS minification options passed to cssnano-preset-lite.
117+ * Accepts false (disable), true/'lite' (use lite preset), or a cssnano options object.
118+ * @see https://cssnano.co/docs/presets
119+ */
120+ minifyCss ?: boolean | "lite" | { preset ?: any ; plugins ?: any [ ] ; configFile ?: string } | undefined ;
121+ /** @deprecated use minifyCss instead */
116122 minifyCSS ?: boolean | undefined ;
117123 removeEmptyAttributes ?: boolean | undefined ;
124+ minifyJs ?: boolean | undefined ;
125+ removeComments ?: false | "safe" | "all" | undefined ;
118126}
119127
120128export interface MJMLParseResults {
0 commit comments