完成世界书、骰子、apiconfig页面处理

This commit is contained in:
2026-04-30 01:35:10 +08:00
parent a3e3711b2b
commit ba9b925c32
4602 changed files with 785225 additions and 23 deletions

View File

@@ -0,0 +1,45 @@
import type { ArchitectureDiagramConfig } from '../../config.type.js';
import type { DiagramDB } from '../../diagram-api/types.js';
import type { D3Element } from '../../types.js';
import type { ArchitectureEdge, ArchitectureGroup, ArchitectureJunction, ArchitectureNode, ArchitectureService } from './architectureTypes.js';
export declare class ArchitectureDB implements DiagramDB {
private nodes;
private groups;
private edges;
private registeredIds;
private dataStructures?;
private elements;
constructor();
clear(): void;
addService({ id, icon, in: parent, title, iconText, }: Omit<ArchitectureService, 'edges'>): void;
getServices(): ArchitectureService[];
addJunction({ id, in: parent }: Omit<ArchitectureJunction, 'edges'>): void;
getJunctions(): ArchitectureJunction[];
getNodes(): ArchitectureNode[];
getNode(id: string): ArchitectureNode | null;
addGroup({ id, icon, in: parent, title }: ArchitectureGroup): void;
getGroups(): ArchitectureGroup[];
addEdge({ lhsId, rhsId, lhsDir, rhsDir, lhsInto, rhsInto, lhsGroup, rhsGroup, title, }: ArchitectureEdge): void;
getEdges(): ArchitectureEdge[];
/**
* Returns the current diagram's adjacency list, spatial map, & group alignments.
* If they have not been created, run the algorithms to generate them.
* @returns
*/
getDataStructures(): import("./architectureTypes.js").ArchitectureDataStructures;
setElementForId(id: string, element: D3Element): void;
getElementById(id: string): D3Element;
getConfig(): Required<ArchitectureDiagramConfig>;
getConfigField<T extends keyof ArchitectureDiagramConfig>(field: T): Required<ArchitectureDiagramConfig>[T];
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getAccDescription: () => string;
setAccDescription: (txt: string) => void;
}
/**
* Typed wrapper for resolving an architecture diagram's config fields. Returns the default value if undefined
* @param field - the config field to access
* @returns
*/

View File

@@ -0,0 +1,5 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
export declare const draw: DrawDefinition;
export declare const renderer: {
draw: DrawDefinition;
};

View 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 {};

View File

@@ -0,0 +1,36 @@
export function drawRect(elem: any, rectData: any): import("../common/commonTypes.js").D3RectElement;
export function drawImage(elem: any, width: any, height: any, x: any, y: any, link: any): void;
export function drawRels(elem: any, rels: any, conf: any): void;
export function drawC4Shape(elem: any, c4Shape: any, conf: any): any;
export function insertDatabaseIcon(elem: any): void;
export function insertComputerIcon(elem: any): void;
export function insertClockIcon(elem: any): void;
export function insertArrowHead(elem: any): void;
export function insertArrowEnd(elem: any): void;
export function insertArrowFilledHead(elem: any): void;
export function insertDynamicNumber(elem: any): void;
export function insertArrowCrossHead(elem: any): void;
declare namespace _default {
export { drawRect };
export { drawBoundary };
export { drawC4Shape };
export { drawRels };
export { drawImage };
export { insertArrowHead };
export { insertArrowEnd };
export { insertArrowFilledHead };
export { insertDynamicNumber };
export { insertArrowCrossHead };
export { insertDatabaseIcon };
export { insertComputerIcon };
export { insertClockIcon };
}
export default _default;
/**
* Draws a boundary in the diagram
*
* @param {any} elem - The diagram we'll draw to.
* @param {any} boundary - The boundary to draw.
* @param {any} conf - DrawText implementation discriminator object
*/
declare function drawBoundary(elem: any, boundary: any, conf: any): void;

View File

