diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-27 14:08:39 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-27 14:08:39 -0500 |
commit | c8ac0d45bfb94deabd933117ba55d365f43fb1c5 (patch) | |
tree | db677ecc0d60f0dcc20ed1679318d8a55baa33b9 /ext/js/templates/sandbox | |
parent | 6a3dae04de68ab633da15bbc8ec6b350e38e6d2f (diff) |
Updates
Diffstat (limited to 'ext/js/templates/sandbox')
4 files changed, 13 insertions, 13 deletions
diff --git a/ext/js/templates/sandbox/anki-template-renderer-content-manager.js b/ext/js/templates/sandbox/anki-template-renderer-content-manager.js index be80c211..4989ced3 100644 --- a/ext/js/templates/sandbox/anki-template-renderer-content-manager.js +++ b/ext/js/templates/sandbox/anki-template-renderer-content-manager.js @@ -22,12 +22,12 @@ export class AnkiTemplateRendererContentManager { /** * Creates a new instance of the class. - * @param {TemplateRendererMediaProvider} mediaProvider The media provider for the object. + * @param {import('./template-renderer-media-provider.js').TemplateRendererMediaProvider} mediaProvider The media provider for the object. * @param {import('anki-templates').NoteData} data The data object passed to the Handlebars template renderer. - * See {@link AnkiNoteDataCreator.create}'s return value for structure information. + * See AnkiNoteDataCreator.create's return value for structure information. */ constructor(mediaProvider, data) { - /** @type {TemplateRendererMediaProvider} */ + /** @type {import('./template-renderer-media-provider.js').TemplateRendererMediaProvider} */ this._mediaProvider = mediaProvider; /** @type {import('anki-templates').NoteData} */ this._data = data; diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index ce8e3200..9f4bf6ff 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -151,8 +151,8 @@ export class AnkiTemplateRenderer { } /** - * - * @param text + * @param {string} text + * @returns {string} */ _safeString(text) { return new Handlebars.SafeString(text); @@ -221,8 +221,8 @@ export class AnkiTemplateRenderer { } /** - * - * @param string + * @param {string} string + * @returns {string} */ _stringToMultiLineHtml(string) { return string.split('\n').join('<br>'); diff --git a/ext/js/templates/sandbox/template-renderer-frame-api.js b/ext/js/templates/sandbox/template-renderer-frame-api.js index 91400ab8..94ebf7fe 100644 --- a/ext/js/templates/sandbox/template-renderer-frame-api.js +++ b/ext/js/templates/sandbox/template-renderer-frame-api.js @@ -20,10 +20,10 @@ import {ExtensionError} from '../../core/extension-error.js'; export class TemplateRendererFrameApi { /** - * @param {TemplateRenderer} templateRenderer + * @param {import('./template-renderer.js').TemplateRenderer} templateRenderer */ constructor(templateRenderer) { - /** @type {TemplateRenderer} */ + /** @type {import('./template-renderer.js').TemplateRenderer} */ this._templateRenderer = templateRenderer; /** @type {import('core').MessageHandlerMap} */ this._windowMessageHandlers = new Map(/** @type {import('core').MessageHandlerArray} */ ([ diff --git a/ext/js/templates/sandbox/template-renderer.js b/ext/js/templates/sandbox/template-renderer.js index 716e3ccc..fe240b5f 100644 --- a/ext/js/templates/sandbox/template-renderer.js +++ b/ext/js/templates/sandbox/template-renderer.js @@ -21,7 +21,7 @@ import {ExtensionError} from '../../core/extension-error.js'; export class TemplateRenderer { constructor() { - /** @type {Map<string, HandlebarsTemplateDelegate<import('anki-templates').NoteData>>} */ + /** @type {Map<string, import('handlebars').TemplateDelegate<import('anki-templates').NoteData>>} */ this._cache = new Map(); /** @type {number} */ this._cacheMaxSize = 5; @@ -110,14 +110,14 @@ export class TemplateRenderer { /** * @param {string} template - * @returns {HandlebarsTemplateDelegate<import('anki-templates').NoteData>} + * @returns {import('handlebars').TemplateDelegate<import('anki-templates').NoteData>} */ _getTemplateInstance(template) { const cache = this._cache; let instance = cache.get(template); if (typeof instance === 'undefined') { this._updateCacheSize(this._cacheMaxSize - 1); - instance = /** @type {HandlebarsTemplateDelegate<import('anki-templates').NoteData>} */ (Handlebars.compileAST(template)); + instance = /** @type {import('handlebars').TemplateDelegate<import('anki-templates').NoteData>} */ (Handlebars.compileAST(template)); cache.set(template, instance); } @@ -125,7 +125,7 @@ export class TemplateRenderer { } /** - * @param {HandlebarsTemplateDelegate<import('anki-templates').NoteData>} instance + * @param {import('handlebars').TemplateDelegate<import('anki-templates').NoteData>} instance * @param {import('anki-templates').NoteData} data * @returns {import('template-renderer').RenderResult} */ |