From fab96881353ff22062aa8000d351759a1a2d50a5 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 21 Aug 2022 01:21:47 +0530 Subject: [PATCH] tsConversion: flowchartStyles --- .../flowchart/{styles.js => styles.ts} | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) rename src/diagrams/flowchart/{styles.js => styles.ts} (77%) diff --git a/src/diagrams/flowchart/styles.js b/src/diagrams/flowchart/styles.ts similarity index 77% rename from src/diagrams/flowchart/styles.js rename to src/diagrams/flowchart/styles.ts index abaecb0b4..82fb1f875 100644 --- a/src/diagrams/flowchart/styles.js +++ b/src/diagrams/flowchart/styles.ts @@ -1,25 +1,21 @@ -/** - * Returns the styles given options - * - * @param {{ - * fontFamily: string; - * nodeTextColor: string; - * textColor: string; - * titleColor: string; - * mainBkg: string; - * nodeBorder: string; - * arrowheadColor: string; - * lineColor: string; - * edgeLabelBackground: string; - * clusterBkg: string; - * clusterBorder: string; - * tertiaryColor: string; - * border2: string; - * }} options - * The options for the styles - * @returns {string} The resulting styles - */ -const getStyles = (options) => +/** Returns the styles given options */ +export interface FlowChartStyleOptions { + arrowheadColor: string; + border2: string; + clusterBkg: string; + clusterBorder: string; + edgeLabelBackground: string; + fontFamily: string; + lineColor: string; + mainBkg: string; + nodeBorder: string; + nodeTextColor: string; + tertiaryColor: string; + textColor: string; + titleColor: string; +} + +const getStyles = (options: FlowChartStyleOptions) => `.label { font-family: ${options.fontFamily}; color: ${options.nodeTextColor || options.textColor};