state sync
This commit is contained in:
57
app/basepak/static/js/mermaid/diagrams/block/blockDB.d.ts
vendored
Normal file
57
app/basepak/static/js/mermaid/diagrams/block/blockDB.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { DiagramDB } from '../../diagram-api/types.js';
|
||||
import type { 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" | "stadium" | "subroutine" | "cylinder" | "diamond" | "hexagon" | "lean_right" | "lean_left" | "trapezoid" | "inv_trapezoid" | "doublecircle" | "rect_left_inv_arrow" | "square" | "round" | "na" | "block_arrow";
|
||||
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: () => Map<string, ClassDef>;
|
||||
declare const db: {
|
||||
readonly getConfig: () => import("./blockTypes.js").BlockConfig | undefined;
|
||||
readonly typeStr2Type: typeof typeStr2Type;
|
||||
readonly edgeTypeStr2Type: typeof edgeTypeStr2Type;
|
||||
readonly edgeStrToEdgeData: typeof edgeStrToEdgeData;
|
||||
readonly getLogger: () => Record<import("../../logger.js").LogLevel, {
|
||||
(...data: any[]): void;
|
||||
(message?: any, ...optionalParams: any[]): void;
|
||||
}>;
|
||||
readonly getBlocksFlat: () => Block[];
|
||||
readonly getBlocks: () => Block[];
|
||||
readonly getEdges: () => Block[];
|
||||
readonly setHierarchy: (block: Block[]) => void;
|
||||
readonly getBlock: (id: string) => Block | undefined;
|
||||
readonly setBlock: (block: Block) => void;
|
||||
readonly getColumns: (blockId: string) => number;
|
||||
readonly getClasses: () => Map<string, ClassDef>;
|
||||
readonly clear: () => void;
|
||||
readonly generateId: () => string;
|
||||
};
|
||||
export type BlockDB = typeof db & DiagramDB;
|
||||
export default db;
|
||||
3
app/basepak/static/js/mermaid/diagrams/block/blockDetector.d.ts
vendored
Normal file
3
app/basepak/static/js/mermaid/diagrams/block/blockDetector.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
|
||||
declare const plugin: ExternalDiagramDefinition;
|
||||
export default plugin;
|
||||
2
app/basepak/static/js/mermaid/diagrams/block/blockDiagram.d.ts
vendored
Normal file
2
app/basepak/static/js/mermaid/diagrams/block/blockDiagram.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { DiagramDefinition } from '../../diagram-api/types.js';
|
||||
export declare const diagram: DiagramDefinition;
|
||||
8
app/basepak/static/js/mermaid/diagrams/block/blockRenderer.d.ts
vendored
Normal file
8
app/basepak/static/js/mermaid/diagrams/block/blockRenderer.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Diagram } from '../../Diagram.js';
|
||||
export declare const getClasses: (text: any, diagObj: any) => any;
|
||||
export declare const draw: (text: string, id: string, _version: string, diagObj: Diagram) => Promise<void>;
|
||||
declare const _default: {
|
||||
draw: (text: string, id: string, _version: string, diagObj: Diagram) => Promise<void>;
|
||||
getClasses: (text: any, diagObj: any) => any;
|
||||
};
|
||||
export default _default;
|
||||
36
app/basepak/static/js/mermaid/diagrams/block/blockTypes.d.ts
vendored
Normal file
36
app/basepak/static/js/mermaid/diagrams/block/blockTypes.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
export type { BlockDiagramConfig as BlockConfig } from '../../config.type.js';
|
||||
export type BlockType = 'na' | 'column-setting' | 'edge' | 'round' | 'block_arrow' | 'space' | 'square' | 'diamond' | 'hexagon' | 'odd' | 'lean_right' | 'lean_left' | 'trapezoid' | 'inv_trapezoid' | 'rect_left_inv_arrow' | 'odd_right' | 'circle' | 'ellipse' | 'stadium' | 'subroutine' | 'cylinder' | 'group' | 'doublecircle' | 'classDef' | 'applyClass' | 'applyStyles' | 'composite';
|
||||
export interface Block {
|
||||
start?: string;
|
||||
end?: string;
|
||||
arrowTypeEnd?: string;
|
||||
arrowTypeStart?: string;
|
||||
width?: number;
|
||||
id: string;
|
||||
label?: string;
|
||||
intersect?: any;
|
||||
parent?: Block;
|
||||
type?: BlockType;
|
||||
children: Block[];
|
||||
size?: {
|
||||
width: number;
|
||||
height: number;
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
node?: any;
|
||||
columns?: number;
|
||||
classes?: string[];
|
||||
directions?: string[];
|
||||
css?: string;
|
||||
styleClass?: string;
|
||||
styles?: string[];
|
||||
stylesStr?: string;
|
||||
widthInColumns?: number;
|
||||
}
|
||||
export interface ClassDef {
|
||||
id: string;
|
||||
textStyles: string[];
|
||||
styles: string[];
|
||||
}
|
||||
export type Direction = 'up' | 'down' | 'left' | 'right' | 'x' | 'y';
|
||||
1
app/basepak/static/js/mermaid/diagrams/block/blockUtils.d.ts
vendored
Normal file
1
app/basepak/static/js/mermaid/diagrams/block/blockUtils.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const prepareTextForParsing: (text: string) => string;
|
||||
13
app/basepak/static/js/mermaid/diagrams/block/layout.d.ts
vendored
Normal file
13
app/basepak/static/js/mermaid/diagrams/block/layout.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { BlockDB } from './blockDB.js';
|
||||
interface BlockPosition {
|
||||
px: number;
|
||||
py: number;
|
||||
}
|
||||
export declare function calculateBlockPosition(columns: number, position: number): BlockPosition;
|
||||
export declare function layout(db: BlockDB): {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined;
|
||||
export {};
|
||||
1
app/basepak/static/js/mermaid/diagrams/block/layout.spec.d.ts
vendored
Normal file
1
app/basepak/static/js/mermaid/diagrams/block/layout.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
1
app/basepak/static/js/mermaid/diagrams/block/parser/block.spec.d.ts
vendored
Normal file
1
app/basepak/static/js/mermaid/diagrams/block/parser/block.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
10
app/basepak/static/js/mermaid/diagrams/block/renderHelpers.d.ts
vendored
Normal file
10
app/basepak/static/js/mermaid/diagrams/block/renderHelpers.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { BlockDB } from './blockDB.js';
|
||||
import type { Block } from './blockTypes.js';
|
||||
declare function calculateBlockSize(elem: d3.Selection<SVGGElement, unknown, HTMLElement, any>, block: any, db: any): Promise<void>;
|
||||
type ActionFun = typeof calculateBlockSize;
|
||||
export declare function insertBlockPositioned(elem: any, block: Block, db: any): Promise<void>;
|
||||
export declare function performOperations(elem: d3.Selection<SVGGElement, unknown, HTMLElement, any>, blocks: Block[], db: BlockDB, operation: ActionFun): Promise<void>;
|
||||
export declare function calculateBlockSizes(elem: any, blocks: Block[], db: BlockDB): Promise<void>;
|
||||
export declare function insertBlocks(elem: d3.Selection<SVGGElement, unknown, HTMLElement, any>, blocks: Block[], db: BlockDB): Promise<void>;
|
||||
export declare function insertEdges(elem: any, edges: Block[], blocks: Block[], db: BlockDB, id: string): Promise<void>;
|
||||
export {};
|
||||
18
app/basepak/static/js/mermaid/diagrams/block/styles.d.ts
vendored
Normal file
18
app/basepak/static/js/mermaid/diagrams/block/styles.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/** Returns the styles given options */
|
||||
export interface BlockChartStyleOptions {
|
||||
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;
|
||||
}
|
||||
declare const getStyles: (options: BlockChartStyleOptions) => string;
|
||||
export default getStyles;
|
||||
Reference in New Issue
Block a user