explorer.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { Handler } from '../core/Handler.js';
  2. import { MmlNode } from '../core/MmlTree/MmlNode.js';
  3. import { MathML } from '../input/mathml.js';
  4. import { EnrichedMathItem, EnrichedMathDocument } from './semantic-enrich.js';
  5. import { MathDocumentConstructor } from '../core/MathDocument.js';
  6. import { LiveRegion, ToolTip, HoverRegion } from './explorer/Region.js';
  7. export declare type Constructor<T> = new (...args: any[]) => T;
  8. export declare type HANDLER = Handler<HTMLElement, Text, Document>;
  9. export declare type HTMLDOCUMENT = EnrichedMathDocument<HTMLElement, Text, Document>;
  10. export declare type HTMLMATHITEM = EnrichedMathItem<HTMLElement, Text, Document>;
  11. export declare type MATHML = MathML<HTMLElement, Text, Document>;
  12. export interface ExplorerMathItem extends HTMLMATHITEM {
  13. explorable(document: HTMLDOCUMENT, force?: boolean): void;
  14. attachExplorers(document: HTMLDOCUMENT): void;
  15. }
  16. export declare function ExplorerMathItemMixin<B extends Constructor<HTMLMATHITEM>>(BaseMathItem: B, toMathML: (node: MmlNode) => string): Constructor<ExplorerMathItem> & B;
  17. export interface ExplorerMathDocument extends HTMLDOCUMENT {
  18. explorerRegions: ExplorerRegions;
  19. explorable(): HTMLDOCUMENT;
  20. }
  21. export declare function ExplorerMathDocumentMixin<B extends MathDocumentConstructor<HTMLDOCUMENT>>(BaseDocument: B): MathDocumentConstructor<ExplorerMathDocument> & B;
  22. export declare function ExplorerHandler(handler: HANDLER, MmlJax?: MATHML): HANDLER;
  23. export declare type ExplorerRegions = {
  24. speechRegion?: LiveRegion;
  25. brailleRegion?: LiveRegion;
  26. magnifier?: HoverRegion;
  27. tooltip1?: ToolTip;
  28. tooltip2?: ToolTip;
  29. tooltip3?: ToolTip;
  30. };
  31. export declare function setA11yOptions(document: HTMLDOCUMENT, options: {
  32. [key: string]: any;
  33. }): void;
  34. export declare function setA11yOption(document: HTMLDOCUMENT, option: string, value: string | boolean): void;