KeyExplorer.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { A11yDocument, Region } from './Region.js';
  2. import { Explorer, AbstractExplorer } from './Explorer.js';
  3. import Sre from '../sre.js';
  4. export interface KeyExplorer extends Explorer {
  5. KeyDown(event: KeyboardEvent): void;
  6. FocusIn(event: FocusEvent): void;
  7. FocusOut(event: FocusEvent): void;
  8. }
  9. export declare abstract class AbstractKeyExplorer<T> extends AbstractExplorer<T> implements KeyExplorer {
  10. attached: boolean;
  11. protected walker: Sre.walker;
  12. private eventsAttached;
  13. protected events: [string, (x: Event) => void][];
  14. private oldIndex;
  15. abstract KeyDown(event: KeyboardEvent): void;
  16. FocusIn(_event: FocusEvent): void;
  17. FocusOut(_event: FocusEvent): void;
  18. Update(force?: boolean): void;
  19. Attach(): void;
  20. AddEvents(): void;
  21. Detach(): void;
  22. Stop(): void;
  23. }
  24. export declare class SpeechExplorer extends AbstractKeyExplorer<string> {
  25. document: A11yDocument;
  26. protected region: Region<string>;
  27. protected node: HTMLElement;
  28. private mml;
  29. private static updatePromise;
  30. speechGenerator: Sre.speechGenerator;
  31. showRegion: string;
  32. private init;
  33. private restarted;
  34. constructor(document: A11yDocument, region: Region<string>, node: HTMLElement, mml: string);
  35. Start(): void;
  36. Update(force?: boolean): void;
  37. Speech(walker: Sre.walker): void;
  38. KeyDown(event: KeyboardEvent): void;
  39. protected triggerLink(code: number): boolean;
  40. Move(key: number): void;
  41. private initWalker;
  42. private getOptions;
  43. }
  44. export declare class Magnifier extends AbstractKeyExplorer<HTMLElement> {
  45. document: A11yDocument;
  46. protected region: Region<HTMLElement>;
  47. protected node: HTMLElement;
  48. private mml;
  49. constructor(document: A11yDocument, region: Region<HTMLElement>, node: HTMLElement, mml: string);
  50. Update(force?: boolean): void;
  51. Start(): void;
  52. private showFocus;
  53. Move(key: number): void;
  54. KeyDown(event: KeyboardEvent): void;
  55. }