Skip to content

Commit

Permalink
Add missing AccessibilityInfo Types to TS Typings
Browse files Browse the repository at this point in the history
Summary:
This adds some missing public methods on AccessibilityInfo.

Changelog:
[General][Fixed] - Add missing AccessibilityInfo Types to TS Typings

Reviewed By: christophpurrer

Differential Revision: D42113713

fbshipit-source-id: bf1945f310b716ff8584dd47fc27752dc592e473
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Dec 17, 2022
1 parent 32af566 commit 76a1445
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ export interface AccessibilityInfoStatic {
*/
isReduceMotionEnabled: () => Promise<boolean>;

/**
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
*
* Returns a promise which resolves to a boolean.
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
*/
prefersCrossFadeTransitions(): Promise<boolean>;

/**
* Query whether reduce transparency is currently enabled.
*
Expand All @@ -81,6 +89,16 @@ export interface AccessibilityInfoStatic {
*/
isScreenReaderEnabled: () => Promise<boolean>;

/**
* Query whether Accessibility Service is currently enabled.
*
* Returns a promise which resolves to a boolean.
* The result is `true` when any service is enabled and `false` otherwise.
*
* @platform android
*/
isAccessibilityServiceEnabled(): Promise<boolean>;

/**
* Add an event handler. Supported events:
* - announcementFinished: iOS-only event. Fires when the screen reader has finished making an announcement.
Expand Down Expand Up @@ -111,6 +129,17 @@ export interface AccessibilityInfoStatic {
*/
announceForAccessibility: (announcement: string) => void;

/**
* Post a string to be announced by the screen reader.
* - `announcement`: The string announced by the screen reader.
* - `options`: An object that configures the reading options.
* - `queue`: The announcement will be queued behind existing announcements. iOS only.
*/
announceForAccessibilityWithOptions(
announcement: string,
options: {queue?: boolean},
): void;

/**
* Gets the timeout in millisecond that the user needs.
* This value is set in "Time to take action (Accessibility timeout)" of "Accessibility" settings.
Expand Down

0 comments on commit 76a1445

Please sign in to comment.