AXObjectsMap.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator"));
  7. var _AbbrRole = _interopRequireDefault(require("./etc/objects/AbbrRole"));
  8. var _AlertDialogRole = _interopRequireDefault(require("./etc/objects/AlertDialogRole"));
  9. var _AlertRole = _interopRequireDefault(require("./etc/objects/AlertRole"));
  10. var _AnnotationRole = _interopRequireDefault(require("./etc/objects/AnnotationRole"));
  11. var _ApplicationRole = _interopRequireDefault(require("./etc/objects/ApplicationRole"));
  12. var _ArticleRole = _interopRequireDefault(require("./etc/objects/ArticleRole"));
  13. var _AudioRole = _interopRequireDefault(require("./etc/objects/AudioRole"));
  14. var _BannerRole = _interopRequireDefault(require("./etc/objects/BannerRole"));
  15. var _BlockquoteRole = _interopRequireDefault(require("./etc/objects/BlockquoteRole"));
  16. var _BusyIndicatorRole = _interopRequireDefault(require("./etc/objects/BusyIndicatorRole"));
  17. var _ButtonRole = _interopRequireDefault(require("./etc/objects/ButtonRole"));
  18. var _CanvasRole = _interopRequireDefault(require("./etc/objects/CanvasRole"));
  19. var _CaptionRole = _interopRequireDefault(require("./etc/objects/CaptionRole"));
  20. var _CellRole = _interopRequireDefault(require("./etc/objects/CellRole"));
  21. var _CheckBoxRole = _interopRequireDefault(require("./etc/objects/CheckBoxRole"));
  22. var _ColorWellRole = _interopRequireDefault(require("./etc/objects/ColorWellRole"));
  23. var _ColumnHeaderRole = _interopRequireDefault(require("./etc/objects/ColumnHeaderRole"));
  24. var _ColumnRole = _interopRequireDefault(require("./etc/objects/ColumnRole"));
  25. var _ComboBoxRole = _interopRequireDefault(require("./etc/objects/ComboBoxRole"));
  26. var _ComplementaryRole = _interopRequireDefault(require("./etc/objects/ComplementaryRole"));
  27. var _ContentInfoRole = _interopRequireDefault(require("./etc/objects/ContentInfoRole"));
  28. var _DateRole = _interopRequireDefault(require("./etc/objects/DateRole"));
  29. var _DateTimeRole = _interopRequireDefault(require("./etc/objects/DateTimeRole"));
  30. var _DefinitionRole = _interopRequireDefault(require("./etc/objects/DefinitionRole"));
  31. var _DescriptionListDetailRole = _interopRequireDefault(require("./etc/objects/DescriptionListDetailRole"));
  32. var _DescriptionListRole = _interopRequireDefault(require("./etc/objects/DescriptionListRole"));
  33. var _DescriptionListTermRole = _interopRequireDefault(require("./etc/objects/DescriptionListTermRole"));
  34. var _DetailsRole = _interopRequireDefault(require("./etc/objects/DetailsRole"));
  35. var _DialogRole = _interopRequireDefault(require("./etc/objects/DialogRole"));
  36. var _DirectoryRole = _interopRequireDefault(require("./etc/objects/DirectoryRole"));
  37. var _DisclosureTriangleRole = _interopRequireDefault(require("./etc/objects/DisclosureTriangleRole"));
  38. var _DivRole = _interopRequireDefault(require("./etc/objects/DivRole"));
  39. var _DocumentRole = _interopRequireDefault(require("./etc/objects/DocumentRole"));
  40. var _EmbeddedObjectRole = _interopRequireDefault(require("./etc/objects/EmbeddedObjectRole"));
  41. var _FeedRole = _interopRequireDefault(require("./etc/objects/FeedRole"));
  42. var _FigcaptionRole = _interopRequireDefault(require("./etc/objects/FigcaptionRole"));
  43. var _FigureRole = _interopRequireDefault(require("./etc/objects/FigureRole"));
  44. var _FooterRole = _interopRequireDefault(require("./etc/objects/FooterRole"));
  45. var _FormRole = _interopRequireDefault(require("./etc/objects/FormRole"));
  46. var _GridRole = _interopRequireDefault(require("./etc/objects/GridRole"));
  47. var _GroupRole = _interopRequireDefault(require("./etc/objects/GroupRole"));
  48. var _HeadingRole = _interopRequireDefault(require("./etc/objects/HeadingRole"));
  49. var _IframePresentationalRole = _interopRequireDefault(require("./etc/objects/IframePresentationalRole"));
  50. var _IframeRole = _interopRequireDefault(require("./etc/objects/IframeRole"));
  51. var _IgnoredRole = _interopRequireDefault(require("./etc/objects/IgnoredRole"));
  52. var _ImageMapLinkRole = _interopRequireDefault(require("./etc/objects/ImageMapLinkRole"));
  53. var _ImageMapRole = _interopRequireDefault(require("./etc/objects/ImageMapRole"));
  54. var _ImageRole = _interopRequireDefault(require("./etc/objects/ImageRole"));
  55. var _InlineTextBoxRole = _interopRequireDefault(require("./etc/objects/InlineTextBoxRole"));
  56. var _InputTimeRole = _interopRequireDefault(require("./etc/objects/InputTimeRole"));
  57. var _LabelRole = _interopRequireDefault(require("./etc/objects/LabelRole"));
  58. var _LegendRole = _interopRequireDefault(require("./etc/objects/LegendRole"));
  59. var _LineBreakRole = _interopRequireDefault(require("./etc/objects/LineBreakRole"));
  60. var _LinkRole = _interopRequireDefault(require("./etc/objects/LinkRole"));
  61. var _ListBoxOptionRole = _interopRequireDefault(require("./etc/objects/ListBoxOptionRole"));
  62. var _ListBoxRole = _interopRequireDefault(require("./etc/objects/ListBoxRole"));
  63. var _ListItemRole = _interopRequireDefault(require("./etc/objects/ListItemRole"));
  64. var _ListMarkerRole = _interopRequireDefault(require("./etc/objects/ListMarkerRole"));
  65. var _ListRole = _interopRequireDefault(require("./etc/objects/ListRole"));
  66. var _LogRole = _interopRequireDefault(require("./etc/objects/LogRole"));
  67. var _MainRole = _interopRequireDefault(require("./etc/objects/MainRole"));
  68. var _MarkRole = _interopRequireDefault(require("./etc/objects/MarkRole"));
  69. var _MarqueeRole = _interopRequireDefault(require("./etc/objects/MarqueeRole"));
  70. var _MathRole = _interopRequireDefault(require("./etc/objects/MathRole"));
  71. var _MenuBarRole = _interopRequireDefault(require("./etc/objects/MenuBarRole"));
  72. var _MenuButtonRole = _interopRequireDefault(require("./etc/objects/MenuButtonRole"));
  73. var _MenuItemRole = _interopRequireDefault(require("./etc/objects/MenuItemRole"));
  74. var _MenuItemCheckBoxRole = _interopRequireDefault(require("./etc/objects/MenuItemCheckBoxRole"));
  75. var _MenuItemRadioRole = _interopRequireDefault(require("./etc/objects/MenuItemRadioRole"));
  76. var _MenuListOptionRole = _interopRequireDefault(require("./etc/objects/MenuListOptionRole"));
  77. var _MenuListPopupRole = _interopRequireDefault(require("./etc/objects/MenuListPopupRole"));
  78. var _MenuRole = _interopRequireDefault(require("./etc/objects/MenuRole"));
  79. var _MeterRole = _interopRequireDefault(require("./etc/objects/MeterRole"));
  80. var _NavigationRole = _interopRequireDefault(require("./etc/objects/NavigationRole"));
  81. var _NoneRole = _interopRequireDefault(require("./etc/objects/NoneRole"));
  82. var _NoteRole = _interopRequireDefault(require("./etc/objects/NoteRole"));
  83. var _OutlineRole = _interopRequireDefault(require("./etc/objects/OutlineRole"));
  84. var _ParagraphRole = _interopRequireDefault(require("./etc/objects/ParagraphRole"));
  85. var _PopUpButtonRole = _interopRequireDefault(require("./etc/objects/PopUpButtonRole"));
  86. var _PreRole = _interopRequireDefault(require("./etc/objects/PreRole"));
  87. var _PresentationalRole = _interopRequireDefault(require("./etc/objects/PresentationalRole"));
  88. var _ProgressIndicatorRole = _interopRequireDefault(require("./etc/objects/ProgressIndicatorRole"));
  89. var _RadioButtonRole = _interopRequireDefault(require("./etc/objects/RadioButtonRole"));
  90. var _RadioGroupRole = _interopRequireDefault(require("./etc/objects/RadioGroupRole"));
  91. var _RegionRole = _interopRequireDefault(require("./etc/objects/RegionRole"));
  92. var _RootWebAreaRole = _interopRequireDefault(require("./etc/objects/RootWebAreaRole"));
  93. var _RowHeaderRole = _interopRequireDefault(require("./etc/objects/RowHeaderRole"));
  94. var _RowRole = _interopRequireDefault(require("./etc/objects/RowRole"));
  95. var _RubyRole = _interopRequireDefault(require("./etc/objects/RubyRole"));
  96. var _RulerRole = _interopRequireDefault(require("./etc/objects/RulerRole"));
  97. var _ScrollAreaRole = _interopRequireDefault(require("./etc/objects/ScrollAreaRole"));
  98. var _ScrollBarRole = _interopRequireDefault(require("./etc/objects/ScrollBarRole"));
  99. var _SeamlessWebAreaRole = _interopRequireDefault(require("./etc/objects/SeamlessWebAreaRole"));
  100. var _SearchRole = _interopRequireDefault(require("./etc/objects/SearchRole"));
  101. var _SearchBoxRole = _interopRequireDefault(require("./etc/objects/SearchBoxRole"));
  102. var _SliderRole = _interopRequireDefault(require("./etc/objects/SliderRole"));
  103. var _SliderThumbRole = _interopRequireDefault(require("./etc/objects/SliderThumbRole"));
  104. var _SpinButtonRole = _interopRequireDefault(require("./etc/objects/SpinButtonRole"));
  105. var _SpinButtonPartRole = _interopRequireDefault(require("./etc/objects/SpinButtonPartRole"));
  106. var _SplitterRole = _interopRequireDefault(require("./etc/objects/SplitterRole"));
  107. var _StaticTextRole = _interopRequireDefault(require("./etc/objects/StaticTextRole"));
  108. var _StatusRole = _interopRequireDefault(require("./etc/objects/StatusRole"));
  109. var _SVGRootRole = _interopRequireDefault(require("./etc/objects/SVGRootRole"));
  110. var _SwitchRole = _interopRequireDefault(require("./etc/objects/SwitchRole"));
  111. var _TabGroupRole = _interopRequireDefault(require("./etc/objects/TabGroupRole"));
  112. var _TabRole = _interopRequireDefault(require("./etc/objects/TabRole"));
  113. var _TableHeaderContainerRole = _interopRequireDefault(require("./etc/objects/TableHeaderContainerRole"));
  114. var _TableRole = _interopRequireDefault(require("./etc/objects/TableRole"));
  115. var _TabListRole = _interopRequireDefault(require("./etc/objects/TabListRole"));
  116. var _TabPanelRole = _interopRequireDefault(require("./etc/objects/TabPanelRole"));
  117. var _TermRole = _interopRequireDefault(require("./etc/objects/TermRole"));
  118. var _TextAreaRole = _interopRequireDefault(require("./etc/objects/TextAreaRole"));
  119. var _TextFieldRole = _interopRequireDefault(require("./etc/objects/TextFieldRole"));
  120. var _TimeRole = _interopRequireDefault(require("./etc/objects/TimeRole"));
  121. var _TimerRole = _interopRequireDefault(require("./etc/objects/TimerRole"));
  122. var _ToggleButtonRole = _interopRequireDefault(require("./etc/objects/ToggleButtonRole"));
  123. var _ToolbarRole = _interopRequireDefault(require("./etc/objects/ToolbarRole"));
  124. var _TreeRole = _interopRequireDefault(require("./etc/objects/TreeRole"));
  125. var _TreeGridRole = _interopRequireDefault(require("./etc/objects/TreeGridRole"));
  126. var _TreeItemRole = _interopRequireDefault(require("./etc/objects/TreeItemRole"));
  127. var _UserInterfaceTooltipRole = _interopRequireDefault(require("./etc/objects/UserInterfaceTooltipRole"));
  128. var _VideoRole = _interopRequireDefault(require("./etc/objects/VideoRole"));
  129. var _WebAreaRole = _interopRequireDefault(require("./etc/objects/WebAreaRole"));
  130. var _WindowRole = _interopRequireDefault(require("./etc/objects/WindowRole"));
  131. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  132. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  133. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  134. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  135. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  136. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  137. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  138. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  139. var AXObjects = [['AbbrRole', _AbbrRole.default], ['AlertDialogRole', _AlertDialogRole.default], ['AlertRole', _AlertRole.default], ['AnnotationRole', _AnnotationRole.default], ['ApplicationRole', _ApplicationRole.default], ['ArticleRole', _ArticleRole.default], ['AudioRole', _AudioRole.default], ['BannerRole', _BannerRole.default], ['BlockquoteRole', _BlockquoteRole.default], ['BusyIndicatorRole', _BusyIndicatorRole.default], ['ButtonRole', _ButtonRole.default], ['CanvasRole', _CanvasRole.default], ['CaptionRole', _CaptionRole.default], ['CellRole', _CellRole.default], ['CheckBoxRole', _CheckBoxRole.default], ['ColorWellRole', _ColorWellRole.default], ['ColumnHeaderRole', _ColumnHeaderRole.default], ['ColumnRole', _ColumnRole.default], ['ComboBoxRole', _ComboBoxRole.default], ['ComplementaryRole', _ComplementaryRole.default], ['ContentInfoRole', _ContentInfoRole.default], ['DateRole', _DateRole.default], ['DateTimeRole', _DateTimeRole.default], ['DefinitionRole', _DefinitionRole.default], ['DescriptionListDetailRole', _DescriptionListDetailRole.default], ['DescriptionListRole', _DescriptionListRole.default], ['DescriptionListTermRole', _DescriptionListTermRole.default], ['DetailsRole', _DetailsRole.default], ['DialogRole', _DialogRole.default], ['DirectoryRole', _DirectoryRole.default], ['DisclosureTriangleRole', _DisclosureTriangleRole.default], ['DivRole', _DivRole.default], ['DocumentRole', _DocumentRole.default], ['EmbeddedObjectRole', _EmbeddedObjectRole.default], ['FeedRole', _FeedRole.default], ['FigcaptionRole', _FigcaptionRole.default], ['FigureRole', _FigureRole.default], ['FooterRole', _FooterRole.default], ['FormRole', _FormRole.default], ['GridRole', _GridRole.default], ['GroupRole', _GroupRole.default], ['HeadingRole', _HeadingRole.default], ['IframePresentationalRole', _IframePresentationalRole.default], ['IframeRole', _IframeRole.default], ['IgnoredRole', _IgnoredRole.default], ['ImageMapLinkRole', _ImageMapLinkRole.default], ['ImageMapRole', _ImageMapRole.default], ['ImageRole', _ImageRole.default], ['InlineTextBoxRole', _InlineTextBoxRole.default], ['InputTimeRole', _InputTimeRole.default], ['LabelRole', _LabelRole.default], ['LegendRole', _LegendRole.default], ['LineBreakRole', _LineBreakRole.default], ['LinkRole', _LinkRole.default], ['ListBoxOptionRole', _ListBoxOptionRole.default], ['ListBoxRole', _ListBoxRole.default], ['ListItemRole', _ListItemRole.default], ['ListMarkerRole', _ListMarkerRole.default], ['ListRole', _ListRole.default], ['LogRole', _LogRole.default], ['MainRole', _MainRole.default], ['MarkRole', _MarkRole.default], ['MarqueeRole', _MarqueeRole.default], ['MathRole', _MathRole.default], ['MenuBarRole', _MenuBarRole.default], ['MenuButtonRole', _MenuButtonRole.default], ['MenuItemRole', _MenuItemRole.default], ['MenuItemCheckBoxRole', _MenuItemCheckBoxRole.default], ['MenuItemRadioRole', _MenuItemRadioRole.default], ['MenuListOptionRole', _MenuListOptionRole.default], ['MenuListPopupRole', _MenuListPopupRole.default], ['MenuRole', _MenuRole.default], ['MeterRole', _MeterRole.default], ['NavigationRole', _NavigationRole.default], ['NoneRole', _NoneRole.default], ['NoteRole', _NoteRole.default], ['OutlineRole', _OutlineRole.default], ['ParagraphRole', _ParagraphRole.default], ['PopUpButtonRole', _PopUpButtonRole.default], ['PreRole', _PreRole.default], ['PresentationalRole', _PresentationalRole.default], ['ProgressIndicatorRole', _ProgressIndicatorRole.default], ['RadioButtonRole', _RadioButtonRole.default], ['RadioGroupRole', _RadioGroupRole.default], ['RegionRole', _RegionRole.default], ['RootWebAreaRole', _RootWebAreaRole.default], ['RowHeaderRole', _RowHeaderRole.default], ['RowRole', _RowRole.default], ['RubyRole', _RubyRole.default], ['RulerRole', _RulerRole.default], ['ScrollAreaRole', _ScrollAreaRole.default], ['ScrollBarRole', _ScrollBarRole.default], ['SeamlessWebAreaRole', _SeamlessWebAreaRole.default], ['SearchRole', _SearchRole.default], ['SearchBoxRole', _SearchBoxRole.default], ['SliderRole', _SliderRole.default], ['SliderThumbRole', _SliderThumbRole.default], ['SpinButtonRole', _SpinButtonRole.default], ['SpinButtonPartRole', _SpinButtonPartRole.default], ['SplitterRole', _SplitterRole.default], ['StaticTextRole', _StaticTextRole.default], ['StatusRole', _StatusRole.default], ['SVGRootRole', _SVGRootRole.default], ['SwitchRole', _SwitchRole.default], ['TabGroupRole', _TabGroupRole.default], ['TabRole', _TabRole.default], ['TableHeaderContainerRole', _TableHeaderContainerRole.default], ['TableRole', _TableRole.default], ['TabListRole', _TabListRole.default], ['TabPanelRole', _TabPanelRole.default], ['TermRole', _TermRole.default], ['TextAreaRole', _TextAreaRole.default], ['TextFieldRole', _TextFieldRole.default], ['TimeRole', _TimeRole.default], ['TimerRole', _TimerRole.default], ['ToggleButtonRole', _ToggleButtonRole.default], ['ToolbarRole', _ToolbarRole.default], ['TreeRole', _TreeRole.default], ['TreeGridRole', _TreeGridRole.default], ['TreeItemRole', _TreeItemRole.default], ['UserInterfaceTooltipRole', _UserInterfaceTooltipRole.default], ['VideoRole', _VideoRole.default], ['WebAreaRole', _WebAreaRole.default], ['WindowRole', _WindowRole.default]];
  140. var AXObjectsMap = {
  141. entries: function entries() {
  142. return AXObjects;
  143. },
  144. forEach: function forEach(fn) {
  145. var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  146. var _iterator = _createForOfIteratorHelper(AXObjects),
  147. _step;
  148. try {
  149. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  150. var _step$value = _slicedToArray(_step.value, 2),
  151. key = _step$value[0],
  152. values = _step$value[1];
  153. fn.call(thisArg, values, key, AXObjects);
  154. }
  155. } catch (err) {
  156. _iterator.e(err);
  157. } finally {
  158. _iterator.f();
  159. }
  160. },
  161. get: function get(key) {
  162. var item = AXObjects.find(function (tuple) {
  163. return tuple[0] === key ? true : false;
  164. });
  165. return item && item[1];
  166. },
  167. has: function has(key) {
  168. return !!AXObjectsMap.get(key);
  169. },
  170. keys: function keys() {
  171. return AXObjects.map(function (_ref) {
  172. var _ref2 = _slicedToArray(_ref, 1),
  173. key = _ref2[0];
  174. return key;
  175. });
  176. },
  177. values: function values() {
  178. return AXObjects.map(function (_ref3) {
  179. var _ref4 = _slicedToArray(_ref3, 2),
  180. values = _ref4[1];
  181. return values;
  182. });
  183. }
  184. };
  185. var _default = (0, _iterationDecorator.default)(AXObjectsMap, AXObjectsMap.entries());
  186. exports.default = _default;