@@ -0,0 +1,150 @@
import type { ClassRelation, ClassNode, ClassNote, ClassNoteMap, ClassMap, NamespaceMap, NamespaceNode } from './classTypes.js';
import type { Node, Edge } from '../../rendering-util/types.js';
import type { DiagramDB } from '../../diagram-api/types.js';
export declare class ClassDB implements DiagramDB {
private relations;
private classes;
private readonly styleClasses;
private notes;
private interfaces;
private namespaces;
private namespaceCounter;
private functions;
constructor();
private splitClassNameAndType;
setClassLabel(_id: string, label: string): void;
/**
* Function called by parser when a node definition has been found.
*
* @param id - ID of the class to add
* @public
*/
addClass(_id: string): void;
private addInterface;
/**
* Function to lookup domId from id in the graph definition.
*
* @param id - class ID to lookup
* @public
*/
lookUpDomId(_id: string): string;
clear(): void;
getClass(id: string): ClassNode;
getClasses(): ClassMap;
getRelations(): ClassRelation[];
getNote(id: string | number): ClassNote;
getNotes(): ClassNoteMap;
addRelation(classRelation: ClassRelation): void;
/**
* Adds an annotation to the specified class Annotations mark special properties of the given type
* (like 'interface' or 'service')
*
* @param className - The class name
* @param annotation - The name of the annotation without any brackets
* @public
*/
addAnnotation(className: string, annotation: string): void;
/**
* Adds a member to the specified class
*
* @param className - The class name
* @param member - The full name of the member. If the member is enclosed in `<<brackets>>` it is
* treated as an annotation If the member is ending with a closing bracket ) it is treated as a
* method Otherwise the member will be treated as a normal property
* @public
*/
addMember(className: string, member: string): void;
addMembers(className: string, members: string[]): void;
addNote(text: string, className: string): string;
cleanupLabel(label: string): string;
/**
* Called by parser when assigning cssClass to a class
*
* @param ids - Comma separated list of ids
* @param className - Class to add
*/
setCssClass(ids: string, className: string): void;
defineClass(ids: string[], style: string[]): void;
/**
* Called by parser when a tooltip is found, e.g. a clickable element.
*
* @param ids - Comma separated list of ids
* @param tooltip - Tooltip to add
*/
setTooltip(ids: string, tooltip?: string): void;
getTooltip(id: string, namespace?: string): string | undefined;
/**
* Called by parser when a link is found. Adds the URL to the vertex data.
*
* @param ids - Comma separated list of ids
* @param linkStr - URL to create a link for
* @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file
*/
setLink(ids: string, linkStr: string, target: string): void;
/**
* Called by parser when a click definition is found. Registers an event handler.
*
* @param ids - Comma separated list of ids
* @param functionName - Function to be called on click
* @param functionArgs - Function args the function should be called with
*/
setClickEvent(ids: string, functionName: string, functionArgs: string): void;
private setClickFunc;
bindFunctions(element: Element): void;
readonly lineType: {
LINE: number;
DOTTED_LINE: number;
};
readonly relationType: {
AGGREGATION: number;
EXTENSION: number;
COMPOSITION: number;
DEPENDENCY: number;
LOLLIPOP: number;
};
private escapeHtml;
private readonly setupToolTips;
private direction;
getDirection(): string;
setDirection(dir: string): void;
/**
* Function called by parser when a namespace definition has been found.
*
* @param id - ID of the namespace to add
* @public
*/
addNamespace(id: string): void;
getNamespace(name: string): NamespaceNode;
getNamespaces(): NamespaceMap;
/**
* Function called by parser when a namespace definition has been found.
*
* @param id - ID of the namespace to add
* @param classNames - IDs of the class to add
* @param noteNames - IDs of the notes to add
* @public
*/
addClassesToNamespace(id: string, classNames: string[], noteNames: string[]): void;
setCssStyle(id: string, styles: string[]): void;
/**
* Gets the arrow marker for a type index
*
* @param type - The type to look for
* @returns The arrow marker
*/
private getArrowMarker;
getData(): {
nodes: Node[];
edges: Edge[];
other: {};
config: import("../../config.type.js").MermaidConfig;
direction: string;
};
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setAccDescription: (txt: string) => void;
getAccDescription: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getConfig: () => import("../../config.type.js").ClassDiagramConfig | undefined;
}

View File

