math_simple_store.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { DynamicCstr } from './dynamic_cstr.js';
  2. export interface MappingsJson {
  3. default: {
  4. [key: string]: string;
  5. };
  6. [domainName: string]: {
  7. [key: string]: string;
  8. };
  9. }
  10. export interface BaseJson {
  11. key: string;
  12. category: string;
  13. names?: string[];
  14. si?: boolean;
  15. }
  16. export interface UnicodeJson extends BaseJson {
  17. mappings: MappingsJson;
  18. modality?: string;
  19. locale?: string;
  20. domain?: string;
  21. }
  22. export interface SiJson {
  23. [key: string]: string;
  24. }
  25. export interface SimpleRule {
  26. cstr: DynamicCstr;
  27. action: string;
  28. }
  29. export declare class MathSimpleStore {
  30. base: BaseJson;
  31. rules: Map<string, SimpleRule[]>;
  32. static parseUnicode(num: string): string;
  33. private static testDynamicConstraints_;
  34. defineRulesFromMappings(locale: string, modality: string, mapping: MappingsJson): void;
  35. getRules(key: string): SimpleRule[];
  36. defineRuleFromStrings(locale: string, modality: string, domain: string, style: string, content: string): void;
  37. lookupRule(_node: Node, dynamic: DynamicCstr): SimpleRule;
  38. }