fix(tl-utils): do not make @link tags for primitives
This commit is contained in:
parent
e3dbe3b7d1
commit
ff58e3ee0d
1 changed files with 11 additions and 5 deletions
|
@ -22,12 +22,13 @@ function fullTypeName(
|
||||||
type: string,
|
type: string,
|
||||||
baseNamespace: string,
|
baseNamespace: string,
|
||||||
namespace = true,
|
namespace = true,
|
||||||
method = false
|
method = false,
|
||||||
|
link = false
|
||||||
): string {
|
): string {
|
||||||
if (type in PRIMITIVE_TO_TS) return PRIMITIVE_TO_TS[type]
|
if (type in PRIMITIVE_TO_TS) return PRIMITIVE_TO_TS[type]
|
||||||
let m
|
let m
|
||||||
if ((m = type.match(/^[Vv]ector[< ](.+?)[> ]$/))) {
|
if ((m = type.match(/^[Vv]ector[< ](.+?)[> ]$/))) {
|
||||||
return fullTypeName(m[1], baseNamespace) + '[]'
|
return fullTypeName(m[1], baseNamespace, namespace, method, link) + '[]'
|
||||||
}
|
}
|
||||||
|
|
||||||
const [ns, name] = splitNameToNamespace(type)
|
const [ns, name] = splitNameToNamespace(type)
|
||||||
|
@ -44,6 +45,8 @@ function fullTypeName(
|
||||||
|
|
||||||
if (method) res += 'Request'
|
if (method) res += 'Request'
|
||||||
|
|
||||||
|
if (link) res = `{@link ${res}}`
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,10 +69,13 @@ export function generateTypescriptDefinitionsForTlEntry(
|
||||||
if (entry.kind === 'method' && !entry.generics) {
|
if (entry.kind === 'method' && !entry.generics) {
|
||||||
if (comment) comment += '\n\n'
|
if (comment) comment += '\n\n'
|
||||||
|
|
||||||
comment += `RPC method returns {@see ${fullTypeName(
|
comment += `RPC method returns ${fullTypeName(
|
||||||
entry.type,
|
entry.type,
|
||||||
baseNamespace
|
baseNamespace,
|
||||||
)}}`
|
true,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
)}`
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
if (errors.userOnly[entry.name]) {
|
if (errors.userOnly[entry.name]) {
|
||||||
|
|
Loading…
Reference in a new issue