UNPKG

1.25 kBTypeScriptView Raw
1/**
2 * Accessibility (a11y) functions, types, helpers
3 * @see https://www.w3.org/WAI/
4 * @see https://www.w3.org/TR/wai-aria-1.1/
5 * @see https://www.w3.org/TR/svg-aam-1.0/
6 *
7 */
8import { D3Element } from './mermaidAPI.js';
9/**
10 * Add role and aria-roledescription to the svg element
11 *
12 * @param svg - d3 object that contains the SVG HTML element
13 * @param diagramType - diagram name for to the aria-roledescription
14 */
15export declare function setA11yDiagramInfo(svg: D3Element, diagramType: string | null | undefined): void;
16/**
17 * Add an accessible title and/or description element to a chart.
18 * The title is usually not displayed and the description is never displayed.
19 *
20 * The following charts display their title as a visual and accessibility element: gantt
21 *
22 * @param svg - d3 node to insert the a11y title and desc info
23 * @param a11yTitle - a11y title. null and undefined are meaningful: means to skip it
24 * @param a11yDesc - a11y description. null and undefined are meaningful: means to skip it
25 * @param baseId - id used to construct the a11y title and description id
26 */
27export declare function addSVGa11yTitleDescription(svg: D3Element, a11yTitle: string | null | undefined, a11yDesc: string | null | undefined, baseId: string): void;