rename getDiagramStyles type into DiagramStylesProvider

This commit is contained in:
Yokozuna59
2023-06-26 20:34:21 +03:00
parent 8b67200717
commit 64a28be5e3
2 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;
}
};