mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added minify options to MJML (#43223)
* added MJMLMinifyOptions to MJMLParsingOpts * revert changes from prettier Co-authored-by: emrah <ek@infomedia.dk>
This commit is contained in:
parent
4a1d0d6881
commit
878f12fc93
8
types/mjml/index.d.ts
vendored
8
types/mjml/index.d.ts
vendored
@ -3,6 +3,7 @@
|
||||
// Definitions by: aahoughton <https://github.com/aahoughton>
|
||||
// marpstar <https://github.com/marpstar>
|
||||
// eiskalteschatten <https://github.com/eiskalteschatten>
|
||||
// emrah88 <https://github.com/emrah88>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface MJMLParsingOpts {
|
||||
@ -12,6 +13,7 @@ interface MJMLParsingOpts {
|
||||
minify?: boolean;
|
||||
validationLevel?: 'strict' | 'soft' | 'skip';
|
||||
filePath?: string;
|
||||
minifyOptions?: MJMLMinifyOptions;
|
||||
}
|
||||
|
||||
interface MJMLParseError {
|
||||
@ -33,6 +35,12 @@ interface MJMLJsonObject {
|
||||
content?: string;
|
||||
}
|
||||
|
||||
interface MJMLMinifyOptions {
|
||||
collapseWhitespace?: boolean;
|
||||
minifyCSS?: boolean;
|
||||
removeEmptyAttributes?: boolean;
|
||||
}
|
||||
|
||||
declare function mjml2html(inp: string | MJMLJsonObject, opts?: MJMLParsingOpts): MJMLParseResults;
|
||||
|
||||
export = mjml2html;
|
||||
|
||||
@ -12,3 +12,6 @@ const filePath_test = mjml2html("<mjml>", {filePath: "."});
|
||||
|
||||
const jsonObject = {tagName: "mjml", attributes: {width: "100px"}, content: "test content"};
|
||||
const jsonObject_test = mjml2html(jsonObject);
|
||||
|
||||
const minify_opts_test = mjml2html("<mjml", {minifyOptions: {minifyCSS: true}});
|
||||
const minify_opts_all_test = mjml2html("<mjml", {minifyOptions: {minifyCSS: true, collapseWhitespace: true, removeEmptyAttributes: true}});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user