mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 18:39:41 +02:00

The `node16` module resolution requires imports to use the `.js` file extension in type definitions. `@rollup/plugin-typescript` is needed to make this work with the Vite setup used by Mermaid. The module option for Mermaid internally is set to `nodenext`. This is needed to support `.json` imports. Note that setting `module` to `node16` or `nodenext` implies a matching `moduleResolution` value.
42 lines
613 B
JavaScript
42 lines
613 B
JavaScript
/** Created by knut on 15-01-14. */
|
|
import { log } from './mermaidUtils.js';
|
|
|
|
var message = '';
|
|
var info = false;
|
|
|
|
export const setMessage = (txt) => {
|
|
log.debug('Setting message to: ' + txt);
|
|
message = txt;
|
|
};
|
|
|
|
export const getMessage = () => {
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Sets the info flag
|
|
*
|
|
* @param {boolean} inf
|
|
*/
|
|
export const setInfo = (inf) => {
|
|
info = inf;
|
|
};
|
|
|
|
/** @returns Returns the info flag */
|
|
export const getInfo = () => {
|
|
return info;
|
|
};
|
|
|
|
export const clear = () => {
|
|
message = '';
|
|
info = false;
|
|
};
|
|
|
|
export default {
|
|
setMessage,
|
|
getMessage,
|
|
setInfo,
|
|
getInfo,
|
|
clear,
|
|
};
|