diff options
Diffstat (limited to 'ext/js/comm/anki.js')
-rw-r--r-- | ext/js/comm/anki.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/js/comm/anki.js b/ext/js/comm/anki.js index 6921caf5..83cb8221 100644 --- a/ext/js/comm/anki.js +++ b/ext/js/comm/anki.js @@ -120,6 +120,18 @@ class AnkiConnect { return await this._invoke('storeMediaFile', {filename: fileName, data: content}); } + /** + * Finds notes matching a query. + * @param {string} query Searches for notes matching a query. + * @returns {number[]} An array of note IDs. + * @see https://docs.ankiweb.net/searching.html + */ + async findNotes(query) { + if (!this._enabled) { return []; } + await this._checkVersion(); + return await this._invoke('findNotes', {query}); + } + async findNoteIds(notes) { if (!this._enabled) { return []; } await this._checkVersion(); |