Skip to content

Commit

Permalink
rename getDiagramStyles type into DiagramStylesProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Yokozuna59 committed Jun 26, 2023
1 parent 8b67200 commit 64a28be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagram-api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
10 changes: 5 additions & 5 deletions packages/mermaid/src/styles.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
}
};

Expand Down

0 comments on commit 64a28be

Please sign in to comment.