@@ -26,7 +26,7 @@ import {LiveRegion, SpeechRegion, ToolTip, HoverRegion} from './Region.js';
2626import type { ExplorerMathDocument , ExplorerMathItem } from '../explorer.js' ;
2727
2828import { Explorer } from './Explorer.js' ;
29- import * as ke from './KeyExplorer.js' ;
29+ import { SpeechExplorer } from './KeyExplorer.js' ;
3030import * as me from './MouseExplorer.js' ;
3131import { TreeColorer , FlameColorer } from './TreeExplorer.js' ;
3232
@@ -87,9 +87,9 @@ type ExplorerInit = (doc: ExplorerMathDocument, pool: ExplorerPool,
8787 */
8888let allExplorers : { [ options : string ] : ExplorerInit } = {
8989 speech : ( doc : ExplorerMathDocument , pool : ExplorerPool , node : HTMLElement , ...rest : any [ ] ) => {
90- let explorer = ke . SpeechExplorer . create (
90+ let explorer = SpeechExplorer . create (
9191 doc , pool , doc . explorerRegions . speechRegion , node ,
92- doc . explorerRegions . brailleRegion , doc . explorerRegions . magnifier , rest [ 0 ] , rest [ 1 ] ) as ke . SpeechExplorer ;
92+ doc . explorerRegions . brailleRegion , doc . explorerRegions . magnifier , rest [ 0 ] , rest [ 1 ] ) as SpeechExplorer ;
9393 explorer . sound = true ;
9494 return explorer ;
9595 } ,
@@ -213,7 +213,7 @@ export class ExplorerPool {
213213 let keyExplorers = [ ] ;
214214 for ( let key of Object . keys ( this . explorers ) ) {
215215 let explorer = this . explorers [ key ] ;
216- if ( explorer instanceof ke . SpeechExplorer ) {
216+ if ( explorer instanceof SpeechExplorer ) {
217217 explorer . AddEvents ( ) ;
218218 explorer . stoppable = false ;
219219 keyExplorers . unshift ( explorer ) ;
@@ -253,7 +253,9 @@ export class ExplorerPool {
253253 * Restarts explorers after a MathItem is rerendered.
254254 */
255255 public restart ( ) {
256- this . _restart . forEach ( x => this . explorers [ x ] . Start ( ) ) ;
256+ this . _restart . forEach ( x => {
257+ this . explorers [ x ] . Start ( ) ;
258+ } ) ;
257259 this . _restart = [ ] ;
258260 }
259261
@@ -275,7 +277,7 @@ export class ExplorerPool {
275277 { color : 'red' } , { color : 'black' } ,
276278 { renderer : this . document . outputJax . name , browser : 'v3' }
277279 ) ;
278- ( ( this . explorers [ ' speech' ] as ke . SpeechExplorer ) . region as SpeechRegion ) . highlighter =
280+ ( this . speech . region as SpeechRegion ) . highlighter =
279281 this . secondaryHighlighter ;
280282 }
281283
@@ -295,6 +297,16 @@ export class ExplorerPool {
295297 this . highlighter . unhighlight ( ) ;
296298 }
297299
300+ /**
301+ * Convenience method to return the speech explorer of the pool with the
302+ * correct type.
303+ *
304+ * @return {SpeechExplorer }
305+ */
306+ public get speech ( ) : SpeechExplorer {
307+ return this . explorers [ 'speech' ] as SpeechExplorer ;
308+ }
309+
298310 /**
299311 * Retrieves color assignment for the document options.
300312 *
0 commit comments