@@ -0,0 +1,57 @@
import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
import type { ClassRelation, ClassMap, ClassNoteMap, NamespaceMap } from './classTypes.js';
/**
* Function that adds the vertices found during parsing to the graph to be rendered.
*
* @param namespaces - Object containing the vertices.
* @param g - The graph that is to be drawn.
* @param _id - id of the graph
* @param diagObj - The diagram object
*/
export declare const addNamespaces: (namespaces: NamespaceMap, g: graphlib.Graph, _id: string, diagObj: any) => void;
/**
* Function that adds the vertices found during parsing to the graph to be rendered.
*
* @param classes - Object containing the vertices.
* @param g - The graph that is to be drawn.
* @param _id - id of the graph
* @param diagObj - The diagram object
* @param parent - id of the parent namespace, if it exists
*/
export declare const addClasses: (classes: ClassMap, g: graphlib.Graph, _id: string, diagObj: any, parent?: string) => void;
/**
* Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.
*
* @param notes - Object containing the additional vertices (notes).
* @param g - The graph that is to be drawn.
* @param startEdgeId - starting index for note edge
* @param classes - Classes
*/
export declare const addNotes: (notes: ClassNoteMap, g: graphlib.Graph, startEdgeId: number, classes: ClassMap, parent?: string) => void;
/**
* Add edges to graph based on parsed graph definition
*
* @param relations -
* @param g - The graph object
*/
export declare const addRelations: (relations: ClassRelation[], g: graphlib.Graph) => void;
/**
* Merges the value of `conf` with the passed `cnf`
*
* @param cnf - Config to merge
*/
export declare const setConf: (cnf: any) => void;
/**
* Draws a class diagram in the tag with id: id based on the definition in text.
*
* @param text -
* @param id -
* @param _version -
* @param diagObj -
*/
export declare const draw: (text: string, id: string, _version: string, diagObj: any) => Promise<void>;
declare const _default: {
setConf: (cnf: any) => void;
draw: (text: string, id: string, _version: string, diagObj: any) => Promise<void>;
};
export default _default;

View File

@@ -0,0 +1,51 @@
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>;

View File

@@ -0,0 +1,16 @@
import type { SVG, SVGGroup } from '../../diagram-api/types.js';
import type { Bound, D3RectElement, D3TextElement, RectData, TextData, TextObject } from './commonTypes.js';
export declare const drawRect: (element: SVG | SVGGroup, 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 | SVGGroup, bounds: Bound) => void;
export declare const drawText: (element: SVG | SVGGroup, textData: TextData) => D3TextElement;
export declare const drawImage: (elem: SVG | SVGGroup, x: number, y: number, link: string) => void;
export declare const drawEmbeddedImage: (element: SVG | SVGGroup, x: number, y: number, link: string) => void;
export declare const getNoteRect: () => RectData;
export declare const getTextObj: () => TextObject;
export declare const createTooltip: () => import("d3-selection").Selection<HTMLDivElement, unknown, HTMLElement, any>;

View File

@@ -0,0 +1,53 @@
import type { Edge, Node } from '../../rendering-util/types.js';
import type { EntityNode, Attribute, Relationship, EntityClass, RelSpec } from './erTypes.js';
import type { DiagramDB } from '../../diagram-api/types.js';
export declare class ErDB implements DiagramDB {
private entities;
private relationships;
private classes;
private direction;
private Cardinality;
private Identification;
constructor();
/**
* Add entity
* @param name - The name of the entity
* @param alias - The alias of the entity
*/
addEntity(name: string, alias?: string): EntityNode;
getEntity(name: string): EntityNode | undefined;
getEntities(): Map<string, EntityNode>;
getClasses(): Map<string, EntityClass>;
addAttributes(entityName: string, attribs: Attribute[]): void;
/**
* Add a relationship
*
* @param entA - The first entity in the relationship
* @param rolA - The role played by the first entity in relation to the second
* @param entB - The second entity in the relationship
* @param rSpec - The details of the relationship between the two entities
*/
addRelationship(entA: string, rolA: string, entB: string, rSpec: RelSpec): void;
getRelationships(): Relationship[];
getDirection(): string;
setDirection(dir: string): void;
private getCompiledStyles;
addCssStyles(ids: string[], styles: string[]): void;
addClass(ids: string[], style: string[]): void;
setClass(ids: string[], classNames: string[]): void;
clear(): void;
getData(): {
nodes: Node[];
edges: Edge[];
other: {};
config: import("../../config.type.js").MermaidConfig;
direction: string;
};
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setAccDescription: (txt: string) => void;
getAccDescription: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getConfig: () => import("../../config.type.js").ErDiagramConfig | undefined;
}

View File

