可访问性

此接口提供了与无障碍相关的方法和事件。

有时,在应用程序中宣布状态变化(例如,有新消息)非常重要,以便视力受损的用户能够意识到屏幕上发生了变化。可以对多个公告进行排队。

事件

// Triggered when the high-contrast setting changes.
highContrastChangedEvent: SubscribableEvent<(isEnabled: boolean) => void>;

// Triggered when the screen reader setting changes.
screenReaderChangedEvent: SubscribableEvent<(isEnabled: boolean) => void>;

方法

// Sends the specified string to the screen reader.
announceForAccessibility(announcement: string): void;

// Indicates whether a screen reader is currently enabled.
isScreenReaderEnabled(): boolean;

// Indicates whether the OS-level "high-contrast" setting is enabled.
isHighContrastEnabled(): boolean;