aboutsummaryrefslogtreecommitdiff
path: root/dev/translator-vm.js
diff options
context:
space:
mode:
Diffstat (limited to 'dev/translator-vm.js')
-rw-r--r--dev/translator-vm.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/dev/translator-vm.js b/dev/translator-vm.js
index 60777da0..f407e57e 100644
--- a/dev/translator-vm.js
+++ b/dev/translator-vm.js
@@ -32,6 +32,9 @@ vi.mock('../ext/js/language/dictionary-importer-media-loader.js', async () => aw
const dirname = path.dirname(fileURLToPath(import.meta.url));
+/**
+ * Translator Virtual Machine.
+ */
export class TranslatorVM {
constructor() {
/** @type {import('dev/vm').PseudoChrome} */
@@ -55,15 +58,19 @@ export class TranslatorVM {
this._dictionaryName = null;
}
- /** @type {Translator} */
+ /**
+ * Returns this VM's translator.
+ * @type {Translator}
+ */
get translator() {
if (this._translator === null) { throw new Error('Not prepared'); }
return this._translator;
}
/**
- * @param {string} dictionaryDirectory
- * @param {string} dictionaryName
+ * Initialize this translator VM from a dictionary.
+ * @param {string} dictionaryDirectory Directory of the dictionary files.
+ * @param {string} dictionaryName Name of the dictionary.
*/
async prepare(dictionaryDirectory, dictionaryName) {
// Dictionary