diff --git a/docs/scripts/buildApi.ts b/docs/scripts/buildApi.ts index 5af0eea0a88d..5a6d8ff46e7e 100644 --- a/docs/scripts/buildApi.ts +++ b/docs/scripts/buildApi.ts @@ -99,7 +99,9 @@ function generateProperties(api: Api, apisToGenerate) { api.properties.forEach((propertyReflection) => { let name = propertyReflection.name; - const comment = propertyReflection.comment; + const type = propertyReflection!.type as any; + const signatures = type.declaration?.signatures; + const comment = signatures?.length ? signatures[0].comment : propertyReflection.comment; const description = linkify(comment?.shortText || '', apisToGenerate, 'markdown'); if (propertyReflection.flags.isOptional) { @@ -114,14 +116,12 @@ function generateProperties(api: Api, apisToGenerate) { defaultValue = `${escapeCell(defaultTag.text)}`; } - const type = `${escapeCell( - generateType(propertyReflection.type), - )}`; + const typeFormatted = `${escapeCell(generateType(type))}`; if (hasDefaultValue) { - text += `| ${name} | ${type} | ${defaultValue} | ${escapeCell(description)} |\n`; + text += `| ${name} | ${typeFormatted} | ${defaultValue} | ${escapeCell(description)} |\n`; } else { - text += `| ${name} | ${type} | ${escapeCell(description)} |\n`; + text += `| ${name} | ${typeFormatted} | ${escapeCell(description)} |\n`; } }); @@ -239,12 +239,14 @@ function run(argv: { outputDirectory?: string }) { name: reflection.name, description: linkify(reflection.comment?.shortText, apisToGenerate, 'html'), properties: api.properties.map((propertyReflection) => { - const comment = propertyReflection.comment; + const type = propertyReflection!.type as any; + const signatures = type.declaration!.signatures; + const comment = signatures.length ? signatures[0].comment : null; const description = linkify(comment?.shortText || '', apisToGenerate, 'html'); const response: any = { name: propertyReflection.name, description: renderMarkdownInline(description), - type: generateType(propertyReflection.type), + type: generateType(type), }; return response; }), diff --git a/package.json b/package.json index 474e56ef60ea..eb798c2e063c 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "stylelint": "^13.7.2", "stylelint-config-standard": "^22.0.0", "stylelint-processor-styled-components": "^1.10.0", - "typedoc": "^0.20.36", + "typedoc": "^0.21.0", "typescript": "^4.1.2", "webpack": "^4.41.0", "webpack-cli": "^4.6.0", diff --git a/yarn.lock b/yarn.lock index b34dd2148add..89d3862a30d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10527,19 +10527,7 @@ gzip-size@^6.0.0: dependencies: duplexer "^0.1.2" -handlebars@^4.7.6: - version "4.7.6" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" - integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -handlebars@^4.7.7: +handlebars@^4.7.6, handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== @@ -12900,7 +12888,7 @@ markdown-to-jsx@^7.0.1, markdown-to-jsx@^7.1.0: resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.3.tgz#f00bae66c0abe7dd2d274123f84cb6bd2a2c7c6a" integrity sha512-jtQ6VyT7rMT5tPV0g2EJakEnXLiPksnvlYtwQsVVZ611JsWGN8bQ1tVSDX4s6JllfEH6wmsYxNjTUAMrPmNA8w== -marked@^2.0.0, marked@^2.0.3: +marked@^2.0.0, marked@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/marked/-/marked-2.1.1.tgz#b7c27f520fc4de0ddd049d9b4be3b04e06314923" integrity sha512-5XFS69o9CzDpQDSpUYC+AN2xvq8yl1EGa5SG/GI1hP78/uTeo3PDfiDNmsUyiahpyhToDDJhQk7fNtJsga+KVw== @@ -17208,7 +17196,7 @@ shell-quote@1.7.2: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== -shelljs@^0.8.3, shelljs@^0.8.4: +shelljs@^0.8.3: version "0.8.4" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== @@ -18751,20 +18739,18 @@ typedoc-default-themes@^0.12.10: resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz#614c4222fe642657f37693ea62cad4dafeddf843" integrity sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA== -typedoc@^0.20.36: - version "0.20.36" - resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.36.tgz#ee5523c32f566ad8283fc732aa8ea322d1a45f6a" - integrity sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw== +typedoc@^0.21.0: + version "0.21.0" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.21.0.tgz#d35dd69b1566032cd893f4f6f21f37156f5f78d2" + integrity sha512-InmPBVlpOXptIkg/WnsQhbGYhv9cuDh/cRACUSautQ0QwcJPLAK2kHcfP0Pld6z/NiDvHc159fMq2qS+b/ALUw== dependencies: - colors "^1.4.0" - fs-extra "^9.1.0" + glob "^7.1.7" handlebars "^4.7.7" lodash "^4.17.21" lunr "^2.3.9" - marked "^2.0.3" + marked "^2.1.1" minimatch "^3.0.0" progress "^2.0.3" - shelljs "^0.8.4" shiki "^0.9.3" typedoc-default-themes "^0.12.10"