Skip to content

Use typescript 3.2.x #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 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 @@ -46,7 +46,7 @@
"progress": "^2.0.0",
"shelljs": "^0.8.2",
"typedoc-default-themes": "^0.5.0",
"typescript": "3.1.x"
"typescript": "3.2.x"
},
"devDependencies": {
"@types/mocha": "^5.2.4",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/SourcePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class SourcePlugin extends ConverterComponent {
file.reflections.push(reflection);
}

reflection.sources!.push({
reflection.sources.push({
file: file,
fileName: fileName,
line: position.line + 1,
Expand Down
14 changes: 13 additions & 1 deletion src/lib/converter/types/tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ export class TupleConverter extends ConverterTypeComponent implements TypeConver
* Test whether this converter can handle the given TypeScript type.
*/
supportsType(context: Context, type: ts.TypeReference): boolean {
return !!(type.objectFlags & ts.ObjectFlags.Tuple);
// If this type is a tuple
if (type.objectFlags & ts.ObjectFlags.Tuple) {
return true;
}

// If this type points to a tuple
if (type.objectFlags & ts.ObjectFlags.Reference) {
if (type.target.objectFlags & ts.ObjectFlags.Tuple) {
return true;
}
}

return false;
}

/**
Expand Down
32 changes: 22 additions & 10 deletions src/test/converter/destructuring/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@
}
],
"type": {
"type": "array",
"elementType": {
"type": "intrinsic",
"name": "number"
}
"type": "tuple",
"elements": [
{
"type": "intrinsic",
"name": "number"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
},
{
Expand All @@ -130,11 +136,17 @@
}
],
"type": {
"type": "array",
"elementType": {
"type": "intrinsic",
"name": "number"
}
"type": "tuple",
"elements": [
{
"type": "intrinsic",
"name": "number"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/test/renderer/specs/modules/_typescript_1_5_.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h3>destruct<wbr>Array<wbr>With<wbr>IgnoresA</h3>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported">
<a name="destructarraywithignoresrest" class="tsd-anchor"></a>
<h3>destruct<wbr>Array<wbr>With<wbr>Ignores<wbr>Rest</h3>
<div class="tsd-signature tsd-kind-icon">destruct<wbr>Array<wbr>With<wbr>Ignores<wbr>Rest<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">destruct<wbr>Array<wbr>With<wbr>Ignores<wbr>Rest<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/typescript-1.5.ts#L20">typescript-1.5.ts:20</a></li>
Expand All @@ -150,7 +150,7 @@ <h3>destruct<wbr>Array<wbr>With<wbr>Ignores<wbr>Rest</h3>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported">
<a name="destructarraywithrest" class="tsd-anchor"></a>
<h3>destruct<wbr>Array<wbr>With<wbr>Rest</h3>
<div class="tsd-signature tsd-kind-icon">destruct<wbr>Array<wbr>With<wbr>Rest<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">destruct<wbr>Array<wbr>With<wbr>Rest<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/typescript-1.5.ts#L15">typescript-1.5.ts:15</a></li>
Expand Down