Skip to content

Commit c83340d

Browse files
huntiefacebook-github-bot
authored andcommitted
Add missing event names in AccessibilityInfo types
Summary: Add `'windowStateChange'` to `AccessibilityEventTypes` and `'accessibilityServiceChanged'` to `AccessibilityChangeEventName`, matching Flow source code. Changelog: [General][Fixed] - Add missing `windowStateChange` and `accessibilityServiceChanged` event types to `AccessibilityInfo` TypeScript definitions Differential Revision: D104057500
1 parent 71a0d5d commit c83340d

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ import {HostInstance} from '../../../types/public/ReactNativeTypes';
1111
import {EmitterSubscription} from '../../vendor/emitter/EventEmitter';
1212

1313
type AccessibilityChangeEventName =
14-
| 'change' // deprecated, maps to screenReaderChanged
14+
| 'accessibilityServiceChanged' // Android-only Event
1515
| 'boldTextChanged' // iOS-only Event
16+
| 'change' // deprecated, maps to screenReaderChanged
17+
| 'darkerSystemColorsChanged' // iOS-only Event
1618
| 'grayscaleChanged' // iOS-only Event
19+
| 'highTextContrastChanged' // Android-only Event
1720
| 'invertColorsChanged' // iOS-only Event
1821
| 'reduceMotionChanged'
19-
| 'highTextContrastChanged' // Android-only Event
20-
| 'darkerSystemColorsChanged' // iOS-only Event
21-
| 'screenReaderChanged'
22-
| 'reduceTransparencyChanged'; // iOS-only Event
22+
| 'reduceTransparencyChanged' // iOS-only Event
23+
| 'screenReaderChanged';
2324

2425
type AccessibilityChangeEvent = boolean;
2526

@@ -38,7 +39,11 @@ type AccessibilityAnnouncementFinishedEventHandler = (
3839
event: AccessibilityAnnouncementFinishedEvent,
3940
) => void;
4041

41-
type AccessibilityEventTypes = 'click' | 'focus' | 'viewHoverEnter';
42+
type AccessibilityEventTypes =
43+
| 'click'
44+
| 'focus'
45+
| 'viewHoverEnter'
46+
| 'windowStateChange';
4247

4348
/**
4449
* @see https://reactnative.dev/docs/accessibilityinfo

0 commit comments

Comments
 (0)