speech-rule-engine
Version:
A standalone speech rule engine for XML structures, based on the original engine from ChromeVox.
55 lines (54 loc) • 2.52 kB
TypeScript
import { AuditoryDescription } from '../audio/auditory_description.js';
import { KeyCode } from './event_util.js';
import * as FileUtil from './file_util.js';
import { standardLoader } from '../speech_rules/math_map.js';
export declare const version: string;
export declare function setupEngine(feature: {
[key: string]: boolean | string;
}): Promise<string>;
export declare function engineSetup(): {
[key: string]: boolean | string;
};
export declare function resetEngine(): void;
export declare function engineReady(): Promise<any>;
export declare const localeLoader: typeof standardLoader;
export declare function toSpeech(expr: string): string;
export declare function toSemantic(expr: string): Node;
export declare function toJson(expr: string): any;
export declare function toDescription(expr: string): AuditoryDescription[];
export declare function toEnriched(expr: string): Element;
export declare function number(expr: string): string;
export declare function ordinal(expr: string): string;
export declare function numericOrdinal(expr: string): string;
export declare function vulgar(expr: string): string;
export declare const file: Record<string, (input: string, output?: string) => any>;
export declare function processFile(processor: string, input: string, opt_output?: string): string | Promise<string>;
export declare function walk(expr: string): string;
export declare function move(direction: KeyCode | string): string | null;
export declare function exit(opt_value?: number): void;
export declare function toSpeechStructure(expr: string): string;
type OptionsList = {
[key: string]: string;
};
type SpeechList = {
[id: string]: {
[mod: string]: string;
};
};
type WorkerStructure = {
speech?: SpeechList;
braille?: SpeechList;
mactions?: SpeechList;
options?: OptionsList;
translations?: OptionsList;
label?: string;
braillelabel?: string;
ssml?: string;
};
export declare function workerSpeech(expr: string, options: OptionsList): Promise<WorkerStructure>;
export declare function workerNextRules(expr: string, options: OptionsList): Promise<WorkerStructure>;
export declare function workerNextStyle(expr: string, options: OptionsList, id: string): Promise<WorkerStructure>;
export declare function workerLocalePreferences(options: OptionsList): Promise<WorkerStructure>;
export declare function workerRelevantPreferences(expr: string, id: string): Promise<string>;
export declare const localePath: typeof FileUtil.localePath;
export {};