mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 01:09:42 +02:00
chore: Fix config type
This commit is contained in:
@@ -2,8 +2,12 @@ import assignWithDepth from './assignWithDepth.js';
|
||||
import { log } from './logger.js';
|
||||
import theme from './themes/index.js';
|
||||
import config from './defaultConfig.js';
|
||||
import type { MermaidConfig, MermaidConfigWithDefaults } from './config.type.js';
|
||||
import type { MermaidConfig } from './config.type.js';
|
||||
import { sanitizeDirective } from './utils/sanitizeDirective.js';
|
||||
import type { RequiredDeep } from 'type-fest';
|
||||
|
||||
// I'd prefer this to be named MermaidConfig, so all the functions can use the shorter name.
|
||||
export type MermaidConfigWithDefaults = RequiredDeep<MermaidConfig>;
|
||||
|
||||
export const defaultConfig: MermaidConfig = Object.freeze(config);
|
||||
|
||||
|
@@ -5,8 +5,6 @@
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
import { RequiredDeep } from 'type-fest';
|
||||
|
||||
/**
|
||||
* Configuration options to pass to the `dompurify` library.
|
||||
*/
|
||||
@@ -167,9 +165,6 @@ export interface MermaidConfig {
|
||||
wrap?: boolean;
|
||||
fontSize?: number;
|
||||
}
|
||||
|
||||
// I'd prefer this to be named MermaidConfig, so all the functions can use the shorter name.
|
||||
export type MermaidConfigWithDefaults = RequiredDeep<MermaidConfig>;
|
||||
/**
|
||||
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
||||
* via the `definition` "BaseDiagramConfig".
|
||||
|
@@ -7,10 +7,11 @@ import cytoscape from 'cytoscape';
|
||||
// @ts-expect-error No types available
|
||||
import coseBilkent from 'cytoscape-cose-bilkent';
|
||||
import * as db from './mindmapDb.js';
|
||||
import type { MermaidConfig, MermaidConfigWithDefaults } from '../../config.type.js';
|
||||
import type { MermaidConfig } from '../../config.type.js';
|
||||
import type { Diagram } from '../../Diagram.js';
|
||||
import type { MindmapDB } from './mindmapTypes.js';
|
||||
import type { D3Element } from '../../mermaidAPI.js';
|
||||
import type { MermaidConfigWithDefaults } from '../../config.js';
|
||||
|
||||
// Inject the layout algorithm into cytoscape
|
||||
cytoscape.use(coseBilkent);
|
||||
|
Reference in New Issue
Block a user