From 5f96276fda93dcad39f2165fd3c8d890aa5f9be5 Mon Sep 17 00:00:00 2001 From: Cashew <52880648+Scrub1492@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:22:22 +0900 Subject: update JSDoc comments (#387) * lesen-tan initial commit * update README.md * tidy up code * opt for Map instead of Object * Document dev/* * add docs for deinflector.js * update deinflector example * Annotate * Revert "Merge branch 'development' of https://github.com/Scrub1492/lesen-tan into development" This reverts commit b92348f702bc031b36f24462adfa940d17f9ecdd, reversing changes made to 3255e6d963281af3533dcf1e893df39032d29fec. * Lint error fix * Lint error fix * update JSDoc comments --------- Co-authored-by: Darius Jahandarie --- ext/js/data/anki-note-builder.js | 28 ---------------------------- ext/js/data/database.js | 11 ++++------- 2 files changed, 4 insertions(+), 35 deletions(-) (limited to 'ext/js/data') diff --git a/ext/js/data/anki-note-builder.js b/ext/js/data/anki-note-builder.js index 80cc210a..9240c1d8 100644 --- a/ext/js/data/anki-note-builder.js +++ b/ext/js/data/anki-note-builder.js @@ -22,16 +22,10 @@ import {TemplateRendererProxy} from '../templates/template-renderer-proxy.js'; import {yomitan} from '../yomitan.js'; import {AnkiUtil} from './anki-util.js'; -/** - * Anki Note Builder Class. - */ export class AnkiNoteBuilder { /** * Initiate an instance of AnkiNoteBuilder. * @param {{japaneseUtil: import('../language/sandbox/japanese-util.js').JapaneseUtil}} details - * @example - * const japaneseUtil = new JapaneseUtil(null); - * const ankiNoteBuilder = new AnkiNoteBuilder({japaneseUtil}); */ constructor({japaneseUtil}) { /** @type {import('../language/sandbox/japanese-util.js').JapaneseUtil} */ @@ -47,30 +41,8 @@ export class AnkiNoteBuilder { } /** - * Creates an Anki note. * @param {import('anki-note-builder').CreateNoteDetails} details * @returns {Promise} - * @example - * const ankiNoteBuilder = new AnkiNoteBuilder({japaneseUtil}); - * const details = { - * dictionaryEntry, - * mode: 'test', - * context, - * template, - * deckName: 'deckName', - * modelName: 'modelName', - * fields, - * tags: ['yomitan'], - * checkForDuplicates: true, - * duplicateScope: 'collection', - * duplicateScopeCheckAllModels: false, - * resultOutputMode: mode, - * glossaryLayoutMode: 'default', - * compactTags: false, - * requirements: [], - * mediaOptions: null - * }; - * const {note: {fields: noteFields}, errors} = await ankiNoteBuilder.createNote(details); */ async createNote({ dictionaryEntry, diff --git a/ext/js/data/database.js b/ext/js/data/database.js index 5aba1373..c8047b41 100644 --- a/ext/js/data/database.js +++ b/ext/js/data/database.js @@ -17,7 +17,6 @@ */ /** - * Database class to store objects. * @template {string} TObjectStoreName */ export class Database { @@ -29,7 +28,6 @@ export class Database { } /** - * Opens the DB. * @param {string} databaseName * @param {number} version * @param {import('database').StructureDefinition[]} structure @@ -53,7 +51,6 @@ export class Database { } /** - * Closes the DB. * @throws {Error} */ close() { @@ -66,7 +63,7 @@ export class Database { } /** - * Returns true if DB opening is in process. + * Returns true if the database opening is in process. * @returns {boolean} */ isOpening() { @@ -74,7 +71,7 @@ export class Database { } /** - * Returns true if the DB is open. + * Returns true if the database is fully opened. * @returns {boolean} */ isOpen() { @@ -97,10 +94,10 @@ export class Database { /** * Add items in bulk to the object store. - * count items will be added beginning from start index of items list. + * _count_ items will be added, starting from _start_ index of _items_ list. * @param {TObjectStoreName} objectStoreName * @param {unknown[]} items List of items to add. - * @param {number} start Start index. Added items begin at items[start]. + * @param {number} start Start index. Added items begin at _items_[_start_]. * @param {number} count Count of items to add. * @returns {Promise} */ -- cgit v1.2.3