Merge pull request #19568 from Snuffleupagus/FakeMLManager-no-bundle
Don't bundle the `FakeMLManager` class in regular builds
This commit is contained in:
commit
27c82ab8cc
@ -53,6 +53,12 @@ class ExternalServices extends BaseExternalServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MLManager {
|
class MLManager {
|
||||||
|
static {
|
||||||
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||||
|
this.getFakeMLManager = options => new FakeMLManager(options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async isEnabledFor(_name) {
|
async isEnabledFor(_name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -68,13 +74,11 @@ class MLManager {
|
|||||||
guess(_data) {}
|
guess(_data) {}
|
||||||
|
|
||||||
toggleService(_name, _enabled) {}
|
toggleService(_name, _enabled) {}
|
||||||
|
|
||||||
static getFakeMLManager(options) {
|
|
||||||
return new FakeMLManager(options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FakeMLManager {
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||||
|
// eslint-disable-next-line no-var
|
||||||
|
var FakeMLManager = class {
|
||||||
eventBus = null;
|
eventBus = null;
|
||||||
|
|
||||||
hasProgress = false;
|
hasProgress = false;
|
||||||
@ -145,6 +149,7 @@ class FakeMLManager {
|
|||||||
toggleService(_name, enabled) {
|
toggleService(_name, enabled) {
|
||||||
this.enableGuessAltText = enabled;
|
this.enableGuessAltText = enabled;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ExternalServices, initCom, MLManager, Preferences };
|
export { ExternalServices, initCom, MLManager, Preferences };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user