Skip to content

Module: config

Variables

defaultConfig

Const defaultConfig: MermaidConfig

Defined in

packages/mermaid/src/config.ts:8

Functions

addDirective

addDirective(directive): void

Pushes in a directive to the configuration

Parameters

NameTypeDescription
directiveMermaidConfigThe directive to push in

Returns

void

Defined in

packages/mermaid/src/config.ts:188


getConfig

getConfig(): MermaidConfig

getConfig

FunctionDescriptionTypeReturn Values
getConfigObtains the currentConfigGet RequestAny Values from current Config

Notes: Avoid calling this function repeatedly. Instead, store the result in a variable and use it, and pass it down to function calls.

Returns

MermaidConfig

The currentConfig

Defined in

packages/mermaid/src/config.ts:131


getSiteConfig

getSiteConfig(): MermaidConfig

getSiteConfig

FunctionDescriptionTypeValues
setSiteConfigReturns the current siteConfig base configurationGet RequestReturns Any Values in siteConfig

Notes: Returns any values in siteConfig.

Returns

MermaidConfig

The siteConfig

Defined in

packages/mermaid/src/config.ts:96


reset

reset(config?): void

reset

FunctionDescriptionTypeRequiredValues
resetResets currentConfig to confPut RequestRequiredNone

conf

ParameterDescriptionTypeRequiredValues
confbase set of values, which currentConfig could be reset to.DictionaryRequiredAny Values, with respect to the secure Array

Notes: (default: current siteConfig ) (optional, default getSiteConfig())

Parameters

NameTypeDefault valueDescription
configMermaidConfigsiteConfigbase set of values, which currentConfig could be reset to. Defaults to the current siteConfig (e.g returned by getSiteConfig).

Returns

void

Defined in

packages/mermaid/src/config.ts:221


sanitize

sanitize(options): void

sanitize

FunctionDescriptionTypeValues
sanitizeSets the siteConfig to desired values.Put RequestNone

Ensures options parameter does not attempt to override siteConfig secure keys Notes: modifies options in-place

Parameters

NameTypeDescription
optionsanyThe potential setConfig parameter

Returns

void

Defined in

packages/mermaid/src/config.ts:146


saveConfigFromInitialize

saveConfigFromInitialize(conf): void

Parameters

NameType
confMermaidConfig

Returns

void

Defined in

packages/mermaid/src/config.ts:75


setConfig

setConfig(conf): MermaidConfig

setConfig

FunctionDescriptionTypeValues
setSiteConfigSets the siteConfig to desired valuesPut RequestAny Values, except ones in secure array

Notes: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any values found in conf with key found in siteConfig.secure will be replaced with the corresponding siteConfig value.

Parameters

NameTypeDescription
confMermaidConfigThe potential currentConfig

Returns

MermaidConfig

The currentConfig merged with the sanitized conf

Defined in

packages/mermaid/src/config.ts:113


setSiteConfig

setSiteConfig(conf): MermaidConfig

setSiteConfig

FunctionDescriptionTypeValues
setSiteConfigSets the siteConfig to desired valuesPut RequestAny Values, except ones in secure array

Notes: Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this function Default value: At default, will mirror Global Config

Parameters

NameTypeDescription
confMermaidConfigThe base currentConfig to use as siteConfig

Returns

MermaidConfig

The new siteConfig

Defined in

packages/mermaid/src/config.ts:61


updateCurrentConfig

updateCurrentConfig(siteCfg, _directives): MermaidConfig

Parameters

NameType
siteCfgMermaidConfig
_directivesMermaidConfig[]

Returns

MermaidConfig

Defined in

packages/mermaid/src/config.ts:15


updateSiteConfig

updateSiteConfig(conf): MermaidConfig

Parameters

NameType
confMermaidConfig

Returns

MermaidConfig

Defined in

packages/mermaid/src/config.ts:79