diff options
author | Eloy Robillard <eloy.robillard@gmail.com> | 2024-03-18 12:19:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 11:19:27 +0000 |
commit | 7ee76d708934adeef06479f7757beb22c6c01d14 (patch) | |
tree | c03ad4227e8a71939bb5efddffe57fa21a75b043 /types | |
parent | 4fe881d68d4c1182bee2e78a559c2064aaf48b0d (diff) |
Add an option to allow both viewing and adding duplicates (#693)
* Detect duplicates when checking if can add note
* Display the stacked add buttons
Diffstat (limited to 'types')
-rw-r--r-- | types/ext/anki-connect.d.ts | 22 | ||||
-rw-r--r-- | types/ext/anki-note-builder.d.ts | 1 | ||||
-rw-r--r-- | types/ext/backend.d.ts | 5 |
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[]; +}; |