add config functions to DiagramDB interface

This commit is contained in:
Yokozuna59 2023-06-19 20:13:15 +03:00
parent 3a22d4a501
commit 9c2b95fc3c
2 changed files with 13 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;