speech_rule_engine.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { AuditoryDescription } from '../audio/auditory_description.js';
  2. import { BaseRuleStore } from './base_rule_store.js';
  3. import { RulesJson } from './base_rule_store.js';
  4. import { DynamicCstr } from './dynamic_cstr.js';
  5. import { State as GrammarState } from './grammar.js';
  6. import { SpeechRule } from './speech_rule.js';
  7. import { SpeechRuleContext } from './speech_rule_context.js';
  8. import { Trie } from '../indexing/trie.js';
  9. export declare class SpeechRuleEngine {
  10. private static instance;
  11. trie: Trie;
  12. private evaluators_;
  13. static getInstance(): SpeechRuleEngine;
  14. static debugSpeechRule(rule: SpeechRule, node: Element): void;
  15. static debugNamedSpeechRule(name: string, node: Element): void;
  16. evaluateNode(node: Element): AuditoryDescription[];
  17. toString(): string;
  18. runInSetting(settings: {
  19. [feature: string]: string | boolean;
  20. }, callback: () => AuditoryDescription[]): AuditoryDescription[];
  21. static addStore(set: RulesJson): void;
  22. processGrammar(context: SpeechRuleContext, node: Element, grammar: GrammarState): void;
  23. addEvaluator(store: BaseRuleStore): void;
  24. getEvaluator(locale: string, modality: string): (p1: Element) => AuditoryDescription[];
  25. enumerate(opt_info?: {
  26. [key: string]: any;
  27. }): {
  28. [key: string]: any;
  29. };
  30. private constructor();
  31. private evaluateNode_;
  32. private evaluateTree_;
  33. private evaluateNodeList_;
  34. private addLayout;
  35. private addPersonality_;
  36. private addExternalAttributes_;
  37. private addRelativePersonality_;
  38. private updateConstraint_;
  39. private makeSet_;
  40. lookupRule(node: Element, dynamic: DynamicCstr): SpeechRule;
  41. lookupRules(node: Element, dynamic: DynamicCstr): SpeechRule[];
  42. private pickMostConstraint_;
  43. }