From edcd1fcbabf0ee31c3d7b6d2706f3b082ec4fb63 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Sat, 11 Jan 2025 14:34:44 +0530 Subject: [PATCH] fix(#507): jsdocs return statment updation with type TemplateRenderResult --- apps/generator/docs/api.md | 6 +++--- apps/generator/lib/generator.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/generator/docs/api.md b/apps/generator/docs/api.md index 42d7309e5..3dd56e79e 100644 --- a/apps/generator/docs/api.md +++ b/apps/generator/docs/api.md @@ -39,9 +39,9 @@ Reference API documentation for AsyncAPI Generator library. * [.executeAfterHook()](#Generator+executeAfterHook) ⇒ `Promise.<void>` * [.parseInput()](#Generator+parseInput) * [.configureTemplate()](#Generator+configureTemplate) - * ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise`~~ - * [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise` - * [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise` + * ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise.<(TemplateRenderResult|undefined)>`~~ + * [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise.<(TemplateRenderResult|undefined)>` + * [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise.<(TemplateRenderResult|undefined)>` * [.installTemplate([force])](#Generator+installTemplate) * _static_ * [.getTemplateFile(templateName, filePath, [templatesDir])](#Generator.getTemplateFile) ⇒ `Promise` diff --git a/apps/generator/lib/generator.js b/apps/generator/lib/generator.js index 077634e1c..2414cc6a7 100644 --- a/apps/generator/lib/generator.js +++ b/apps/generator/lib/generator.js @@ -436,7 +436,7 @@ class Generator { * @param {String} asyncapiString AsyncAPI string to use as source. * @param {Object} [parseOptions={}] AsyncAPI Parser parse options. Check out {@link https://www.github.com/asyncapi/parser-js|@asyncapi/parser} for more information. * @deprecated Use the `generate` function instead. Just change the function name and it works out of the box. - * @return {Promise} + * @return {Promise<TemplateRenderResult|undefined>} */ async generateFromString(asyncapiString, parseOptions = {}) { const isParsableCompatible = asyncapiString && typeof asyncapiString === 'string'; @@ -466,7 +466,7 @@ class Generator { * } * * @param {String} asyncapiURL Link to AsyncAPI file - * @return {Promise} + * @return {Promise<TemplateRenderResult|undefined>} */ async generateFromURL(asyncapiURL) { const doc = await fetchSpec(asyncapiURL); @@ -493,7 +493,7 @@ class Generator { * } * * @param {String} asyncapiFile AsyncAPI file to use as source. - * @return {Promise} + * @return {Promise<TemplateRenderResult|undefined>} */ async generateFromFile(asyncapiFile) { const doc = await readFile(asyncapiFile, { encoding: 'utf8' });