mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 10:49:38 +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 getDiagramStyles = (options?: any) => string;
|
||||
export type DiagramStylesProvider = (options?: any) => string;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import type { FlowChartStyleOptions } from './diagrams/flowchart/styles.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 = (
|
||||
type: string,
|
||||
@@ -74,9 +74,9 @@ const getStyles = (
|
||||
`;
|
||||
};
|
||||
|
||||
export const addStylesForDiagram = (type: string, getDiagramStyles?: getDiagramStyles): void => {
|
||||
if (getDiagramStyles !== undefined) {
|
||||
themes[type] = getDiagramStyles;
|
||||
export const addStylesForDiagram = (type: string, diagramTheme?: DiagramStylesProvider): void => {
|
||||
if (diagramTheme !== undefined) {
|
||||
themes[type] = diagramTheme;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user