aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-11 15:21:43 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-11 15:25:19 -0400
commit51e17b35e3a855c0db6c4be94a8cb416b14c8ad7 (patch)
treee59ccc1e8bf78c9db172af9cf1c3eac25f48b6bb /ext/mixed/js
parent3c48290cd83744983df2e708b892a8415bcf750f (diff)
Convert some util* functions into api* functions
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/api.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index 50b285a5..56e6a715 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -120,6 +120,30 @@ function apiGetDefaultAnkiFieldTemplates() {
return _apiInvoke('getDefaultAnkiFieldTemplates');
}
+function apiGetAnkiDeckNames() {
+ return _apiInvoke('getAnkiDeckNames');
+}
+
+function apiGetAnkiModelNames() {
+ return _apiInvoke('getAnkiModelNames');
+}
+
+function apiGetAnkiModelFieldNames(modelName) {
+ return _apiInvoke('getAnkiModelFieldNames', {modelName});
+}
+
+function apiGetDictionaryInfo() {
+ return _apiInvoke('getDictionaryInfo');
+}
+
+function apiGetDictionaryCounts(dictionaryNames, getTotal) {
+ return _apiInvoke('getDictionaryCounts', {dictionaryNames, getTotal});
+}
+
+function apiPurgeDatabase() {
+ return _apiInvoke('purgeDatabase');
+}
+
function _apiInvoke(action, params={}) {
const data = {action, params};
return new Promise((resolve, reject) => {