chore(web): resolves domOverrides.ts

This commit is contained in:
Joshua A. Horton 2023-05-23 13:12:02 +07:00
parent d436639ae4
commit 2d6f80f2c9
2 changed files with 4 additions and 15 deletions

View file

@ -80,11 +80,10 @@ export default class LanguageProcessor extends EventEmitter<LanguageProcessorEve
maxRightContextCodePoints: supportsRightDeletions ? 0 : 64
}
if(!this.canEnable() || !predictiveTextWorker) {
if(!predictiveTextWorker) {
return;
}
// TODO: this needs to be supplied separately - runs on Node need to refer to a different type!
this.lmEngine = new LMLayer(capabilities, predictiveTextWorker);
}
@ -392,9 +391,9 @@ export default class LanguageProcessor extends EventEmitter<LanguageProcessorEve
return (this.activeModel || false) && this._mayPredict;
}
public canEnable(): boolean {
// Is overridden for dom-aware KMW in case of old IE versions.
return true;
canEnable(): boolean {
// Is not initialized if there is no worker.
return !!this.lmEngine;
}
public get mayPredict() {

View file

@ -1,10 +0,0 @@
namespace com.keyman.dom {
text.prediction.LanguageProcessor.prototype.canEnable = function(): boolean {
if(typeof Worker != 'function') {
console.warn("WebWorkers are not supported by this browser.");
return false;
}
return true;
}
}