UNPKG

4.78 kBTypeScriptView Raw
1import type { MermaidConfig } from './config.type.js';
2export declare const defaultConfig: MermaidConfig;
3export declare const updateCurrentConfig: (siteCfg: MermaidConfig, _directives: any[]) => MermaidConfig;
4/**
5 * ## setSiteConfig
6 *
7 * | Function | Description | Type | Values |
8 * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
9 * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
10 *
11 * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls
12 * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig)
13 * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this
14 * function _Default value: At default, will mirror Global Config_
15 *
16 * @param conf - The base currentConfig to use as siteConfig
17 * @returns The new siteConfig
18 */
19export declare const setSiteConfig: (conf: MermaidConfig) => MermaidConfig;
20export declare const saveConfigFromInitialize: (conf: MermaidConfig) => void;
21export declare const updateSiteConfig: (conf: MermaidConfig) => MermaidConfig;
22/**
23 * ## getSiteConfig
24 *
25 * | Function | Description | Type | Values |
26 * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- |
27 * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig |
28 *
29 * **Notes**: Returns **any** values in siteConfig.
30 *
31 * @returns The siteConfig
32 */
33export declare const getSiteConfig: () => MermaidConfig;
34/**
35 * ## setConfig
36 *
37 * | Function | Description | Type | Values |
38 * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
39 * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
40 *
41 * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure
42 * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the
43 * corresponding siteConfig value.
44 *
45 * @param conf - The potential currentConfig
46 * @returns The currentConfig merged with the sanitized conf
47 */
48export declare const setConfig: (conf: MermaidConfig) => MermaidConfig;
49/**
50 * ## getConfig
51 *
52 * | Function | Description | Type | Return Values |
53 * | --------- | ------------------------- | ----------- | ------------------------------ |
54 * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |
55 *
56 * **Notes**: Returns **any** the currentConfig
57 *
58 * @returns The currentConfig
59 */
60export declare const getConfig: () => MermaidConfig;
61/**
62 * ## sanitize
63 *
64 * | Function | Description | Type | Values |
65 * | -------- | -------------------------------------- | ----------- | ------ |
66 * | sanitize | Sets the siteConfig to desired values. | Put Request | None |
67 *
68 * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies
69 * options in-place
70 *
71 * @param options - The potential setConfig parameter
72 */
73export declare const sanitize: (options: any) => void;
74/**
75 * Pushes in a directive to the configuration
76 *
77 * @param directive - The directive to push in
78 */
79export declare const addDirective: (directive: any) => void;
80/**
81 * ## reset
82 *
83 * | Function | Description | Type | Required | Values |
84 * | -------- | ---------------------------- | ----------- | -------- | ------ |
85 * | reset | Resets currentConfig to conf | Put Request | Required | None |
86 *
87 * ## conf
88 *
89 * | Parameter | Description | Type | Required | Values |
90 * | --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- |
91 * | conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array |
92 *
93 * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)
94 *
95 * @param config - base set of values, which currentConfig could be **reset** to.
96 * Defaults to the current siteConfig (e.g returned by {@link getSiteConfig}).
97 */
98export declare const reset: (config?: MermaidConfig) => void;