engine.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { AuditoryDescription } from '../audio/auditory_description.js';
  2. import * as Dcstr from '../rule_engine/dynamic_cstr.js';
  3. import * as EngineConst from './engine_const.js';
  4. export declare class SREError extends Error {
  5. message: string;
  6. name: string;
  7. constructor(message?: string);
  8. }
  9. export declare class Engine {
  10. static BINARY_FEATURES: string[];
  11. static STRING_FEATURES: string[];
  12. private static instance;
  13. customLoader: (locale: string) => Promise<string>;
  14. evaluator: (p1: string, p2: Dcstr.DynamicCstr) => string | null;
  15. defaultParser: Dcstr.DynamicCstrParser;
  16. parser: Dcstr.DynamicCstrParser;
  17. parsers: {
  18. [key: string]: Dcstr.DynamicCstrParser;
  19. };
  20. dynamicCstr: Dcstr.DynamicCstr;
  21. comparator: Dcstr.Comparator;
  22. mode: EngineConst.Mode;
  23. init: boolean;
  24. delay: boolean;
  25. comparators: {
  26. [key: string]: () => Dcstr.Comparator;
  27. };
  28. domain: string;
  29. style: string;
  30. _defaultLocale: string;
  31. set defaultLocale(loc: string);
  32. get defaultLocale(): string;
  33. locale: string;
  34. subiso: string;
  35. modality: string;
  36. speech: EngineConst.Speech;
  37. markup: EngineConst.Markup;
  38. mark: boolean;
  39. automark: boolean;
  40. character: boolean;
  41. cleanpause: boolean;
  42. cayleyshort: boolean;
  43. linebreaks: boolean;
  44. rate: string;
  45. walker: string;
  46. structure: boolean;
  47. aria: boolean;
  48. ruleSets: string[];
  49. strict: boolean;
  50. isIE: boolean;
  51. isEdge: boolean;
  52. pprint: boolean;
  53. config: boolean;
  54. rules: string;
  55. prune: string;
  56. static getInstance(): Engine;
  57. static defaultEvaluator(str: string, _cstr: Dcstr.DynamicCstr): string;
  58. static nodeEvaluator: (node: Element) => AuditoryDescription[];
  59. static evaluateNode(node: Element): AuditoryDescription[];
  60. getRate(): number;
  61. setDynamicCstr(opt_dynamic?: Dcstr.AxisMap): void;
  62. private constructor();
  63. configurate(feature: {
  64. [key: string]: boolean | string;
  65. }): void;
  66. setCustomLoader(fn: any): void;
  67. }
  68. export default Engine;
  69. export declare class EnginePromise {
  70. static loaded: {
  71. [locale: string]: [boolean, boolean];
  72. };
  73. static promises: {
  74. [locale: string]: Promise<string>;
  75. };
  76. static get(locale?: string): Promise<string>;
  77. static getall(): Promise<string[]>;
  78. }