UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

14 lines (13 loc) 717 B
import type { MermaidConfig } from '../config.type.js'; /** * Returns a diagram section of the current (site + user) config with all * fields typed as present. * * `getConfig()` always merges the full `defaultConfig` (generated from the * config JSON schema, where every field has a default) under any user * overrides, so every field of every diagram section is guaranteed to be * defined at runtime even though the `MermaidConfig` input type marks them * optional. This helper centralizes that invariant so renderers don't need * non-null assertions on every config access. */ export declare const getRequiredConfig: <K extends keyof MermaidConfig>(section: K) => Required<NonNullable<MermaidConfig[K]>>;