aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/anki.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/anki.js')
-rw-r--r--ext/bg/js/anki.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/bg/js/anki.js b/ext/bg/js/anki.js
index 05c07ce2..68d9fc43 100644
--- a/ext/bg/js/anki.js
+++ b/ext/bg/js/anki.js
@@ -122,6 +122,22 @@ class AnkiConnect {
return await this._invoke('multi', {actions});
}
+ async suspendCards(cardIds) {
+ if (!this._enabled) { return false; }
+ await this._checkVersion();
+ return await this._invoke('suspend', {cards: cardIds});
+ }
+
+ async findCards(query) {
+ if (!this._enabled) { return []; }
+ await this._checkVersion();
+ return await this._invoke('findCards', {query});
+ }
+
+ async findCardsForNote(noteId) {
+ return await this.findCards(`nid:${noteId}`);
+ }
+
getRootDeckName(deckName) {
const index = deckName.indexOf('::');
return index >= 0 ? deckName.substring(0, index) : deckName;