@@ -0,0 +1,8 @@
import { ErDB } from './erDb.js';
import * as renderer from './erRenderer-unified.js';
export declare const diagram: {
parser: any;
readonly db: ErDB;
renderer: typeof renderer;
styles: (options: import("../flowchart/styles.js").FlowChartStyleOptions) => string;
};

View File

@@ -0,0 +1,24 @@
declare namespace _default {
export { ERMarkers };
export { insertMarkers };
}
export default _default;
declare namespace ERMarkers {
let ONLY_ONE_START: string;
let ONLY_ONE_END: string;
let ZERO_OR_ONE_START: string;
let ZERO_OR_ONE_END: string;
let ONE_OR_MORE_START: string;
let ONE_OR_MORE_END: string;
let ZERO_OR_MORE_START: string;
let ZERO_OR_MORE_END: string;
let MD_PARENT_END: string;
let MD_PARENT_START: string;
}
/**
* Put the markers into the svg DOM for later use with edge paths
*
* @param elem
* @param conf
*/
declare function insertMarkers(elem: any, conf: any): void;

View File

@@ -0,0 +1 @@
export declare const draw: (text: string, id: string, _version: string, diag: any) => Promise<void>;

View File

@@ -0,0 +1,12 @@
/**
* Draws an info picture in the tag with id: id based on the graph definition in text.
*
* @param _text - Mermaid graph definition.
* @param id - The text for the error
* @param version - The version
*/
export declare const draw: (_text: string, id: string, version: string) => void;
export declare const renderer: {
draw: (_text: string, id: string, version: string) => void;
};
export default renderer;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,2 @@
declare const newParser: any;
export default newParser;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,2 @@
export default getStyles;
declare function getStyles(options: any): string;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,21 @@
import type { DiagramOrientation, Commit, GitGraphDB, CommitDB, MergeDB, BranchDB, CherryPickDB } from './gitGraphTypes.js';
export declare const setDirection: (dir: DiagramOrientation) => void;
export declare const setOptions: (rawOptString: string) => void;
export declare const getOptions: () => any;
export declare const commit: (commitDB: CommitDB) => void;
export declare const branch: (branchDB: BranchDB) => void;
export declare const merge: (mergeDB: MergeDB) => void;
export declare const cherryPick: (cherryPickDB: CherryPickDB) => void;
export declare const checkout: (branch: string) => void;
export declare const prettyPrint: () => void;
export declare const clear: () => void;
export declare const getBranchesAsObjArray: () => {
name: string;
}[];
export declare const getBranches: () => Map<string, string | null>;
export declare const getCommits: () => Map<string, Commit>;
export declare const getCommitsArray: () => Commit[];
export declare const getCurrentBranch: () => string;
export declare const getDirection: () => DiagramOrientation;
export declare const getHead: () => Commit | null;
export declare const db: GitGraphDB;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,6 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
export declare const draw: DrawDefinition;
declare const _default: {
draw: DrawDefinition;
};
export default _default;

View File

