summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
committerChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
commite77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch)
treef0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts
parent4b355837824ac2422d371acef790f0f4249255c7 (diff)
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts')
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts54
1 files changed, 54 insertions, 0 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts
new file mode 100644
index 0000000..2db398e
--- /dev/null
+++ b/themes/blowfish/assets/lib/mermaid/diagrams/block/blockDB.d.ts
@@ -0,0 +1,54 @@
+import type { DiagramDB } from '../../diagram-api/types.js';
+import type { BlockConfig, Block, ClassDef } from './blockTypes.js';
+/**
+ * Called when the parser comes across a (style) class definition
+ * @example classDef my-style fill:#f96;
+ *
+ * @param id - the id of this (style) class
+ * @param styleAttributes - the string with 1 or more style attributes (each separated by a comma)
+ */
+export declare const addStyleClass: (id: string, styleAttributes?: string) => void;
+/**
+ * Called when the parser comes across a style definition
+ * @example style my-block-id fill:#f96;
+ *
+ * @param id - the id of the block to style
+ * @param styles - the string with 1 or more style attributes (each separated by a comma)
+ */
+export declare const addStyle2Node: (id: string, styles?: string) => void;
+/**
+ * Add a CSS/style class to the block with the given id.
+ * If the block isn't already in the list of known blocks, add it.
+ * Might be called by parser when a CSS/style class should be applied to a block
+ *
+ * @param itemIds - The id or a list of ids of the item(s) to apply the css class to
+ * @param cssClassName - CSS class name
+ */
+export declare const setCssClass: (itemIds: string, cssClassName: string) => void;
+export declare function typeStr2Type(typeStr: string): "circle" | "round" | "square" | "diamond" | "hexagon" | "rect_left_inv_arrow" | "lean_right" | "lean_left" | "trapezoid" | "inv_trapezoid" | "stadium" | "subroutine" | "cylinder" | "na" | "block_arrow" | "doublecircle";
+export declare function edgeTypeStr2Type(typeStr: string): string;
+export declare function edgeStrToEdgeData(typeStr: string): string;
+export declare const generateId: () => string;
+/**
+ * Return all of the style classes
+ */
+export declare const getClasses: () => Record<string, ClassDef>;
+declare const db: {
+ readonly getConfig: () => BlockConfig | undefined;
+ readonly typeStr2Type: typeof typeStr2Type;
+ readonly edgeTypeStr2Type: typeof edgeTypeStr2Type;
+ readonly edgeStrToEdgeData: typeof edgeStrToEdgeData;
+ readonly getLogger: () => Console;
+ readonly getBlocksFlat: () => Block[];
+ readonly getBlocks: () => Block[];
+ readonly getEdges: () => Block[];
+ readonly setHierarchy: (block: Block[]) => void;
+ readonly getBlock: (id: string) => Block;
+ readonly setBlock: (block: Block) => void;
+ readonly getColumns: (blockId: string) => number;
+ readonly getClasses: () => Record<string, ClassDef>;
+ readonly clear: () => void;
+ readonly generateId: () => string;
+};
+export type BlockDB = typeof db & DiagramDB;
+export default db;