diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-01 10:00:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 15:00:59 +0000 |
commit | dfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch) | |
tree | 04686b943b84b33b8927238be17e4bc0dda7eb62 /test | |
parent | 2356223942a21d1683ac38eed8e7b9485f453d87 (diff) |
Application refactor (#591)
* Rename Yomitan class to Application, change initialization style
* Rename file
* Update init
* Update config
* Remove dead code
Diffstat (limited to 'test')
-rw-r--r-- | test/utilities/anki.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/utilities/anki.js b/test/utilities/anki.js index 69f4ce8b..d0e095bd 100644 --- a/test/utilities/anki.js +++ b/test/utilities/anki.js @@ -144,7 +144,8 @@ export async function getTemplateRenderResults(dictionaryEntries, type, mode, te } break; } - const ankiNoteBuilder = new AnkiNoteBuilder(ankiTemplateRenderer.templateRenderer); + const api = new MinimalApi(); + const ankiNoteBuilder = new AnkiNoteBuilder(api, ankiTemplateRenderer.templateRenderer); const context = { url: 'url:', sentence: { @@ -186,3 +187,19 @@ export async function getTemplateRenderResults(dictionaryEntries, type, mode, te return results; } + +class MinimalApi { + /** + * @type {import('anki-note-builder.js').MinimalApi['injectAnkiNoteMedia']} + */ + async injectAnkiNoteMedia() { + throw new Error('Not supported'); + } + + /** + * @type {import('anki-note-builder.js').MinimalApi['parseText']} + */ + async parseText() { + throw new Error('Not supported'); + } +} |