Skip to content

Commit

Permalink
Changes according to review suggestions and discussion.
Browse files Browse the repository at this point in the history
  • Loading branch information
zorkow committed Apr 8, 2020
1 parent 480591e commit 6138f45
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ts/a11y/explorer/KeyExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import {A11yDocument, Region} from './Region.js';
import {Explorer, AbstractExplorer} from './Explorer.js';
import {sreReady, SRE} from '../sre.js';
import {sreReady} from '../sre.js';


/**
Expand Down
2 changes: 1 addition & 1 deletion ts/a11y/semantic-enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {MathML} from '../input/mathml.js';
import {SerializedMmlVisitor} from '../core/MmlTree/SerializedMmlVisitor.js';
import {OptionList, expandable} from '../util/Options.js';

import {SRE, sreReady} from './sre.js';
import {sreReady} from './sre.js';

/*==========================================================================*/

Expand Down
8 changes: 4 additions & 4 deletions ts/a11y/sre-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

declare const require: (name: string) => any;

const SRE = require('speech-rule-engine');
const Sre = require('speech-rule-engine');

declare const global: any;

/**
* The global sre with sre.Engine.isReady() and sre.toEnriched()
*/
global.SRE = SRE;
global.sre = Object.create(SRE);
global.sre.Engine = {isReady() {return SRE.engineReady()}};
global.SRE = Sre;
global.sre = Object.create(Sre);
global.sre.Engine = {isReady() {return Sre.engineReady()}};
10 changes: 0 additions & 10 deletions ts/a11y/sre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,3 @@ export const sreReady = function() {
}).catch((error: Error) => reject(error.message || error));
});
};


/**
* The functions we need from SRE.
*/
export type SRE = {
toEnriched(mml: string): Element;
setupEngine(options: OptionList): void;
engineSetup(): OptionList;
};
6 changes: 6 additions & 0 deletions ts/a11y/sre_browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ declare namespace sre.ClearspeakPreferences {
export function smartPreferences(item: Object, locale: string): string[];

}

declare namespace SRE {
export function toEnriched(mml: string): void;
export function setupEngine(obj: any): void;
export function engineSetup(): any;
}

0 comments on commit 6138f45

Please sign in to comment.