mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-07 08:09:39 +02:00
rename getDiagramStyles
type into DiagramStylesProvider
This commit is contained in:
@@ -83,4 +83,4 @@ export type HTML = d3.Selection<HTMLIFrameElement, unknown, Element, unknown>;
|
|||||||
|
|
||||||
export type SVG = d3.Selection<SVGSVGElement, unknown, Element, unknown>;
|
export type SVG = d3.Selection<SVGSVGElement, unknown, Element, unknown>;
|
||||||
|
|
||||||
export type getDiagramStyles = (options?: any) => string;
|
export type DiagramStylesProvider = (options?: any) => string;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import type { FlowChartStyleOptions } from './diagrams/flowchart/styles.js';
|
import type { FlowChartStyleOptions } from './diagrams/flowchart/styles.js';
|
||||||
import { log } from './logger.js';
|
import { log } from './logger.js';
|
||||||
import { getDiagramStyles } from './diagram-api/types.js';
|
import type { DiagramStylesProvider } from './diagram-api/types.js';
|
||||||
|
|
||||||
const themes: Record<string, getDiagramStyles> = {};
|
const themes: Record<string, DiagramStylesProvider> = {};
|
||||||
|
|
||||||
const getStyles = (
|
const getStyles = (
|
||||||
type: string,
|
type: string,
|
||||||
@@ -74,9 +74,9 @@ const getStyles = (
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addStylesForDiagram = (type: string, getDiagramStyles?: getDiagramStyles): void => {
|
export const addStylesForDiagram = (type: string, diagramTheme?: DiagramStylesProvider): void => {
|
||||||
if (getDiagramStyles !== undefined) {
|
if (diagramTheme !== undefined) {
|
||||||
themes[type] = getDiagramStyles;
|
themes[type] = diagramTheme;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user