semantic_util.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { SemanticNode } from './semantic_node.js';
  2. export declare enum MMLTAGS {
  3. ANNOTATION = "ANNOTATION",
  4. ANNOTATIONXML = "ANNOTATION-XML",
  5. MACTION = "MACTION",
  6. MALIGNGROUP = "MALIGNGROUP",
  7. MALIGNMARK = "MALIGNMARK",
  8. MATH = "MATH",
  9. MENCLOSE = "MENCLOSE",
  10. MERROR = "MERROR",
  11. MFENCED = "MFENCED",
  12. MFRAC = "MFRAC",
  13. MGLYPH = "MGLYPH",
  14. MI = "MI",
  15. MLABELEDTR = "MLABELEDTR",
  16. MMULTISCRIPTS = "MMULTISCRIPTS",
  17. MN = "MN",
  18. MO = "MO",
  19. MOVER = "MOVER",
  20. MPADDED = "MPADDED",
  21. MPHANTOM = "MPHANTOM",
  22. MPRESCRIPTS = "MPRESCRIPTS",
  23. MROOT = "MROOT",
  24. MROW = "MROW",
  25. MS = "MS",
  26. MSPACE = "MSPACE",
  27. MSQRT = "MSQRT",
  28. MSTYLE = "MSTYLE",
  29. MSUB = "MSUB",
  30. MSUBSUP = "MSUBSUP",
  31. MSUP = "MSUP",
  32. MTABLE = "MTABLE",
  33. MTD = "MTD",
  34. MTEXT = "MTEXT",
  35. MTR = "MTR",
  36. MUNDER = "MUNDER",
  37. MUNDEROVER = "MUNDEROVER",
  38. NONE = "NONE",
  39. SEMANTICS = "SEMANTICS"
  40. }
  41. export declare function hasMathTag(node: Element): boolean;
  42. export declare function hasIgnoreTag(node: Element): boolean;
  43. export declare function hasEmptyTag(node: Element): boolean;
  44. export declare function hasDisplayTag(node: Element): boolean;
  45. export declare function isOrphanedGlyph(node: Element): boolean;
  46. export declare function purgeNodes(nodes: Element[]): Element[];
  47. export declare function isZeroLength(length: string): boolean;
  48. export declare function addAttributes(to: SemanticNode, from: Element): void;
  49. export declare function getEmbellishedInner(node: SemanticNode): SemanticNode;
  50. export interface Slice {
  51. head: SemanticNode[];
  52. div: SemanticNode;
  53. tail: SemanticNode[];
  54. }
  55. export declare function sliceNodes(nodes: SemanticNode[], pred: (p1: SemanticNode) => boolean, opt_reverse?: boolean): Slice;
  56. export interface Partition {
  57. rel: SemanticNode[];
  58. comp: SemanticNode[][];
  59. }
  60. export declare function partitionNodes(nodes: SemanticNode[], pred: (p1: SemanticNode) => boolean): Partition;