aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
Diffstat (limited to 'types')
-rw-r--r--types/ext/anki-connect.d.ts22
-rw-r--r--types/ext/anki-note-builder.d.ts1
-rw-r--r--types/ext/backend.d.ts5
3 files changed, 27 insertions, 1 deletions
diff --git a/types/ext/anki-connect.d.ts b/types/ext/anki-connect.d.ts
new file mode 100644
index 00000000..07e6dd7f
--- /dev/null
+++ b/types/ext/anki-connect.d.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2023-2024 Yomitan Authors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+type CanAddNote = {canAdd: true};
+
+type CannotAddNote = {canAdd: false, error: string};
+
+export type CanAddResult = CanAddNote | CannotAddNote;
diff --git a/types/ext/anki-note-builder.d.ts b/types/ext/anki-note-builder.d.ts
index 8aec3342..e3a1ed6a 100644
--- a/types/ext/anki-note-builder.d.ts
+++ b/types/ext/anki-note-builder.d.ts
@@ -35,7 +35,6 @@ export type CreateNoteDetails = {
fields: Field[];
tags: string[];
requirements: Requirement[];
- checkForDuplicates: boolean;
duplicateScope: Settings.AnkiDuplicateScope;
duplicateScopeCheckAllModels: boolean;
resultOutputMode: Settings.ResultOutputMode;
diff --git a/types/ext/backend.d.ts b/types/ext/backend.d.ts
index a832e434..c7d66522 100644
--- a/types/ext/backend.d.ts
+++ b/types/ext/backend.d.ts
@@ -32,3 +32,8 @@ export type TabInfo = {
};
export type FindTabsPredicate = (tabInfo: TabInfo) => boolean | Promise<boolean>;
+
+export type CanAddResults = {
+ canAddArray: {note: import('anki').Note, isDuplicate: boolean}[];
+ cannotAddArray: import('anki').Note[];
+};