claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
120 lines • 3.34 kB
TypeScript
export interface ChartAccessibilityConfig {
enableScreenReader: boolean;
enableKeyboardNavigation: boolean;
enableHighContrast: boolean;
enableDataSonification: boolean;
enableVoiceNavigation: boolean;
reducedMotion: boolean;
dataTableAlternative: boolean;
describedBy: string[];
}
export interface DataPoint {
label: string;
value: number | string | Date;
description?: string;
category?: string;
metadata?: Record<string, any>;
}
export interface ChartDescription {
title: string;
type: string;
summary: string;
trends: string[];
keyInsights: string[];
dataRange: {
min: number | Date;
max: number | Date;
count: number;
};
accessibility: {
keyboardInstructions: string[];
screenReaderInstructions: string[];
alternativeFormats: string[];
};
}
/**
* Generate comprehensive chart descriptions for screen readers
*/
export declare function generateChartDescription(data: DataPoint[], chartType: string, title: string): ChartDescription;
/**
* Create ARIA live region for dynamic chart updates
*/
export declare function createLiveRegion(container: HTMLElement, id: string): HTMLElement;
/**
* Announce chart updates to screen readers
*/
export declare function announceChartUpdate(liveRegion: HTMLElement, updateType: 'data' | 'selection' | 'zoom' | 'filter', details: string): void;
/**
* Create accessible data table alternative
*/
export declare function createDataTable(data: DataPoint[], caption: string, container: HTMLElement): HTMLTableElement;
/**
* Simple data sonification for accessibility
*/
export declare class DataSonification {
private audioContext;
private isEnabled;
constructor();
/**
* Convert data values to audio frequencies
*/
private valueToFrequency;
/**
* Play a tone for a data point
*/
playTone(value: number, min: number, max: number, duration?: number): void;
/**
* Play data series as a sequence of tones
*/
playDataSeries(data: DataPoint[], intervalMs?: number): void;
/**
* Enable/disable sonification
*/
setEnabled(enabled: boolean): void;
/**
* Resume audio context (required after user interaction)
*/
resume(): void;
}
/**
* High contrast mode utilities
*/
export declare class HighContrastMode {
private static instance;
private isEnabled;
private originalColors;
static getInstance(): HighContrastMode;
enable(container: HTMLElement): void;
disable(container: HTMLElement): void;
toggle(container: HTMLElement): void;
}
/**
* Voice navigation for charts
*/
export declare class VoiceNavigation {
private recognition;
private isListening;
private commands;
constructor();
/**
* Register voice commands
*/
registerCommand(phrase: string, callback: () => void): void;
/**
* Start listening for voice commands
*/
startListening(): void;
/**
* Stop listening for voice commands
*/
stopListening(): void;
/**
* Process recognized speech command
*/
private processCommand;
/**
* Register default chart commands
*/
registerDefaultCommands(chartElement: HTMLElement): void;
}
//# sourceMappingURL=chart-accessibility.d.ts.map