accessibility-checker-engine
Version:
An automated accessibility checking engine for use by other tools
45 lines (44 loc) • 2.49 kB
TypeScript
import { SRCursor } from "../SRCursor";
import { SRRendererRule } from "../SRRendererRule";
import { NavigationMode } from "../SRTypes";
/**
* Provide the name, surrounded by the quoteCharBefore and quoteCharAfter and followed by the padding if the name exists
* @param cursor The cursor for which to fetch the name
* @param padding String to add after, if the name exists
* @param quoteCharBefore The string to use as the leading quote, if the name exists
* @param quoteCharBefore The string to use as the trailing quote, if the name exists
* @returns
*/
export declare function quoteNamePadAfter(cursor: SRCursor, padding?: string, quoteCharBefore?: string, quoteCharAfter?: string): string;
/**
* Provide the name, surrounded by quotes and preceded by the padding if the name exists
* @param cursor The cursor for which to fetch the name
* @param padding String to add before, if the name exists (defaults to ", ")
* @returns The quoted name with leading padding, or empty string if no name exists
*/
export declare function quoteNamePadBefore(cursor: SRCursor, padding?: string): string;
/**
* Provide the name surrounded by quote characters
* @param cursor The cursor for which to fetch the name
* @param quoteCharBefore The string to use as the leading quote (defaults to ")
* @param quoteCharAfter The string to use as the trailing quote (defaults to ")
* @returns The quoted name, or empty string if no name exists
*/
export declare function quoteName(cursor: SRCursor, quoteCharBefore?: string, quoteCharAfter?: string): string;
/**
* Get the role description for an element, using aria-roledescription if present
* Falls back to the provided default role name if aria-roledescription is not specified or empty
* @param cursor The cursor positioned at the element
* @param defaultRole The default role name to use if aria-roledescription is not present
* @returns The role description (either custom or default)
*/
export declare function getRoleDescription(cursor: SRCursor, defaultRole: string): string;
/**
* Generate the screen reader announcement for a link element
* Distinguishes between same-page links (anchors) and regular links
* @param cursor The cursor positioned at the link element
* @param mode The navigation mode (affects announcement order)
* @returns The formatted link announcement string
*/
export declare function getLinkAnnouncement(cursor: SRCursor, mode?: NavigationMode): string;
export declare const RULES: SRRendererRule[];