fix(api-extractor): link to enum types on inherited properties (#10085)

* fix: link to enum types on inherited properties

* fix: `undefined` in properties without access modifier
This commit is contained in:
Qjuh
2024-02-04 21:06:03 +01:00
committed by GitHub
parent bc9b487eb1
commit ef83bc3e41

View File

@@ -1712,6 +1712,7 @@ export class ApiModelGenerator {
const mapper = Array.isArray(typey) ? typey : typey.types ?? [];
const lookup: { [K in ts.SyntaxKind]?: string } = {
[ts.SyntaxKind.ClassDeclaration]: 'class',
[ts.SyntaxKind.EnumDeclaration]: 'enum',
[ts.SyntaxKind.InterfaceDeclaration]: 'interface',
[ts.SyntaxKind.TypeAliasDeclaration]: 'type',
};
@@ -1770,9 +1771,9 @@ export class ApiModelGenerator {
excerptTokens: [
{
kind: ExcerptTokenKind.Content,
text: `${prop.access} ${prop.scope === 'static' ? 'static ' : ''}${prop.readonly ? 'readonly ' : ''}${
prop.name
} :`,
text: `${prop.access ? `${prop.access} ` : ''}${prop.scope === 'static' ? 'static ' : ''}${
prop.readonly ? 'readonly ' : ''
}${prop.name} :`,
},
...mappedVarType,
{ kind: ExcerptTokenKind.Content, text: ';' },