text_accessibility.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * This class aims to provide some methods:
  3. * - to reorder elements in the DOM with respect to the visual order;
  4. * - to create a link, using aria-owns, between spans in the textLayer and
  5. * annotations in the annotationLayer. The goal is to help to know
  6. * where the annotations are in the text flow.
  7. */
  8. export class TextAccessibilityManager {
  9. /**
  10. * Compare the positions of two elements, it must correspond to
  11. * the visual ordering.
  12. *
  13. * @param {HTMLElement} e1
  14. * @param {HTMLElement} e2
  15. * @returns {number}
  16. */
  17. static "__#30@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
  18. setTextMapping(textDivs: any): void;
  19. /**
  20. * Function called when the text layer has finished rendering.
  21. */
  22. enable(): void;
  23. disable(): void;
  24. /**
  25. * Remove an aria-owns id from a node in the text layer.
  26. * @param {HTMLElement} element
  27. */
  28. removePointerInTextLayer(element: HTMLElement): void;
  29. /**
  30. * Find the text node which is the nearest and add an aria-owns attribute
  31. * in order to correctly position this editor in the text flow.
  32. * @param {HTMLElement} element
  33. * @param {boolean} isRemovable
  34. */
  35. addPointerInTextLayer(element: HTMLElement, isRemovable: boolean): void;
  36. /**
  37. * Move a div in the DOM in order to respect the visual order.
  38. * @param {HTMLDivElement} element
  39. */
  40. moveElementInDOM(container: any, element: HTMLDivElement, contentElement: any, isRemovable: any): void;
  41. #private;
  42. }