Constructors
new KeplerA11ySettingsInterface()
new KeplerA11ySettingsInterface(): KeplerA11ySettingsInterfaceReturns
KeplerA11ySettingsInterfaceMethods
addAudioDescriptionStateListener()
addAudioDescriptionStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for audio description state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when audio description state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addCaptioningPreferencesListener()
addCaptioningPreferencesListener(handler:(preferences: CaptioningProps) => void): Promise<boolean>
Adds a listener for captioning preferences changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(preferences: CaptioningProps) => void
Callback function invoked on the main thread when captioning preferences change
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addClosedCaptioningStateListener()
addClosedCaptioningStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for closed captioning state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when closed captioning state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addColorCorrectionModeListener()
addColorCorrectionModeListener(handler:(mode: ColorCorrectionMode) => void): Promise<boolean>
Adds a listener for color correction mode changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(mode: ColorCorrectionMode) => void
Callback function invoked on the main thread when color correction mode changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addColorInversionStateListener()
addColorInversionStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for color inversion state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when color inversion state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addHighContrastTextStateListener()
addHighContrastTextStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for high contrast text state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when high contrast text state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addScreenMagnifierStateListener()
addScreenMagnifierStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for screen magnifier state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when screen magnifier state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addScreenReaderStateListener()
addScreenReaderStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for screen reader state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when screen reader state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addTextBannerStateListener()
addTextBannerStateListener(handler:(enabled: boolean) => void): Promise<boolean>
Adds a listener for text banner state changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(enabled: boolean) => void
Callback function invoked on the main thread when text banner state changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addTimeToTakeActionListener()
addTimeToTakeActionListener(handler:(value: TimeoutMultiplier) => void): Promise<boolean>
Adds a listener for time to take action changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(value: TimeoutMultiplier) => void
Callback function invoked on the main thread when time to take action changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
addUiScaleSettingListener()
addUiScaleSettingListener(handler:(newScaleSetting: UiScaleSetting) => void): Promise<boolean>
Adds a listener for UI scale setting changes.
If a listener is already registered, it will be removed and replaced with the new one.
Parameters
handler
(newScaleSetting: UiScaleSetting) => void
Callback function invoked on the main thread when UI scale setting changes
Returns
Promise<boolean>
Promise that resolves to boolean representing if listener registered successfully.
getCaptionPreferences()
getCaptionPreferences():Promise<CaptioningProps>
Gets all captioning preferences.
Returns
Promise<CaptioningProps>
Promise that resolves to object containing all captioning preference settings
getColorCorrectionMode()
getColorCorrectionMode():Promise<ColorCorrectionMode>
Gets the current color correction mode.
Returns
Promise<ColorCorrectionMode>
Promise that resolves to the current color correction mode
getScaledSize()
getScaledSize(originalSize:number, scalingProps: ScalingProps): Promise<number>
Gets the scaled size for the given original size and scaling properties.
Note: Prefer using the useScaledSize hook from UiScaleSettingContextProvider.
Parameters
originalSize
number
The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
is enabled, or in physical pixels otherwise)
scalingProps
ScalingProps Properties that define how scaling should be appliedReturns
Promise<number>
Promise that resolves to the scaled size
getScalingMultiplier()
getScalingMultiplier(originalSize:number, scalingProps: ScalingProps): Promise<number>
Gets the scaling multiplier for the given original size and scaling properties.
This method should be used to retrieve a scale factor, which can be applied to related
values that do not have the same scaling properties, like the height and width of an image.
Note: Prefer using the useScalingMultiplier hook from UiScaleSettingContextProvider.
Parameters
originalSize
number
The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
is enabled, or in physical pixels otherwise)
scalingProps
ScalingProps Properties that define how scaling should be appliedReturns
Promise<number>
Promise that resolves to the scaling multiplier
getTimeToTakeAction()
getTimeToTakeAction():Promise<TimeoutMultiplier>
Gets the current time to take action setting.
Returns
Promise<TimeoutMultiplier>
Promise that resolves to the current timeout multiplier
getUiScaleSetting()
getUiScaleSetting():Promise<UiScaleSetting>
Gets the current UI scale setting.
Note: Prefer using the useUiScaleSetting hook from UiScaleSettingContextProvider.
Returns
Promise<UiScaleSetting>
Promise that resolves to the current UI scale setting
isAudioDescriptionPreferred()
isAudioDescriptionPreferred():Promise<boolean>
Checks if audio description is preferred.
Returns
Promise<boolean>
Promise that resolves to true if audio description is preferred, false otherwise
isClosedCaptioningEnabled()
isClosedCaptioningEnabled():Promise<boolean>
Checks if closed captioning is enabled.
Returns
Promise<boolean>
Promise that resolves to true if closed captioning is enabled, false otherwise
isColorInversionEnabled()
isColorInversionEnabled():Promise<boolean>
Checks if color inversion is enabled.
Returns
Promise<boolean>
Promise that resolves to true if color inversion is enabled, false otherwise
isHighContrastTextEnabled()
isHighContrastTextEnabled():Promise<boolean>
Checks if high contrast text is enabled.
Returns
Promise<boolean>
Promise that resolves to true if high contrast text is enabled, false otherwise
isScreenMagnifierEnabled()
isScreenMagnifierEnabled():Promise<boolean>
Checks if screen magnifier is enabled.
Returns
Promise<boolean>
Promise that resolves to true if screen magnifier is enabled, false otherwise
isScreenReaderEnabled()
isScreenReaderEnabled():Promise<boolean>
Checks if screen reader is enabled.
Returns
Promise<boolean>
Promise that resolves to true if screen reader is enabled, false otherwise
isTextBannerEnabled()
isTextBannerEnabled():Promise<boolean>
Checks if text banner is enabled.
Returns
Promise<boolean>
Promise that resolves to true if text banner is enabled, false otherwise
removeAudioDescriptionStateListener()
removeAudioDescriptionStateListener():Promise<void>
Removes the audio description state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeCaptioningPreferencesListener()
removeCaptioningPreferencesListener():Promise<void>
Removes the captioning preferences listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeClosedCaptioningStateListener()
removeClosedCaptioningStateListener():Promise<void>
Removes the closed captioning state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeColorCorrectionModeListener()
removeColorCorrectionModeListener():Promise<void>
Removes the color correction mode listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeColorInversionStateListener()
removeColorInversionStateListener():Promise<void>
Removes the color inversion state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeHighContrastTextStateListener()
removeHighContrastTextStateListener():Promise<void>
Removes the high contrast text state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeScreenMagnifierStateListener()
removeScreenMagnifierStateListener():Promise<void>
Removes the screen magnifier state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeScreenReaderStateListener()
removeScreenReaderStateListener():Promise<void>
Removes the screen reader state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeTextBannerStateListener()
removeTextBannerStateListener():Promise<void>
Removes the text banner state listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeTimeToTakeActionListener()
removeTimeToTakeActionListener():Promise<void>
Removes the time to take action listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
removeUiScaleSettingListener()
removeUiScaleSettingListener():Promise<void>
Removes the UI scale setting listener.
Returns
Promise<void>
Promise that resolves when the listener has been removed.
setAudioDescriptionPreferred()
setAudioDescriptionPreferred(enabled:boolean): Promise<void>
Sets the audio description preference.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to prefer audio description, false otherwise
Returns
Promise<void>
setCaptionPreferences()
setCaptionPreferences(prefs: CaptioningProps):Promise<void>
Sets multiple captioning preferences at once.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
prefs
CaptioningProps Object containing captioning preference settings to update. Only the properties present in the object will be updated.Returns
Promise<void>
setClosedCaptioningEnabled()
setClosedCaptioningEnabled(enabled:boolean): Promise<void>
Sets the closed captioning enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable closed captioning, false to disable
Returns
Promise<void>
setColorCorrectionMode()
setColorCorrectionMode(mode: ColorCorrectionMode):Promise<void>
Sets the color correction mode.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
mode
ColorCorrectionMode The color correction mode to setReturns
Promise<void>
setColorInversionEnabled()
setColorInversionEnabled(enabled:boolean): Promise<void>
Sets the color inversion enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable color inversion, false to disable
Returns
Promise<void>
setHighContrastTextEnabled()
setHighContrastTextEnabled(enabled:boolean): Promise<void>
Sets the high contrast text enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable high contrast text, false to disable
Returns
Promise<void>
setScreenMagnifierEnabled()
setScreenMagnifierEnabled(enabled:boolean): Promise<void>
Sets the screen magnifier enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable screen magnifier, false to disable
Returns
Promise<void>
setScreenReaderEnabled()
setScreenReaderEnabled(enabled:boolean): Promise<void>
Sets the screen reader enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable screen reader, false to disable
Returns
Promise<void>
setTextBannerEnabled()
setTextBannerEnabled(enabled:boolean): Promise<void>
Sets the text banner enabled state.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
enabled
boolean
true to enable text banner, false to disable
Returns
Promise<void>
setTimeToTakeAction()
setTimeToTakeAction(multiplier: TimeoutMultiplier):Promise<void>
Sets the time to take action multiplier.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
multiplier
TimeoutMultiplier The timeout multiplier to setReturns
Promise<void>
setUiScaleSetting()
setUiScaleSetting(setting: UiScaleSetting):Promise<void>
Sets the UI scale setting.
Requires com.amazon.devconf.privilege.accessibility.write permission.
Parameters
setting
UiScaleSetting The UI scale setting to setReturns
Promise<void>