@@ -0,0 +1,121 @@
import type { GitGraphDiagramConfig } from '../../config.type.js';
import type { DiagramDBBase } from '../../diagram-api/types.js';
export declare const commitType: {
readonly NORMAL: 0;
readonly REVERSE: 1;
readonly HIGHLIGHT: 2;
readonly MERGE: 3;
readonly CHERRY_PICK: 4;
};
export interface CommitDB {
msg: string;
id: string;
type: number;
tags?: string[];
}
export interface BranchDB {
name: string;
order: number;
}
export interface MergeDB {
branch: string;
id: string;
type?: number;
tags?: string[];
}
export interface CherryPickDB {
id: string;
targetId: string;
parent: string;
tags?: string[];
}
export interface Commit {
id: string;
message: string;
seq: number;
type: number;
tags: string[];
parents: string[];
branch: string;
customType?: number;
customId?: boolean;
}
export interface GitGraph {
statements: Statement[];
}
export type Statement = CommitAst | BranchAst | MergeAst | CheckoutAst | CherryPickingAst;
export interface CommitAst {
$type: 'Commit';
id: string;
message?: string;
tags?: string[];
type?: 'NORMAL' | 'REVERSE' | 'HIGHLIGHT';
}
export interface BranchAst {
$type: 'Branch';
name: string;
order?: number;
}
export interface MergeAst {
$type: 'Merge';
branch: string;
id?: string;
tags?: string[];
type?: 'NORMAL' | 'REVERSE' | 'HIGHLIGHT';
}
export interface CheckoutAst {
$type: 'Checkout';
branch: string;
}
export interface CherryPickingAst {
$type: 'CherryPicking';
id: string;
parent: string;
tags?: string[];
}
export interface GitGraphDB extends DiagramDBBase<GitGraphDiagramConfig> {
commitType: typeof commitType;
setDirection: (dir: DiagramOrientation) => void;
setOptions: (rawOptString: string) => void;
getOptions: () => any;
commit: (commitDB: CommitDB) => void;
branch: (branchDB: BranchDB) => void;
merge: (mergeDB: MergeDB) => void;
cherryPick: (cherryPickDB: CherryPickDB) => void;
checkout: (branch: string) => void;
prettyPrint: () => void;
clear: () => void;
getBranchesAsObjArray: () => {
name: string;
}[];
getBranches: () => Map<string, string | null>;
getCommits: () => Map<string, Commit>;
getCommitsArray: () => Commit[];
getCurrentBranch: () => string;
getDirection: () => DiagramOrientation;
getHead: () => Commit | null;
}
export interface GitGraphDBParseProvider extends Partial<GitGraphDB> {
commitType: typeof commitType;
setDirection: (dir: DiagramOrientation) => void;
commit: (commitDB: CommitDB) => void;
branch: (branchDB: BranchDB) => void;
merge: (mergeDB: MergeDB) => void;
cherryPick: (cherryPickDB: CherryPickDB) => void;
checkout: (branch: string) => void;
}
export interface GitGraphDBRenderProvider extends Partial<GitGraphDB> {
prettyPrint: () => void;
clear: () => void;
getBranchesAsObjArray: () => {
name: string;
}[];
getBranches: () => Map<string, string | null>;
getCommits: () => Map<string, Commit>;
getCommitsArray: () => Commit[];
getCurrentBranch: () => string;
getDirection: () => DiagramOrientation;
getHead: () => Commit | null;
getDiagramTitle: () => string;
}
export type DiagramOrientation = 'LR' | 'TB' | 'BT';

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,4 @@
import type { InfoFields, InfoDB } from './infoTypes.js';
export declare const DEFAULT_INFO_DB: InfoFields;
export declare const getVersion: () => string;
export declare const db: InfoDB;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1,17 @@
import type { DiagramDB } from '../../diagram-api/types.js';
import type { IshikawaNode } from './ishikawaTypes.js';
export declare class IshikawaDB implements DiagramDB {
private root?;
private stack;
private baseLevel?;
constructor();
clear(): void;
getRoot(): IshikawaNode | undefined;
addNode(rawLevel: number, text: string): void;
getAccTitle(): string;
setAccTitle(title: string): void;
getAccDescription(): string;
setAccDescription(description: string): void;
getDiagramTitle(): string;
setDiagramTitle(title: string): void;
}

View File

@@ -0,0 +1,2 @@
import type { DiagramRenderer } from '../../diagram-api/types.js';
export declare const renderer: DiagramRenderer;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,6 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
export declare const draw: DrawDefinition;
declare const _default: {
draw: DrawDefinition;
};
export default _default;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,6 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
export declare const draw: DrawDefinition;
declare const _default: {
draw: DrawDefinition;
};
export default _default;

View File

@@ -0,0 +1,3 @@
import type { DiagramStylesProvider } from '../../diagram-api/types.js';
declare const getStyles: DiagramStylesProvider;
export default getStyles;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,25 @@
import type { Packet, RecursiveAstOmit } from '@mermaid-js/parser';
import type { PacketDiagramConfig } from '../../config.type.js';
import type { DiagramDBBase } from '../../diagram-api/types.js';
import type { ArrayElement } from '../../types.js';
export type PacketBlock = RecursiveAstOmit<ArrayElement<Packet['blocks']>>;
export type PacketWord = Required<PacketBlock>[];
export interface PacketDB extends DiagramDBBase<PacketDiagramConfig> {
pushWord: (word: PacketWord) => void;
getPacket: () => PacketWord[];
}
export interface PacketStyleOptions {
byteFontSize?: string;
startByteColor?: string;
endByteColor?: string;
labelColor?: string;
labelFontSize?: string;
blockStrokeColor?: string;
blockStrokeWidth?: string;
blockFillColor?: string;
titleColor?: string;
titleFontSize?: string;
}
export interface PacketData {
packet: PacketWord[];
}

