state sync
This commit is contained in:
53
app/basepak/static/js/mermaid/diagrams/er/erDb.d.ts
vendored
Normal file
53
app/basepak/static/js/mermaid/diagrams/er/erDb.d.ts
vendored
Normal 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;
|
||||
}
|
||||
3
app/basepak/static/js/mermaid/diagrams/er/erDetector.d.ts
vendored
Normal file
3
app/basepak/static/js/mermaid/diagrams/er/erDetector.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
|
||||
declare const plugin: ExternalDiagramDefinition;
|
||||
export default plugin;
|
||||
8
app/basepak/static/js/mermaid/diagrams/er/erDiagram.d.ts
vendored
Normal file
8
app/basepak/static/js/mermaid/diagrams/er/erDiagram.d.ts
vendored
Normal 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;
|
||||
};
|
||||
24
app/basepak/static/js/mermaid/diagrams/er/erMarkers.d.ts
vendored
Normal file
24
app/basepak/static/js/mermaid/diagrams/er/erMarkers.d.ts
vendored
Normal 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;
|
||||
1
app/basepak/static/js/mermaid/diagrams/er/erRenderer-unified.d.ts
vendored
Normal file
1
app/basepak/static/js/mermaid/diagrams/er/erRenderer-unified.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const draw: (text: string, id: string, _version: string, diag: any) => Promise<void>;
|
||||
19
app/basepak/static/js/mermaid/diagrams/er/erRenderer.d.ts
vendored
Normal file
19
app/basepak/static/js/mermaid/diagrams/er/erRenderer.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Return a unique id based on the given string. Start with the prefix, then a hyphen, then the
|
||||
* simplified str, then a hyphen, then a unique uuid based on the str. (Hyphens are only included if needed.)
|
||||
* Although the official XML standard for ids says that many more characters are valid in the id,
|
||||
* this keeps things simple by accepting only A-Za-z0-9.
|
||||
*
|
||||
* @param {string} str Given string to use as the basis for the id. Default is `''`
|
||||
* @param {string} prefix String to put at the start, followed by '-'. Default is `''`
|
||||
* @returns {string}
|
||||
* @see https://www.w3.org/TR/xml/#NT-Name
|
||||
*/
|
||||
export function generateId(str?: string, prefix?: string): string;
|
||||
export function setConf(cnf: any): void;
|
||||
export function draw(text: any, id: any, _version: any, diagObj: any): void;
|
||||
declare namespace _default {
|
||||
export { setConf };
|
||||
export { draw };
|
||||
}
|
||||
export default _default;
|
||||
1
app/basepak/static/js/mermaid/diagrams/er/erRenderer.spec.d.ts
vendored
Normal file
1
app/basepak/static/js/mermaid/diagrams/er/erRenderer.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
33
app/basepak/static/js/mermaid/diagrams/er/erTypes.d.ts
vendored
Normal file
33
app/basepak/static/js/mermaid/diagrams/er/erTypes.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
export interface EntityNode {
|
||||
id: string;
|
||||
label: string;
|
||||
attributes: Attribute[];
|
||||
alias: string;
|
||||
shape: string;
|
||||
look?: string;
|
||||
cssClasses?: string;
|
||||
cssStyles?: string[];
|
||||
cssCompiledStyles?: string[];
|
||||
}
|
||||
export interface Attribute {
|
||||
type: string;
|
||||
name: string;
|
||||
keys: ('PK' | 'FK' | 'UK')[];
|
||||
comment: string;
|
||||
}
|
||||
export interface Relationship {
|
||||
entityA: string;
|
||||
roleA: string;
|
||||
entityB: string;
|
||||
relSpec: RelSpec;
|
||||
}
|
||||
export interface RelSpec {
|
||||
cardA: string;
|
||||
cardB: string;
|
||||
relType: string;
|
||||
}
|
||||
export interface EntityClass {
|
||||
id: string;
|
||||
styles: string[];
|
||||
textStyles: string[];
|
||||
}
|
||||
3
app/basepak/static/js/mermaid/diagrams/er/styles.d.ts
vendored
Normal file
3
app/basepak/static/js/mermaid/diagrams/er/styles.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { FlowChartStyleOptions } from '../flowchart/styles.js';
|
||||
declare const getStyles: (options: FlowChartStyleOptions) => string;
|
||||
export default getStyles;
|
||||
Reference in New Issue
Block a user