summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/diagrams/common
diff options
context:
space:
mode:
authorChristoph Cullmann <christoph@cullmann.io>2024-07-15 22:27:55 +0200
committerChristoph Cullmann <christoph@cullmann.io>2024-07-15 22:27:55 +0200
commit3be5285488090ab70254b3080e33e64e6c702d2c (patch)
tree1e54462f560fd759b5be13d5ecfe1fa5c2c832ed /themes/blowfish/assets/lib/mermaid/diagrams/common
parent69075c6fb15ae660fc3d78eb2a4dfcde1c5fba1c (diff)
sync theme
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/diagrams/common')
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/common/common.d.ts110
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/common/common.spec.d.ts1
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/common/commonDb.d.ts7
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/common/commonTypes.d.ts51
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/common/svgDrawCommon.d.ts15
5 files changed, 0 insertions, 184 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/common/common.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/common/common.d.ts
deleted file mode 100644
index c43fcad..0000000
--- a/themes/blowfish/assets/lib/mermaid/diagrams/common/common.d.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import type { MermaidConfig } from '../../config.type.js';
-export declare const lineBreakRegex: RegExp;
-/**
- * Gets the rows of lines in a string
- *
- * @param s - The string to check the lines for
- * @returns The rows in that string
- */
-export declare const getRows: (s?: string) => string[];
-/**
- * Removes script tags from a text
- *
- * @param txt - The text to sanitize
- * @returns The safer text
- */
-export declare const removeScript: (txt: string) => string;
-export declare const sanitizeText: (text: string, config: MermaidConfig) => string;
-export declare const sanitizeTextOrArray: (a: string | string[] | string[][], config: MermaidConfig) => string | string[];
-/**
- * Whether or not a text has any line breaks
- *
- * @param text - The text to test
- * @returns Whether or not the text has breaks
- */
-export declare const hasBreaks: (text: string) => boolean;
-/**
- * Splits on <br> tags
- *
- * @param text - Text to split
- * @returns List of lines as strings
- */
-export declare const splitBreaks: (text: string) => string[];
-/**
- * Converts a string/boolean into a boolean
- *
- * @param val - String or boolean to convert
- * @returns The result from the input
- */
-export declare const evaluate: (val?: string | boolean) => boolean;
-/**
- * Wrapper around Math.max which removes non-numeric values
- * Returns the larger of a set of supplied numeric expressions.
- * @param values - Numeric expressions to be evaluated
- * @returns The smaller value
- */
-export declare const getMax: (...values: number[]) => number;
-/**
- * Wrapper around Math.min which removes non-numeric values
- * Returns the smaller of a set of supplied numeric expressions.
- * @param values - Numeric expressions to be evaluated
- * @returns The smaller value
- */
-export declare const getMin: (...values: number[]) => number;
-/**
- * Makes generics in typescript syntax
- *
- * @example
- * Array of array of strings in typescript syntax
- *
- * ```js
- * // returns "Array<Array<string>>"
- * parseGenericTypes('Array~Array~string~~');
- * ```
- * @param text - The text to convert
- * @returns The converted string
- */
-export declare const parseGenericTypes: (input: string) => string;
-export declare const countOccurrence: (string: string, substring: string) => number;
-export declare const isMathMLSupported: () => boolean;
-export declare const katexRegex: RegExp;
-/**
- * Whether or not a text has KaTeX delimiters
- *
- * @param text - The text to test
- * @returns Whether or not the text has KaTeX delimiters
- */
-export declare const hasKatex: (text: string) => boolean;
-/**
- * Computes the minimum dimensions needed to display a div containing MathML
- *
- * @param text - The text to test
- * @param config - Configuration for Mermaid
- * @returns Object containing \{width, height\}
- */
-export declare const calculateMathMLDimensions: (text: string, config: MermaidConfig) => Promise<{
- width: number;
- height: number;
-}>;
-/**
- * Attempts to render and return the KaTeX portion of a string with MathML
- *
- * @param text - The text to test
- * @param config - Configuration for Mermaid
- * @returns String containing MathML if KaTeX is supported, or an error message if it is not and stylesheets aren't present
- */
-export declare const renderKatex: (text: string, config: MermaidConfig) => Promise<string>;
-declare const _default: {
- getRows: (s?: string | undefined) => string[];
- sanitizeText: (text: string, config: MermaidConfig) => string;
- sanitizeTextOrArray: (a: string | string[] | string[][], config: MermaidConfig) => string | string[];
- hasBreaks: (text: string) => boolean;
- splitBreaks: (text: string) => string[];
- lineBreakRegex: RegExp;
- removeScript: (txt: string) => string;
- getUrl: (useAbsolute: boolean) => string;
- evaluate: (val?: string | boolean | undefined) => boolean;
- getMax: (...values: number[]) => number;
- getMin: (...values: number[]) => number;
-};
-export default _default;
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/common/common.spec.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/common/common.spec.d.ts
deleted file mode 100644
index cb0ff5c..0000000
--- a/themes/blowfish/assets/lib/mermaid/diagrams/common/common.spec.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/common/commonDb.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/common/commonDb.d.ts
deleted file mode 100644
index 143f5ee..0000000
--- a/themes/blowfish/assets/lib/mermaid/diagrams/common/commonDb.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare const clear: () => void;
-export declare const setAccTitle: (txt: string) => void;
-export declare const getAccTitle: () => string;
-export declare const setAccDescription: (txt: string) => void;
-export declare const getAccDescription: () => string;
-export declare const setDiagramTitle: (txt: string) => void;
-export declare const getDiagramTitle: () => string;
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/common/commonTypes.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/common/commonTypes.d.ts
deleted file mode 100644
index 671f19f..0000000
--- a/themes/blowfish/assets/lib/mermaid/diagrams/common/commonTypes.d.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-export interface RectData {
- x: number;
- y: number;
- fill: string;
- width: number;
- height: number;
- stroke: string;
- class?: string;
- color?: string;
- rx?: number;
- ry?: number;
- attrs?: Record<string, string | number>;
- anchor?: string;
- name?: string;
-}
-export interface Bound {
- startx: number;
- stopx: number;
- starty: number;
- stopy: number;
- fill: string;
- stroke: string;
-}
-export interface TextData {
- x: number;
- y: number;
- anchor: string;
- text: string;
- textMargin: number;
- class?: string;
-}
-export interface TextObject {
- x: number;
- y: number;
- width: number;
- height: number;
- fill?: string;
- anchor?: string;
- 'text-anchor': string;
- style: string;
- textMargin: number;
- rx: number;
- ry: number;
- tspan: boolean;
- valign?: string;
-}
-export type D3RectElement = d3.Selection<SVGRectElement, unknown, Element | null, unknown>;
-export type D3UseElement = d3.Selection<SVGUseElement, unknown, Element | null, unknown>;
-export type D3ImageElement = d3.Selection<SVGImageElement, unknown, Element | null, unknown>;
-export type D3TextElement = d3.Selection<SVGTextElement, unknown, Element | null, unknown>;
-export type D3TSpanElement = d3.Selection<SVGTSpanElement, unknown, Element | null, unknown>;
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/common/svgDrawCommon.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/common/svgDrawCommon.d.ts
deleted file mode 100644
index 3d864ab..0000000
--- a/themes/blowfish/assets/lib/mermaid/diagrams/common/svgDrawCommon.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import type { Group, SVG } from '../../diagram-api/types.js';
-import type { Bound, D3RectElement, D3TextElement, RectData, TextData, TextObject } from './commonTypes.js';
-export declare const drawRect: (element: SVG | Group, rectData: RectData) => D3RectElement;
-/**
- * Draws a background rectangle
- *
- * @param element - Diagram (reference for bounds)
- * @param bounds - Shape of the rectangle
- */
-export declare const drawBackgroundRect: (element: SVG | Group, bounds: Bound) => void;
-export declare const drawText: (element: SVG | Group, textData: TextData) => D3TextElement;
-export declare const drawImage: (elem: SVG | Group, x: number, y: number, link: string) => void;
-export declare const drawEmbeddedImage: (element: SVG | Group, x: number, y: number, link: string) => void;
-export declare const getNoteRect: () => RectData;
-export declare const getTextObj: () => TextObject;