summaryrefslogtreecommitdiff
path: root/ext/js/comm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/comm')
-rw-r--r--ext/js/comm/anki-connect.js15
-rw-r--r--ext/js/comm/api.js8
2 files changed, 23 insertions, 0 deletions
diff --git a/ext/js/comm/anki-connect.js b/ext/js/comm/anki-connect.js
index 446b2139..8c5e2c85 100644
--- a/ext/js/comm/anki-connect.js
+++ b/ext/js/comm/anki-connect.js
@@ -144,6 +144,21 @@ export class AnkiConnect {
}
/**
+ * @param {import('anki').Note} noteWithId
+ * @returns {Promise<null>}
+ */
+ async updateNoteFields(noteWithId) {
+ if (!this._enabled) { return null; }
+ await this._checkVersion();
+ const result = await this._invoke('updateNoteFields', {note: noteWithId});
+ if (result !== null) {
+ throw this._createUnexpectedResultError('null', result);
+ }
+ return result;
+ }
+
+
+ /**
* @param {import('anki').Note[]} notes
* @returns {Promise<boolean[]>}
*/
diff --git a/ext/js/comm/api.js b/ext/js/comm/api.js
index e8db7846..b044a783 100644
--- a/ext/js/comm/api.js
+++ b/ext/js/comm/api.js
@@ -96,6 +96,14 @@ export class API {
}
/**
+ * @param {import('api').ApiParam<'updateAnkiNote', 'noteWithId'>} noteWithId
+ * @returns {Promise<import('api').ApiReturn<'updateAnkiNote'>>}
+ */
+ updateAnkiNote(noteWithId) {
+ return this._invoke('updateAnkiNote', {noteWithId});
+ }
+
+ /**
* @param {import('api').ApiParam<'getAnkiNoteInfo', 'notes'>} notes
* @param {import('api').ApiParam<'getAnkiNoteInfo', 'fetchAdditionalInfo'>} fetchAdditionalInfo
* @returns {Promise<import('api').ApiReturn<'getAnkiNoteInfo'>>}