fix(website): doc links to other packages (#9994)

* fix(website): doc links to other packages

* fix: missing parameter

* Apply suggestions from code review

Co-authored-by: Almeida <almeidx@pm.me>

---------

Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
Qjuh
2023-11-22 19:06:13 +01:00
committed by GitHub
parent 57c414be21
commit 9fdbf0ad65
12 changed files with 53 additions and 19 deletions

View File

@@ -1094,6 +1094,10 @@ export class ApiModelGenerator {
fileColumn: sourceLocation.sourceFileColumn,
});
} else if (jsDoc) {
if (jsDoc.inherited) {
return;
}
const methodOptions = this._mapMethod(jsDoc, parentApiItem.getAssociatedPackage()!.name);
if (methodOptions.releaseTag === ReleaseTag.Internal || methodOptions.releaseTag === ReleaseTag.Alpha) {
return; // trim out items marked as "@internal" or "@alpha"
@@ -1802,7 +1806,7 @@ export class ApiModelGenerator {
text: `${
method.scope === 'global'
? `export function ${method.name}(`
: `${method.access}${method.scope === 'static' ? ' static' : ''} ${method.name}(`
: `${method.access ? `${method.access} ` : ''}${method.scope === 'static' ? 'static ' : ''}${method.name}(`
}${
method.params?.length
? `${method.params[0]!.name}${method.params[0]!.nullable || method.params[0]!.optional ? '?' : ''}`
@@ -1853,8 +1857,8 @@ export class ApiModelGenerator {
?.map((param) => ` * @param ${param.name} - ${this._fixLinkTags(param.description) ?? ''}\n`)
.join('') ?? ''
}${
method.returns?.length && !Array.isArray(method.returns[0])
? ` * @returns ${this._fixLinkTags(method.returns[0]!.description) ?? ''}\n`
method.returns?.length && !Array.isArray(method.returns[0]) && method.returns[0]!.description
? ` * @returns ${this._fixLinkTags(method.returns[0]!.description) ?? ''}`
: ''
}${method.examples?.map((example) => ` * @example\n * \`\`\`js\n * ${example}\n * \`\`\`\n`).join('') ?? ''}${
method.deprecated