abstract_walker.d.ts 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { KeyCode } from '../common/event_util.js';
  2. import { Highlighter } from '../highlighter/highlighter.js';
  3. import { AxisMap } from '../rule_engine/dynamic_cstr.js';
  4. import { SemanticRole, SemanticType } from '../semantic_tree/semantic_meaning.js';
  5. import { SemanticNode } from '../semantic_tree/semantic_node.js';
  6. import { SemanticSkeleton } from '../semantic_tree/semantic_skeleton.js';
  7. import { SpeechGenerator } from '../speech_generator/speech_generator.js';
  8. import { Focus } from './focus.js';
  9. import { Levels } from './levels.js';
  10. import { RebuildStree } from './rebuild_stree.js';
  11. import { Walker, WalkerMoves } from './walker.js';
  12. export declare abstract class AbstractWalker<T> implements Walker {
  13. node: Element;
  14. generator: SpeechGenerator;
  15. highlighter: Highlighter;
  16. static ID_COUNTER: number;
  17. static SRE_ID_ATTR: string;
  18. modifier: boolean;
  19. id: any;
  20. rootNode: Element;
  21. rootId: string;
  22. skeleton: SemanticSkeleton;
  23. keyMapping: Map<KeyCode, () => any>;
  24. moved: WalkerMoves;
  25. cursors: {
  26. focus: Focus;
  27. levels: Levels<T>;
  28. undo: boolean;
  29. }[];
  30. levels: any;
  31. private xmlString_;
  32. private xml_;
  33. private rebuilt_;
  34. private focus_;
  35. private active_;
  36. abstract findFocusOnLevel(id: number): Focus;
  37. abstract initLevels(): Levels<T>;
  38. abstract combineContentChildren(type: SemanticType, role: SemanticRole, content: string[], children: string[]): T[];
  39. constructor(node: Element, generator: SpeechGenerator, highlighter: Highlighter, xml: string);
  40. getXml(): Element;
  41. getRebuilt(): RebuildStree;
  42. isActive(): boolean;
  43. activate(): void;
  44. deactivate(): void;
  45. getFocus(update?: boolean): Focus;
  46. setFocus(focus: Focus): void;
  47. getDepth(): number;
  48. isSpeech(): boolean;
  49. focusDomNodes(): Element[];
  50. focusSemanticNodes(): SemanticNode[];
  51. speech(): string;
  52. move(key: KeyCode): boolean;
  53. protected up(): Focus | null;
  54. protected down(): Focus | null;
  55. protected left(): Focus | null;
  56. protected right(): Focus | null;
  57. protected repeat(): Focus | null;
  58. protected depth(): Focus | null;
  59. protected home(): Focus | null;
  60. getBySemanticId(id: string): Element;
  61. primaryId(): string;
  62. expand(): Focus;
  63. expandable(node: Element): boolean;
  64. collapsible(node: Element): boolean;
  65. restoreState(): void;
  66. updateFocus(): void;
  67. protected rebuildStree(): void;
  68. previousLevel(): string | null;
  69. nextLevel(): T[];
  70. singletonFocus(id: string): Focus;
  71. private retrieveVisuals;
  72. private subtreeIds;
  73. focusFromId(id: string, ids: string[]): Focus;
  74. protected summary(): Focus | null;
  75. protected detail(): Focus | null;
  76. protected specialMove(): string | null;
  77. virtualize(opt_undo?: boolean): Focus;
  78. previous(): Focus;
  79. undo(): Focus;
  80. update(options: AxisMap): void;
  81. nextRules(): Focus;
  82. previousRules(): Focus;
  83. refocus(): void;
  84. private toggleActive_;
  85. private mergePrefix_;
  86. private prefix_;
  87. private postfix_;
  88. private depth_;
  89. private actionable_;
  90. private summary_;
  91. private detail_;
  92. }