semantic_heuristic.d.ts 856 B

1234567891011121314151617181920
  1. import { SemanticNode } from './semantic_node.js';
  2. export declare type SemanticHeuristicTypes = Element | SemanticNode | SemanticNode[];
  3. export interface SemanticHeuristic<T> {
  4. name: string;
  5. apply: (node: T) => void;
  6. applicable: (node: T) => boolean;
  7. }
  8. declare abstract class SemanticAbstractHeuristic<T extends SemanticHeuristicTypes> implements SemanticHeuristic<T> {
  9. name: string;
  10. apply: (node: T) => void;
  11. applicable: (_node: T) => boolean;
  12. constructor(name: string, method: (node: T) => void, predicate?: (node: T) => boolean);
  13. }
  14. export declare class SemanticTreeHeuristic extends SemanticAbstractHeuristic<SemanticNode> {
  15. }
  16. export declare class SemanticMultiHeuristic extends SemanticAbstractHeuristic<SemanticNode[]> {
  17. }
  18. export declare class SemanticMmlHeuristic extends SemanticAbstractHeuristic<Element> {
  19. }
  20. export {};