mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
add config functions to DiagramDB interface
This commit is contained in:
parent
3a22d4a501
commit
9c2b95fc3c
@ -1,5 +1,5 @@
|
||||
import { Diagram } from '../Diagram.js';
|
||||
import { MermaidConfig } from '../config.type.js';
|
||||
import type { BaseDiagramConfig, MermaidConfig } from '../config.type.js';
|
||||
import type * as d3 from 'd3';
|
||||
|
||||
export interface InjectUtils {
|
||||
@ -16,11 +16,21 @@ export interface InjectUtils {
|
||||
* Generic Diagram DB that may apply to any diagram type.
|
||||
*/
|
||||
export interface DiagramDB {
|
||||
// config
|
||||
reset?: () => void;
|
||||
setConfig?: (config: BaseDiagramConfig) => void;
|
||||
getConfig?: () => Required<BaseDiagramConfig>;
|
||||
|
||||
// db
|
||||
clear?: () => void;
|
||||
setDiagramTitle?: (title: string) => void;
|
||||
setDisplayMode?: (title: string) => void;
|
||||
getDiagramTitle?: () => string;
|
||||
setAccTitle?: (title: string) => void;
|
||||
getAccTitle?: () => string;
|
||||
setAccDescription?: (describetion: string) => void;
|
||||
getAccDescription?: () => string;
|
||||
|
||||
setDisplayMode?: (title: string) => void;
|
||||
bindFunctions?: (element: Element) => void;
|
||||
}
|
||||
|
||||
|
@ -48,9 +48,9 @@ export interface D3Sections {
|
||||
|
||||
export interface PieDb extends DiagramDB {
|
||||
// config
|
||||
reset: () => void;
|
||||
setConfig: (config: PieDiagramConfig) => void;
|
||||
getConfig: () => Required<PieDiagramConfig>;
|
||||
reset: () => void;
|
||||
|
||||
// common db
|
||||
parseDirective: ParseDirectiveDefinition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user