Closed neminovno closed 5 years ago
Solved with creating new file myfile.d.ts:
interface MJMLParsingOpts {
fonts?: { [key: string]: string; };
keepComments?: boolean;
beautify?: boolean;
minify?: boolean;
validationLevel?: 'strict' | 'soft' | 'skip';
filePath?: string;
}
declare module "mjml2json" {
function mjml2json(inp: string, opts?: MJMLParsingOpts): {};
export default mjml2json;
}
and use it like this:
const mjml2json = require('mjml2json').default;
(...)
const output = mjml2json(input);
How to solve this?