View File

@@ -0,0 +1,13 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
/**
* Draws a Pie Chart with the data given in text.
*
* @param text - pie chart code
* @param id - diagram id
* @param _version - MermaidJS version from package.json.
* @param diagObj - A standard diagram containing the DB and the text and type etc of the diagram.
*/
export declare const draw: DrawDefinition;
export declare const renderer: {
draw: DrawDefinition;
};

View File

@@ -0,0 +1,43 @@
import type { StylesObject } from './quadrantBuilder.js';
interface LexTextObj {
text: string;
type: 'text' | 'markdown';
}
declare function setQuadrant1Text(textObj: LexTextObj): void;
declare function setQuadrant2Text(textObj: LexTextObj): void;
declare function setQuadrant3Text(textObj: LexTextObj): void;
declare function setQuadrant4Text(textObj: LexTextObj): void;
declare function setXAxisLeftText(textObj: LexTextObj): void;
declare function setXAxisRightText(textObj: LexTextObj): void;
declare function setYAxisTopText(textObj: LexTextObj): void;
declare function setYAxisBottomText(textObj: LexTextObj): void;
declare function parseStyles(styles: string[]): StylesObject;
declare function addPoint(textObj: LexTextObj, className: string, x: number, y: number, styles: string[]): void;
declare function addClass(className: string, styles: string[]): void;
declare function setWidth(width: number): void;
declare function setHeight(height: number): void;
declare function getQuadrantData(): import("./quadrantBuilder.js").QuadrantBuildType;
declare const _default: {
setWidth: typeof setWidth;
setHeight: typeof setHeight;
setQuadrant1Text: typeof setQuadrant1Text;
setQuadrant2Text: typeof setQuadrant2Text;
setQuadrant3Text: typeof setQuadrant3Text;
setQuadrant4Text: typeof setQuadrant4Text;
setXAxisLeftText: typeof setXAxisLeftText;
setXAxisRightText: typeof setXAxisRightText;
setYAxisTopText: typeof setYAxisTopText;
setYAxisBottomText: typeof setYAxisBottomText;
parseStyles: typeof parseStyles;
addPoint: typeof addPoint;
addClass: typeof addClass;
getQuadrantData: typeof getQuadrantData;
clear: () => void;
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getAccDescription: () => string;
setAccDescription: (txt: string) => void;
};
export default _default;

View File

@@ -0,0 +1,2 @@
import type { RadarDB } from './types.js';
export declare const db: RadarDB;

View File

