@atlaskit/editor-plugin-accessibility-utils
Version:
Accessibility utils for @atlaskit/editor-core
26 lines (25 loc) • 992 B
TypeScript
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
export interface AriaLiveElementAttributes {
priority?: 'important' | 'none';
}
export interface AccessibilityUtilsPluginState {
ariaLiveElementAttributes?: AriaLiveElementAttributes;
key?: string;
message: string;
}
export type AccessibilityUtilsPlugin = NextEditorPlugin<'accessibilityUtils', {
actions: {
/**
*
* @param {string} message - Message to be announced to screen readers. This should be internationalized.
*
* These are currently announced via assertive live regions to screen readers.
*
* *In future, the ariaNotify proposal looks like a good fit for this use case. The naming has been selected to align with this proposal.
*/
ariaNotify: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
};
dependencies: [
];
sharedState: AccessibilityUtilsPluginState;
}>;