diff --git a/packages/mermaid/src/diagram-api/frontmatter.ts b/packages/mermaid/src/diagram-api/frontmatter.ts index 8c0e998f6..f8d2e9c41 100644 --- a/packages/mermaid/src/diagram-api/frontmatter.ts +++ b/packages/mermaid/src/diagram-api/frontmatter.ts @@ -1,4 +1,4 @@ -import { DiagramDb } from './types.js'; +import { DiagramDB } from './types.js'; // The "* as yaml" part is necessary for tree-shaking import * as yaml from 'js-yaml'; @@ -22,7 +22,7 @@ type FrontMatterMetadata = { * @param db - Diagram database, could be of any diagram. * @returns text with frontmatter stripped out */ -export function extractFrontMatter(text: string, db: DiagramDb): string { +export function extractFrontMatter(text: string, db: DiagramDB): string { const matches = text.match(frontMatterRegex); if (matches) { const parsed: FrontMatterMetadata = yaml.load(matches[1], { diff --git a/packages/mermaid/src/diagram-api/types.ts b/packages/mermaid/src/diagram-api/types.ts index 1687e1791..26cf33fbe 100644 --- a/packages/mermaid/src/diagram-api/types.ts +++ b/packages/mermaid/src/diagram-api/types.ts @@ -14,7 +14,7 @@ export interface InjectUtils { /** * Generic Diagram DB that may apply to any diagram type. */ -export interface DiagramDb { +export interface DiagramDB { clear?: () => void; setDiagramTitle?: (title: string) => void; setDisplayMode?: (title: string) => void; @@ -24,7 +24,7 @@ export interface DiagramDb { } export interface DiagramDefinition { - db: DiagramDb; + db: DiagramDB; renderer: any; parser: any; styles?: any; diff --git a/packages/mermaid/src/diagrams/info/infoDb.ts b/packages/mermaid/src/diagrams/info/infoDb.ts index a757ad9c4..71a1203e2 100644 --- a/packages/mermaid/src/diagrams/info/infoDb.ts +++ b/packages/mermaid/src/diagrams/info/infoDb.ts @@ -1,6 +1,6 @@ /** Created by knut on 15-01-14. */ import { clear } from '../../commonDb.js'; -import type { InfoDb } from './infoTypes.js'; +import type { InfoDB } from './infoTypes.js'; let info = false; @@ -10,7 +10,7 @@ export const setInfo = (inf: boolean): void => { export const getInfo = (): boolean => info; -const db: InfoDb = { +const db: InfoDB = { clear, setInfo, getInfo, diff --git a/packages/mermaid/src/diagrams/info/infoTypes.ts b/packages/mermaid/src/diagrams/info/infoTypes.ts index 7d240e3d4..9878642b1 100644 --- a/packages/mermaid/src/diagrams/info/infoTypes.ts +++ b/packages/mermaid/src/diagrams/info/infoTypes.ts @@ -1,9 +1,6 @@ -import type { DiagramDb } from '../../diagram-api/types.js'; +import type { DiagramDB } from '../../diagram-api/types.js'; -/** - * Info diagram DB. - */ -export interface InfoDb extends DiagramDb { +export interface InfoDB extends DiagramDB { clear: () => void; setInfo: (info: boolean) => void; getInfo: () => boolean;