@@ -0,0 +1,54 @@
import type { DiagramDB } from '../../diagram-api/types.js';
import type { Node, Edge } from '../../rendering-util/types.js';
import type { Element, Relation, RelationshipType, Requirement, RequirementClass, RequirementType, RiskLevel, VerifyType } from './types.js';
export declare class RequirementDB implements DiagramDB {
private relations;
private latestRequirement;
private requirements;
private latestElement;
private elements;
private classes;
private direction;
private RequirementType;
private RiskLevel;
private VerifyType;
private Relationships;
constructor();
getDirection(): string;
setDirection(dir: string): void;
private resetLatestRequirement;
private resetLatestElement;
private getInitialRequirement;
private getInitialElement;
addRequirement(name: string, type: RequirementType): Requirement | undefined;
getRequirements(): Map<string, Requirement>;
setNewReqId(id: string): void;
setNewReqText(text: string): void;
setNewReqRisk(risk: RiskLevel): void;
setNewReqVerifyMethod(verifyMethod: VerifyType): void;
addElement(name: string): Element | undefined;
getElements(): Map<string, Element>;
setNewElementType(type: string): void;
setNewElementDocRef(docRef: string): void;
addRelationship(type: RelationshipType, src: string, dst: string): void;
getRelationships(): Relation[];
clear(): void;
setCssStyle(ids: string[], styles: string[]): void;
setClass(ids: string[], classNames: string[]): void;
defineClass(ids: string[], style: string[]): void;
getClasses(): Map<string, RequirementClass>;
getData(): {
nodes: Node[];
edges: Edge[];
other: {};
config: import("../../config.type.js").MermaidConfig;
direction: string;
};
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setAccDescription: (txt: string) => void;
getAccDescription: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getConfig: () => import("../../config.type.js").RequirementDiagramConfig | undefined;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,31 @@
export type RequirementType = 'Requirement' | 'Functional Requirement' | 'Interface Requirement' | 'Performance Requirement' | 'Physical Requirement' | 'Design Constraint';
export type RiskLevel = 'Low' | 'Medium' | 'High';
export type VerifyType = 'Analysis' | 'Demonstration' | 'Inspection' | 'Test';
export interface Requirement {
name: string;
type: RequirementType;
requirementId: string;
text: string;
risk: RiskLevel;
verifyMethod: VerifyType;
cssStyles: string[];
classes: string[];
}
export type RelationshipType = 'contains' | 'copies' | 'derives' | 'satisfies' | 'verifies' | 'refines' | 'traces';
export interface Relation {
type: RelationshipType;
src: string;
dst: string;
}
export interface Element {
name: string;
type: string;
docRef: string;
cssStyles: string[];
classes: string[];
}
export interface RequirementClass {
id: string;
styles: string[];
textStyles: string[];
}

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,14 @@
import type { Diagram } from '../../Diagram.js';
/**
* Draws Sankey diagram.
*
* @param text - The text of the diagram
* @param id - The id of the diagram which will be used as a DOM element id¨
* @param _version - Mermaid version from package.json
* @param diagObj - A standard diagram containing the db and the text and type etc of the diagram
*/
export declare const draw: (text: string, id: string, _version: string, diagObj: Diagram) => void;
declare const _default: {
draw: (text: string, id: string, _version: string, diagObj: Diagram) => void;
};
export default _default;

View File

@@ -0,0 +1 @@
export declare const prepareTextForParsing: (text: string) => string;

View File

@@ -0,0 +1,2 @@
export default getStyles;
declare function getStyles(options: any): string;

View File

@@ -0,0 +1,81 @@
export const ACTOR_TYPE_WIDTH: number;
export function drawRect(elem: any, rectData: any): import("../common/commonTypes.js").D3RectElement;
export function drawPopup(elem: any, actor: any, minMenuWidth: any, textAttrs: any, forceMenus: any): {
height: any;
width: any;
};
export function drawKatex(elem: any, textData: any, msgModel?: null): Promise<any[]>;
export function drawText(elem: any, textData: any): any[];
export function drawLabel(elem: any, txtObject: any): any;
export function fixLifeLineHeights(diagram: any, actors: any, actorKeys: any, conf: any): void;
export function drawActor(elem: any, actor: any, conf: any, isFooter: any): Promise<any>;
export function drawBox(elem: any, box: any, conf: any): void;
export function anchorElement(elem: any): any;
export function drawActivation(elem: any, bounds: any, verticalPos: any, conf: any, actorActivations: any): void;
export function drawLoop(elem: any, loopModel: any, labelText: any, conf: any): any;
export function drawBackgroundRect(elem: any, bounds: any): void;
export function insertDatabaseIcon(elem: any): void;
export function insertComputerIcon(elem: any): void;
export function insertClockIcon(elem: any): void;
export function insertArrowHead(elem: any): void;
export function insertArrowFilledHead(elem: any): void;
export function insertSequenceNumber(elem: any): void;
export function insertArrowCrossHead(elem: any): void;
export function getTextObj(): {
x: number;
y: number;
fill: undefined;
anchor: undefined;
style: string;
width: undefined;
height: undefined;
textMargin: number;
rx: number;
ry: number;
tspan: boolean;
valign: undefined;
};
export function getNoteRect(): {
x: number;
y: number;
fill: string;
stroke: string;
width: number;
anchor: string;
height: number;
rx: number;
ry: number;
};
export function insertSolidTopArrowHead(elem: any): void;
export function insertSolidBottomArrowHead(elem: any): void;
export function insertStickTopArrowHead(elem: any): void;
export function insertStickBottomArrowHead(elem: any): void;
declare namespace _default {
export { drawRect };
export { drawText };
export { drawLabel };
export { drawActor };
export { drawBox };
export { drawPopup };
export { anchorElement };
export { drawActivation };
export { drawLoop };
export { drawBackgroundRect };
export { insertArrowHead };
export { insertArrowFilledHead };
export { insertSequenceNumber };
export { insertArrowCrossHead };
export { insertDatabaseIcon };
export { insertComputerIcon };
export { insertClockIcon };
export { getTextObj };
export { getNoteRect };
export { fixLifeLineHeights };
export { sanitizeUrl };
export { insertSolidTopArrowHead };
export { insertSolidBottomArrowHead };
export { insertStickTopArrowHead };
export { insertStickBottomArrowHead };
}
export default _default;
import { sanitizeUrl } from '@braintree/sanitize-url';

View File

@@ -0,0 +1,2 @@
export default getStyles;
declare function getStyles(options: any): string;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,19 @@
import type { Selection } from 'd3';
import type { Diagram } from '../../Diagram.js';
import type { MermaidConfig } from '../../config.type.js';
interface TimelineTask {
id: number;
section: string;
type: string;
task: string;
score: number;
events: string[];
}
export declare const draw: (text: string, id: string, version: string, diagObj: Diagram) => void;
export declare const drawTasks: (diagram: Selection<SVGElement, unknown, null, undefined>, tasks: TimelineTask[], sectionColor: number, masterX: number, masterY: number, maxTaskHeight: number, conf: MermaidConfig, maxEventCount: number, maxEventLineLength: number, maxSectionHeight: number, isWithoutSections: boolean) => void;
export declare const drawEvents: (diagram: Selection<SVGElement, unknown, null, undefined>, events: string[], sectionColor: number, masterX: number, masterY: number, conf: MermaidConfig) => number;
declare const _default: {
setConf: () => void;
draw: (text: string, id: string, version: string, diagObj: Diagram) => void;
};
export default _default;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1,30 @@
export declare const setConf: (cnf: any) => void;
export declare const draw: (text: any, id: any, version: any, diagObj: any) => void;
export declare const bounds: {
data: {
startx: undefined;
stopx: undefined;
starty: undefined;
stopy: undefined;
};
verticalPos: number;
sequenceItems: never[];
init: () => void;
updateVal: (obj: any, key: any, val: any, fun: any) => void;
updateBounds: (startx: any, starty: any, stopx: any, stopy: any) => void;
insert: (startx: any, starty: any, stopx: any, stopy: any) => void;
bumpVerticalPos: (bump: any) => void;
getVerticalPos: () => number;
getBounds: () => {
startx: undefined;
stopx: undefined;
starty: undefined;
stopy: undefined;
};
};
export declare const drawTasks: (diagram: any, tasks: any, verticalPos: any) => void;
declare const _default: {
setConf: (cnf: any) => void;
draw: (text: any, id: any, version: any, diagObj: any) => void;
};
export default _default;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,42 @@
import type { SVGGroup } from '../../diagram-api/types.js';
import type { DrawableElem, XYChartConfig, XYChartData, XYChartThemeConfig } from './chartBuilder/interfaces.js';
interface NormalTextType {
type: 'text';
text: string;
}
declare function setTmpSVGG(SVGG: SVGGroup): void;
declare function setOrientation(orientation: string): void;
declare function setXAxisTitle(title: NormalTextType): void;
declare function setXAxisRangeData(min: number, max: number): void;
declare function setXAxisBand(categories: NormalTextType[]): void;
declare function setYAxisTitle(title: NormalTextType): void;
declare function setYAxisRangeData(min: number, max: number): void;
declare function setLineData(title: NormalTextType, data: number[]): void;
declare function setBarData(title: NormalTextType, data: number[]): void;
declare function getDrawableElem(): DrawableElem[];
declare function getChartThemeConfig(): XYChartThemeConfig;
declare function getChartConfig(): XYChartConfig;
declare function getXYChartData(): XYChartData;
declare const _default: {
getDrawableElem: typeof getDrawableElem;
clear: () => void;
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getAccDescription: () => string;
setAccDescription: (txt: string) => void;
setOrientation: typeof setOrientation;
setXAxisTitle: typeof setXAxisTitle;
setXAxisRangeData: typeof setXAxisRangeData;
setXAxisBand: typeof setXAxisBand;
setYAxisTitle: typeof setYAxisTitle;
setYAxisRangeData: typeof setYAxisRangeData;
setLineData: typeof setLineData;
setBarData: typeof setBarData;
setTmpSVGG: typeof setTmpSVGG;
getChartThemeConfig: typeof getChartThemeConfig;
getChartConfig: typeof getChartConfig;
getXYChartData: typeof getXYChartData;
};
export default _default;