Skip to content

Commit

Permalink
Resolve TypeOperatorType to allow it to be hyperlinkable
Browse files Browse the repository at this point in the history
  • Loading branch information
socsieng committed Jan 12, 2020
1 parent d18664d commit fd57421
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"minimatch": "^3.0.0",
"progress": "^2.0.3",
"shelljs": "^0.8.3",
"typedoc-default-themes": "0.7.0-2",
"typedoc-default-themes": "file:../typedoc-default-themes/typedoc-default-themes-0.6.4.tgz",
"typescript": "3.7.x"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/converter/plugins/TypePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Reflection, ReflectionKind, Decorator, DeclarationReflection, DeclarationHierarchy } from '../../models/reflections/index';
import { Type, ReferenceType, TupleType, UnionType, IntersectionType, ArrayType } from '../../models/types/index';
import { Type, ReferenceType, TupleType, UnionType, IntersectionType, ArrayType, TypeOperatorType } from '../../models/types/index';
import { Component, ConverterComponent } from '../components';
import { Converter } from '../converter';
import { Context } from '../context';
Expand Down Expand Up @@ -106,6 +106,8 @@ export class TypePlugin extends ConverterComponent {
resolveTypes(reflection, type.types);
} else if (type instanceof ArrayType) {
resolveType(reflection, type.elementType);
} else if (type instanceof TypeOperatorType) {
resolveType(reflection, type.target);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.html]
insert_final_newline = false
4 changes: 3 additions & 1 deletion src/test/converter/type-operator/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"type": "typeOperator",
"operator": "keyof",
"target": {
"id": 2,
"type": "reference",
"name": "TestClass"
}
Expand Down Expand Up @@ -64,6 +65,7 @@
"type": "typeOperator",
"operator": "keyof",
"target": {
"id": 2,
"type": "reference",
"name": "TestClass"
}
Expand Down Expand Up @@ -195,4 +197,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion src/test/renderer/specs/classes/_classes_.baseclass.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private">
<a name="internalclass" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> internal<wbr>Class</h3>
<div class="tsd-signature tsd-kind-icon">internal<wbr>Class<span class="tsd-signature-symbol">:</span> <a href="_classes_.internalclass.html" class="tsd-signature-type">InternalClass</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">keyof BaseClass</span><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-signature tsd-kind-icon">internal<wbr>Class<span class="tsd-signature-symbol">:</span> <a href="_classes_.internalclass.html" class="tsd-signature-type">InternalClass</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">keyof <a href="_classes_.baseclass.html" class="tsd-signature-type">BaseClass</a></span><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L76">classes.ts:76</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h1>Class InternalClass&lt;TTT&gt;</h1>
<h3>Type parameters</h3>
<ul class="tsd-type-parameters">
<li>
<h4>TTT<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">keyof BaseClass</span></h4>
<h4>TTT<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">keyof <a href="_classes_.baseclass.html" class="tsd-signature-type">BaseClass</a></span></h4>
</li>
</ul>
</section>
Expand Down

0 comments on commit fd57421

Please sign in to comment.