From dc1b20d49514ec5962a6c165a99d9406a66ba67d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 17 Dec 2022 11:58:19 -0800 Subject: [PATCH] Add missing AccessibilityInfo Types to TS Typings 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 --- .../AccessibilityInfo/AccessibilityInfo.d.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts index 749d44e36717d0..8ac2a29819f97c 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts @@ -69,6 +69,14 @@ export interface AccessibilityInfoStatic { */ isReduceMotionEnabled: () => Promise; + /** + * 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; + /** * Query whether reduce transparency is currently enabled. * @@ -81,6 +89,16 @@ export interface AccessibilityInfoStatic { */ isScreenReaderEnabled: () => Promise; + /** + * 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; + /** * Add an event handler. Supported events: * - announcementFinished: iOS-only event. Fires when the screen reader has finished making an announcement. @@ -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.