ViewAccessibility.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow strict-local
  9. */
  10. 'use strict';
  11. import type {SyntheticEvent} from '../../Types/CoreEventTypes';
  12. // This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m
  13. export type AccessibilityRole =
  14. | 'none'
  15. | 'button'
  16. | 'link'
  17. | 'search'
  18. | 'image'
  19. | 'keyboardkey'
  20. | 'text'
  21. | 'adjustable'
  22. | 'imagebutton'
  23. | 'header'
  24. | 'summary'
  25. | 'alert'
  26. | 'checkbox'
  27. | 'combobox'
  28. | 'menu'
  29. | 'menubar'
  30. | 'menuitem'
  31. | 'progressbar'
  32. | 'radio'
  33. | 'radiogroup'
  34. | 'scrollbar'
  35. | 'spinbutton'
  36. | 'switch'
  37. | 'tab'
  38. | 'tablist'
  39. | 'timer'
  40. | 'toolbar';
  41. // the info associated with an accessibility action
  42. export type AccessibilityActionInfo = $ReadOnly<{
  43. name: string,
  44. label?: string,
  45. ...
  46. }>;
  47. // The info included in the event sent to onAccessibilityAction
  48. export type AccessibilityActionEvent = SyntheticEvent<
  49. $ReadOnly<{actionName: string, ...}>,
  50. >;
  51. export type AccessibilityState = {
  52. disabled?: boolean,
  53. selected?: boolean,
  54. checked?: ?boolean | 'mixed',
  55. busy?: boolean,
  56. expanded?: boolean,
  57. ...
  58. };
  59. export type AccessibilityValue = $ReadOnly<{|
  60. /**
  61. * The minimum value of this component's range. (should be an integer)
  62. */
  63. min?: number,
  64. /**
  65. * The maximum value of this component's range. (should be an integer)
  66. */
  67. max?: number,
  68. /**
  69. * The current value of this component's range. (should be an integer)
  70. */
  71. now?: number,
  72. /**
  73. * A textual description of this component's value. (will override minimum, current, and maximum if set)
  74. */
  75. text?: string,
  76. |}>;